• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java CodeStyleScheme类的典型用法和代码示例

java 1次浏览

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

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

示例1: onSaveAs

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
private void onSaveAs() {
  if (mySchemesTableModel.isProjectScheme(getSelectedScheme())) {
    int rowToSelect = mySchemesTableModel.exportProjectScheme();
    if (rowToSelect > 0) {
      mySchemesTable.getSelectionModel().setSelectionInterval(rowToSelect, rowToSelect);
    }
  }
  else {
    CodeStyleScheme[] schemes = CodeStyleSchemes.getInstance().getSchemes();
    ArrayList<String> names = new ArrayList<String>();
    for (CodeStyleScheme scheme : schemes) {
      names.add(scheme.getName());
    }
    String selectedName = getSelectedScheme().getName();
    SaveSchemeDialog saveDialog =
      new SaveSchemeDialog(myParent, ApplicationBundle.message("title.save.code.style.scheme.as"), names, selectedName);
    if (saveDialog.showAndGet()) {
      int row = mySchemesTableModel.createNewScheme(getSelectedScheme(), saveDialog.getSchemeName());
      mySchemesTable.getSelectionModel().setSelectionInterval(row, row);
    }
  }
}
 

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

示例2: MySchemesTable

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
private MySchemesTable() {
  myFixedItemsRenderer = new DefaultTableCellRenderer() {
    @NotNull
    @Override
    public Component getTableCellRendererComponent(@NotNull JTable table,
                                                   Object value,
                                                   boolean isSelected,
                                                   boolean hasFocus,
                                                   int row,
                                                   int column) {
      Component defaultComponent = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
      if (value instanceof CodeStyleScheme) {
        CodeStyleScheme scheme = (CodeStyleScheme)value;
        if (scheme.isDefault() || myModel.isProjectScheme(scheme)) {
          defaultComponent.setFont(defaultComponent.getFont().deriveFont(Font.BOLD));
        }
      }
      return defaultComponent;
    }
  };
}
 

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

示例3: exportProjectScheme

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
public int exportProjectScheme() {
  String name = Messages.showInputDialog("Enter new scheme name:", "Copy Project Scheme to Global List", Messages.getQuestionIcon());
  if (name != null && !CodeStyleSchemesModel.PROJECT_SCHEME_NAME.equals(name)) {
    CodeStyleScheme newScheme = mySchemesModel.exportProjectScheme(name);
    updateSchemes();
    int switchToGlobal = Messages
      .showYesNoDialog("Project scheme was copied to global scheme list as '" + newScheme.getName() + "'.\n" +
                       "Switch to this created scheme?",
                       "Copy Project Scheme to Global List", Messages.getQuestionIcon());
    if (switchToGlobal == Messages.YES) {
      mySchemesModel.setUsePerProjectSettings(false);
      mySchemesModel.selectScheme(newScheme, null);
    }
    int row = 0;
    for (CodeStyleScheme scheme : mySchemes) {
      if (scheme == newScheme) {
        fireTableRowsInserted(row, row);
        return switchToGlobal == 0 ? row : -1;
      }
      row++;
    }
  }
  return -1;
}
 

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

示例4: resetSchemesCombo

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
public void resetSchemesCombo() {
  myIsReset = true;
  try {
    List<CodeStyleScheme> schemes = new ArrayList<CodeStyleScheme>();
    schemes.addAll(myModel.getAllSortedSchemes());
    DefaultComboBoxModel model = new DefaultComboBoxModel(schemes.toArray());
    myCombo.setModel(model);
    if (myModel.isUsePerProjectSettings()) {
      myCombo.setSelectedItem(myModel.getProjectScheme());
    }
    else {
      myCombo.setSelectedItem(myModel.getSelectedGlobalScheme());
    }
  }
  finally {
    myIsReset = false;
  }


}
 

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

