Package javax.swing

Examples of javax.swing.JPopupMenu$AccessibleJPopupMenu


     
      private void showPopup(MouseEvent e) {
        
         if (e.isPopupTrigger()) {
          
           JPopupMenu popup_menu = new JPopupMenu();
         
           popup_menu.add(column_setup);
          
           popup_menu.show(e.getComponent(), e.getX(), e.getY());
         }
      } 
View Full Code Here


            actions = AbstractNodeAction.getActions(n.getGraphObject(), null);
        }
        if (actions == null) {
            return;
        }
        JPopupMenu popup = new JPopupMenu();
        for (Object c : actions) {
            if (c == null) {
                popup.add(new JSeparator());
            } else if (c instanceof String) {
                popup.add(createSubMenu(n, (String) c, x ,y));
            } else if (c instanceof Class) {
                AbstractNodeAction aa = AbstractNodeAction.createAction(
                        (Class<?>) c, n);
                aa.setLocation(this, x, y);
                JMenuItem jmi = new JMenuItem(aa);
                popup.add(jmi);
            }
        }
        popup.show(this, x, y);
    }
View Full Code Here

    if (action == null)
    {
      throw new IllegalArgumentException("Null Action passed");
    }

    final JPopupMenu pop = getPopup(dboType, true);
    pop.add(action);
  }
View Full Code Here

    _globalPopup.add(action);
    _globalActions.add(action);

    for (Iterator<JPopupMenu> it = _popups.values().iterator(); it.hasNext();)
    {
      JPopupMenu pop = it.next();
      pop.add(action);
    }
  }
View Full Code Here

    if (menu == null)
    {
      throw new IllegalArgumentException("JMenu == null");
    }

    final JPopupMenu pop = getPopup(dboType, true);
    pop.add(menu);
  }
View Full Code Here

    _globalPopup.add(menu);
    _globalActions.add(menu.getAction());

    for (Iterator<JPopupMenu> it = _popups.values().iterator(); it.hasNext();)
    {
      JPopupMenu pop = it.next();
      pop.add(menu);
    }
  }
View Full Code Here

    if (dboType == null)
    {
      throw new IllegalArgumentException("Null DatabaseObjectType passed");
    }
    IIdentifier key = dboType.getIdentifier();
    JPopupMenu pop = _popups.get(key);
    if (pop == null && create)
    {
      pop = new JPopupMenu();
      _popups.put(key, pop);
      for (Iterator<Action> it = _globalActions.iterator(); it.hasNext();)
      {
        pop.add(it.next());
      }
    }
    return pop;
  }
View Full Code Here

          sameType = false;
          break;
        }
      }

      JPopupMenu pop = null;
      if (sameType)
      {
        pop = getPopup(dboType, false);
      }
      if (pop == null)
      {
        pop = _globalPopup;
      }
      pop.show(this, x, y);
    }
  }
View Full Code Here

    _globalPopup.removeAll();
    _globalPopup.setInvoker(null);
    _globalActions.clear();
    for(Iterator<JPopupMenu> i=_popups.values().iterator(); i.hasNext();)
    {
      JPopupMenu popup = i.next();
      popup.removeAll();
      popup.setInvoker(null);
    }
    _popups.clear();
  }
View Full Code Here

    return _releaseVersionWillChange;
  }
  
  
   private void initPopup() {
      final JPopupMenu popup = new JPopupMenu(i18n.INSTALL_OPTIONS_LABEL);
     
      JMenuItem pluginItem = new JMenuItem(i18n.ALL_PLUGINS_LABEL);
      pluginItem.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent e) {
            for (ArtifactStatus status : _artifacts) {
               if (status.isPluginArtifact()) {
                  status.setArtifactAction(ArtifactAction.INSTALL);
               }
            }
            _model.fireTableDataChanged();
         }
      });
      JMenuItem translationItem = new JMenuItem(i18n.ALL_TRANSLATIONS_LABEL);
      translationItem.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent e) {
            for (ArtifactStatus status : _artifacts) {
               if (status.isTranslationArtifact()) {
                  status.setArtifactAction(ArtifactAction.INSTALL);
               }
            }
            _model.fireTableDataChanged();
         }
      });
                 
      popup.add(pluginItem);
      popup.add(translationItem);
     
      addMouseListener(new MouseAdapter() {
         public void mousePressed(MouseEvent event){
          if(popup.isPopupTrigger(event)){
           popup.show(event.getComponent(), event.getX(),event.getY());
          }
         }
         public void mouseReleased(MouseEvent event){
          if(popup.isPopupTrigger(event)){
           popup.show(event.getComponent(), event.getX(),event.getY());
          }
         }
        });           
   }
View Full Code Here

TOP

Related Classes of javax.swing.JPopupMenu$AccessibleJPopupMenu

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.