コード例 #1
0
 private static void saveState(TreeAction action, boolean state) {
   if (action instanceof PropertyOwner) {
     final String propertyName = ((PropertyOwner) action).getPropertyName();
     PropertiesComponent.getInstance()
         .setValue(getPropertyName(propertyName), Boolean.toString(state));
   }
 }
コード例 #2
0
  private static boolean getDefaultValue(TreeAction action) {
    if (action instanceof PropertyOwner) {
      final String propertyName = ((PropertyOwner) action).getPropertyName();
      return PropertiesComponent.getInstance().getBoolean(getPropertyName(propertyName), false);
    }

    return false;
  }
コード例 #3
0
  protected void fillToolbarActions(DefaultActionGroup group) {
    final boolean alphabeticallySorted = PropertiesComponent.getInstance().isTrueValue(PROP_SORTED);
    if (alphabeticallySorted) {
      setSortComparator(new OrderComparator());
    }
    myAlphabeticallySorted = alphabeticallySorted;
    group.add(mySortAction);

    if (!supportsNestedContainers()) {
      ShowContainersAction showContainersAction = getShowContainersAction();
      showContainersAction.registerCustomShortcutSet(
          new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.ALT_MASK)),
          myTree);
      setShowClasses(PropertiesComponent.getInstance().isTrueValue(PROP_SHOWCLASSES));
      group.add(showContainersAction);
    }
  }
コード例 #4
0
  @Override
  public void dispose() {
    PropertiesComponent instance = PropertiesComponent.getInstance();
    instance.setValue(PROP_SORTED, Boolean.toString(isAlphabeticallySorted()));
    instance.setValue(PROP_SHOWCLASSES, Boolean.toString(myShowClasses));

    if (myCopyJavadocCheckbox != null) {
      instance.setValue(PROP_COPYJAVADOC, Boolean.toString(myCopyJavadocCheckbox.isSelected()));
    }

    final Container contentPane = getContentPane();
    if (contentPane != null) {
      contentPane.removeAll();
    }
    mySelectedNodes.clear();
    myElements = null;
    super.dispose();
  }
コード例 #5
0
 protected void customizeOptionsPanel() {
   if (myInsertOverrideAnnotationCheckbox != null && myIsInsertOverrideVisible) {
     CodeStyleSettings styleSettings =
         CodeStyleSettingsManager.getInstance(myProject).getCurrentSettings();
     myInsertOverrideAnnotationCheckbox.setSelected(styleSettings.INSERT_OVERRIDE_ANNOTATION);
   }
   if (myCopyJavadocCheckbox != null) {
     myCopyJavadocCheckbox.setSelected(
         PropertiesComponent.getInstance().isTrueValue(PROP_COPYJAVADOC));
   }
 }
コード例 #6
0
  private JComponent createSouthPanel() {
    final JCheckBox checkBox = new JCheckBox(IdeBundle.message("checkbox.narrow.down.on.typing"));
    checkBox.setSelected(PropertiesComponent.getInstance().getBoolean(narrowDownPropertyKey, true));
    checkBox.addChangeListener(
        new ChangeListener() {
          public void stateChanged(ChangeEvent e) {
            myShouldNarrowDown = checkBox.isSelected();
            PropertiesComponent.getInstance()
                .setValue(narrowDownPropertyKey, Boolean.toString(myShouldNarrowDown));

            if (mySpeedSearch.isPopupActive()
                && !StringUtil.isEmpty(mySpeedSearch.getEnteredPrefix())) {
              myAbstractTreeBuilder.queueUpdate();
            }
          }
        });

    checkBox.setFocusable(false);
    UIUtil.applyStyle(UIUtil.ComponentStyle.MINI, checkBox);
    final JPanel panel = new JPanel(new BorderLayout());
    panel.add(checkBox, BorderLayout.WEST);
    return panel;
  }