Search in sources :

Example 1 with KeyProperty

use of org.freeplane.core.resources.components.KeyProperty in project freeplane by freeplane.

the class MIconController method createPreferences.

private void createPreferences() {
    final MModeController modeController = (MModeController) Controller.getCurrentModeController();
    final OptionPanelBuilder optionPanelBuilder = modeController.getOptionPanelBuilder();
    final List<AFreeplaneAction> actions = new ArrayList<AFreeplaneAction>();
    actions.addAll(iconActions.values());
    actions.add(modeController.getAction("RemoveIcon_0_Action"));
    actions.add(modeController.getAction("RemoveIconAction"));
    actions.add(modeController.getAction("RemoveAllIconsAction"));
    for (final AFreeplaneAction iconAction : actions) {
        final IIconInformation info = (IIconInformation) iconAction;
        optionPanelBuilder.addCreator("Keystrokes/icons", new IPropertyControlCreator() {

            public IPropertyControl createControl() {
                final KeyProperty keyProperty = new KeyProperty(info.getShortcutKey(), info.getTranslationValueLabel());
                keyProperty.setIcon(info.getIcon());
                keyProperty.disableModifiers();
                return keyProperty;
            }
        }, IndexedTree.AS_CHILD);
    }
}
Also used : IPropertyControlCreator(org.freeplane.core.resources.components.IPropertyControlCreator) AFreeplaneAction(org.freeplane.core.ui.AFreeplaneAction) OptionPanelBuilder(org.freeplane.core.resources.components.OptionPanelBuilder) ArrayList(java.util.ArrayList) IIconInformation(org.freeplane.features.icon.IIconInformation) IPropertyControl(org.freeplane.core.resources.components.IPropertyControl) KeyProperty(org.freeplane.core.resources.components.KeyProperty) MModeController(org.freeplane.features.mode.mindmapmode.MModeController)

Aggregations

ArrayList (java.util.ArrayList)1 IPropertyControl (org.freeplane.core.resources.components.IPropertyControl)1 IPropertyControlCreator (org.freeplane.core.resources.components.IPropertyControlCreator)1 KeyProperty (org.freeplane.core.resources.components.KeyProperty)1 OptionPanelBuilder (org.freeplane.core.resources.components.OptionPanelBuilder)1 AFreeplaneAction (org.freeplane.core.ui.AFreeplaneAction)1 IIconInformation (org.freeplane.features.icon.IIconInformation)1 MModeController (org.freeplane.features.mode.mindmapmode.MModeController)1