示例5: ensurePanel

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
private NewCodeStyleSettingsPanel ensurePanel(final CodeStyleScheme scheme) {
  String name = scheme.getName();
  if (!mySettingsPanels.containsKey(name)) {
    NewCodeStyleSettingsPanel panel = myFactory.createPanel(scheme);
    panel.reset();
    panel.setModel(myModel);
    CodeStyleAbstractPanel settingsPanel = panel.getSelectedPanel();
    if (settingsPanel instanceof TabbedLanguageCodeStylePanel) {
      TabbedLanguageCodeStylePanel tabbedPanel = (TabbedLanguageCodeStylePanel)settingsPanel;
      tabbedPanel.setListener(this);
      String currentTab = myProperties.getValue(getSelectedTabPropertyName(tabbedPanel));
      if (currentTab != null) {
        tabbedPanel.changeTab(currentTab);
      }
    }
    mySettingsPanels.put(name, panel);
    mySettingsPanel.add(scheme.getName(), panel);
  }

  return mySettingsPanels.get(name);
}
 

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

示例6: reset

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
public void reset() {
  myUsePerProjectSettings = getProjectSettings().USE_PER_PROJECT_SETTINGS;

  CodeStyleScheme[] allSchemes = CodeStyleSchemes.getInstance().getSchemes();
  mySettingsToClone.clear();
  mySchemes.clear();
  ContainerUtil.addAll(mySchemes, allSchemes);
  myGlobalSelected = CodeStyleSchemes.getInstance().findPreferredScheme(getProjectSettings().PREFERRED_PROJECT_CODE_STYLE);

  CodeStyleSettings perProjectSettings = getProjectSettings().PER_PROJECT_SETTINGS;
  if (perProjectSettings != null) {
    myProjectScheme.setCodeStyleSettings(perProjectSettings);
  }


  myDispatcher.getMulticaster().schemeListChanged();
  myDispatcher.getMulticaster().currentSchemeChanged(this);

}
 

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

示例7: getAllSortedSchemes

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
public List<CodeStyleScheme> getAllSortedSchemes() {
  List<CodeStyleScheme> schemes = new ArrayList<CodeStyleScheme>();
  schemes.addAll(getSchemes());
  schemes.add(myProjectScheme);
  Collections.sort(schemes, new Comparator<CodeStyleScheme>() {
    @Override
    public int compare(CodeStyleScheme s1, CodeStyleScheme s2) {
      if (isProjectScheme(s1)) return -1;
      if (isProjectScheme(s2)) return 1;
      if (s1.isDefault()) return -1;
      if (s2.isDefault()) return 1;
      return s1.getName().compareToIgnoreCase(s2.getName());
    }
  });
  return schemes;
}
 

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

示例8: init

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
private void init(@Nullable CodeStyleScheme parentScheme, Element root) {
  if (parentScheme == null) {
    myCodeStyleSettings = new CodeStyleSettings();
  }
  else {
    CodeStyleSettings parentSettings = parentScheme.getCodeStyleSettings();
    myCodeStyleSettings = parentSettings.clone();
    while (parentSettings.getParentSettings() != null) {
      parentSettings = parentSettings.getParentSettings();
    }
    myCodeStyleSettings.setParentSettings(parentSettings);
  }
  if (root != null) {
    try {
      readExternal(root);
    }
    catch (InvalidDataException e) {
      LOG.error(e);
    }
  }
}
 

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

示例9: getState

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
@Nullable
@Override
public Element getState() {
  CodeStyleScheme currentScheme = getCurrentScheme();
  CURRENT_SCHEME_NAME = currentScheme == null ? null : currentScheme.getName();
  return XmlSerializer.serialize(this, new SerializationFilter() {
    @Override
    public boolean accepts(@NotNull Accessor accessor, @NotNull Object bean) {
      if ("CURRENT_SCHEME_NAME".equals(accessor.getName())) {
        return !DEFAULT_SCHEME_NAME.equals(accessor.read(bean));
      }
      else {
        return accessor.getValueClass().equals(String.class);
      }
    }
  });
}
 

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

示例10: fillActions

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
@Override
protected void fillActions(Project project, @NotNull DefaultActionGroup group, @NotNull DataContext dataContext) {
  final CodeStyleSettingsManager manager = CodeStyleSettingsManager.getInstance(project);
  if (manager.PER_PROJECT_SETTINGS != null) {
    //noinspection HardCodedStringLiteral
    group.add(new AnAction("<project>", "",
                           manager.USE_PER_PROJECT_SETTINGS ? ourCurrentAction : ourNotCurrentAction) {
      @Override
      public void actionPerformed(@NotNull AnActionEvent e) {
        manager.USE_PER_PROJECT_SETTINGS = true;
      }
    });
  }

  CodeStyleScheme currentScheme = CodeStyleSchemes.getInstance().getCurrentScheme();
  for (CodeStyleScheme scheme : CodeStyleSchemes.getInstance().getSchemes()) {
    addScheme(group, manager, currentScheme, scheme, false);
  }
}
 

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

