public void reset() {
    myEnableCompileServer.setSelected(mySettings.COMPILE_SERVER_ENABLED);
    myCompilationServerPort.setText(mySettings.COMPILE_SERVER_PORT);

    Sdk sdk =
        mySettings.COMPILE_SERVER_SDK == null
            ? null
            : ProjectJdkTable.getInstance().findJdk(mySettings.COMPILE_SERVER_SDK);
    myCompilationServerSdk.setSelectedJdk(sdk);

    myCompilationServerMaximumHeapSize.setText(mySettings.COMPILE_SERVER_MAXIMUM_HEAP_SIZE);
    myCompilationServerJvmParameters.setText(mySettings.COMPILE_SERVER_JVM_PARAMETERS);
    showTypeInfoOnCheckBox.setSelected(mySettings.SHOW_TYPE_TOOLTIP_ON_MOUSE_HOVER);
    delaySpinner.setValue(mySettings.SHOW_TYPE_TOOLTIP_DELAY);
  }
  public boolean isModified() {
    Sdk sdk = myCompilationServerSdk.getSelectedJdk();
    String sdkName = sdk == null ? null : sdk.getName();

    if (showTypeInfoOnCheckBox.isSelected() != mySettings.SHOW_TYPE_TOOLTIP_ON_MOUSE_HOVER)
      return true;
    if (!delaySpinner.getValue().equals(mySettings.SHOW_TYPE_TOOLTIP_DELAY)) return true;

    return !(myEnableCompileServer.isSelected() == mySettings.COMPILE_SERVER_ENABLED
        && myCompilationServerPort.getText().equals(mySettings.COMPILE_SERVER_PORT)
        && ComparatorUtil.equalsNullable(sdkName, mySettings.COMPILE_SERVER_SDK)
        && myCompilationServerMaximumHeapSize
            .getText()
            .equals(mySettings.COMPILE_SERVER_MAXIMUM_HEAP_SIZE)
        && myCompilationServerJvmParameters
            .getText()
            .equals(mySettings.COMPILE_SERVER_JVM_PARAMETERS)
        && myIncrementalTypeCmb.getModel().getSelectedItem().equals(mySettings.INCREMENTAL_TYPE)
        && myCompileOrderCmb.getModel().getSelectedItem().equals(mySettings.COMPILE_ORDER));
  }
  public void apply() throws ConfigurationException {
    mySettings.INCREMENTAL_TYPE = (String) myIncrementalTypeCmb.getModel().getSelectedItem();
    mySettings.COMPILE_ORDER = (String) myCompileOrderCmb.getModel().getSelectedItem();
    mySettings.COMPILE_SERVER_ENABLED = myEnableCompileServer.isSelected();
    mySettings.COMPILE_SERVER_PORT = myCompilationServerPort.getText();

    Sdk sdk = myCompilationServerSdk.getSelectedJdk();
    mySettings.COMPILE_SERVER_SDK = sdk == null ? null : sdk.getName();

    mySettings.COMPILE_SERVER_MAXIMUM_HEAP_SIZE = myCompilationServerMaximumHeapSize.getText();
    mySettings.COMPILE_SERVER_JVM_PARAMETERS = myCompilationServerJvmParameters.getText();
    mySettings.SHOW_TYPE_TOOLTIP_ON_MOUSE_HOVER = showTypeInfoOnCheckBox.isSelected();
    mySettings.SHOW_TYPE_TOOLTIP_DELAY = (Integer) delaySpinner.getValue();

    // TODO
    //    boolean externalCompiler =
    // CompilerWorkspaceConfiguration.getInstance(myProject).USE_COMPILE_SERVER;
    //
    //    if (!externalCompiler || !myEnableCompileServer.isSelected()) {
    //      myProject.getComponent(CompileServerLauncher.class).stop();
    //    }
    //    myProject.getComponent(CompileServerManager.class).configureWidget();
  }
  public ScalaApplicationSettingsForm(ScalaApplicationSettings settings) {
    mySettings = settings;

    myEnableCompileServer.addChangeListener(
        new ChangeListener() {
          public void stateChanged(ChangeEvent e) {
            updateCompilationServerSettingsPanel();
          }
        });

    initCompilerTypeCmb();
    initCompileOrderCmb();

    ProjectSdksModel model = new ProjectSdksModel();
    model.reset(null);

    myCompilationServerSdk = new JdkComboBox(model);
    myCompilationServerSdk.insertItemAt(new JdkComboBox.NoneJdkComboBoxItem(), 0);

    mySdkPanel.add(myCompilationServerSdk, BorderLayout.CENTER);
    mySdkPanel.setSize(mySdkPanel.getPreferredSize());

    myNote.setForeground(JBColor.GRAY);

    delaySpinner.setEnabled(showTypeInfoOnCheckBox.isSelected());
    showTypeInfoOnCheckBox.addItemListener(
        new ItemListener() {
          @Override
          public void itemStateChanged(ItemEvent e) {
            delaySpinner.setEnabled(showTypeInfoOnCheckBox.isSelected());
          }
        });
    delaySpinner.setValue(mySettings.SHOW_TYPE_TOOLTIP_DELAY);

    updateCompilationServerSettingsPanel();
  }