@Override public void showAllStandardOptions() { myShowAllStandardOptions = true; for (Option each : myOptions) { each.setEnabled(true); } for (Option each : myCustomOptions) { each.setEnabled(false); } }
@Override public void showStandardOptions(String... optionNames) { Collections.addAll(myAllowedOptions, optionNames); for (Option each : myOptions) { each.setEnabled(false); for (String optionName : optionNames) { if (each.field.getName().equals(optionName)) { each.setEnabled(true); } } } for (Option each : myCustomOptions) { each.setEnabled(false); } }
@Override public void actionPerformed(String ident, Object... params) { if (ident.equals("show")) { opt.getTag(name).setBooleanValue(!show()); updateNames(); } }
@Override public void showCustomOption( Class<? extends CustomCodeStyleSettings> settingsClass, String fieldName, String title, String groupName, @Nullable OptionAnchor anchor, @Nullable String anchorFieldName, Object... options) { if (isFirstUpdate) { Option option; if (options.length == 2) { option = new SelectionOption( settingsClass, fieldName, title, groupName, anchor, anchorFieldName, (String[]) options[0], (int[]) options[1]); } else { option = new BooleanOption(settingsClass, fieldName, title, groupName, anchor, anchorFieldName); } myCustomOptions.add(option); option.setEnabled(true); } else { for (Option each : myCustomOptions) { if (each.clazz == settingsClass && each.field.getName().equals(fieldName)) { each.setEnabled(true); } } } }
public boolean isEnabled() { return myKey.isEnabled(); }
public void apply(final CodeStyleSettings settings) { myKey.setValue(myValue, settings); }
public boolean isModified(final CodeStyleSettings settings) { return !myValue.equals(myKey.getValue(settings)); }
public void reset(CodeStyleSettings settings) { setValue(myKey.getValue(settings)); }
public MyTreeNode(Option key, String text, CodeStyleSettings settings) { myKey = key; myText = text; myValue = key.getValue(settings); setUserObject(myText); }
public Point getPos() { return new Point(opt.getTag(name + ".x").getIntValue(), opt.getTag(name + ".y").getIntValue()); }
private boolean show() { return opt.getTag(name).getBooleanValue(); }
private void setPos(Point p) { opt.getTag(name + ".x").setIntValue(p.x); opt.getTag(name + ".y").setIntValue(p.y); }