Package javax.swing

Examples of javax.swing.JPopupMenu.addPopupMenuListener()


            popup.add(item);
            item.addActionListener(actionListener);
          }
          textComponent.setCaretPosition(span.start);
          textComponent.moveCaretPosition(span.end);
          popup.addPopupMenuListener(new PopupMenuListener() {
            @Override
            public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
            }

            @Override
View Full Code Here


    // If this sub menu is added to a parent
    // then an Listener is added to request show popup events of the parent
    if (ev.getChangeFlags() == HierarchyEvent.PARENT_CHANGED && ev.getChanged() == this) {
      final JPopupMenu parent = (JPopupMenu) getParent();
      if (parent != null) {
        parent.addPopupMenuListener(listener);
      }
      else {
        ((JPopupMenu) ev.getChangedParent()).removePopupMenuListener(listener);
      }
    }
View Full Code Here

      else {
        throw new RuntimeException("no popup menu found!");
      }
    }
    final Object userObject = node.getUserObject();
    popup.addPopupMenuListener(new DelegatingPopupMenuListener(listener, userObject));
    }

  public JMenuItem addRadioItem(final String category, final AFreeplaneAction action, final boolean isSelected) {
    assert action != null;
    final String actionKey = "$" + action.getKey() + '$';
View Full Code Here

            popup.addSeparator();
          }
        }

        // on popup close make more-button unselected
        popup.addPopupMenuListener(new PopupMenuListener() {

          public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
            setSelected(false);
          }
View Full Code Here

    // open the color changing popup 
    if (popupManager != null && e.isPopupTrigger()) {
      setBorder(focusBorder); //TODO: Externalize the color of this?
      JPopupMenu popup = popupManager.getPopup(this);
      popup.show(this, e.getX(), e.getY());
      popup.addPopupMenuListener(new PopupMenuListener() {

        @Override
        public void popupMenuCanceled(PopupMenuEvent arg0) {
          setBorder(EMPTY_BORDER);
        }
View Full Code Here

            nonGemPopupMenu.add(GemCutter.makeNewMenuItem(getTidyTableTopAction()));
            nonGemPopupMenu.add(GemCutter.makeNewMenuItem(getFitTableTopAction()));
        }
       
        // This listener enables/disables the add emitter item and resets the popup location
        nonGemPopupMenu.addPopupMenuListener(new PopupMenuListener() {
           
            public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
               
                // Get the names of all the collectors.
                List<String> sortedReflectorNames = new ArrayList<String>();
View Full Code Here

                   
                        JPopupMenu popup = ((JMenu)evt.getSource()).getPopupMenu();
                        RunDropDownMenuListener menuListener = new RunDropDownMenuListener();
                       
                        // Add the new listener
                        popup.addPopupMenuListener(menuListener);
                        runMenuItem.addChangeListener(menuListener);

                        // Add the menu item to the listeners internal menuitem->gem map
                        DisplayedGem displayedGem = getTableTop().getDisplayedGem(currentGemToRun);
                        menuListener.addMenuItem(runMenuItem, displayedGem);
View Full Code Here

            if (qualificationType == QualificationType.UnqualifiedArgument) {

                gemCodePanel.getVariablesDisplay().selectPanelForArgument(identifier.getName());
                gemCodePanel.getQualificationsDisplay().clearSelection();
                JPopupMenu menu = getArgumentPopupMenu(identifier);
                menu.addPopupMenuListener(editorMenuFocusListener);
                return menu;
            }

            // Qualified symbol ?
            if (qualificationType.isResolvedTopLevelSymbol()) {
View Full Code Here

            // Qualified symbol ?
            if (qualificationType.isResolvedTopLevelSymbol()) {
                gemCodePanel.getQualificationsDisplay().selectPanelForIdentifier(identifier);
                gemCodePanel.getVariablesDisplay().clearSelection();
                JPopupMenu menu = getQualificationPopupMenu(identifier);
                menu.addPopupMenuListener(editorMenuFocusListener);
                return menu;
            }

            // Ambiguity ?
            if (qualificationType == QualificationType.UnqualifiedAmbiguousTopLevelSymbol) {
View Full Code Here

            // Ambiguity ?
            if (qualificationType == QualificationType.UnqualifiedAmbiguousTopLevelSymbol) {
                gemCodePanel.getQualificationsDisplay().selectPanelForIdentifier(identifier);
                gemCodePanel.getVariablesDisplay().clearSelection();
                JPopupMenu menu = getAmbiguityPopupMenu(identifier);
                menu.addPopupMenuListener(editorMenuFocusListener);
                return menu;
            }

            // Local Variable ?
            if (qualificationType == QualificationType.UnqualifiedLocalVariable) {
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.