示例11: importScheme

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
public void importScheme(@NotNull InputStream inputStream, final @Nullable String sourceScheme, final CodeStyleScheme scheme)
  throws SchemeImportException {
  final CodeStyleSettings settings = scheme.getCodeStyleSettings();
  EclipseXmlProfileReader reader = new EclipseXmlProfileReader(new EclipseXmlProfileReader.OptionHandler() {
    private String myCurrScheme;

    @Override
    public void handleOption(@NotNull String eclipseKey, @NotNull String value) throws SchemeImportException {
      if (sourceScheme == null || myCurrScheme != null && myCurrScheme.equals(sourceScheme)) {
        setCodeStyleOption(settings, eclipseKey, value);
      }
    }
    @Override
    public void handleName(String name) {
      myCurrScheme = name;
    }
  });
  reader.readSettings(inputStream);
}
 

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

示例12: importScheme

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
@Nullable
@Override
public CodeStyleScheme importScheme(@NotNull Project project,
                                    @NotNull VirtualFile selectedFile,
                                    CodeStyleScheme currentScheme,
                                    SchemeFactory<CodeStyleScheme> schemeFactory) throws SchemeImportException {
  final String[] schemeNames = readSchemeNames(selectedFile);
  final ImportSchemeChooserDialog schemeChooserDialog =
    new ImportSchemeChooserDialog(project, schemeNames, !currentScheme.isDefault() ? currentScheme.getName() : null);
  if (! schemeChooserDialog.showAndGet()) return null;
  final CodeStyleScheme scheme = schemeChooserDialog.isUseCurrentScheme() && (! currentScheme.isDefault()) ? currentScheme :
    schemeFactory.createNewScheme(schemeChooserDialog.getTargetName());
  if (scheme == null) return null;
  readFromStream(selectedFile, new ThrowableConsumer<InputStream, SchemeImportException>() {
    @Override
    public void consume(InputStream stream) throws SchemeImportException {
      new EclipseCodeStyleImportWorker().importScheme(stream, schemeChooserDialog.getSelectedName(), scheme);
    }
  });

  return scheme;
}
 

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

