Package org.twodividedbyzero.idea.findbugs.preferences

Examples of org.twodividedbyzero.idea.findbugs.preferences.PersistencePreferencesBean


    buildSearchIndexIfNecessary();
  }


  public PersistencePreferencesBean getState() {
    final PersistencePreferencesBean preferencesBean = new PersistencePreferencesBean();
    if (_preferences == null) {
      _preferences = getDefaultPreferences();
    }

    //noinspection ForLoopWithMissingComponent
    for (final Enumeration<?> confNames = _preferences.propertyNames(); confNames.hasMoreElements();) {
      final String elementName = (String) confNames.nextElement();
      preferencesBean.getBasePreferences().put(elementName, _preferences.getProperty(elementName));
    }
    preferencesBean.getDetectors().putAll(_preferences.getDetectors());
    preferencesBean.getBugCategories().putAll(_preferences.getBugCategories());

    preferencesBean.getIncludeFilters().addAll(_preferences.getIncludeFilters());
    preferencesBean.getExcludeFilters().addAll(_preferences.getExcludeFilters());
    preferencesBean.getExcludeBaselineBugs().addAll(_preferences.getExcludeBaselineBugs());
    preferencesBean.getPlugins().addAll(_preferences.getPlugins());
    preferencesBean.getEnabledUserPluginIds().addAll(_preferences.getEnabledUserPluginIds());
    preferencesBean.getDisabledUserPluginIds().addAll(_preferences.getDisabledUserPluginIds());
    preferencesBean.getEnabledBundledPluginIds().addAll(_preferences.getEnabledBundledPluginIds());
    preferencesBean.getDisabledBundledPluginIds().addAll(_preferences.getDisabledBundledPluginIds());

    preferencesBean.getEnabledModuleConfigs().addAll(_preferences.getEnabledModuleConfigs());

    preferencesBean.setAnnotationSuppressWarningsClass(_preferences.getAnnotationSuppressWarningsClass());
    preferencesBean.setAnnotationGutterIconEnabled(_preferences.isAnnotationGutterIconEnabled());
    preferencesBean.setAnnotationTextRangeMarkupEnabled(_preferences.isAnnotationTextRangeMarkupEnabled());
    preferencesBean.setAnnotationTypeSettings(_preferences.getFlattendAnnotationTypeSettings());


    return preferencesBean;
  }
View Full Code Here


      return null;
    }

    final Map<String, Set<String>> detectorsShortNameByBugPatternType = createIndexDetectorsShortNameByBugPatternType();

    final PersistencePreferencesBean ret = new PersistencePreferencesBean();
    for (final Set<String> detectorsShortName : detectorsShortNameByBugPatternType.values()) {
      for (final String detectorShortName : detectorsShortName) {
        ret.getDetectors().put(detectorShortName, "false");
      }
    }

    final List ruleList = rules.getChildren("rule");
    for (final Object child : ruleList) {
      if (child instanceof Element) {
        final Element rule = (Element)child;
        final Element repositoryKey = rule.getChild("repositoryKey");
        final Element key = rule.getChild("key");
        if (repositoryKey != null && "findbugs".equals(repositoryKey.getValue()) && key != null) {
          final String bugPatternType = key.getValue();
          final Set<String> detectorsShortName = detectorsShortNameByBugPatternType.get(bugPatternType);
          if (detectorsShortName != null) {
            for (final String detectorShortName : detectorsShortName) {
              ret.getDetectors().put(detectorShortName, "true");
            }
          } else {
            LOGGER.warn("Unknown bug pattern type: " + bugPatternType);
          }
        }
View Full Code Here

    _configPanel = null;
  }


  public PersistencePreferencesBean getState() {
    final PersistencePreferencesBean preferencesBean = new PersistencePreferencesBean();
    //noinspection ForLoopWithMissingComponent
    for (final Enumeration<?> confNames = _preferences.propertyNames(); confNames.hasMoreElements();) {
      final String elementName = (String) confNames.nextElement();
      preferencesBean.getBasePreferences().put(elementName, _preferences.getProperty(elementName));
    }
    preferencesBean.getDetectors().putAll(_preferences.getDetectors());
    preferencesBean.getBugCategories().putAll(_preferences.getBugCategories());

    preferencesBean.getIncludeFilters().addAll(_preferences.getIncludeFilters());
    preferencesBean.getExcludeFilters().addAll(_preferences.getExcludeFilters());
    preferencesBean.getExcludeBaselineBugs().addAll(_preferences.getExcludeBaselineBugs());

    return preferencesBean;
  }
View Full Code Here

    bugsPreferences.setModified(true);
  }


  private void exportPreferences() {
    final PersistencePreferencesBean prefs = _plugin.getState();
    final VirtualFileWrapper wrapper = FileChooserFactory.getInstance().createSaveFileDialog(
        new FileSaverDescriptor("Export FindBugs Preferences to File...", "", "xml"), this).save( null, null );
    if (wrapper == null) return;
    final Element el= XmlSerializer.serialize(prefs);
    el.setName(PERSISTENCE_ROOT_NAME); // rename "PersistencePreferencesBean"
View Full Code Here

    final VirtualFile [] files = FileChooser.chooseFiles(descriptor, this, getProject(), null);
    if (files.length != 1) {
      return;
    }
    final PersistencePreferencesBean prefs;
    try {
      final Document document = JDOMUtil.loadDocument(files[0].getInputStream());
      if (SonarProfileImporter.isValid(document)) {
        prefs = SonarProfileImporter.doImport(this, document);
        if (prefs == null) {
View Full Code Here

TOP

Related Classes of org.twodividedbyzero.idea.findbugs.preferences.PersistencePreferencesBean

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.