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


Java CodeInsightSettings.NO_REFORMAT属性代码示例

本文整理汇总了Java中com.intellij.codeInsight.CodeInsightSettings.NO_REFORMAT属性的典型用法代码示例。如果您正苦于以下问题:Java CodeInsightSettings.NO_REFORMAT属性的具体用法?Java CodeInsightSettings.NO_REFORMAT怎么用?Java CodeInsightSettings.NO_REFORMAT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.intellij.codeInsight.CodeInsightSettings的用法示例。


在下文中一共展示了CodeInsightSettings.NO_REFORMAT属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getReformatPastedBlockValue

private int getReformatPastedBlockValue(){
  Object selectedItem = myReformatOnPasteCombo.getSelectedItem();
  if (NO_REFORMAT.equals(selectedItem)){
    return CodeInsightSettings.NO_REFORMAT;
  }
  else if (INDENT_BLOCK.equals(selectedItem)){
    return CodeInsightSettings.INDENT_BLOCK;
  }
  else if (INDENT_EACH_LINE.equals(selectedItem)){
    return CodeInsightSettings.INDENT_EACH_LINE;
  }
  else if (REFORMAT_BLOCK.equals(selectedItem)){
    return CodeInsightSettings.REFORMAT_BLOCK;
  }
  else{
    LOG.assertTrue(false);
    return -1;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:EditorSmartKeysConfigurable.java

示例2: doTest

private void doTest(String prefix) {
  int oldReformat = CodeInsightSettings.getInstance().REFORMAT_ON_PASTE;
  try {
    CodeInsightSettings.getInstance().REFORMAT_ON_PASTE = CodeInsightSettings.NO_REFORMAT;
    String name = getTestName(false);

    myFixture.configureByFile("copyPaste/" + prefix + name + ".src.py");
    myFixture.performEditorAction(IdeActions.ACTION_EDITOR_COPY);
    myFixture.configureByFile("copyPaste/" + prefix + name + ".dst.py");
    myFixture.performEditorAction(IdeActions.ACTION_EDITOR_PASTE);
    myFixture.checkResultByFile("copyPaste/" + prefix + name + ".after.py", true);
  }
  finally {
    CodeInsightSettings.getInstance().REFORMAT_ON_PASTE = oldReformat;
  }

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

示例3: reset

@Override
public void reset() {
  EditorSettingsExternalizable editorSettings = EditorSettingsExternalizable.getInstance();
  CodeInsightSettings codeInsightSettings = CodeInsightSettings.getInstance();

  // Paste
  switch(codeInsightSettings.REFORMAT_ON_PASTE){
    case CodeInsightSettings.NO_REFORMAT:
      myReformatOnPasteCombo.setSelectedItem(NO_REFORMAT);
    break;

    case CodeInsightSettings.INDENT_BLOCK:
      myReformatOnPasteCombo.setSelectedItem(INDENT_BLOCK);
    break;

    case CodeInsightSettings.INDENT_EACH_LINE:
      myReformatOnPasteCombo.setSelectedItem(INDENT_EACH_LINE);
    break;

    case CodeInsightSettings.REFORMAT_BLOCK:
      myReformatOnPasteCombo.setSelectedItem(REFORMAT_BLOCK);
    break;
  }

  myCbSmartHome.setSelected(editorSettings.isSmartHome());
  myCbSmartEnd.setSelected(codeInsightSettings.SMART_END_ACTION);

  myCbSmartIndentOnEnter.setSelected(codeInsightSettings.SMART_INDENT_ON_ENTER);
  myCbInsertPairCurlyBraceOnEnter.setSelected(codeInsightSettings.INSERT_BRACE_ON_ENTER);
  myCbInsertJavadocStubOnEnter.setSelected(codeInsightSettings.JAVADOC_STUB_ON_ENTER);

  myCbInsertPairBracket.setSelected(codeInsightSettings.AUTOINSERT_PAIR_BRACKET);
  myCbInsertPairQuote.setSelected(codeInsightSettings.AUTOINSERT_PAIR_QUOTE);
  myCbCamelWords.setSelected(editorSettings.isCamelWords());

  myCbSurroundSelectionOnTyping.setSelected(codeInsightSettings.SURROUND_SELECTION_ON_QUOTE_TYPED);

  super.reset();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:39,代码来源:EditorSmartKeysConfigurable.java

示例4: reset

@Override
public void reset() {
  EditorSettingsExternalizable editorSettings = EditorSettingsExternalizable.getInstance();
  CodeInsightSettings codeInsightSettings = CodeInsightSettings.getInstance();

  // Paste
  switch(codeInsightSettings.REFORMAT_ON_PASTE){
    case CodeInsightSettings.NO_REFORMAT:
      myReformatOnPasteCombo.setSelectedItem(NO_REFORMAT);
    break;

    case CodeInsightSettings.INDENT_BLOCK:
      myReformatOnPasteCombo.setSelectedItem(INDENT_BLOCK);
    break;

    case CodeInsightSettings.INDENT_EACH_LINE:
      myReformatOnPasteCombo.setSelectedItem(INDENT_EACH_LINE);
    break;

    case CodeInsightSettings.REFORMAT_BLOCK:
      myReformatOnPasteCombo.setSelectedItem(REFORMAT_BLOCK);
    break;
  }

  myCbSmartHome.setSelected(editorSettings.isSmartHome());
  myCbSmartEnd.setSelected(codeInsightSettings.SMART_END_ACTION);

  myCbSmartIndentOnEnter.setSelected(codeInsightSettings.SMART_INDENT_ON_ENTER);
  myCbInsertPairCurlyBraceOnEnter.setSelected(codeInsightSettings.INSERT_BRACE_ON_ENTER);
  myCbInsertJavadocStubOnEnter.setSelected(codeInsightSettings.JAVADOC_STUB_ON_ENTER);

  myCbInsertPairBracket.setSelected(codeInsightSettings.AUTOINSERT_PAIR_BRACKET);
  myCbInsertPairQuote.setSelected(codeInsightSettings.AUTOINSERT_PAIR_QUOTE);
  myCbReformatBlockOnTypingRBrace.setSelected(codeInsightSettings.REFORMAT_BLOCK_ON_RBRACE);
  myCbCamelWords.setSelected(editorSettings.isCamelWords());

  myCbSurroundSelectionOnTyping.setSelected(codeInsightSettings.SURROUND_SELECTION_ON_QUOTE_TYPED);

  SmartBackspaceMode backspaceMode = codeInsightSettings.getBackspaceMode();
  switch (backspaceMode) {
    case OFF:
      mySmartBackspaceCombo.setSelectedItem(OFF);
      break;
    case INDENT:
      mySmartBackspaceCombo.setSelectedItem(SIMPLE);
      break;
    case AUTOINDENT:
      mySmartBackspaceCombo.setSelectedItem(SMART);
      break;
    default:
      LOG.error("Unexpected smart backspace mode value: " + backspaceMode);
  }

  super.reset();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:55,代码来源:EditorSmartKeysConfigurable.java

示例5: PyCharmInitialConfigurator

public PyCharmInitialConfigurator(MessageBus bus, final PropertiesComponent propertiesComponent, final FileTypeManager fileTypeManager) {
  if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration")) {
    propertiesComponent.setValue("PyCharm.InitialConfiguration", "true");
    EditorSettingsExternalizable.getInstance().setVirtualSpace(false);
  }
  if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration.V2")) {
    propertiesComponent.setValue("PyCharm.InitialConfiguration.V2", true);
    final CodeStyleSettings settings = CodeStyleSettingsManager.getInstance().getCurrentSettings();
    settings.ALIGN_MULTILINE_PARAMETERS_IN_CALLS = true;
    settings.getCommonSettings(PythonLanguage.getInstance()).ALIGN_MULTILINE_PARAMETERS_IN_CALLS = true;
    UISettings.getInstance().SHOW_DIRECTORY_FOR_NON_UNIQUE_FILENAMES = true;
  }
  if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration.V3")) {
    propertiesComponent.setValue("PyCharm.InitialConfiguration.V3", "true");
    UISettings.getInstance().SHOW_MEMORY_INDICATOR = false;
    final String ignoredFilesList = fileTypeManager.getIgnoredFilesList();
    ApplicationManager.getApplication().invokeLater(new Runnable() {
      @Override
      public void run() {
        ApplicationManager.getApplication().runWriteAction(new Runnable() {
          @Override
          public void run() {
            FileTypeManager.getInstance().setIgnoredFilesList(ignoredFilesList + ";*$py.class");
          }
        });
      }
    });
  }
  if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration.V4")) {
    propertiesComponent.setValue("PyCharm.InitialConfiguration.V4", true);
    PyCodeInsightSettings.getInstance().SHOW_IMPORT_POPUP = false;
  }
  if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration.V5")) {
    propertiesComponent.setValue("PyCharm.InitialConfiguration.V5", true);
    CodeInsightSettings.getInstance().REFORMAT_ON_PASTE = CodeInsightSettings.NO_REFORMAT;
  }
  if (!propertiesComponent.isValueSet(DISPLAYED_PROPERTY)) {
    bus.connect().subscribe(AppLifecycleListener.TOPIC, new AppLifecycleListener.Adapter() {
      @Override
      public void welcomeScreenDisplayed() {
        ApplicationManager.getApplication().invokeLater(new Runnable() {
          public void run() {
            propertiesComponent.setValue(DISPLAYED_PROPERTY, "true");
            showInitialConfigurationDialog();
          }
        });
      }
    });
  }

  Registry.get("ide.scratch.enabled").setValue(true);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:52,代码来源:PyCharmInitialConfigurator.java


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