Package org.intellij.sonar.persistence

Examples of org.intellij.sonar.persistence.SonarServerConfig


  private void makePasswordVisible() {
    myPasswordField.setEchoChar('\u0000');
  }

  public SonarServerConfig toSonarServerConfigurationBean() {
    SonarServerConfig bean = SonarServerConfig.of(
        myNameTestField.getText(),
        myHostUrlTextField.getText(),
        myAnonymousCheckBox.isSelected(),
        myUserTextField.getText()
    );
    bean.setPassword(String.valueOf(myPasswordField.getPassword()));
    return bean;
  }
View Full Code Here


      @Override
      public void actionPerformed(ActionEvent actionEvent) {

        final SonarServerConfigurable dlg = showSonarServerConfigurableDialog();
        if (dlg.isOK()) {
          SonarServerConfig newSonarConfigurationBean = dlg.toSonarServerConfigurationBean();
          try {
            SonarServers.add(newSonarConfigurationBean);
            mySonarServersComboBox.addItem(makeObj(newSonarConfigurationBean.getName()));
            UIUtil.selectComboBoxItem(mySonarServersComboBox, newSonarConfigurationBean.getName());
          } catch (IllegalArgumentException e) {
            Messages.showErrorDialog(newSonarConfigurationBean.getName() + " already exists", "SonarQube Name Error");
            showSonarServerConfigurableDialog(newSonarConfigurationBean);
          }
        }
      }
    });

    myEditSonarServerButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent actionEvent) {
        final Object selectedSonarServer = sonarServersComboBox.getSelectedItem();
        final Optional<SonarServerConfig> oldBean = SonarServers.get(selectedSonarServer.toString());
        if (!oldBean.isPresent()) {
          Messages.showErrorDialog(selectedSonarServer.toString() + " is not more preset", "Cannot Perform Edit");
        } else {
          final SonarServerConfigurable dlg = showSonarServerConfigurableDialog(oldBean.get());
          if (dlg.isOK()) {
            SonarServerConfig newSonarConfigurationBean = dlg.toSonarServerConfigurationBean();
            try {
              SonarServers.remove(oldBean.get().getName());
              SonarServers.add(newSonarConfigurationBean);
              mySonarServersComboBox.removeItem(selectedSonarServer);
              mySonarServersComboBox.addItem(makeObj(newSonarConfigurationBean.getName()));
              UIUtil.selectComboBoxItem(mySonarServersComboBox, newSonarConfigurationBean.getName());
            } catch (IllegalArgumentException e) {
              Messages.showErrorDialog(selectedSonarServer.toString() + " cannot be saved\n\n" + Throwables.getStackTraceAsString(e), "Cannot Perform Edit");
            }
          }
        }
View Full Code Here

TOP

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

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.