Java 类com.intellij.psi.codeStyle.FileTypeIndentOptionsProvider 实例源码

项目:tools-idea    文件:GeneralCodeStylePanel.java   
public GeneralCodeStylePanel(CodeStyleSettings settings) {
  super(settings);

  final List<FileTypeIndentOptionsProvider> indentOptionsProviders =
    Arrays.asList(Extensions.getExtensions(FileTypeIndentOptionsProvider.EP_NAME));
  Collections.sort(indentOptionsProviders, new Comparator<FileTypeIndentOptionsProvider>() {
    @Override
    public int compare(FileTypeIndentOptionsProvider p1, FileTypeIndentOptionsProvider p2) {
      Language lang1 = getLanguage(p1.getFileType());
      if (lang1 == null) return -1;
      Language lang2 = getLanguage(p2.getFileType());
      if (lang2 == null) return 1;
      DisplayPriority priority1 = LanguageCodeStyleSettingsProvider.getDisplayPriority(lang1);
      DisplayPriority priority2 = LanguageCodeStyleSettingsProvider.getDisplayPriority(lang2);
      if (priority1.equals(priority2)) {
        return lang1.getDisplayName().compareTo(lang2.getDisplayName());
      }
      return priority1.compareTo(priority2);
    }
  });

  myLineSeparatorCombo.addItem(SYSTEM_DEPENDANT_STRING);
  myLineSeparatorCombo.addItem(UNIX_STRING);
  myLineSeparatorCombo.addItem(WINDOWS_STRING);
  myLineSeparatorCombo.addItem(MACINTOSH_STRING);
  addPanelToWatch(myPanel);

  myRightMarginSpinner.setModel(new SpinnerNumberModel(settings.RIGHT_MARGIN, 1, 1000000, 1));

  myIndentOptionsEditor = new SmartIndentOptionsEditor();
  myDefaultIndentOptionsPanel.add(myIndentOptionsEditor.createPanel(), BorderLayout.CENTER);
}
项目:tools-idea    文件:OtherTabsAndIndentsProvider.java   
@Override
public boolean hasSettingsPage() {
  final FileTypeIndentOptionsProvider[] indentOptionsProviders = Extensions.getExtensions(FileTypeIndentOptionsProvider.EP_NAME);
  return indentOptionsProviders.length > 0;
}