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)); } }
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; }
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); } }
@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(); }
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)); } }
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; }