Avoid showing unnecessary Folder column in certain DeckManagers

This commit is contained in:
drdev
2014-02-12 04:25:20 +00:00
parent 968a035672
commit b447b4ab6b
5 changed files with 17 additions and 9 deletions

View File

@@ -180,7 +180,7 @@ public class FDeckChooser extends JPanel implements IDecksComboBoxListener {
lstDecks.setAllowMultipleSelections(false);
lstDecks.setPool(DeckProxy.getAllPreconstructedDecks(QuestController.getPrecons()));
lstDecks.update(false, true);
lstDecks.update(false, true, true);
btnRandom.setText("Random Deck");
btnRandom.setCommand(new UiCommand() {
@@ -197,7 +197,7 @@ public class FDeckChooser extends JPanel implements IDecksComboBoxListener {
lstDecks.setAllowMultipleSelections(false);
lstDecks.setPool(DeckProxy.getAllQuestEventAndChallenges());
lstDecks.update(false, true);
lstDecks.update(false, true, true);
btnRandom.setText("Random Deck");
btnRandom.setCommand(new UiCommand() {

View File

@@ -76,7 +76,7 @@ public enum CSubmenuQuestDecks implements ICDoc {
boolean hasQuest = qData.getAssets() != null;
// Retrieve and set all decks
view.getLstDecks().setPool(DeckProxy.getAllQuestDecks(hasQuest ? qData.getMyDecks() : null));
view.getLstDecks().update();
view.getLstDecks().update(false, false, true);
// Look through list for preferred deck from prefs
final DeckProxy deck = hasQuest ? view.getLstDecks().stringToItem(Singletons.getModel().getQuestPreferences().getPref(QPref.CURRENT_DECK)) : null;

View File

@@ -77,7 +77,7 @@ public enum CSubmenuDraft implements ICDoc {
final JButton btnStart = view.getBtnStart();
view.getLstDecks().setPool(DeckProxy.getDraftDecks(Singletons.getModel().getDecks().getDraft()));
view.getLstDecks().update();
view.getLstDecks().update(false, false, true);
if (!view.getLstDecks().getPool().isEmpty()) {
btnStart.setEnabled(true);

View File

@@ -101,7 +101,7 @@ public enum CSubmenuSealed implements ICDoc {
final VSubmenuSealed view = VSubmenuSealed.SINGLETON_INSTANCE;
view.getLstDecks().setPool(DeckProxy.getAllSealedDecks(Singletons.getModel().getDecks().getSealed()));
view.getLstDecks().update();
view.getLstDecks().update(false, false, true);
SwingUtilities.invokeLater(new Runnable() {
@Override public void run() {

View File

@@ -48,7 +48,7 @@ public final class DeckManager extends ItemManager<DeckProxy> {
private static final FSkin.SkinIcon icoEditOver = FSkin.getIcon(FSkin.InterfaceIcons.ICO_EDIT_OVER);
private final GameType gametype;
private boolean stringOnly, preventEdit;
private boolean stringOnly, preventEdit, hideFolderColumn;
private UiCommand cmdDelete, cmdSelect;
private final Map<ColumnDef, ItemColumn> columns = SColumnUtil.getColumns(
ColumnDef.DECK_FAVORITE,
@@ -97,23 +97,31 @@ public final class DeckManager extends ItemManager<DeckProxy> {
* Update table columns
*/
public void update() {
update(false, false);
update(false, false, false);
}
public void update(boolean stringOnly0) {
update(stringOnly0, stringOnly0);
update(stringOnly0, stringOnly0, stringOnly0);
}
public void update(boolean stringOnly0, boolean preventEdit0) {
update(stringOnly0, preventEdit0, stringOnly0);
}
public void update(boolean stringOnly0, boolean preventEdit0, boolean hideFolderColumn0) {
if (this.stringOnly != stringOnly0) {
this.stringOnly = stringOnly0;
this.restoreDefaultFilters();
}
if (stringOnly0) {
preventEdit0 = true; //if name only, always prevent edit
preventEdit0 = true; //if name only, always prevent edit and hide folder column
hideFolderColumn0 = true;
}
if (this.preventEdit != preventEdit0) {
this.preventEdit = preventEdit0;
columns.get(ColumnDef.DECK_ACTIONS).setVisible(!preventEdit0);
}
if (this.hideFolderColumn != hideFolderColumn0) {
this.hideFolderColumn = hideFolderColumn0;
columns.get(ColumnDef.DECK_FOLDER).setVisible(!hideFolderColumn0);
}
if (stringOnly0) {
this.setup(SColumnUtil.getStringColumn());
}