@Override public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { if (settingsType == SettingsType.INDENT_SETTINGS) { consumer.showAllStandardOptions(); } else if (settingsType == SettingsType.SPACING_SETTINGS) { consumer.showStandardOptions("SPACE_AROUND_ASSIGNMENT_OPERATORS", "SPACE_AROUND_EQUALITY_OPERATORS", "SPACE_BEFORE_CLASS_LBRACE", "SPACE_BEFORE_METHOD_LBRACE", "SPACE_BEFORE_METHOD_LBRACE", "SPACE_WITHIN_BRACKETS", "SPACE_AFTER_SEMICOLON", "SPACE_BEFORE_SEMICOLON", "SPACE_AFTER_COLON"); consumer.renameStandardOption("SPACE_AROUND_ASSIGNMENT_OPERATORS", "Attribute operator"); consumer.renameStandardOption("SPACE_BEFORE_CLASS_LBRACE", "Space before {"); consumer.renameStandardOption("SPACE_BEFORE_METHOD_LBRACE", "Space before ["); } else if (settingsType == SettingsType.BLANK_LINES_SETTINGS) { consumer.showStandardOptions("KEEP_BLANK_LINES_IN_CODE"); } }
public RightMarginForm(@NotNull Language language, @NotNull CodeStyleSettings settings) { myLanguage = language; myDefaultRightMargin = settings.getDefaultRightMargin(); myDefaultGeneralCheckBox.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { if (myDefaultGeneralCheckBox.isSelected()) { myRightMarginField.setText(Integer.toString(myDefaultRightMargin)); myRightMarginField.setEnabled(false); } else { myRightMarginField.setEnabled(true); } } }); //noinspection unchecked myWrapOnTypingCombo.setModel(new DefaultComboBoxModel( CodeStyleSettingsCustomizable.WRAP_ON_TYPING_OPTIONS )); }
public void reset(@NotNull CodeStyleSettings settings) { CommonCodeStyleSettings langSettings = settings.getCommonSettings(myLanguage); if (langSettings != settings && langSettings.RIGHT_MARGIN >= 0) { myDefaultGeneralCheckBox.setSelected(false); myRightMarginField.setText(Integer.toString(langSettings.RIGHT_MARGIN)); } else { myDefaultGeneralCheckBox.setSelected(true); myRightMarginField.setText(Integer.toString(settings.getDefaultRightMargin())); if (langSettings == settings) { myDefaultGeneralCheckBox.setEnabled(false); myRightMarginField.setEnabled(false); } } for (int i = 0; i < CodeStyleSettingsCustomizable.WRAP_ON_TYPING_VALUES.length; i ++) { if (langSettings.WRAP_ON_TYPING == CodeStyleSettingsCustomizable.WRAP_ON_TYPING_VALUES[i]) { myWrapOnTypingCombo.setSelectedIndex(i); break; } } }
@Override public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { if (settingsType == SettingsType.SPACING_SETTINGS) { consumer.showStandardOptions(SPACE_AROUND_ASSIGNMENT_OPERATORS.name()); consumer.renameStandardOption(SPACE_AROUND_ASSIGNMENT_OPERATORS.name(), "Separator"); consumer.showStandardOptions(SPACE_AROUND_LAMBDA_ARROW.name()); consumer.renameStandardOption(SPACE_AROUND_LAMBDA_ARROW.name(), "Mapping arrow"); } else if (settingsType == SettingsType.WRAPPING_AND_BRACES_SETTINGS) { consumer.showStandardOptions(ALIGN_GROUP_FIELD_DECLARATIONS.name()); } else if (settingsType == SettingsType.BLANK_LINES_SETTINGS) { consumer.showStandardOptions(KEEP_BLANK_LINES_IN_CODE.name()); } }
@Override public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { if (settingsType == SettingsType.INDENT_SETTINGS) { //consumer.showStandardOptions("SPACE_AROUND_ASSIGNMENT_OPERATORS"); consumer.showAllStandardOptions(); } }
@Override public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { List<String> settings = new ArrayList<String>(); switch (settingsType) { case BLANK_LINES_SETTINGS: for (LuaSupportedCodeStyleSettings.BlankLinesOption blankLinesOption : LuaSupportedCodeStyleSettings .BlankLinesOption.values()) { settings.add(blankLinesOption.name()); } break; case SPACING_SETTINGS: for (LuaSupportedCodeStyleSettings.SpacingOption spacingOption : LuaSupportedCodeStyleSettings .SpacingOption.values()) { settings.add(spacingOption.name()); } break; case WRAPPING_AND_BRACES_SETTINGS: for (LuaSupportedCodeStyleSettings.WrappingOrBraceOption wrappingOrBraceOption : LuaSupportedCodeStyleSettings .WrappingOrBraceOption.values()) { settings.add(wrappingOrBraceOption.name()); } break; default: // ignore return; } consumer.showStandardOptions(settings.toArray(new String[settings.size()])); }
@Override public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { if (settingsType == SettingsType.SPACING_SETTINGS) { consumer.showStandardOptions("SPACE_AROUND_ASSIGNMENT_OPERATORS"); consumer.renameStandardOption("SPACE_AROUND_ASSIGNMENT_OPERATORS", "Assignment Operators"); consumer.showStandardOptions("SPACES_BEFORE_LEFT_BRACE"); consumer.showStandardOptions("SPACE_AFTER_COMMA"); consumer.showStandardOptions("SPACE_BEFORE_COMMA"); } else if (settingsType == SettingsType.BLANK_LINES_SETTINGS) { consumer.showStandardOptions("KEEP_BLANK_LINES_IN_CODE"); } }
@Override public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { if (settingsType == SettingsType.SPACING_SETTINGS) { consumer.showStandardOptions("SPACE_AROUND_ASSIGNMENT_OPERATORS"); consumer.renameStandardOption("SPACE_AROUND_ASSIGNMENT_OPERATORS", "Separator"); } else if (settingsType == SettingsType.BLANK_LINES_SETTINGS) { consumer.showStandardOptions("KEEP_BLANK_LINES_IN_CODE"); } }
@Override public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { switch (settingsType) { default: break; } }
private int getSelectedWrapOnTypingValue() { int i = myWrapOnTypingCombo.getSelectedIndex(); if (i >= 0 && i < CodeStyleSettingsCustomizable.WRAP_ON_TYPING_VALUES.length) { return CodeStyleSettingsCustomizable.WRAP_ON_TYPING_VALUES[i]; } return CommonCodeStyleSettings.WrapOnTyping.DEFAULT.intValue; }
@Override public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { if (settingsType == SettingsType.SPACING_SETTINGS) { consumer.showStandardOptions("SPACE_WITHIN_BRACKETS", "SPACE_WITHIN_BRACES", "SPACE_AFTER_COMMA", "SPACE_BEFORE_COMMA"); consumer.renameStandardOption("SPACE_WITHIN_BRACES", "Braces"); consumer.showCustomOption(JsonCodeStyleSettings.class, "SPACE_BEFORE_COLON", "Before ':'", SPACES_OTHER); consumer.showCustomOption(JsonCodeStyleSettings.class, "SPACE_AFTER_COLON", "After ':'", SPACES_OTHER); } else if (settingsType == SettingsType.BLANK_LINES_SETTINGS) { consumer.showStandardOptions("KEEP_BLANK_LINES_IN_CODE"); } else if (settingsType == SettingsType.WRAPPING_AND_BRACES_SETTINGS) { consumer.showStandardOptions("RIGHT_MARGIN", "WRAP_ON_TYPING", "KEEP_LINE_BREAKS", "WRAP_LONG_LINES"); consumer.showCustomOption(JsonCodeStyleSettings.class, "ARRAY_WRAPPING", "Arrays", null, CodeStyleSettingsCustomizable.WRAP_OPTIONS, CodeStyleSettingsCustomizable.WRAP_VALUES); consumer.showCustomOption(JsonCodeStyleSettings.class, "OBJECT_WRAPPING", "Objects", null, CodeStyleSettingsCustomizable.WRAP_OPTIONS, CodeStyleSettingsCustomizable.WRAP_VALUES); } }
@Override public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { if (settingsType == SettingsType.WRAPPING_AND_BRACES_SETTINGS) { consumer.showStandardOptions("RIGHT_MARGIN", "WRAP_ON_TYPING"); } }
@Override public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { if (settingsType == SettingsType.SPACING_SETTINGS) { //consumer.showStandardOptions("SPACE_AROUND_ASSIGNMENT_OPERATORS"); //consumer.renameStandardOption("SPACE_AROUND_ASSIGNMENT_OPERATORS", "Separator"); } else if (settingsType == SettingsType.BLANK_LINES_SETTINGS) { //consumer.showStandardOptions("KEEP_BLANK_LINES_IN_CODE"); } }
@Override public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { List<String> settings = new ArrayList<String>(); switch(settingsType) { case BLANK_LINES_SETTINGS: for(LuaSupportedCodeStyleSettings.BlankLinesOption blankLinesOption : LuaSupportedCodeStyleSettings.BlankLinesOption.values()) { settings.add(blankLinesOption.name()); } break; case SPACING_SETTINGS: for(LuaSupportedCodeStyleSettings.SpacingOption spacingOption : LuaSupportedCodeStyleSettings.SpacingOption.values()) { settings.add(spacingOption.name()); } break; case WRAPPING_AND_BRACES_SETTINGS: for(LuaSupportedCodeStyleSettings.WrappingOrBraceOption wrappingOrBraceOption : LuaSupportedCodeStyleSettings.WrappingOrBraceOption.values()) { settings.add(wrappingOrBraceOption.name()); } break; default: // ignore return; } consumer.showStandardOptions(settings.toArray(new String[settings.size()])); }
@Override public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { if(settingsType == SettingsType.SPACING_SETTINGS) { consumer.showStandardOptions("SPACE_BEFORE_METHOD_CALL_PARENTHESES", "SPACE_BEFORE_METHOD_PARENTHESES", "SPACE_BEFORE_IF_PARENTHESES", "SPACE_BEFORE_WHILE_PARENTHESES", "SPACE_BEFORE_FOR_PARENTHESES", "SPACE_BEFORE_CATCH_PARENTHESES", "SPACE_BEFORE_SWITCH_PARENTHESES", "SPACE_AROUND_ASSIGNMENT_OPERATORS", "SPACE_AROUND_LOGICAL_OPERATORS", "SPACE_AROUND_EQUALITY_OPERATORS", "SPACE_AROUND_RELATIONAL_OPERATORS", "SPACE_AROUND_ADDITIVE_OPERATORS", "SPACE_AROUND_MULTIPLICATIVE_OPERATORS", "SPACE_AROUND_SHIFT_OPERATORS", "SPACE_BEFORE_CLASS_LBRACE", "SPACE_BEFORE_METHOD_LBRACE", "SPACE_BEFORE_IF_LBRACE", "SPACE_BEFORE_ELSE_LBRACE", "SPACE_BEFORE_WHILE_LBRACE", "SPACE_BEFORE_FOR_LBRACE", "SPACE_BEFORE_SWITCH_LBRACE", "SPACE_BEFORE_TRY_LBRACE", "SPACE_BEFORE_CATCH_LBRACE", "SPACE_BEFORE_WHILE_KEYWORD", "SPACE_BEFORE_ELSE_KEYWORD", "SPACE_BEFORE_CATCH_KEYWORD", "SPACE_WITHIN_METHOD_CALL_PARENTHESES", "SPACE_WITHIN_METHOD_PARENTHESES", "SPACE_WITHIN_IF_PARENTHESES", "SPACE_WITHIN_WHILE_PARENTHESES", "SPACE_WITHIN_FOR_PARENTHESES", "SPACE_WITHIN_CATCH_PARENTHESES", "SPACE_WITHIN_SWITCH_PARENTHESES", "SPACE_BEFORE_QUEST", "SPACE_AFTER_QUEST", "SPACE_BEFORE_COLON", "SPACE_AFTER_COLON", "SPACE_AFTER_COMMA", "SPACE_AFTER_COMMA_IN_TYPE_ARGUMENTS", "SPACE_BEFORE_COMMA", "SPACE_AROUND_UNARY_OPERATOR", "SPACE_WITHIN_BRACKETS", "SPACE_BEFORE_METHOD_PARENTHESES"); } else if(settingsType == SettingsType.BLANK_LINES_SETTINGS) { consumer.showStandardOptions("KEEP_BLANK_LINES_IN_CODE"); } else if(settingsType == SettingsType.WRAPPING_AND_BRACES_SETTINGS) { consumer.showStandardOptions("KEEP_LINE_BREAKS", "KEEP_FIRST_COLUMN_COMMENT", "BRACE_STYLE", "CLASS_BRACE_STYLE", "METHOD_BRACE_STYLE", "CALL_PARAMETERS_WRAP", "CALL_PARAMETERS_LPAREN_ON_NEXT_LINE", "CALL_PARAMETERS_RPAREN_ON_NEXT_LINE", "METHOD_PARAMETERS_WRAP", "METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE", "METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE", "ELSE_ON_NEW_LINE", "WHILE_ON_NEW_LINE", "CATCH_ON_NEW_LINE", "ALIGN_MULTILINE_PARAMETERS", "ALIGN_MULTILINE_PARAMETERS_IN_CALLS", "ALIGN_MULTILINE_BINARY_OPERATION", "BINARY_OPERATION_WRAP", "BINARY_OPERATION_SIGN_ON_NEXT_LINE", "TERNARY_OPERATION_WRAP", "TERNARY_OPERATION_SIGNS_ON_NEXT_LINE", "PARENTHESES_EXPRESSION_LPAREN_WRAP", "PARENTHESES_EXPRESSION_RPAREN_WRAP", "ALIGN_MULTILINE_TERNARY_OPERATION"); } }
public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull LanguageCodeStyleSettingsProvider.SettingsType settingsType) { if (consumer == null) throw new IllegalArgumentException("Argument 0 for @NotNull parameter of org/livescriptidea/formatter/LiveScriptLanguageCodeStyleSettingsProvider.customizeSettings must not be null"); if (settingsType == null) throw new IllegalArgumentException("Argument 1 for @NotNull parameter of org/livescriptidea/formatter/LiveScriptLanguageCodeStyleSettingsProvider.customizeSettings must not be null"); if (settingsType == LanguageCodeStyleSettingsProvider.SettingsType.SPACING_SETTINGS) { consumer.showStandardOptions(STANDARD_SPACING_OPTIONS); consumer.showCustomOption(LiveScriptCodeStyleSettings.class, "SPACE_BEFORE_PROPERTY_COLON", "Before property name-value separator ':'", CodeStyleSettingsCustomizable.SPACES_OTHER, new Object[0]); consumer.showCustomOption(LiveScriptCodeStyleSettings.class, "SPACE_AFTER_PROPERTY_COLON", "After property name-value separator ':'", CodeStyleSettingsCustomizable.SPACES_OTHER, new Object[0]); consumer.renameStandardOption("SPACE_WITHIN_ARRAY_INITIALIZER_BRACES", "Array initializer brackets"); consumer.showCustomOption(LiveScriptCodeStyleSettings.class, "SPACE_WITHIN_INDEX_BRACKETS", "Array index brackets", CodeStyleSettingsCustomizable.SPACES_WITHIN, new Object[0]); consumer.showCustomOption(LiveScriptCodeStyleSettings.class, "SPACE_WITHIN_RANGE_BRACKETS", "Range brackets", CodeStyleSettingsCustomizable.SPACES_WITHIN, new Object[0]); consumer.showCustomOption(LiveScriptCodeStyleSettings.class, "SPACE_WITHIN_OBJECT_BRACES", "Object braces", CodeStyleSettingsCustomizable.SPACES_WITHIN, new Object[0]); } else if (settingsType == LanguageCodeStyleSettingsProvider.SettingsType.WRAPPING_AND_BRACES_SETTINGS) { consumer.showStandardOptions(STANDARD_WRAPPING_OPTIONS); consumer.renameStandardOption("ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE", "New line after '['"); consumer.renameStandardOption("ARRAY_INITIALIZER_RBRACE_ON_NEXT_LINE", "Place ']' on new line"); consumer.renameStandardOption("METHOD_PARAMETERS_WRAP", "Function declaration parameters"); consumer.renameStandardOption("CALL_PARAMETERS_WRAP", "Function call arguments inside parenthesis"); consumer.showCustomOption(LiveScriptCodeStyleSettings.class, "ALIGN_FUNCTION_BODY", "Align function body", CodeStyleSettingsCustomizable.SPACES_OTHER, new Object[0]); } else if (settingsType == LanguageCodeStyleSettingsProvider.SettingsType.BLANK_LINES_SETTINGS) { consumer.showStandardOptions(STANDARD_BLANK_LINES_OPTIONS); } }
@Override public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { if (settingsType == SettingsType.SPACING_SETTINGS) { consumer.showStandardOptions("SPACE_BEFORE_METHOD_CALL_PARENTHESES", "SPACE_BEFORE_METHOD_PARENTHESES", "SPACE_BEFORE_IF_PARENTHESES", "SPACE_AROUND_ASSIGNMENT_OPERATORS", "SPACE_AROUND_LOGICAL_OPERATORS", "SPACE_AROUND_EQUALITY_OPERATORS", "SPACE_AROUND_RELATIONAL_OPERATORS", "SPACE_AROUND_ADDITIVE_OPERATORS", "SPACE_AROUND_MULTIPLICATIVE_OPERATORS", "SPACE_AROUND_SHIFT_OPERATORS", "SPACE_BEFORE_METHOD_LBRACE", "SPACE_BEFORE_ELSE_LBRACE", "SPACE_BEFORE_WHILE_KEYWORD", "SPACE_BEFORE_ELSE_KEYWORD", "SPACE_WITHIN_METHOD_CALL_PARENTHESES", "SPACE_WITHIN_METHOD_PARENTHESES", "SPACE_WITHIN_IF_PARENTHESES", "SPACE_BEFORE_COLON", "SPACE_AFTER_COLON", "SPACE_AFTER_COMMA", "SPACE_AFTER_COMMA_IN_TYPE_ARGUMENTS", "SPACE_BEFORE_COMMA", "SPACE_AROUND_UNARY_OPERATOR" ); } else if (settingsType == SettingsType.BLANK_LINES_SETTINGS) { consumer.showStandardOptions("KEEP_BLANK_LINES_IN_CODE"); } else if (settingsType == SettingsType.WRAPPING_AND_BRACES_SETTINGS) { consumer.showStandardOptions("RIGHT_MARGIN", "KEEP_LINE_BREAKS", "KEEP_FIRST_COLUMN_COMMENT", "BRACE_STYLE", "METHOD_BRACE_STYLE", "CALL_PARAMETERS_WRAP", "CALL_PARAMETERS_LPAREN_ON_NEXT_LINE", "CALL_PARAMETERS_RPAREN_ON_NEXT_LINE", "METHOD_PARAMETERS_WRAP", "METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE", "METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE", "ELSE_ON_NEW_LINE", "ALIGN_MULTILINE_PARAMETERS", "ALIGN_MULTILINE_PARAMETERS_IN_CALLS", "ALIGN_MULTILINE_BINARY_OPERATION", "BINARY_OPERATION_WRAP", "BINARY_OPERATION_SIGN_ON_NEXT_LINE", "PARENTHESES_EXPRESSION_LPAREN_WRAP", "PARENTHESES_EXPRESSION_RPAREN_WRAP", "SPECIAL_ELSE_IF_TREATMENT"); } }
@Override public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { if (settingsType == SettingsType.LANGUAGE_SPECIFIC) { consumer.showCustomOption(CsvCodeStyleSettings.class, "SEPARATOR_INDEX", "Value separator", "Separator", CsvCodeStyleSettings.SUPPORTED_SEPARATORS_DISPLAY, IntStream.rangeClosed(0, CsvCodeStyleSettings.SUPPORTED_SEPARATORS.length - 1).toArray()); consumer.showCustomOption(CsvCodeStyleSettings.class, "SPACE_BEFORE_SEPARATOR", "Space before separator", "Separator"); consumer.showCustomOption(CsvCodeStyleSettings.class, "SPACE_AFTER_SEPARATOR", "Space after separator", "Separator"); consumer.showCustomOption(CsvCodeStyleSettings.class, "TRIM_LEADING_WHITE_SPACES", "Trim leading whitespaces", "Trimming"); consumer.showCustomOption(CsvCodeStyleSettings.class, "TRIM_TRAILING_WHITE_SPACES", "Trim trailing whitespaces", "Trimming"); consumer.showCustomOption(CsvCodeStyleSettings.class, "TABULARIZE", "Enabled", "Tabularize (ignores Trimming settings)"); consumer.showCustomOption(CsvCodeStyleSettings.class, "WHITE_SPACES_OUTSIDE_QUOTES", "Trimming/Spacing Outside Quotes", "Tabularize (ignores Trimming settings)"); consumer.showCustomOption(CsvCodeStyleSettings.class, "LEADING_WHITE_SPACES", "Leading White Spaces", "Tabularize (ignores Trimming settings)"); } }
@Override public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { if (settingsType == SettingsType.SPACING_SETTINGS) { consumer.moveStandardOption(String.valueOf(SPACE_BEFORE_COLON), SEPARATORS_GROUP); consumer.moveStandardOption(String.valueOf(SPACE_AFTER_COLON), SEPARATORS_GROUP); consumer.moveStandardOption(String.valueOf(SPACE_AFTER_COMMA), SEPARATORS_GROUP); consumer.moveStandardOption(String.valueOf(SPACE_BEFORE_SEMICOLON), SEPARATORS_GROUP); consumer.moveStandardOption(String.valueOf(SPACE_AFTER_SEMICOLON), SEPARATORS_GROUP); consumer.showStandardOptions(String.valueOf(SPACE_BEFORE_COLON), String.valueOf(SPACE_AFTER_COLON), String.valueOf(SPACE_AFTER_COMMA), String.valueOf(SPACE_BEFORE_SEMICOLON), String.valueOf(SPACE_AFTER_SEMICOLON), String.valueOf(SPACE_WITHIN_BRACES)); consumer.showCustomOption(SmcCodeStyleSettings.class, String.valueOf(SmcOptions.SPACE_AFTER_KEYWORD), SPACES_AFTER_KEYWORD_LABEL, CodeStyleSettingsCustomizable.SPACES_OTHER); consumer.showCustomOption(SmcCodeStyleSettings.class, String.valueOf(SmcOptions.SPACE_WITHIN_PARENTHESES), SPACE_WITHIN_PARENTHESES_LABEL, CodeStyleSettingsCustomizable.SPACES_WITHIN); consumer.showCustomOption(SmcCodeStyleSettings.class, String.valueOf(SmcOptions.SPACE_BEFORE_PARENTHESES_OPEN), SPACE_BEFORE_PARENTHESES_LABEL, CodeStyleSettingsCustomizable.SPACES_BEFORE_PARENTHESES); consumer.showCustomOption(SmcCodeStyleSettings.class, String.valueOf(SmcOptions.SPACE_BEFORE_TRANSITION_ARGS), SPACE_BEFORE_TRANSITION_ARGS_LABEL, CodeStyleSettingsCustomizable.SPACES_BEFORE_PARENTHESES); consumer.showCustomOption(SmcCodeStyleSettings.class, String.valueOf(SmcOptions.SPACE_BEFORE_ACTIONS_BLOCK), SPACE_BEFORE_ACTIONS_BLOCK_LABEL, CodeStyleSettingsCustomizable.SPACES_BEFORE_PARENTHESES); consumer.showCustomOption(SmcCodeStyleSettings.class, String.valueOf(SmcOptions.SPACE_BEFORE_TRANSITIONS_BLOCK), INSERT_SPACES_BEFORE_TRANSITIONS_LABEL, CodeStyleSettingsCustomizable.SPACES_BEFORE_PARENTHESES); consumer.showCustomOption(SmcCodeStyleSettings.class, String.valueOf(SmcOptions.SPACE_AROUND_MAP_STATE_SEPARATOR), SPACE_AROUND_MAP_STATE_SEPARATOR_LABEL, CodeStyleSettingsCustomizable.SPACES_OTHER); consumer.showCustomOption(SmcCodeStyleSettings.class, String.valueOf(SmcOptions.SPACE_AROUND_PUSH_PROXY_STATE_KEYWORD_SEPARATOR), SPACE_AROUND_PUSH_PROXY_STATE_KEYWORD_SEPARATOR_LABEL, CodeStyleSettingsCustomizable.SPACES_OTHER); consumer.showCustomOption(SmcCodeStyleSettings.class, String.valueOf(SmcOptions.SPACE_AFTER_ENTRY_EXIT_KEYWORDS), SPACE_AFTER_ENTRY_EXIT_KEYWORDS_LABEL, CodeStyleSettingsCustomizable.SPACES_OTHER); } else if (settingsType == SettingsType.BLANK_LINES_SETTINGS) { consumer.showCustomOption(SmcCodeStyleSettings.class, String.valueOf(SmcOptions.BLANK_LINES_AROUND_MAP), "Blank lines around \"Map\" definition", CodeStyleSettingsCustomizable.BLANK_LINES_KEEP); consumer.showCustomOption(SmcCodeStyleSettings.class, String.valueOf(SmcOptions.BLANK_LINES_AROUND_STATE), "Blank lines around \"State\" definition", CodeStyleSettingsCustomizable.BLANK_LINES_KEEP); consumer.showCustomOption(SmcCodeStyleSettings.class, String.valueOf(SmcOptions.BLANK_LINES_AROUND_TRANSITION), "Blank lines around \"Transition\" definition", CodeStyleSettingsCustomizable.BLANK_LINES_KEEP); consumer.showCustomOption(SmcCodeStyleSettings.class, String.valueOf(SmcOptions.BLANK_LINES_AROUND_ENTRY), "Blank lines around \"Entry\" definition", CodeStyleSettingsCustomizable.BLANK_LINES_KEEP); consumer.showCustomOption(SmcCodeStyleSettings.class, String.valueOf(SmcOptions.BLANK_LINES_AROUND_EXIT), "Blank lines around \"Exit\" definition", CodeStyleSettingsCustomizable.BLANK_LINES_KEEP); } else if (settingsType == SettingsType.WRAPPING_AND_BRACES_SETTINGS) { newWrapOption(consumer, SmcOptions.WRAP_ACTIONS, "Wrap \"Action\" statement"); newWrapOption(consumer, SmcOptions.WRAP_ENTRY, "Wrap \"Entry\"block"); newWrapOption(consumer, SmcOptions.WRAP_EXIT, "Wrap \"Exit\" block"); newWrapOption(consumer, SmcOptions.WRAP_NEXT_STATE, "Wrap \"Next state\" name"); newWrapOption(consumer, SmcOptions.WRAP_POP_TRANSITION, "Wrap \"Pop transition\" statement"); newWrapOption(consumer, SmcOptions.WRAP_PUSH_TRANSITION, "Wrap \"Push transition\" statement"); newWrapOption(consumer, SmcOptions.WRAP_STATE, "Wrap \"State\" Statement"); newWrapOption(consumer, SmcOptions.WRAP_TRANSITION, "Wrap \"Transition\" Statement"); newWrapOption(consumer, SmcOptions.WRAP_TRANSITION_ARGS, "Wrap \"Transition arguments\""); } }
private void newWrapOption(@NotNull CodeStyleSettingsCustomizable consumer, SmcOptions wrapPropertyOption, String title) { consumer.showCustomOption(SmcCodeStyleSettings.class, String.valueOf(wrapPropertyOption), title, null, CodeStyleSettingsCustomizable.WRAP_OPTIONS, CodeStyleSettingsCustomizable.WRAP_VALUES); }
@Override public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { if (settingsType == SettingsType.INDENT_SETTINGS) { consumer.showAllStandardOptions(); } }
@Override public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { if (settingsType == SettingsType.SPACING_SETTINGS) { consumer.showStandardOptions("SPACE_BEFORE_METHOD_CALL_PARENTHESES", "SPACE_BEFORE_METHOD_PARENTHESES", "SPACE_AROUND_ASSIGNMENT_OPERATORS", "SPACE_AROUND_EQUALITY_OPERATORS", "SPACE_AROUND_RELATIONAL_OPERATORS", "SPACE_AROUND_BITWISE_OPERATORS", "SPACE_AROUND_ADDITIVE_OPERATORS", "SPACE_AROUND_MULTIPLICATIVE_OPERATORS", "SPACE_AROUND_SHIFT_OPERATORS", "SPACE_WITHIN_METHOD_CALL_PARENTHESES", "SPACE_WITHIN_METHOD_PARENTHESES", "SPACE_WITHIN_BRACKETS", "SPACE_AFTER_COMMA", "SPACE_BEFORE_COMMA", "SPACE_BEFORE_SEMICOLON"); consumer.showCustomOption(PyCodeStyleSettings.class, "SPACE_BEFORE_LBRACKET", PyBundle.message("formatter.left.bracket"), SPACES_BEFORE_PARENTHESES); consumer.showCustomOption(PyCodeStyleSettings.class, "SPACE_AROUND_EQ_IN_NAMED_PARAMETER", PyBundle.message("formatter.around.eq.in.named.parameter"), SPACES_AROUND_OPERATORS); consumer.showCustomOption(PyCodeStyleSettings.class, "SPACE_AROUND_EQ_IN_KEYWORD_ARGUMENT", PyBundle.message("formatter.around.eq.in.keyword.argument"), SPACES_AROUND_OPERATORS); consumer.showCustomOption(PyCodeStyleSettings.class, "SPACE_WITHIN_BRACES", PyBundle.message("formatter.braces"), SPACES_WITHIN); consumer.showCustomOption(PyCodeStyleSettings.class, "SPACE_BEFORE_PY_COLON", ApplicationBundle.message("checkbox.spaces.before.colon"), SPACES_OTHER); consumer.showCustomOption(PyCodeStyleSettings.class, "SPACE_AFTER_PY_COLON", ApplicationBundle.message("checkbox.spaces.after.colon"), SPACES_OTHER); consumer.showCustomOption(PyCodeStyleSettings.class, "SPACE_BEFORE_BACKSLASH", PyBundle.message("formatter.before.backslash"), SPACES_OTHER); consumer.showCustomOption(PyCodeStyleSettings.class, "SPACE_BEFORE_NUMBER_SIGN", PyBundle.message("formatter.before.hash"), SPACES_OTHER); consumer.showCustomOption(PyCodeStyleSettings.class, "SPACE_AFTER_NUMBER_SIGN", PyBundle.message("formatter.after.hash"), SPACES_OTHER); } else if (settingsType == SettingsType.BLANK_LINES_SETTINGS) { consumer.showStandardOptions("BLANK_LINES_AROUND_CLASS", "BLANK_LINES_AROUND_METHOD", "BLANK_LINES_AFTER_IMPORTS", "KEEP_BLANK_LINES_IN_DECLARATIONS", "KEEP_BLANK_LINES_IN_CODE"); consumer.renameStandardOption("BLANK_LINES_AFTER_IMPORTS", PyBundle.message("formatter.around.top.level.imports")); consumer.showCustomOption(PyCodeStyleSettings.class, "BLANK_LINES_AROUND_TOP_LEVEL_CLASSES_FUNCTIONS", PyBundle.message("formatter.around.top.level.classes.and.function"), BLANK_LINES); consumer.showCustomOption(PyCodeStyleSettings.class, "BLANK_LINES_AFTER_LOCAL_IMPORTS", PyBundle.message("formatter.after.local.imports"), BLANK_LINES); } else if (settingsType == SettingsType.WRAPPING_AND_BRACES_SETTINGS) { consumer.showStandardOptions("RIGHT_MARGIN", "WRAP_ON_TYPING", "KEEP_LINE_BREAKS", "WRAP_LONG_LINES", "ALIGN_MULTILINE_PARAMETERS", "ALIGN_MULTILINE_PARAMETERS_IN_CALLS"); consumer.showCustomOption(PyCodeStyleSettings.class, "NEW_LINE_AFTER_COLON", PyBundle.message("formatter.single.clause.statements"), PyBundle.message("formatter.force.new.line.after.colon")); consumer.showCustomOption(PyCodeStyleSettings.class, "NEW_LINE_AFTER_COLON_MULTI_CLAUSE", PyBundle.message("formatter.multi.clause.statements"), PyBundle.message("formatter.force.new.line.after.colon")); consumer.showCustomOption(PyCodeStyleSettings.class, "ALIGN_COLLECTIONS_AND_COMPREHENSIONS", PyBundle.message("formatter.align.when.multiline"), PyBundle.message("formatter.collections.and.comprehensions")); consumer.showCustomOption(PyCodeStyleSettings.class, "ALIGN_MULTILINE_IMPORTS", PyBundle.message("formatter.align.when.multiline"), PyBundle.message("formatter.import.statements")); consumer.showCustomOption(PyCodeStyleSettings.class, "DICT_WRAPPING", PyBundle.message("formatter.dictionary.literals"), null, WRAP_OPTIONS, WRAP_VALUES); consumer.showCustomOption(PyCodeStyleSettings.class, "DICT_NEW_LINE_AFTER_LEFT_BRACE", ApplicationBundle.message("wrapping.new.line.after.lbrace"), PyBundle.message("formatter.dictionary.literals")); consumer.showCustomOption(PyCodeStyleSettings.class, "DICT_NEW_LINE_BEFORE_RIGHT_BRACE", ApplicationBundle.message("wrapping.rbrace.on.new.line"), PyBundle.message("formatter.dictionary.literals")); } }
@Override public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { consumer.showAllStandardOptions(); }
@Override public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { if (settingsType == SettingsType.SPACING_SETTINGS) { consumer.showStandardOptions("SPACE_BEFORE_METHOD_CALL_PARENTHESES", "SPACE_BEFORE_METHOD_PARENTHESES", "SPACE_BEFORE_IF_PARENTHESES", "SPACE_BEFORE_WHILE_PARENTHESES", "SPACE_BEFORE_FOR_PARENTHESES", "SPACE_BEFORE_CATCH_PARENTHESES", "SPACE_BEFORE_SWITCH_PARENTHESES", "SPACE_AROUND_ASSIGNMENT_OPERATORS", "SPACE_AROUND_LOGICAL_OPERATORS", "SPACE_AROUND_EQUALITY_OPERATORS", "SPACE_AROUND_RELATIONAL_OPERATORS", "SPACE_AROUND_ADDITIVE_OPERATORS", "SPACE_AROUND_MULTIPLICATIVE_OPERATORS", "SPACE_BEFORE_METHOD_LBRACE", "SPACE_BEFORE_IF_LBRACE", "SPACE_BEFORE_ELSE_LBRACE", "SPACE_BEFORE_WHILE_LBRACE", "SPACE_BEFORE_FOR_LBRACE", "SPACE_BEFORE_SWITCH_LBRACE", "SPACE_BEFORE_TRY_LBRACE", "SPACE_BEFORE_CATCH_LBRACE", "SPACE_BEFORE_WHILE_KEYWORD", "SPACE_BEFORE_ELSE_KEYWORD", "SPACE_BEFORE_CATCH_KEYWORD", "SPACE_WITHIN_METHOD_CALL_PARENTHESES", "SPACE_WITHIN_METHOD_PARENTHESES", "SPACE_WITHIN_IF_PARENTHESES", "SPACE_WITHIN_WHILE_PARENTHESES", "SPACE_WITHIN_FOR_PARENTHESES", "SPACE_WITHIN_CATCH_PARENTHESES", "SPACE_WITHIN_SWITCH_PARENTHESES", "SPACE_BEFORE_QUEST", "SPACE_AFTER_QUEST", "SPACE_BEFORE_COLON", "SPACE_AFTER_COLON", "SPACE_AFTER_COMMA", "SPACE_AFTER_COMMA_IN_TYPE_ARGUMENTS", "SPACE_BEFORE_COMMA", "SPACE_AROUND_UNARY_OPERATOR" ); consumer.showCustomOption(HaxeCodeStyleSettings.class, "SPACE_AROUND_ARROW", "Around ->", CodeStyleSettingsCustomizable.SPACES_OTHER, CodeStyleSettingsCustomizable.OptionAnchor.NONE); consumer.showCustomOption(HaxeCodeStyleSettings.class, "SPACE_BEFORE_TYPE_REFERENCE_COLON", "Space before type reference colon ':'", CodeStyleSettingsCustomizable.SPACES_OTHER, CodeStyleSettingsCustomizable.OptionAnchor.NONE); consumer.showCustomOption(HaxeCodeStyleSettings.class, "SPACE_AFTER_TYPE_REFERENCE_COLON", "Space after type reference colon ':'", CodeStyleSettingsCustomizable.SPACES_OTHER, CodeStyleSettingsCustomizable.OptionAnchor.NONE); } else if (settingsType == SettingsType.BLANK_LINES_SETTINGS) { consumer.showStandardOptions("KEEP_BLANK_LINES_IN_CODE"); } else if (settingsType == SettingsType.WRAPPING_AND_BRACES_SETTINGS) { consumer.showStandardOptions("KEEP_LINE_BREAKS", "KEEP_FIRST_COLUMN_COMMENT", "BRACE_STYLE", "METHOD_BRACE_STYLE", "CALL_PARAMETERS_WRAP", "CALL_PARAMETERS_LPAREN_ON_NEXT_LINE", "CALL_PARAMETERS_RPAREN_ON_NEXT_LINE", "METHOD_PARAMETERS_WRAP", "METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE", "METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE", "ELSE_ON_NEW_LINE", "WHILE_ON_NEW_LINE", "CATCH_ON_NEW_LINE", "ALIGN_MULTILINE_PARAMETERS", "ALIGN_MULTILINE_PARAMETERS_IN_CALLS", "ALIGN_MULTILINE_BINARY_OPERATION", "BINARY_OPERATION_WRAP", "BINARY_OPERATION_SIGN_ON_NEXT_LINE", "TERNARY_OPERATION_WRAP", "TERNARY_OPERATION_SIGNS_ON_NEXT_LINE", "PARENTHESES_EXPRESSION_LPAREN_WRAP", "PARENTHESES_EXPRESSION_RPAREN_WRAP", "ALIGN_MULTILINE_TERNARY_OPERATION", "SPECIAL_ELSE_IF_TREATMENT"); } }
@Override public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) { if (settingsType == SettingsType.SPACING_SETTINGS) { consumer.showStandardOptions( "SPACE_AROUND_ASSIGNMENT_OPERATORS", "SPACE_AROUND_EQUALITY_OPERATORS", "SPACE_AROUND_RELATIONAL_OPERATORS", "SPACE_AROUND_ADDITIVE_OPERATORS", "SPACE_AROUND_MULTIPLICATIVE_OPERATORS", "SPACE_AROUND_UNARY_OPERATOR", "SPACE_AFTER_COMMA", "SPACE_BEFORE_COMMA", "SPACE_BEFORE_IF_PARENTHESES", "SPACE_BEFORE_SWITCH_PARENTHESES" ); consumer.renameStandardOption("SPACE_AROUND_ASSIGNMENT_OPERATORS", "Assignment operator (:=)"); consumer.renameStandardOption("SPACE_AROUND_EQUALITY_OPERATORS", "Equality operators (=, !=)"); consumer.renameStandardOption("SPACE_AROUND_RELATIONAL_OPERATORS", "Relational operators (<, <=, >, >=)"); consumer.renameStandardOption("SPACE_AROUND_ADDITIVE_OPERATORS", "Additive operators (+, -)"); consumer.renameStandardOption("SPACE_AROUND_MULTIPLICATIVE_OPERATORS", "Multiplicative operator (*)"); consumer.renameStandardOption("SPACE_AROUND_UNARY_OPERATOR", "Unary operators (+, -)"); consumer.showCustomOption(XQueryCodeStyleSettings.class, "SPACE_AROUND_AXIS_OPERATOR", "Axis operator (::)", CodeStyleSettingsCustomizable.SPACES_AROUND_OPERATORS); consumer.showCustomOption(XQueryCodeStyleSettings.class, "SPACE_AROUND_ASSIGNMENT_IN_PROLOG", "Around '=' in declarations", CodeStyleSettingsCustomizable.SPACES_OTHER); consumer.showCustomOption(XQueryCodeStyleSettings.class, "SPACE_AROUND_ASSIGNMENT_IN_XML_ATTRIBUTE", "Around '=' inside XML attributes", CodeStyleSettingsCustomizable.SPACES_OTHER); consumer.showCustomOption(XQueryCodeStyleSettings.class, "SPACE_BEFORE_TYPESWITCH_PARENTHESES", "'typeswitch' parentheses", CodeStyleSettingsCustomizable.SPACES_BEFORE_PARENTHESES); consumer.showCustomOption(XQueryCodeStyleSettings.class, "SPACE_BEFORE_TYPE_TEST_PARENTHESES", "SequenceType and NodeTest parentheses", CodeStyleSettingsCustomizable.SPACES_BEFORE_PARENTHESES); consumer.showCustomOption(XQueryCodeStyleSettings.class, "SPACE_BEFORE_FUNCTION_DECLARATION_PARENTHESES", "Function declaration parentheses", CodeStyleSettingsCustomizable.SPACES_BEFORE_PARENTHESES); consumer.showCustomOption(XQueryCodeStyleSettings.class, "SPACE_BEFORE_FUNCTION_CALL_PARENTHESES", "Function call parentheses", CodeStyleSettingsCustomizable.SPACES_BEFORE_PARENTHESES); } else if (settingsType == SettingsType.WRAPPING_AND_BRACES_SETTINGS) { consumer.showStandardOptions("KEEP_LINE_BREAKS"); } else if (settingsType == SettingsType.BLANK_LINES_SETTINGS) { consumer.showStandardOptions("KEEP_BLANK_LINES_IN_CODE"); } }