Java 类com.intellij.psi.impl.source.codeStyle.CodeStyleSchemeImpl 实例源码

项目:intellij-ce-playground    文件:CodeStyleSchemesConfigurable.java   
@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;
    }

  }

}
项目:intellij-ce-playground    文件:CodeStyleSchemesModel.java   
public CodeStyleScheme exportProjectScheme(@NotNull String name) {
  CodeStyleScheme newScheme = createNewScheme(name, myProjectScheme);
  ((CodeStyleSchemeImpl)newScheme).setCodeStyleSettings(getCloneSettings(myProjectScheme));
  addScheme(newScheme, false);

  return newScheme;
}
项目:tools-idea    文件:CodeStyleSchemesConfigurable.java   
@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;
    }

  }

}
项目:tools-idea    文件:CodeStyleSchemesModel.java   
public CodeStyleScheme exportProjectScheme(final String name) {
  CodeStyleScheme newScheme = createNewScheme(name, myProjectScheme);
  ((CodeStyleSchemeImpl)newScheme).setCodeStyleSettings(getCloneSettings(myProjectScheme));
  addScheme(newScheme, false);

  return newScheme;
}
项目:consulo    文件:CodeStyleSchemesConfigurable.java   
@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;
    }

  }

}
项目:consulo    文件:CodeStyleSchemesModel.java   
public CodeStyleScheme exportProjectScheme(@Nonnull String name) {
  CodeStyleScheme newScheme = createNewScheme(name, myProjectScheme);
  ((CodeStyleSchemeImpl)newScheme).setCodeStyleSettings(getCloneSettings(myProjectScheme));
  addScheme(newScheme, false);

  return newScheme;
}
项目:intellij-ce-playground    文件:CodeStyleSchemesModel.java   
public CodeStyleSchemesModel(Project project) {
  myProject = project;
  myProjectScheme = new CodeStyleSchemeImpl(PROJECT_SCHEME_NAME, false, CodeStyleSchemes.getInstance().getDefaultScheme());
  reset();
  myDefault = CodeStyleSchemes.getInstance().getDefaultScheme();
}
项目:tools-idea    文件:CodeStyleSchemesModel.java   
public CodeStyleSchemesModel(Project project) {
  myProject = project;
  myProjectScheme = new CodeStyleSchemeImpl(PROJECT_SCHEME_NAME, false, CodeStyleSchemes.getInstance().getDefaultScheme());
  reset();
  myDefault = CodeStyleSchemes.getInstance().getDefaultScheme();
}
项目:tools-idea    文件:CodeStyleSchemesModel.java   
static SchemesManager<CodeStyleScheme, CodeStyleSchemeImpl> getSchemesManager() {
  return ((CodeStyleSchemesImpl) CodeStyleSchemes.getInstance()).getSchemesManager();
}
项目:consulo    文件:CodeStyleSchemesModel.java   
public CodeStyleSchemesModel(Project project) {
  myProject = project;
  myProjectScheme = new CodeStyleSchemeImpl(PROJECT_SCHEME_NAME, false, CodeStyleSchemes.getInstance().getDefaultScheme());
  reset();
  myDefault = CodeStyleSchemes.getInstance().getDefaultScheme();
}
项目:consulo    文件:CodeStyleSchemesModel.java   
static SchemesManager<CodeStyleScheme, CodeStyleSchemeImpl> getSchemesManager() {
  return ((CodeStyleSchemesImpl) CodeStyleSchemes.getInstance()).getSchemesManager();
}