コード例 #1
0
  @Override
  public boolean isModified() {
    EditorSettingsExternalizable editorSettings = EditorSettingsExternalizable.getInstance();
    boolean isModified =
        !Arrays.asList(myNegativePanel.getListItems()).equals(mySettings.getNegativePatterns());
    isModified |=
        !Arrays.asList(myPositivePanel.getListItems()).equals(mySettings.getPositivePatterns());
    isModified |=
        isModified(
            myCbUseSoftWrapsAtConsole,
            editorSettings.isUseSoftWraps(SoftWrapAppliancePlaces.CONSOLE));
    isModified |=
        isModified(
            myCommandsHistoryLimitField, UISettings.getInstance().CONSOLE_COMMAND_HISTORY_LIMIT);
    if (ConsoleBuffer.useCycleBuffer()) {
      isModified |=
          isModified(
              myCbOverrideConsoleCycleBufferSize,
              UISettings.getInstance().OVERRIDE_CONSOLE_CYCLE_BUFFER_SIZE);
      isModified |=
          isModified(
              myConsoleCycleBufferSizeField, UISettings.getInstance().CONSOLE_CYCLE_BUFFER_SIZE_KB);
    }

    return isModified;
  }
コード例 #2
0
  @Override
  public void reset() {
    EditorSettingsExternalizable editorSettings = EditorSettingsExternalizable.getInstance();
    UISettings uiSettings = UISettings.getInstance();

    myCbUseSoftWrapsAtConsole.setSelected(
        editorSettings.isUseSoftWraps(SoftWrapAppliancePlaces.CONSOLE));
    myCommandsHistoryLimitField.setText(Integer.toString(uiSettings.CONSOLE_COMMAND_HISTORY_LIMIT));

    myCbOverrideConsoleCycleBufferSize.setEnabled(ConsoleBuffer.useCycleBuffer());
    myCbOverrideConsoleCycleBufferSize.setSelected(uiSettings.OVERRIDE_CONSOLE_CYCLE_BUFFER_SIZE);
    myConsoleCycleBufferSizeField.setEnabled(
        ConsoleBuffer.useCycleBuffer() && uiSettings.OVERRIDE_CONSOLE_CYCLE_BUFFER_SIZE);
    myConsoleCycleBufferSizeField.setText(
        Integer.toString(uiSettings.CONSOLE_CYCLE_BUFFER_SIZE_KB));

    myNegativePanel.resetFrom(mySettings.getNegativePatterns());
    myPositivePanel.resetFrom(mySettings.getPositivePatterns());
  }
コード例 #3
0
  @Override
  public void apply() throws ConfigurationException {
    EditorSettingsExternalizable editorSettings = EditorSettingsExternalizable.getInstance();
    UISettings uiSettings = UISettings.getInstance();

    editorSettings.setUseSoftWraps(
        myCbUseSoftWrapsAtConsole.isSelected(), SoftWrapAppliancePlaces.CONSOLE);
    boolean uiSettingsChanged = false;
    if (isModified(myCommandsHistoryLimitField, uiSettings.CONSOLE_COMMAND_HISTORY_LIMIT)) {
      uiSettings.CONSOLE_COMMAND_HISTORY_LIMIT =
          Math.max(
              0, Math.min(1000, Integer.parseInt(myCommandsHistoryLimitField.getText().trim())));
      uiSettingsChanged = true;
    }
    if (ConsoleBuffer.useCycleBuffer()) {
      if (isModified(
          myCbOverrideConsoleCycleBufferSize, uiSettings.OVERRIDE_CONSOLE_CYCLE_BUFFER_SIZE)) {
        uiSettings.OVERRIDE_CONSOLE_CYCLE_BUFFER_SIZE =
            myCbOverrideConsoleCycleBufferSize.isSelected();
        uiSettingsChanged = true;
      }
      if (isModified(myConsoleCycleBufferSizeField, uiSettings.CONSOLE_CYCLE_BUFFER_SIZE_KB)) {
        uiSettings.CONSOLE_CYCLE_BUFFER_SIZE_KB =
            Math.max(
                0,
                Math.min(
                    1024 * 100, Integer.parseInt(myConsoleCycleBufferSizeField.getText().trim())));
        uiSettingsChanged = true;
      }
    }
    if (uiSettingsChanged) {
      uiSettings.fireUISettingsChanged();
    }

    myNegativePanel.applyTo(mySettings.getNegativePatterns());
    myPositivePanel.applyTo(mySettings.getPositivePatterns());
  }
コード例 #4
0
 public void reset() {
   myNegativePanel.resetFrom(mySettings.getNegativePatterns());
   myPositivePanel.resetFrom(mySettings.getPositivePatterns());
 }
コード例 #5
0
 public void apply() throws ConfigurationException {
   myNegativePanel.applyTo(mySettings.getNegativePatterns());
   myPositivePanel.applyTo(mySettings.getPositivePatterns());
 }
コード例 #6
0
 public boolean isModified() {
   return !Arrays.asList(myNegativePanel.getListItems()).equals(mySettings.getNegativePatterns())
       || !Arrays.asList(myPositivePanel.getListItems()).equals(mySettings.getPositivePatterns());
 }