public void setItem(@Nullable QuickList item) { apply(); this.item = item; if (item == null) { return; } myName.setText(item.getName()); myName.setEnabled(QuickListsManager.getInstance().getSchemeManager().isMetadataEditable(item)); myDescription.setText(item.getDescription()); actionsModel.removeAll(); for (String id : item.getActionIds()) { includeActionId(id); } }
@Override public void apply(@NotNull List<QuickList> settings) throws ConfigurationException { itemPanel.apply(); editor.ensureNonEmptyNames("Quick list should have non empty name"); editor.processModifiedItems(new PairProcessor<QuickList, QuickList>() { @Override public boolean process(QuickList newItem, QuickList oldItem) { if (!oldItem.getName().equals(newItem.getName())) { keymapListener.quickListRenamed(oldItem, newItem); } return true; } }); if (isModified(settings)) { java.util.List<QuickList> result = editor.apply(); keymapListener.processCurrentKeymapChanged(result.toArray(new QuickList[result.size()])); QuickListsManager.getInstance().setQuickLists(result); } }
@Override public void reset() { myQuickListsModel.removeAllElements(); for (QuickList list : QuickListsManager.getInstance().getAllQuickLists()) { myQuickListsModel.addElement(list); } SwingUtilities.invokeLater(new Runnable() { @Override public void run() { if (!myQuickListsModel.isEmpty()) { myQuickListsList.setSelectedIndex(0); } } }); }
public void reset() { myQuickListsModel.removeAllElements(); QuickList[] allQuickLists = QuickListsManager.getInstance().getAllQuickLists(); for (QuickList list : allQuickLists) { myQuickListsModel.addElement(list); } SwingUtilities.invokeLater(new Runnable() { public void run() { if (myQuickListsModel.size() > 0) { myQuickListsList.setSelectedIndex(0); } } }); }
public void apply() { QuickListsManager.getInstance().removeAllQuickLists(); final QuickList[] currentQuickLists = getCurrentQuickListIds(); for (QuickList quickList : currentQuickLists) { QuickListsManager.getInstance().registerQuickList(quickList); } QuickListsManager.getInstance().registerActions(); }
@NotNull @Override protected List<QuickList> getSettings() { return QuickListsManager.getInstance().getSchemeManager().getAllSchemes(); }
@Override public boolean isRemovable(@NotNull QuickList item) { return QuickListsManager.getInstance().getSchemeManager().isMetadataEditable(item); }
public boolean isModified() { QuickList[] storedLists = QuickListsManager.getInstance().getAllQuickLists(); QuickList[] modelLists = getCurrentQuickListIds(); return !Comparing.equal(storedLists, modelLists); }
@Override public boolean isModified() { QuickList[] storedLists = QuickListsManager.getInstance().getAllQuickLists(); QuickList[] modelLists = getCurrentQuickListIds(); return !Comparing.equal(storedLists, modelLists); }
@Override public void apply() { QuickListsManager.getInstance().setQuickLists(getCurrentQuickListIds()); }