本文整理汇总了Java中com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable.showStandardOptions方法的典型用法代码示例。如果您正苦于以下问题:Java CodeStyleSettingsCustomizable.showStandardOptions方法的具体用法?Java CodeStyleSettingsCustomizable.showStandardOptions怎么用?Java CodeStyleSettingsCustomizable.showStandardOptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable
的用法示例。
在下文中一共展示了CodeStyleSettingsCustomizable.showStandardOptions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: customizeSettings
import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable; //导入方法依赖的package包/类
@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");
}
}
示例2: customizeSettings
import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable; //导入方法依赖的package包/类
@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());
}
}
示例3: customizeSettings
import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable; //导入方法依赖的package包/类
@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()]));
}
示例4: customizeSettings
import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable; //导入方法依赖的package包/类
@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");
}
}
示例5: customizeSettings
import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable; //导入方法依赖的package包/类
@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");
}
}
示例6: customizeSettings
import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable; //导入方法依赖的package包/类
@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);
}
}
示例7: customizeSettings
import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable; //导入方法依赖的package包/类
@Override
public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer,
@NotNull SettingsType settingsType) {
if (settingsType == SettingsType.WRAPPING_AND_BRACES_SETTINGS) {
consumer.showStandardOptions("RIGHT_MARGIN", "WRAP_ON_TYPING");
}
}
示例8: customizeSettings
import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable; //导入方法依赖的package包/类
@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()]));
}
示例9: customizeSettings
import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable; //导入方法依赖的package包/类
@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");
}
}
示例10: customizeSettings
import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable; //导入方法依赖的package包/类
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);
}
}
示例11: customizeSettings
import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable; //导入方法依赖的package包/类
@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");
}
}
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:53,代码来源:AppleScriptLanguageCodeStyleSettingsProvider.java
示例12: customizeSettings
import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable; //导入方法依赖的package包/类
@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\"");
}
}
示例13: customizeSettings
import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable; //导入方法依赖的package包/类
@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"));
}
}
示例14: customizeSettings
import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable; //导入方法依赖的package包/类
@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");
}
}
示例15: customizeSettings
import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable; //导入方法依赖的package包/类
@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");
}
}