Package org.intellij.sonar.configuration

Examples of org.intellij.sonar.configuration.LocalAnalysisScriptConfigurable


    });

    myAddLocalAnalysisScriptButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        final LocalAnalysisScriptConfigurable dlg = showLocalAnalysisScriptConfigurableDialog();
        if (dlg.isOK()) {
          final LocalAnalysisScript newLocalAnalysisScript = dlg.toLocalAnalysisScript();
          try {
            LocalAnalysisScripts.add(newLocalAnalysisScript);
            myLocalAnalysisScriptComboBox.addItem(makeObj(newLocalAnalysisScript.getName()));
            UIUtil.selectComboBoxItem(myLocalAnalysisScriptComboBox, newLocalAnalysisScript.getName());
          } catch (IllegalArgumentException ex) {
            Messages.showErrorDialog(newLocalAnalysisScript.getName() + " already exists", "Local Analysis Script Name Error");
            showLocalAnalysisScriptConfigurableDialog(newLocalAnalysisScript);
          }
        }
      }
    });

    myEditLocalAnalysisScriptButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent actionEvent) {
        final Object selected = myLocalAnalysisScriptComboBox.getSelectedItem();
        final Optional<LocalAnalysisScript> previous = LocalAnalysisScripts.get(selected.toString());
        if (!previous.isPresent()) {
          Messages.showErrorDialog(selected.toString() + " is not more preset", "Cannot Perform Edit");
        } else {
          final LocalAnalysisScriptConfigurable dlg = showLocalAnalysisScriptConfigurableDialog(previous.get());
          if (dlg.isOK()) {
            LocalAnalysisScript next = dlg.toLocalAnalysisScript();
            try {
              LocalAnalysisScripts.remove(previous.get().getName());
              LocalAnalysisScripts.add(next);
              myLocalAnalysisScriptComboBox.removeItem(selected);
              myLocalAnalysisScriptComboBox.addItem(makeObj(next.getName()));
View Full Code Here


  protected LocalAnalysisScriptConfigurable showLocalAnalysisScriptConfigurableDialog() {
    return showLocalAnalysisScriptConfigurableDialog(null);
  }

  protected LocalAnalysisScriptConfigurable showLocalAnalysisScriptConfigurableDialog(LocalAnalysisScript localAnalysisScript) {
    final LocalAnalysisScriptConfigurable dlg = new LocalAnalysisScriptConfigurable(myProject);
    if (null != localAnalysisScript) dlg.setValuesFrom(localAnalysisScript);
    dlg.show();
    return dlg;
  }
View Full Code Here

TOP

Related Classes of org.intellij.sonar.configuration.LocalAnalysisScriptConfigurable

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.