public Option(@Nullable Class<? extends CustomCodeStyleSettings> clazz, @NotNull String fieldName, @NotNull String title, @Nullable String groupName, @Nullable OptionAnchor anchor, @Nullable String anchorFiledName) { super(fieldName, anchor, anchorFiledName); this.clazz = clazz; this.title = title; this.groupName = groupName; try { Class styleSettingsClass = clazz == null ? CommonCodeStyleSettings.class : clazz; this.field = styleSettingsClass.getField(fieldName); } catch (NoSuchFieldException e) { throw new RuntimeException(e); } }
public IntOption(Class<? extends CustomCodeStyleSettings> clazz, @NotNull String fieldName, @NotNull String title, @Nullable String groupName, @Nullable OptionAnchor anchor, @Nullable String anchorFiledName, int minValue, int maxValue, int defaultValue, @Nullable String defaultValueText) { super(clazz, fieldName, title, groupName, anchor, anchorFiledName); myMinValue = minValue; myMaxValue = maxValue; myDefaultValue = defaultValue; myDefaultValueText = defaultValueText; }
@Override public void showCustomOption(Class<? extends CustomCodeStyleSettings> settingsClass, String fieldName, String title, String groupName, @Nullable OptionAnchor anchor, @Nullable String anchorFieldName, Object... options) { if (myIsFirstUpdate) { myCustomOptions.putValue(groupName, (Trinity)Trinity.create(settingsClass, fieldName, title)); } for (IntOption option : myOptions) { if (option.myTarget.getName().equals(fieldName)) { option.myTextField.setEnabled(true); } } }
public Option(Class<? extends CustomCodeStyleSettings> clazz, @NotNull String fieldName, @NotNull String title, @Nullable String groupName, @Nullable OptionAnchor anchor, @Nullable String anchorFiledName) { super(fieldName, anchor, anchorFiledName); this.clazz = clazz; this.title = title; this.groupName = groupName; try { Class styleSettingsClass = clazz == null ? CodeStyleSettings.class : clazz; this.field = styleSettingsClass.getField(fieldName); } catch (NoSuchFieldException e) { throw new RuntimeException(e); } }
public Option(@Nullable Class<? extends CustomCodeStyleSettings> clazz, @Nonnull String fieldName, @Nonnull String title, @Nullable String groupName, @Nullable OptionAnchor anchor, @Nullable String anchorFiledName) { super(fieldName, anchor, anchorFiledName); this.clazz = clazz; this.title = title; this.groupName = groupName; try { Class styleSettingsClass = clazz == null ? CommonCodeStyleSettings.class : clazz; this.field = styleSettingsClass.getField(fieldName); } catch (NoSuchFieldException e) { throw new RuntimeException(e); } }
public IntOption(Class<? extends CustomCodeStyleSettings> clazz, @Nonnull String fieldName, @Nonnull String title, @Nullable String groupName, @Nullable OptionAnchor anchor, @Nullable String anchorFiledName, int minValue, int maxValue, int defaultValue, @Nullable String defaultValueText) { super(clazz, fieldName, title, groupName, anchor, anchorFiledName); myMinValue = minValue; myMaxValue = maxValue; myDefaultValue = defaultValue; myDefaultValueText = defaultValueText; }
@Override public void showCustomOption(Class<? extends CustomCodeStyleSettings> settingsClass, String fieldName, String title, String groupName, Object... options) { showCustomOption(settingsClass, fieldName, title, groupName, null, null, options); }
@Override public void showCustomOption(Class<? extends CustomCodeStyleSettings> settingsClass, String fieldName, String title, @Nullable String groupName, @Nullable OptionAnchor anchor, @Nullable String anchorFieldName, Object... options) { if (isFirstUpdate) { myCustomOptions.putValue(groupName, new CustomBooleanOptionInfo(settingsClass, fieldName, title, groupName, anchor, anchorFieldName)); } enableOption(fieldName); }
private CustomBooleanOptionInfo(@NotNull Class<? extends CustomCodeStyleSettings> settingClass, @NotNull String fieldName, @NotNull String title, String groupName, OptionAnchor anchor, String anchorFieldName) { this.settingClass = settingClass; this.fieldName = fieldName; this.title = title; this.groupName = groupName; this.anchor = anchor; this.anchorFieldName = anchorFieldName; }
@Override public void setValue(CodeStyleSettings settings, Boolean aBoolean) { final CustomCodeStyleSettings customSettings = settings.getCustomSettings(mySettingsClass); try { field.set(customSettings, aBoolean); } catch (IllegalAccessException e) { LOG.error(e); } }
@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); } } } }
private BooleanOption(Class<? extends CustomCodeStyleSettings> clazz, @NotNull String fieldName, @NotNull String title, @Nullable String groupName, @Nullable OptionAnchor anchor, @Nullable String anchorFiledName) { super(clazz, fieldName, title, groupName, anchor, anchorFiledName); }
public SelectionOption(Class<? extends CustomCodeStyleSettings> clazz, @NotNull String fieldName, @NotNull String title, @Nullable String groupName, @Nullable OptionAnchor anchor, @Nullable String anchorFiledName, @NotNull String[] options, @NotNull int[] values) { super(clazz, fieldName, title, groupName, anchor, anchorFiledName); this.options = options; this.values = values; }
private CustomBooleanOptionInfo(@Nonnull Class<? extends CustomCodeStyleSettings> settingClass, @Nonnull String fieldName, @Nonnull String title, String groupName, OptionAnchor anchor, String anchorFieldName) { this.settingClass = settingClass; this.fieldName = fieldName; this.title = title; this.groupName = groupName; this.anchor = anchor; this.anchorFieldName = anchorFieldName; }
private BooleanOption(Class<? extends CustomCodeStyleSettings> clazz, @Nonnull String fieldName, @Nonnull String title, @Nullable String groupName, @Nullable OptionAnchor anchor, @Nullable String anchorFiledName) { super(clazz, fieldName, title, groupName, anchor, anchorFiledName); }
public SelectionOption(Class<? extends CustomCodeStyleSettings> clazz, @Nonnull String fieldName, @Nonnull String title, @Nullable String groupName, @Nullable OptionAnchor anchor, @Nullable String anchorFiledName, @Nonnull String[] options, @Nonnull int[] values) { super(clazz, fieldName, title, groupName, anchor, anchorFiledName); this.options = options; this.values = values; }
@Override public CustomCodeStyleSettings createCustomSettings(final CodeStyleSettings settings) { return new ImpexCodeStyleSettings(settings); }
@Override public CustomCodeStyleSettings createCustomSettings(CodeStyleSettings settings) { return new CsvCodeStyleSettings(settings); }
@Override public CustomCodeStyleSettings createCustomSettings(CodeStyleSettings settings) { return new SmcCodeStyleSettings(settings); }
@Nullable @Override public CustomCodeStyleSettings createCustomSettings(CodeStyleSettings settings) { return new FusionCodeStyleSettings(settings); }
@Override public CustomCodeStyleSettings createCustomSettings(CodeStyleSettings settings) { return new RythmCodeStyleSettings(settings); }