private boolean isGroupEnabled(String group) { List<IdSet> sets = PluginGroups.getInstance().getSets(group); for (IdSet idSet : sets) { String[] ids = idSet.getIds(); for (String id : ids) { if (PluginGroups.getInstance().isPluginEnabled(id)) return true; } } return false; }
@Override public void linkSelected(LinkLabel linkLabel, String command) { if (command == null || !command.contains(":")) return; int semicolonPosition = command.indexOf(":"); String group = command.substring(semicolonPosition + 1); command = command.substring(0, semicolonPosition); if (SWITCH_COMMAND.equals(command)) { boolean enabled = isGroupEnabled(group); List<IdSet> sets = PluginGroups.getInstance().getSets(group); for (IdSet idSet : sets) { String[] ids = idSet.getIds(); for (String id : ids) { PluginGroups.getInstance().setPluginEnabledWithDependencies(id, !enabled); } } repaint(); return; } if (CUSTOMIZE_COMMAND.equals(command)) { myCustomizePanel.update(group); myCardLayout.show(this, CUSTOMIZE); } }