Package krasa.formatter.settings

Examples of krasa.formatter.settings.ProjectSettingsComponent


    public static void notifyProjectsWhichUsesThisSettings(Settings deletedSettings, Project project,
                                                           Settings defaultSettings) {
        Project[] openProjects = ProjectManagerImpl.getInstance().getOpenProjects();
        for (Project openProject : openProjects) {
            ProjectSettingsComponent component = openProject.getComponent(ProjectSettingsComponent.class);
            if (component != null) {
                Settings state = component.getSettings();
                if (deletedSettings.getId().equals(state.getId())) {
                    component.loadState(defaultSettings);
                    if (project != openProject) {
                        Notifier.notifyDeletedSettings(component.getProject());
                    }
                }
            }
        }
    }
View Full Code Here


    }

    public static void applyToAllOpenedProjects(Settings updatedSettings) {
        Project[] openProjects = ProjectManagerImpl.getInstance().getOpenProjects();
        for (Project openProject : openProjects) {
            ProjectSettingsComponent component = openProject.getComponent(ProjectSettingsComponent.class);
            if (component != null) {
                Settings state = component.getSettings();
                if (updatedSettings.getId().equals(state.getId())) {
                    component.install(updatedSettings);
                }
            }
        }
    }
View Full Code Here

            });
        }
    }

    private void changeFormatter(Project project, Settings.Formatter formatter) {
        ProjectSettingsComponent instance = ProjectSettingsComponent.getInstance(project);
        final Settings state = instance.getState();
        state.setFormatter(formatter);
        ProjectUtils.applyToAllOpenedProjects(state);
    }
View Full Code Here

  }

  private Settings getSettings(AnActionEvent e) {
    Project project = getProject(e);
    if (project != null) {
      ProjectSettingsComponent instance = ProjectSettingsComponent.getInstance(project);
      return instance.getSettings();
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of krasa.formatter.settings.ProjectSettingsComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.