Don't retain selection when clicking to change column sort

Support showing color deck options in proper order with no column header
This commit is contained in:
drdev
2014-01-19 18:15:02 +00:00
parent 95709401a3
commit f0ce722aa4
16 changed files with 151 additions and 64 deletions

View File

@@ -76,6 +76,16 @@ public abstract class DeckBase implements Serializable, Comparable<DeckBase>, In
return this.name;
}
@Override
public String toString() {
return this.name;
}
@Override
public Comparable<?> getCompareValue() {
return this.name;
}
/**
* Sets the comment.
*
@@ -133,5 +143,4 @@ public abstract class DeckBase implements Serializable, Comparable<DeckBase>, In
public final String getBestFileName() {
return this.getName().replaceAll("[^-_$#@.,{[()]} a-zA-Z0-9]", "");
}
}

View File

@@ -31,4 +31,11 @@ public interface InventoryItem extends IHasName
* @return the type
*/
String getItemType();
/**
* Return object used to compare this item with other items
*
* @return the compare object
*/
Comparable<?> getCompareValue();
}

View File

@@ -172,6 +172,11 @@ public final class PaperCard implements Comparable<IPaperCard>, InventoryItemFro
// return String.format("%s|%s", name, cardSet);
}
@Override
public Comparable<?> getCompareValue() {
return this.name;
}
/*
* (non-Javadoc)
*

View File

@@ -47,6 +47,10 @@ public class PaperToken implements InventoryItemFromSet, IPaperCard {
@Override public String getName() { return name; }
@Override public String toString() { return name; }
@Override public Comparable<?> getCompareValue() { return name; }
@Override public String getEdition() { return edition.getCode(); }
@Override public int getArtIndex() { return 0; } // This might change however

View File

@@ -63,6 +63,16 @@ public class PreconDeck implements InventoryItemFromSet {
return "Prebuilt Deck";
}
@Override
public String toString() {
return this.deck.toString();
}
@Override
public Comparable<?> getCompareValue() {
return this.deck.getCompareValue();
}
public PreconDeck(final Deck d, String set, String description) {
deck = d;
this.set = set;

View File

@@ -99,6 +99,16 @@ public abstract class SealedProduct implements InventoryItemFromSet {
return hash;
}
@Override
public String toString() {
return getName();
}
@Override
public Comparable<?> getCompareValue() {
return getName();
}
protected List<PaperCard> generate() {
return BoosterGenerator.getBoosterPack(contents);
}