Package org.freeplane.core.ui

Examples of org.freeplane.core.ui.AFreeplaneAction


    private JCommandMenuButton createScriptButton(final String scriptName, final String scriptPath,
                                                  ExecutionMode executionMode) {
        final ScriptMetaData metaData = configuration.getMenuTitleToMetaDataMap().get(scriptName);
        final String title = scriptNameToMenuItemTitle(scriptName);
        AFreeplaneAction action = new ExecuteScriptAction(scriptName, title, scriptPath, executionMode,
            metaData.cacheContent(), metaData.getPermissions());
        ResizableIcon icon = ActionUtils.getActionIcon(action);
        final JCommandMenuButton scriptEntry = new JCommandMenuButton(title, icon);
        scriptEntry.setActionRichTooltip(createRichTooltip(title, metaData));
        scriptEntry.addActionListener(action);
View Full Code Here


      }
     
      public void contribute(RibbonBuildContext context, ARibbonContributor parent) {
        final String key = attributes.getProperty("action");
        if(key != null) {
          AFreeplaneAction action = context.getBuilder().getMode().getAction(key);
          if(action != null) {
            String title = ActionUtils.getActionTitle(action);
            ResizableIcon icon = ActionUtils.getActionIcon(action);
            ActionListener listener = new RibbonActionContributorFactory.RibbonActionListener(action);
            final RibbonApplicationMenuEntryFooter entry = new RibbonApplicationMenuEntryFooter(icon, title, listener);
View Full Code Here

        if(callback != null) {
          entry.setPopupCallback(callback);
        }
        KeyStroke ks = (KeyStroke) button.getClientProperty(RibbonActionContributorFactory.ACTION_ACCELERATOR)
        if(ks != null) {
          AFreeplaneAction action = (AFreeplaneAction) button.getClientProperty(RibbonActionContributorFactory.ACTION_KEY_PROPERTY);
          if(action != null) {
            RichTooltip tip = RibbonActionContributorFactory.getRichTooltip(action, ks);
            if(tip != null) {
              entry.setActionRichTooltip(tip);
            }
View Full Code Here

     
      public void contribute(RibbonBuildContext context, ARibbonContributor parent) {
        entry = null;
        if(context.hasChildren(context.getCurrentPath())) {         
          if(attributes.get("action") == null) {
            AFreeplaneAction action = ActionUtils.getDummyAction(getKey());
            entry = createMenuEntry(action, CommandButtonKind.POPUP_ONLY);
          }
          else {
            AFreeplaneAction action = context.getBuilder().getMode().getAction(getKey());
            if(action == null) {
              action = ActionUtils.getDummyAction(getKey());
            }
            entry = createMenuEntry(action, CommandButtonKind.ACTION_AND_POPUP_MAIN_ACTION);
          }
         
          context.processChildren(context.getCurrentPath(), this);
        }
        else {
          if(attributes.get("action") == null) {
            return;
          }
          AFreeplaneAction action = context.getBuilder().getMode().getAction(getKey());
          if(action == null) {
            return;
          }
         
          entry = createMenuEntry(action, CommandButtonKind.ACTION_ONLY);
        }
        KeyStroke ks = context.getBuilder().getAcceleratorManager().getAccelerator(getKey());
        if(ks != null) {
          AFreeplaneAction action = context.getBuilder().getMode().getAction(getKey());
          if(action != null) {
            RichTooltip tip = RibbonActionContributorFactory.getRichTooltip(action, ks);
            if(tip != null) {
              entry.setActionRichTooltip(tip);
            }
View Full Code Here

    }
    return TextUtils.removeTranslateComment(title);
  }

  public static AFreeplaneAction getDummyAction(final String key) {
    return new AFreeplaneAction(key) {
      private static final long serialVersionUID = -5405032373977903024L;
 
      public String getTextKey() {
        return getKey();
      }
View Full Code Here

    final boolean setTitle = saved != mapModel.isSaved();
    mapModel.setSaved(saved);
    if (setTitle) {
      final Controller controller = Controller.getCurrentController();
      controller.getMapViewManager().setTitle();
      final AFreeplaneAction saveAction = controller.getModeController().getAction("SaveAction");
      if(saveAction != null)
        saveAction.setEnabled();
    }
  }
View Full Code Here

  public ModelessAttributeController() {
    super();
//    this.controller = controller;
    Controller controller = Controller.getCurrentController();
    final AFreeplaneAction showAllAttributes = new ShowAllAttributesAction();
    final AFreeplaneAction showSelectedAttributes = new ShowSelectedAttributesAction();
    final AFreeplaneAction hideAllAttributes = new HideAllAttributesAction();
    controller.addAction(showAllAttributes);
    controller.addAction(showSelectedAttributes);
    controller.addAction(hideAllAttributes);
  }
View Full Code Here

        button.setCommandButtonKind(CommandButtonKind.POPUP_ONLY);
        button.setPopupCallback(new PopupPanelCallback() {
          public JPopupPanel getPopupPanel(JCommandButton commandButton) {
            JCommandPopupMenu popupmenu = new JCommandPopupMenu();
             
              AFreeplaneAction action = context.getBuilder().getMode().getAction("ApplyToVisibleAction");
              JCommandToggleMenuButton toggleButton = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
              action.setSelected();
              toggleButton.getActionModel().setSelected(action.isSelected());
              popupmenu.addMenuButton(toggleButton);
             
              action = context.getBuilder().getMode().getAction("ShowAncestorsAction");
              toggleButton = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
              action.setSelected();
              toggleButton.getActionModel().setSelected(action.isSelected());
              popupmenu.addMenuButton(toggleButton);
             
              action = context.getBuilder().getMode().getAction("ShowDescendantsAction");
              toggleButton = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
              action.setSelected();
              toggleButton.getActionModel().setSelected(action.isSelected());
              popupmenu.addMenuButton(toggleButton);             
             
            return popupmenu;
          }
        });
View Full Code Here

        band.setExpandButtonKeyTip("ES");
        band.setCollapsedStateKeyTip("ZE");

        JCommandButton styleGroupButton = new JCommandButton(TextUtils.removeTranslateComment(TextUtils.getText("edgeStyleGroupAction.text")));       
        styleGroupButton.setCommandButtonKind(CommandButtonKind.POPUP_ONLY);
        AFreeplaneAction action = context.getBuilder().getMode().getAction("EdgeStyleAsParentAction");
        final JCommandToggleMenuButton styleAsParent = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, styleAsParent);
        action = context.getBuilder().getMode().getAction("EdgeStyleAction.linear");
        final JCommandToggleMenuButton styleLinear = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, styleLinear);
View Full Code Here

        addDefaultToggleHandler(context,zoomBox);
        band.addFlowComponent(zoomBox);
       
        JCommandButtonStrip strip = new JCommandButtonStrip();
               
        AFreeplaneAction action = context.getBuilder().getMode().getAction("ZoomInAction");       
        JCommandButton button = RibbonActionContributorFactory.createCommandButton(action);       
        button.setDisplayState(CommandButtonDisplayState.SMALL);
        getAccelChangeListener().addAction(action.getKey(), button);
        addDefaultToggleHandler(context, action, button);
        strip.add(button);
       
        action = context.getBuilder().getMode().getAction("ZoomOutAction");       
        button = RibbonActionContributorFactory.createCommandButton(action);       
        button.setDisplayState(CommandButtonDisplayState.SMALL);
        getAccelChangeListener().addAction(action.getKey(), button);
        addDefaultToggleHandler(context, action, button);
        strip.add(button);
       
        action = context.getBuilder().getMode().getAction("FitToPage");       
        button = RibbonActionContributorFactory.createCommandButton(action);       
        button.setDisplayState(CommandButtonDisplayState.MEDIUM);
        getAccelChangeListener().addAction(action.getKey(), button);
        addDefaultToggleHandler(context, action, button);
        strip.add(button);
       
        band.addFlowComponent(strip);
       
View Full Code Here

TOP

Related Classes of org.freeplane.core.ui.AFreeplaneAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.