示例13: MySchemesTable

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
private MySchemesTable() {
  myFixedItemsRenderer = new DefaultTableCellRenderer() {
    @Override
    public Component getTableCellRendererComponent(JTable table,
                                                   Object value,
                                                   boolean isSelected,
                                                   boolean hasFocus,
                                                   int row,
                                                   int column) {
      Component defaultComponent = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
      if (value instanceof CodeStyleScheme) {
        CodeStyleScheme scheme = (CodeStyleScheme)value;
        if (scheme.isDefault() || myModel.isProjectScheme(scheme)) {
          defaultComponent.setFont(defaultComponent.getFont().deriveFont(Font.BOLD));
        }
      }
      return defaultComponent;
    }
  };
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:21,
代码来源:ManageCodeStyleSchemesDialog.java

示例14: exportProjectScheme

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
public int exportProjectScheme() {
  String name = Messages.showInputDialog("Enter new scheme name:", "Copy Project Scheme to Global List", Messages.getQuestionIcon());
  if (name != null && !CodeStyleSchemesModel.PROJECT_SCHEME_NAME.equals(name)) {
    CodeStyleScheme newScheme = mySchemesModel.exportProjectScheme(name);
    updateSchemes();
    int switchToGlobal = Messages
      .showYesNoDialog("Project scheme was copied to global scheme list as '" + newScheme.getName() + "'.\n" +
                       "Switch to this created scheme?",
                       "Copy Project Scheme to Global List", Messages.getQuestionIcon());
    if (switchToGlobal == 0) {
      mySchemesModel.setUsePerProjectSettings(false);
      mySchemesModel.selectScheme(newScheme, null);
    }
    int row = 0;
    for (CodeStyleScheme scheme : mySchemes) {
      if (scheme == newScheme) {
        fireTableRowsInserted(row, row);
        return switchToGlobal == 0 ? row : -1;
      }
      row++;
    }
  }
  return -1;
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:25,
代码来源:ManageCodeStyleSchemesDialog.java

示例15: onSaveAs

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
private void onSaveAs() {
  if (mySchemesTableModel.isProjectScheme(getSelectedScheme())) {
    int rowToSelect = mySchemesTableModel.exportProjectScheme();
    if (rowToSelect > 0) {
      mySchemesTable.getSelectionModel().setSelectionInterval(rowToSelect, rowToSelect);
    }
  }
  else {
    CodeStyleScheme[] schemes = CodeStyleSchemes.getInstance().getSchemes();
    ArrayList<String> names = new ArrayList<String>();
    for (CodeStyleScheme scheme : schemes) {
      names.add(scheme.getName());
    }
    SaveSchemeDialog saveDialog = new SaveSchemeDialog(myParent, ApplicationBundle.message("title.save.code.style.scheme.as"), names);
    saveDialog.show();
    if (saveDialog.isOK()) {
      int row = mySchemesTableModel.createNewScheme(getSelectedScheme(), saveDialog.getSchemeName());
      mySchemesTable.getSelectionModel().setSelectionInterval(row, row);
    }
  }
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:22,
代码来源:ManageCodeStyleSchemesDialog.java

示例16: init

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
private void init(CodeStyleScheme parentScheme, Element root) {
  CodeStyleSettings parentSettings = parentScheme == null ? null : parentScheme.getCodeStyleSettings();
  if (parentSettings == null){
    myCodeStyleSettings = new CodeStyleSettings();
  }
  else{
    myCodeStyleSettings = parentSettings.clone();
    while(parentSettings.getParentSettings() != null){
      parentSettings = parentSettings.getParentSettings();
    }
    myCodeStyleSettings.setParentSettings(parentSettings);
  }
  if (root != null) {
    try {
      readExternal(root);
    } catch (InvalidDataException e) {
      LOG.error(e);
    }
  }
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:21,
代码来源:CodeStyleSchemeImpl.java

示例17: actionPerformed

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent event) {
    final DataContext dataContext = event.getDataContext();
    final Module module = LangDataKeys.MODULE.getData(dataContext);
    if (module != null) {
        ModuleCodeStyleComponent component = module.getComponent(ModuleCodeStyleComponent.class);
        if (component != null && component.getState() != null) {
            final String moduleCodeStyleScheme = component.getState().getCodeStyleSchemeName();
            final CodeStyleSchemes schemes = PersistableCodeStyleSchemes.getInstance();
            final CodeStyleScheme scheme = schemes.findSchemeByName(moduleCodeStyleScheme);
            if (scheme != null)
                schemes.setCurrentScheme(scheme);
        }
    }
    super.actionPerformed(event);
}
 

开发者ID:idanmo,
项目名称:module-code-style,
代码行数:17,
代码来源:ModuleCodeStyleReformatCodeAction.java

示例18: loadAvailableCodeStyleSchemes

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
private void loadAvailableCodeStyleSchemes() {
    final CodeStyleSchemes schemes = PersistableCodeStyleSchemes.getInstance();
    if (schemes != null) {
        final List<String> schemesList = new ArrayList<String>(schemes.getSchemes().length);

        String selectedCodeStyleSchemeName = getModuleCodeStyleSchemeName();
        boolean schemeExists = false;
        for (CodeStyleScheme scheme : schemes.getSchemes()) {
            schemesList.add(scheme.getName());
            if (scheme.getName().equals(selectedCodeStyleSchemeName))
                schemeExists = true;
        }

        if (!schemeExists)
            selectedCodeStyleSchemeName = ModuleCodeStyleState.defaultState().getCodeStyleSchemeName();

        final ComboBoxModel model = new CollectionComboBoxModel(schemesList, selectedCodeStyleSchemeName);
        codeStyleSchemesComboBox.setModel(model);
    } else {
        mainPanel.setEnabled(false);
    }
}
 

开发者ID:idanmo,
项目名称:module-code-style,
代码行数:23,
代码来源:ModuleCodeStyleConfigurable.java

示例19: buildConfigurables

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
@Override
protected Configurable[] buildConfigurables() {
  myPanels = new ArrayList<CodeStyleConfigurableWrapper>();

  for (final CodeStyleSettingsProvider provider : CodeStyleSettingsProvider.EXTENSION_POINT_NAME.getExtensions()) {
    if (provider.hasSettingsPage()) {
      myPanels.add(new CodeStyleConfigurableWrapper(provider, new CodeStyleSettingsPanelFactory() {
        @Override
        public NewCodeStyleSettingsPanel createPanel(final CodeStyleScheme scheme) {
          return new NewCodeStyleSettingsPanel(provider.createSettingsPage(scheme.getCodeStyleSettings(), ensureModel().getCloneSettings(scheme)));
        }
      }));
    }
  }

  return myPanels.toArray(new Configurable[myPanels.size()]);
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:18,
代码来源:CodeStyleSchemesConfigurable.java

示例20: MySchemesTable

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
private MySchemesTable() {
  myFixedItemsRenderer = new DefaultTableCellRenderer() {
    @Nonnull
    @Override
    public Component getTableCellRendererComponent(@Nonnull JTable table,
                                                   Object value,
                                                   boolean isSelected,
                                                   boolean hasFocus,
                                                   int row,
                                                   int column) {
      Component defaultComponent = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
      if (value instanceof CodeStyleScheme) {
        CodeStyleScheme scheme = (CodeStyleScheme)value;
        if (scheme.isDefault() || myModel.isProjectScheme(scheme)) {
          defaultComponent.setFont(defaultComponent.getFont().deriveFont(Font.BOLD));
        }
      }
      return defaultComponent;
    }
  };
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:22,
代码来源:ManageCodeStyleSchemesDialog.java

示例21: resetSchemesCombo

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
public void resetSchemesCombo() {
  myIsReset = true;
  try {
    List<CodeStyleScheme> schemes = new ArrayList<CodeStyleScheme>();
    schemes.addAll(myModel.getAllSortedSchemes());
    DefaultComboBoxModel model = new DefaultComboBoxModel(schemes.toArray());
    myCombo.setModel(model);
    if (myModel.isUsePerProjectSettings()) {
      myCombo.setSelectedItem(myModel.getProjectScheme());
    }
    else {
      myCombo.setSelectedItem(myModel.getSelectedGlobalScheme());
    }
  }
  finally {
    myIsReset = false;
  }
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:19,
代码来源:CodeStyleSchemesPanel.java

示例22: fillActions

点赞 3

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
@Override
protected void fillActions(Project project, @Nonnull DefaultActionGroup group, @Nonnull DataContext dataContext) {
  final CodeStyleSettingsManager manager = CodeStyleSettingsManager.getInstance(project);
  if (manager.PER_PROJECT_SETTINGS != null) {
    //noinspection HardCodedStringLiteral
    group.add(new AnAction("<project>", "",
                           manager.USE_PER_PROJECT_SETTINGS ? ourCurrentAction : ourNotCurrentAction) {
      @Override
      public void actionPerformed(@Nonnull AnActionEvent e) {
        manager.USE_PER_PROJECT_SETTINGS = true;
      }
    });
  }

  CodeStyleScheme currentScheme = CodeStyleSchemes.getInstance().getCurrentScheme();
  for (CodeStyleScheme scheme : CodeStyleSchemes.getInstance().getSchemes()) {
    addScheme(group, manager, currentScheme, scheme, false);
  }
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:20,
代码来源:QuickChangeCodeStyleSchemeAction.java

示例23: disableWrapOnType

点赞 2

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
private void disableWrapOnType(final Language impexLanguage) {
    final CodeStyleScheme currentScheme = CodeStyleSchemes.getInstance().getCurrentScheme();
    final CodeStyleSettings codeStyleSettings = currentScheme.getCodeStyleSettings();
    if (impexLanguage != null) {
        CommonCodeStyleSettings langSettings = codeStyleSettings.getCommonSettings(impexLanguage);
        if (langSettings != null) {
            langSettings.WRAP_ON_TYPING = CommonCodeStyleSettings.WrapOnTyping.NO_WRAP.intValue;
        }
    }
}
 

开发者ID:AlexanderBartash,
项目名称:hybris-integration-intellij-idea-plugin,
代码行数:11,
代码来源:ImportProjectProgressModalWindow.java

示例24: apply

点赞 2

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
@Override
public void apply() throws ConfigurationException {
  if (!myApplyCompleted) {
    try {
      super.apply();

      for (CodeStyleScheme scheme : new ArrayList<CodeStyleScheme>(myModel.getSchemes())) {
        final boolean isDefaultModified = CodeStyleSchemesModel.cannotBeModified(scheme) && isSchemeModified(scheme);
        if (isDefaultModified) {
          CodeStyleScheme newscheme = myModel.createNewScheme(null, scheme);
          CodeStyleSettings settingsWillBeModified = scheme.getCodeStyleSettings();
          CodeStyleSettings notModifiedSettings = settingsWillBeModified.clone();
          ((CodeStyleSchemeImpl)scheme).setCodeStyleSettings(notModifiedSettings);
          ((CodeStyleSchemeImpl)newscheme).setCodeStyleSettings(settingsWillBeModified);
          myModel.addScheme(newscheme, false);

          if (myModel.getSelectedScheme() == scheme) {
            myModel.selectScheme(newscheme, this);
          }

        }
      }

      for (CodeStyleConfigurableWrapper panel : myPanels) {
        panel.applyPanel();
      }

      myModel.apply();
      EditorFactory.getInstance().refreshAllEditors();
    }
    finally {
      myApplyCompleted = true;
    }

  }

}
 

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

示例25: isSchemeModified

点赞 2

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
private boolean isSchemeModified(final CodeStyleScheme scheme) {
  for (CodeStyleConfigurableWrapper panel : myPanels) {
    if (panel.isPanelModified(scheme)) {
      return true;
    }
  }
  return false;
}
 

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

示例26: ensureModel

点赞 2

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
private CodeStyleSchemesModel ensureModel() {
  if (myModel == null) {
    myModel = new CodeStyleSchemesModel(myProject);
    myRootSchemesPanel = new CodeStyleSchemesPanel(myModel);

    myModel.addListener(new CodeStyleSettingsListener(){
      @Override
      public void currentSchemeChanged(final Object source) {
        if (source != myRootSchemesPanel) {
          myRootSchemesPanel.onSelectedSchemeChanged();
        }
      }

      @Override
      public void schemeListChanged() {
        myRootSchemesPanel.resetSchemesCombo();
      }

      @Override
      public void currentSettingsChanged() {

      }

      @Override
      public void usePerProjectSettingsOptionChanged() {
        myRootSchemesPanel.usePerProjectSettingsOptionChanged();
      }

      @Override
      public void schemeChanged(final CodeStyleScheme scheme) {
        //do nothing
      }
    });
  }
  return myModel;
}
 

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

示例27: enumExporters

点赞 2

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
private static String[] enumExporters() {
  List<String> names = new ArrayList<String>();
  Collection<SchemeExporterEP<CodeStyleScheme>> extensions = SchemeExporterEP.getExtensions(CodeStyleScheme.class);
  for (SchemeExporterEP<CodeStyleScheme> extension : extensions) {
    names.add(extension.name);
  }
  return ArrayUtil.toStringArray(names);
}
 

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

示例28: importExternalCodeStyle

点赞 2

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
@Nullable
private CodeStyleScheme importExternalCodeStyle(final SchemeImporter<CodeStyleScheme> importer) throws SchemeImportException {
  final VirtualFile selectedFile = selectImportSource(importer.getSourceExtensions());
  if (selectedFile != null) {
    CodeStyleSchemesUIConfiguration.Util.setRecentImportFile(selectedFile);
    final SchemeCreator schemeCreator = new SchemeCreator();
    final CodeStyleScheme
      schemeImported = importer.importScheme(myModel.getProject(), selectedFile, myModel.getSelectedScheme(), schemeCreator);
    if (schemeImported != null) {
      myModel.fireSchemeChanged(schemeImported);
      return schemeImported;
    }
  }
  return null;
}
 

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

示例29: createNewScheme

点赞 2

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
@Override
public CodeStyleScheme createNewScheme(@Nullable String targetName) {
  if (targetName == null) targetName = ApplicationBundle.message("code.style.scheme.import.unnamed");
  final int row = mySchemesTableModel.createNewScheme(getSelectedScheme(), targetName);
  mySchemesTable.getSelectionModel().setSelectionInterval(row, row);
  return mySchemesTableModel.getSchemeAt(row);
}
 

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

示例30: getDefaultRow

点赞 2

import com.intellij.psi.codeStyle.CodeStyleScheme; //导入依赖的package包/类
public int getDefaultRow() {
  int row = 0;
  for (CodeStyleScheme scheme : mySchemes) {
    if (scheme.isDefault()) return row;
    row ++;
  }
  return 0;
}
 

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


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)