Examples of PopupPanelCallback


Examples of org.pushingpixels.flamingo.api.common.popup.PopupPanelCallback

        styleHorizontal.getActionModel().setGroup(group);
        styleAsParent.getActionModel().setGroup(group);
        styleHideEdge.getActionModel().setGroup(group);
        styleAsParent.getActionModel().setGroup(group);

        styleGroupButton.setPopupCallback(new PopupPanelCallback() {
          public JPopupPanel getPopupPanel(JCommandButton commandButton) {
            JCommandPopupMenu popupmenu = new JCommandPopupMenu();
            popupmenu.addMenuButton(styleAsParent);
            popupmenu.addMenuButton(styleLinear);
            popupmenu.addMenuButton(styleBezier);
            popupmenu.addMenuButton(styleSharpLinear);
            popupmenu.addMenuButton(styleSharpBezier);
            popupmenu.addMenuButton(styleHorizontal);
            popupmenu.addMenuButton(styleHideEdge);
            return popupmenu;
          }
        });

        band.addCommandButton(styleGroupButton, RibbonElementPriority.MEDIUM);

        JCommandButton lineWidthGroupButton = new JCommandButton(TextUtils.removeTranslateComment(TextUtils.getText("edgeLineWidthGroupAction.text")));
        lineWidthGroupButton.setCommandButtonKind(CommandButtonKind.POPUP_ONLY);       
        action = context.getBuilder().getMode().getAction("EdgeWidthAction_width_parent");
        final JCommandToggleMenuButton widthParent = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, widthParent);
        action = context.getBuilder().getMode().getAction("EdgeWidthAction_width_thin");
        final JCommandToggleMenuButton widthThin = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, widthThin);
        action = context.getBuilder().getMode().getAction("EdgeWidthAction_1");
        final JCommandToggleMenuButton width1 = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, width1);
        action = context.getBuilder().getMode().getAction("EdgeWidthAction_2");
        final JCommandToggleMenuButton width2 = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, width2);
        action = context.getBuilder().getMode().getAction("EdgeWidthAction_4");
        final JCommandToggleMenuButton width4 = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, width4);
        action = context.getBuilder().getMode().getAction("EdgeWidthAction_8");
        final JCommandToggleMenuButton width8 = RibbonActionContributorFactory.createCommandToggleMenuButton(action);
        addDefaultToggleHandler(context, action, width8);

        lineWidthGroupButton.setPopupCallback(new PopupPanelCallback() {
          public JPopupPanel getPopupPanel(JCommandButton commandButton) {
            JCommandPopupMenu popupmenu = new JCommandPopupMenu();
            popupmenu.addMenuButton(widthParent);
            popupmenu.addMenuButton(widthThin);
            popupmenu.addMenuButton(width1);
View Full Code Here

Examples of org.pushingpixels.flamingo.api.common.popup.PopupPanelCallback

      }

      private void createToolbarsMenu(final RibbonBuildContext context, JRibbonBand band) {
        JCommandButton button = new JCommandButton(TextUtils.removeTranslateComment(TextUtils.getText("menu_toolbars")));
        button.setCommandButtonKind(CommandButtonKind.POPUP_ONLY);
        button.setPopupCallback(new PopupPanelCallback() {
          public JPopupPanel getPopupPanel(JCommandButton commandButton) {
            JCommandPopupMenu popupmenu = new JCommandPopupMenu();         
             
              final AFreeplaneAction toggleFBarAction = context.getBuilder().getMode().getAction("ToggleFBarAction");
              final JCommandToggleMenuButton toggleFBarButton = RibbonActionContributorFactory.createCommandToggleMenuButton(toggleFBarAction);
              toggleFBarAction.setSelected();
              toggleFBarButton.getActionModel().setSelected(toggleFBarAction.isSelected());
              popupmenu.addMenuButton(toggleFBarButton);
             
              final AFreeplaneAction toggleLeftToolbarAction = context.getBuilder().getMode().getAction("ToggleLeftToolbarAction");
              final JCommandToggleMenuButton toggleLeftToolbarButton = RibbonActionContributorFactory.createCommandToggleMenuButton(toggleLeftToolbarAction);
              toggleLeftToolbarAction.setSelected();
              toggleLeftToolbarButton.getActionModel().setSelected(toggleLeftToolbarAction.isSelected());
              popupmenu.addMenuButton(toggleLeftToolbarButton);
             
              final AFreeplaneAction toggleStatusAction = context.getBuilder().getMode().getAction("ToggleStatusAction");
              final JCommandToggleMenuButton toggleStatusButton = RibbonActionContributorFactory.createCommandToggleMenuButton(toggleStatusAction);
              toggleStatusAction.setSelected();
              toggleStatusButton.getActionModel().setSelected(toggleStatusAction.isSelected());
              popupmenu.addMenuButton(toggleStatusButton);
             
              final AFreeplaneAction toggleScrollbarsAction = context.getBuilder().getMode().getAction("ToggleScrollbarsAction");
              final JCommandToggleMenuButton toggleScrollbarsButton = RibbonActionContributorFactory.createCommandToggleMenuButton(toggleScrollbarsAction);
              toggleScrollbarsAction.setSelected();
              toggleScrollbarsButton.getActionModel().setSelected(toggleScrollbarsAction.isSelected());
              popupmenu.addMenuButton(toggleScrollbarsButton);
             
            return popupmenu;
          }
        });
        band.addCommandButton(button, RibbonElementPriority.MEDIUM);
       
        AFreeplaneAction action = context.getBuilder().getMode().getAction("SetShortenerStateAction");
        button = RibbonActionContributorFactory.createCommandButton(action);
        band.addCommandButton(button, RibbonElementPriority.MEDIUM);
       
        action = context.getBuilder().getMode().getAction("ToggleDetailsAction");       
        button = RibbonActionContributorFactory.createCommandButton(action);
        band.addCommandButton(button, RibbonElementPriority.MEDIUM);       
      }


      private void createToolTipMenu(final RibbonBuildContext context, final JRibbonBand band) {
        JCommandButton button = new JCommandButton(TextUtils.removeTranslateComment(TextUtils.getText("menu_hoverView")));
        button.setCommandButtonKind(CommandButtonKind.POPUP_ONLY);
        button.setPopupCallback(new PopupPanelCallback() {
          public JPopupPanel getPopupPanel(JCommandButton commandButton) {
            JCommandPopupMenu popupmenu = new JCommandPopupMenu();
           
            final SetBooleanPropertyAction showAction = (SetBooleanPropertyAction) context.getBuilder().getMode().getAction("SetBooleanPropertyAction.show_node_tooltips");
              final JCommandToggleMenuButton showButton = RibbonActionContributorFactory.createCommandToggleMenuButton(showAction);
              showAction.setSelected();
              showButton.getActionModel().setSelected(showAction.isSelected());
              popupmenu.addMenuButton(showButton);
             
              final SetBooleanPropertyAction showStylesAction = (SetBooleanPropertyAction) context.getBuilder().getMode().getAction("SetBooleanPropertyAction.show_styles_in_tooltip");
              final JCommandToggleMenuButton showStylesButton = RibbonActionContributorFactory.createCommandToggleMenuButton(showStylesAction);
              showStylesAction.setSelected();
              showStylesButton.getActionModel().setSelected(showStylesAction.isSelected());
              popupmenu.addMenuButton(showStylesButton);
             
              final AFreeplaneAction modificationAction = context.getBuilder().getMode().getAction("CreationModificationPluginAction");
              final JCommandToggleMenuButton modificationButton = RibbonActionContributorFactory.createCommandToggleMenuButton(modificationAction);
              modificationAction.setSelected();
              modificationButton.getActionModel().setSelected(modificationAction.isSelected());
              popupmenu.addMenuButton(modificationButton);
             
            return popupmenu;
          }
        });
        band.addCommandButton(button, RibbonElementPriority.MEDIUM);
      }


      private void createNoteViewMenu(final RibbonBuildContext context, final JRibbonBand band) {       
        JCommandButton displayNotesButton = new JCommandButton(TextUtils.removeTranslateComment(TextUtils.getText("menu_noteView")));
        displayNotesButton.setCommandButtonKind(CommandButtonKind.POPUP_ONLY);
        displayNotesButton.setPopupCallback(new PopupPanelCallback() {
          public JPopupPanel getPopupPanel(JCommandButton commandButton) {
            JCommandPopupMenu popupmenu = new JCommandPopupMenu();
           
            final ShowNotesInMapAction showNotesInMapAction = (ShowNotesInMapAction) context.getBuilder().getMode().getAction("ShowNotesInMapAction");
            final JCommandToggleMenuButton showNotedsInMapButton = RibbonActionContributorFactory.createCommandToggleMenuButton(showNotesInMapAction);
            showNotesInMapAction.setSelected();
            showNotedsInMapButton.getActionModel().setSelected(showNotesInMapAction.isSelected());
              popupmenu.addMenuButton(showNotedsInMapButton);
             
            final SetBooleanMapPropertyAction showIconAction = (SetBooleanMapPropertyAction) context.getBuilder().getMode().getAction("SetBooleanMapPropertyAction.show_note_icons");
              final JCommandToggleMenuButton toggleButton = RibbonActionContributorFactory.createCommandToggleMenuButton(showIconAction);
              showIconAction.setSelected();
              toggleButton.getActionModel().setSelected(showIconAction.isSelected());
              popupmenu.addMenuButton(toggleButton);
             
              JCommandMenuButton button = new JCommandMenuButton(TextUtils.removeTranslateComment(TextUtils.getText("note_window_location")), null);
              button.setDisplayState(CommandButtonDisplayState.MEDIUM);
              button.setCommandButtonKind(CommandButtonKind.POPUP_ONLY);
              button.setPopupCallback(new PopupPanelCallback() {
                public JPopupPanel getPopupPanel(JCommandButton commandButton) {
                  JCommandPopupMenu popupmenu = new JCommandPopupMenu();
               
                  final SetNoteWindowPosition posTopAction = (SetNoteWindowPosition) context.getBuilder().getMode().getAction("SetNoteWindowPosition.top");
                  final JCommandToggleMenuButton posTopButton = RibbonActionContributorFactory.createCommandToggleMenuButton(posTopAction);             
                  popupmenu.addMenuButton(posTopButton);
                  posTopAction.setSelected();
                  posTopButton.getActionModel().setSelected(posTopAction.isSelected());
                 
                  final SetNoteWindowPosition posLeftAction = (SetNoteWindowPosition) context.getBuilder().getMode().getAction("SetNoteWindowPosition.left");
                  final JCommandToggleMenuButton posLeftButton = RibbonActionContributorFactory.createCommandToggleMenuButton(posLeftAction);             
                  popupmenu.addMenuButton(posLeftButton);
                  posLeftAction.setSelected();
                  posLeftButton.getActionModel().setSelected(posLeftAction.isSelected());
                 
                  final SetNoteWindowPosition posRightAction = (SetNoteWindowPosition) context.getBuilder().getMode().getAction("SetNoteWindowPosition.right");
                  final JCommandToggleMenuButton posRightButton = RibbonActionContributorFactory.createCommandToggleMenuButton(posRightAction);             
                  popupmenu.addMenuButton(posRightButton);
                  posRightAction.setSelected();
                  posRightButton.getActionModel().setSelected(posRightAction.isSelected());
                 
                  final SetNoteWindowPosition posBottomAction = (SetNoteWindowPosition) context.getBuilder().getMode().getAction("SetNoteWindowPosition.bottom");
                  final JCommandToggleMenuButton posBottomButton = RibbonActionContributorFactory.createCommandToggleMenuButton(posBottomAction);             
                  popupmenu.addMenuButton(posBottomButton);
                  posBottomAction.setSelected();
                  posBottomButton.getActionModel().setSelected(posBottomAction.isSelected());
                 
                  return popupmenu;
                }
              });             
              popupmenu.addMenuButton(button);
             
            return popupmenu;
          }
        });
        band.addCommandButton(displayNotesButton, RibbonElementPriority.MEDIUM);
      }

      private void createAttributeViewMenu(final RibbonBuildContext context, JRibbonBand band) {
        JCommandButton button = new JCommandButton(TextUtils.removeTranslateComment(TextUtils.getText("menu_displayAttributes")));
        button.setDisplayState(CommandButtonDisplayState.MEDIUM);
        button.setCommandButtonKind(CommandButtonKind.POPUP_ONLY);
        button.setPopupCallback(new PopupPanelCallback() {
          public JPopupPanel getPopupPanel(JCommandButton commandButton) {
            JCommandPopupMenu popupmenu = new JCommandPopupMenu();
           
            final AttributeViewTypeAction showSelectedAttributesAction = (AttributeViewTypeAction) context.getBuilder().getMode().getAction("ShowSelectedAttributesAction");
            final JCommandToggleMenuButton showSelectedAttributesButton = RibbonActionContributorFactory.createCommandToggleMenuButton(showSelectedAttributesAction);             
View Full Code Here

Examples of org.pushingpixels.flamingo.api.common.popup.PopupPanelCallback

   
    if (recentButton == null) {
      recentButton = new JCommandButton(Messages.getString("Document.recent.text"), new file_recent());
      recentButton.setCommandButtonKind(JCommandButton.CommandButtonKind.POPUP_ONLY);
     
      recentButton.setPopupCallback(new PopupPanelCallback() {
        @Override
        public JPopupPanel getPopupPanel(JCommandButton commandButton) {
            return getRecentMenu();
        }
      });
View Full Code Here

Examples of org.pushingpixels.flamingo.api.common.popup.PopupPanelCallback

  private JCommandButton getSampleNetsButton() {
   
    if (sampleNetsButton == null) {
      sampleNetsButton = new JCommandButton(Messages.getString("OptionsAndHelp.SampleNets.text"),new help_smaplenets());
      sampleNetsButton.setCommandButtonKind(JCommandButton.CommandButtonKind.POPUP_ONLY);
      sampleNetsButton.setPopupCallback(new PopupPanelCallback() {
        @Override
        public JPopupPanel getPopupPanel(JCommandButton commandButton) {
              return getSampleMenu();       
        }
      })
View Full Code Here

Examples of org.pushingpixels.flamingo.api.common.popup.PopupPanelCallback

    // we can't set the application menu popup panel if we have no reference
    // to the application ribbon
    if (ribbon != null) {
      final JRibbonApplicationMenuButton appMenuButton = (JRibbonApplicationMenuButton) this.commandButton;
      appMenuButton.setPopupCallback(new PopupPanelCallback() {
        @Override
        public JPopupPanel getPopupPanel(
            final JCommandButton commandButton) {
          // JRibbonFrame ribbonFrame = (JRibbonFrame) SwingUtilities
          // .getWindowAncestor(commandButton);
View Full Code Here

Examples of org.pushingpixels.flamingo.api.common.popup.PopupPanelCallback

                availableColumns.add(column);
            }
        }

        if (!availableColumns.isEmpty()) {
            manipulatorButton.setPopupCallback(new PopupPanelCallback() {

                public JPopupPanel getPopupPanel(JCommandButton jcb) {
                    JCommandPopupMenu popup = new JCommandPopupMenu();

                    JCommandMenuButton button;
View Full Code Here

Examples of org.pushingpixels.flamingo.api.common.popup.PopupPanelCallback

        final PluginGeneralActionsManipulator[] plugins = dlh.getPluginGeneralActionsManipulators();
        if (plugins != null && plugins.length > 0) {
            JCommandButton pluginsButton = new JCommandButton(NbBundle.getMessage(DataTableTopComponent.class, "DataTableTopComponent.general.actions.plugins.button.text"), ImageWrapperResizableIcon.getIcon(ImageUtilities.loadImage("org/gephi/desktop/datalab/resources/puzzle--arrow.png", true), new Dimension(16, 16)));
            pluginsButton.setDisplayState(CommandButtonDisplayState.MEDIUM);
            pluginsButton.setCommandButtonKind(JCommandButton.CommandButtonKind.POPUP_ONLY);
            pluginsButton.setPopupCallback(new PopupPanelCallback() {

                public JPopupPanel getPopupPanel(JCommandButton jcb) {
                    JCommandButtonPanel pluginsPanel = new JCommandButtonPanel(CommandButtonDisplayState.BIG);
                    Integer lastManipulatorType = null;
                    int group = 1;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.