columnAmount.getColumn().setWidth(60);
columnAmount.setLabelProvider( new ColumnLabelProvider() {
@Override
public String getText(Object element) {
if(element instanceof Card) {
Card card = (Card)element;
String meta = deckLegality.getText();
boolean restricted = CardPool.instance().lookupMetaInfo(card.getName(), meta+"restricted");
return Integer.toString(((CardGroup) card.getParent()).count(card)) + (restricted ? "*": "");
}
return null;
}
@Override
public Color getForeground(Object element) {
String meta = deckLegality.getText();
if (element instanceof Card && meta.length()>0) {
Card card = (Card)element;
boolean legal = CardPool.instance().lookupMetaInfo(card.getName(), meta);
if(legal)
return darkGreen;
return red;
}