@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);
   }
 }
Ejemplo n.º 3
0
 @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);
 }
Ejemplo n.º 10
0
 public Point getPos() {
   return new Point(opt.getTag(name + ".x").getIntValue(), opt.getTag(name + ".y").getIntValue());
 }
Ejemplo n.º 11
0
 private boolean show() {
   return opt.getTag(name).getBooleanValue();
 }
Ejemplo n.º 12
0
 private void setPos(Point p) {
   opt.getTag(name + ".x").setIntValue(p.x);
   opt.getTag(name + ".y").setIntValue(p.y);
 }