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

项目:consulo    文件:CodeStyleSchemesConfigurable.java   
@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()]);
}
项目:intellij-ce-playground    文件:JavaCodeStyleMainPanel.java   
@Override
protected void initTabs(CodeStyleSettings settings) {
  super.initTabs(settings);
  addTab(new JavaDocFormattingPanel(settings));
  addTab(new CodeStyleImportsPanelWrapper(settings));
  addTab(new JavaArrangementPanel(settings));
  for (CodeStyleSettingsProvider provider : Extensions.getExtensions(CodeStyleSettingsProvider.EXTENSION_POINT_NAME)) {
    if (provider.getLanguage() == JavaLanguage.INSTANCE && !provider.hasSettingsPage()) {
      createTab(provider);
    }
  }
}
项目:intellij-ce-playground    文件:XmlCodeStyleMainPanel.java   
@Override
protected void initTabs(CodeStyleSettings settings) {
  addIndentOptionsTab(settings);
  addTab(new CodeStyleXmlPanel(settings));
  addTab(new XmlArrangementPanel(settings));

  for (CodeStyleSettingsProvider provider : Extensions.getExtensions(CodeStyleSettingsProvider.EXTENSION_POINT_NAME)) {
    if (provider.getLanguage() == XMLLanguage.INSTANCE && !provider.hasSettingsPage()) {
      createTab(provider);
    }
  }
}
项目:tools-idea    文件:JavaCodeStyleMainPanel.java   
@Override
protected void initTabs(CodeStyleSettings settings) {
  super.initTabs(settings);
  addTab(new JavaDocFormattingPanel(settings));
  addTab(new CodeStyleImportsPanelWrapper(settings));
  addTab(new JavaArrangementPanel(settings));
  for (CodeStyleSettingsProvider provider : Extensions.getExtensions(CodeStyleSettingsProvider.EXTENSION_POINT_NAME)) {
    if (provider.getLanguage() == JavaLanguage.INSTANCE && !provider.hasSettingsPage()) {
      createTab(provider);
    }
  }
}
项目:tools-idea    文件:CodeStyleSchemesConfigurable.java   
@Override
protected Configurable[] buildConfigurables() {
  myPanels = new ArrayList<CodeStyleConfigurableWrapper>();

  final List<CodeStyleSettingsProvider> providers =
    Arrays.asList(Extensions.getExtensions(CodeStyleSettingsProvider.EXTENSION_POINT_NAME));
  Collections.sort(providers, new Comparator<CodeStyleSettingsProvider>() {
    @Override
    public int compare(CodeStyleSettingsProvider p1, CodeStyleSettingsProvider p2) {
      if (!p1.getPriority().equals(p2.getPriority())) {
        return p1.getPriority().compareTo(p2.getPriority());
      }
      String name1 = p1.getConfigurableDisplayName();
      if (name1 == null) name1 = "";
      String name2 = p2.getConfigurableDisplayName();
      if (name2 == null) name2 = "";
      return name1.compareToIgnoreCase(name2);
    }
  });

  for (final CodeStyleSettingsProvider provider : providers) {
    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()]);
}
项目:tools-idea    文件:XmlCodeStyleMainPanel.java   
@Override
protected void initTabs(CodeStyleSettings settings) {
  addIndentOptionsTab(settings);
  addTab(new CodeStyleXmlPanel(settings));
  addTab(new XmlArrangementPanel(settings));

  for (CodeStyleSettingsProvider provider : Extensions.getExtensions(CodeStyleSettingsProvider.EXTENSION_POINT_NAME)) {
    if (provider.getLanguage() == XMLLanguage.INSTANCE && !provider.hasSettingsPage()) {
      createTab(provider);
    }
  }
}
项目:consulo-csharp    文件:CSharpCodeStyleMainPanel.java   
@Override
protected void initTabs(CodeStyleSettings settings)
{
    super.initTabs(settings);
    for(CodeStyleSettingsProvider provider : Extensions.getExtensions(CodeStyleSettingsProvider.EXTENSION_POINT_NAME))
    {
        if(provider.getLanguage() == CSharpLanguage.INSTANCE && !provider.hasSettingsPage())
        {
            createTab(provider);
        }
    }
}
项目:consulo-xml    文件:XmlCodeStyleMainPanel.java   
@Override
protected void initTabs(CodeStyleSettings settings) {
  addIndentOptionsTab(settings);
  addTab(new CodeStyleXmlPanel(settings));
  addTab(new XmlArrangementPanel(settings));

  for (CodeStyleSettingsProvider provider : Extensions.getExtensions(CodeStyleSettingsProvider.EXTENSION_POINT_NAME)) {
    if (provider.getLanguage() == XMLLanguage.INSTANCE && !provider.hasSettingsPage()) {
      createTab(provider);
    }
  }
}
项目:consulo-java    文件:JavaCodeStyleMainPanel.java   
@Override
protected void initTabs(CodeStyleSettings settings) {
  super.initTabs(settings);
  addTab(new JavaDocFormattingPanel(settings));
  addTab(new CodeStyleImportsPanelWrapper(settings));
  addTab(new JavaArrangementPanel(settings));
  for (CodeStyleSettingsProvider provider : Extensions.getExtensions(CodeStyleSettingsProvider.EXTENSION_POINT_NAME)) {
    if (provider.getLanguage() == JavaLanguage.INSTANCE && !provider.hasSettingsPage()) {
      createTab(provider);
    }
  }
}
项目:intellij-ce-playground    文件:CodeStyleSchemesConfigurable.java   
@Override
protected Configurable[] buildConfigurables() {
  myPanels = new ArrayList<CodeStyleConfigurableWrapper>();

  final List<CodeStyleSettingsProvider> providers =
    Arrays.asList(Extensions.getExtensions(CodeStyleSettingsProvider.EXTENSION_POINT_NAME));
  Collections.sort(providers, new Comparator<CodeStyleSettingsProvider>() {
    @Override
    public int compare(CodeStyleSettingsProvider p1, CodeStyleSettingsProvider p2) {
      if (!p1.getPriority().equals(p2.getPriority())) {
        return p1.getPriority().compareTo(p2.getPriority());
      }
      String name1 = p1.getConfigurableDisplayName();
      if (name1 == null) name1 = "";
      String name2 = p2.getConfigurableDisplayName();
      if (name2 == null) name2 = "";
      return name1.compareToIgnoreCase(name2);
    }
  });

  for (final CodeStyleSettingsProvider provider : providers) {
    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)));
        }
      }));
    }
  }

  if (Registry.is("ide.new.settings.dialog")) {
    int size = myPanels.size();
    Configurable[] result = new Configurable[size > 0 ? size - 1 : 0];
    for (int i = 0; i < result.length; i++) {
      result[i] = myPanels.get(i + 1);
    }
    return result;
  }
  return myPanels.toArray(new Configurable[myPanels.size()]);
}
项目:intellij-ce-playground    文件:CodeStyleSchemesConfigurable.java   
public CodeStyleConfigurableWrapper(@NotNull CodeStyleSettingsProvider provider, @NotNull CodeStyleSettingsPanelFactory factory) {
  myProvider = provider;
  myFactory = factory;
  myInitialResetInvoked = false;
}
项目:tools-idea    文件:CodeStyleSchemesConfigurable.java   
public CodeStyleConfigurableWrapper(@NotNull CodeStyleSettingsProvider provider, @NotNull CodeStyleSettingsPanelFactory factory) {
  myProvider = provider;
  myFactory = factory;
  myInitialResetInvoked = false;
}
项目:consulo    文件:CodeStyleSchemesConfigurable.java   
public CodeStyleConfigurableWrapper(@Nonnull CodeStyleSettingsProvider provider, @Nonnull CodeStyleSettingsPanelFactory factory) {
  myProvider = provider;
  myFactory = factory;
  myInitialResetInvoked = false;
}