当前位置: 首页>>代码示例>>Java>>正文


Java CodeStyleSettingsCustomizable类代码示例

本文整理汇总了Java中com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable的典型用法代码示例。如果您正苦于以下问题:Java CodeStyleSettingsCustomizable类的具体用法?Java CodeStyleSettingsCustomizable怎么用?Java CodeStyleSettingsCustomizable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CodeStyleSettingsCustomizable类属于com.intellij.psi.codeStyle包,在下文中一共展示了CodeStyleSettingsCustomizable类的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");
    }
}
 
开发者ID:bzixilu,项目名称:dotplugin,代码行数:22,代码来源:DotLanguageCodeStyleSettingsProvider.java

示例2: RightMarginForm

import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable; //导入依赖的package包/类
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
  ));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:RightMarginForm.java

示例3: reset

import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable; //导入依赖的package包/类
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;
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:RightMarginForm.java

示例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.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());
	}
}
 
开发者ID:xylo,项目名称:intellij-postfix-templates,代码行数:14,代码来源:CptLanguageCodeStyleSettingsProvider.java

示例5: customizeSettings

import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable; //导入依赖的package包/类
@Override
public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) {
    if (settingsType == SettingsType.INDENT_SETTINGS) {
        //consumer.showStandardOptions("SPACE_AROUND_ASSIGNMENT_OPERATORS");
        consumer.showAllStandardOptions();
    }
}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:8,代码来源:RamlLanguageCodeStyleSettingsProvider.java

示例6: 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()]));
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:32,代码来源:LuaLanguageCodeStyleSettingsProvider.java

示例7: 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");
    }
}
 
开发者ID:cvette,项目名称:intellij-neos,代码行数:13,代码来源:FusionLanguageCodeStyleSettingsProvider.java

示例8: 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");

    }
}
 
开发者ID:scireum-incubator,项目名称:rythm_plugin,代码行数:11,代码来源:RythmLanguageCodeStyleSettingsProvider.java

示例9: customizeSettings

import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable; //导入依赖的package包/类
@Override
public void customizeSettings(@NotNull CodeStyleSettingsCustomizable consumer, @NotNull SettingsType settingsType) {
    switch (settingsType) {
        default:
            break;
    }
}
 
开发者ID:protostuff,项目名称:protobuf-jetbrains-plugin,代码行数:8,代码来源:ProtoLanguageCodeStyleSettingsProvider.java

示例10: getSelectedWrapOnTypingValue

import com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable; //导入依赖的package包/类
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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:RightMarginForm.java

示例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_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);

  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:JsonLanguageCodeStyleSettingsProvider.java

示例12: 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");
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:XmlLanguageCodeStyleSettingsProvider.java

示例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_AROUND_ASSIGNMENT_OPERATORS");
        //consumer.renameStandardOption("SPACE_AROUND_ASSIGNMENT_OPERATORS", "Separator");
    } else if (settingsType == SettingsType.BLANK_LINES_SETTINGS) {
        //consumer.showStandardOptions("KEEP_BLANK_LINES_IN_CODE");
    }
}
 
开发者ID:vsch,项目名称:idea-multimarkdown,代码行数:10,代码来源:MultiMarkdownLanguageCodeStyleSettingsProvider.java

示例14: 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()]));
}
 
开发者ID:consulo,项目名称:consulo-lua,代码行数:32,代码来源:LuaLanguageCodeStyleSettingsProvider.java

示例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_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");
	}
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:33,代码来源:JavaScriptLanguageCodeStyleSettingsProvider.java


注:本文中的com.intellij.psi.codeStyle.CodeStyleSettingsCustomizable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。