Examples of PrimaryRolloverCallback


Examples of org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenuEntryPrimary.PrimaryRolloverCallback

      public void addChild(Object child, ChildProperties properties) {
      }

      private PrimaryRolloverCallback getCallback(final RibbonApplicationMenuEntryPrimary primeEntry) {
        if (rolloverCallback == null) {
          rolloverCallback = new PrimaryRolloverCallback() {
            public void menuEntryActivated(JPanel targetPanel) {
              targetPanel.removeAll();
              targetPanel.setLayout(new BorderLayout());
              JCommandButtonPanel secondary = new JRibbonApplicationMenuPopupPanelSecondary(primeEntry);
              secondary.setToShowGroupLabels(false);
View Full Code Here

Examples of org.pushingpixels.flamingo.api.ribbon.RibbonApplicationMenuEntryPrimary.PrimaryRolloverCallback

            commandButton
                .addRolloverActionListener(new RolloverActionListener() {
                  @Override
                  public void actionPerformed(ActionEvent e) {
                    // System.out.println("Rollover action");
                    PrimaryRolloverCallback callback = menuEntry
                        .getRolloverCallback();
                    if (callback != null) {
                      callback
                          .menuEntryActivated(panelLevel2);
                    } else {
                      // default callback?
                      PrimaryRolloverCallback defaultCallback = ribbonAppMenu
                          .getDefaultCallback();
                      if (defaultCallback != null) {
                        defaultCallback
                            .menuEntryActivated(panelLevel2);
                      } else {
                        panelLevel2.removeAll();
                        panelLevel2.revalidate();
                        panelLevel2.repaint();
                      }
                    }
                    panelLevel2
                        .applyComponentOrientation(applicationMenuPopupPanel
                            .getComponentOrientation());
                  }
                });
          } else {
            // register a core callback to populate the second level
            // panel with secondary menu items
            final PrimaryRolloverCallback coreCallback = new PrimaryRolloverCallback() {
              @Override
              public void menuEntryActivated(JPanel targetPanel) {
                targetPanel.removeAll();
                targetPanel.setLayout(new BorderLayout());
                JRibbonApplicationMenuPopupPanelSecondary secondary = new JRibbonApplicationMenuPopupPanelSecondary(
                    menuEntry) {
                  @Override
                  public void removeNotify() {
                    super.removeNotify();
                    commandButton.getPopupModel()
                        .setPopupShowing(false);
                  }
                };
                secondary
                    .applyComponentOrientation(applicationMenuPopupPanel
                        .getComponentOrientation());
                targetPanel.add(secondary, BorderLayout.CENTER);
              }
            };
            commandButton
                .addRolloverActionListener(new RolloverActionListener() {
                  @Override
                  public void actionPerformed(ActionEvent e) {
                    coreCallback
                        .menuEntryActivated(panelLevel2);
                    // emulate showing the popup so the
                    // button remains "selected"
                    commandButton.getPopupModel()
                        .setPopupShowing(true);
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.