Package org.intellij.sonar.persistence

Examples of org.intellij.sonar.persistence.Settings


    final Map<String, Set<SonarIssue>> index = Maps.newConcurrentMap();
    for (PsiFile psiFile : files) {
      String fullFilePath = psiFile.getVirtualFile().getPath();
      ImmutableSet.Builder<SonarIssue> entriesBuilder = ImmutableSet.builder();
      final Settings settings = SettingsUtil.getSettingsFor(psiFile);
      if (settings == null) continue;
      final Collection<Resource> resources = settings.getResources();
      if (resources == null || resources.isEmpty()) {
        matchFileByResource(fullFilePath, entriesBuilder, new Resource());
      } else {
        for (Resource resource : resources) {
          matchFileByResource(fullFilePath, entriesBuilder, resource);
View Full Code Here


    final ImmutableList<PsiFile> psiFiles = filesBuilder.build();
    IssuesByFileIndex.clearIndexFor(psiFiles);

    Set<EnrichedSettings> enrichedSettingsFromScope = Sets.newHashSet();
    if (modules.isEmpty() || AnalysisScope.PROJECT == context.getRefManager().getScope().getScopeType()) {
      final Settings settings = ProjectSettings.getInstance(project).getState();
      enrichedSettingsFromScope.add(new EnrichedSettings(settings, project, null));
    } else {
      for (Module module : modules) {
        final Settings settings = ModuleSettings.getInstance(module).getState();
        enrichedSettingsFromScope.add(new EnrichedSettings(settings, project, module));
      }
    }

    if (oldIssuesGlobalInspectionToolEnabled) {
View Full Code Here

  }

  @Override
  public boolean isModified() {
    if (null == myProjectSettings) return false;
    Settings state = myProjectSettings.getState();
    return null == state || !state.equals(this.toSettings());
  }
View Full Code Here

  }

  @Override
  public void reset() {
    if (myProjectSettings != null && myProjectSettings.getState() != null) {
      Settings persistedSettings = myProjectSettings.getState();
      this.setValuesFromSettings(persistedSettings);
    }
  }
View Full Code Here

  @Override
  public boolean isModified() {
    final ModuleSettings component = ModuleSettings.getInstance(myModule);
    if (null == component) return false;
    Settings state = component.getState();
    return null == state || !state.equals(this.toSettings());
  }
View Full Code Here

    return null == state || !state.equals(this.toSettings());
  }

  @Override
  public void apply() throws ConfigurationException {
    Settings settings = this.toSettings();
    ModuleSettings projectSettingsComponent = ModuleSettings.getInstance(myModule);
    projectSettingsComponent.loadState(settings);
  }
View Full Code Here

  @Override
  public void reset() {
    ModuleSettings moduleSettings = myModule.getComponent(ModuleSettings.class);
    if (moduleSettings != null && moduleSettings.getState() != null) {
      Settings persistedSettings = moduleSettings.getState();
      this.setValuesFromSettings(persistedSettings);
    }
  }
View Full Code Here

  @Override
  public String getSelectedItem() {
    final String selectedItem = super.getSelectedItem();
    if (SonarServers.PROJECT.equals(selectedItem)) {
      final Settings settings = ProjectSettings.getInstance(myProject).getState();
      return null != settings? settings.getServerName() : NO_SONAR;
    }
    return selectedItem;
  }
View Full Code Here

  private final Map<String, ImmutableList<Issue>> downloadedIssuesByResourceKey = Maps.newConcurrentMap();
  private final SonarQubeInspectionContext.EnrichedSettings enrichedSettings;
  private final SonarConsole sonarConsole;

  public static Optional<DownloadIssuesTask> from(SonarQubeInspectionContext.EnrichedSettings enrichedSettings, ImmutableList<PsiFile> psiFiles) {
    final Settings settings = SettingsUtil.process(enrichedSettings.project, enrichedSettings.settings);
    final Optional<SonarServerConfig> c = SonarServers.get(settings.getServerName());
    if (!c.isPresent()) return Optional.absent();
    final ImmutableSet<String> resourceKeys = FluentIterable.from(settings.getResources()).
        transform(new Function<Resource, String>() {
          @Override
          public String apply(Resource resource) {
            return resource.getKey();
          }
View Full Code Here

TOP

Related Classes of org.intellij.sonar.persistence.Settings

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.