Package javax.swing

Examples of javax.swing.JPopupMenu$PopupMouseEventPreprocessor


            Rectangle rect = cti.getBounds();
            if (rect.contains(e.getPoint())) {
                Component c = (Component) getSelectedComponent();
                if (c != null) {
                    if (popup == null) {
                        popup = new JPopupMenu(""); //$NON-NLS-1$
                    }
                    popup.setLabel(getTitleAt(getSelectedIndex()));
                    popup.invalidate();
                    popup.removeAll();
                    Action action;
View Full Code Here


  class ExpandToolBarToggleButton extends JButton implements ActionListener {
    JPopupMenu popup;

    ExpandToolBarToggleButton() {
      super(new ArrowIcon(SwingConstants.SOUTH));
      popup = new JPopupMenu();
      addActionListener(this);
      addMouseListener(new MouseAdapter() {

        public void mouseEntered(MouseEvent e) {
            if(isEnabled()) {
View Full Code Here

        // Grab the focus, this should deselect any other selected fields.
        requestFocus();

        // If the popup has never been show before - then build it
        if (popup == null) {
            popup = new JPopupMenu("Clipboard");
            popup.add(cutAction = new CutAction());
            popup.add(copyAction = new CopyAction());
            popup.add(pasteAction = new PasteAction());
            popup.add(deleteAction = new DeleteAction());
            popup.addSeparator();
View Full Code Here

     * columns. It will associate each tablecolumn with an ColumnKeeper in
     * charge of adding and removing the tablecolumn.
     */
private void createPopupMenu() {
        //Iterator it = mapTableColumnColumnKeeper.keySet().iterator();
        popupMenu = new JPopupMenu();
        TableColumnModel tcModel = this.getTable().getColumnModel();
        // int nbCol = tcModel.getColumnCount();

        //int nbCol = mapTableColumnColumnKeeper.keySet().size();
        for (Iterator entries = mapTableColumnColumnKeeper.entrySet().iterator(); entries.hasNext();) {
View Full Code Here

    }

    /** Create a popup menu when mous click */
    private void createPopupMenu(int x, int y, boolean all) {
        JPopupMenu menu = new JPopupMenu();
        Action[] popupMenuActions = getPopupMenuActions();
        myUIFacade.showPopupMenu(this, popupMenuActions, x - hbar.getValue()
                + (vbar.isVisible() ? vbar.getWidth() : 0), y - vbar.getValue()
                + 20);
    }
View Full Code Here

      new TextComponentClipboardMenu(downloadTextField, language);
      new TextComponentClipboardMenu(downloadPrefixTextField, language);
      final TextComponentClipboardMenu tcmenu = new TextComponentClipboardMenu(downloadDirTextField, language);

      final JPopupMenu menu = tcmenu.getPopupMenu();

      menu.addSeparator();
      menu.add(downloadDirRecentMenu);
      downloadDirRecentMenu.addMenuListener(listener);

      downloadToolBar.setRollover(true);
      downloadToolBar.setFloatable(false);
View Full Code Here

        default: return Choice.CANCEL;
        }
    }

    public void showPopupMenu(Component invoker, Action[] actions, int x, int y) {
        JPopupMenu menu = new JPopupMenu();
        for (int i = 0; i < actions.length; i++) {
            Action next = actions[i];
            if (next == null) {
                menu.addSeparator();
            } else {
                menu.add(next);
            }
        }
        menu.applyComponentOrientation(getLanguage().getComponentOrientation());
        menu.show(invoker, x, y);
    }
View Full Code Here

    }
  }

  /* creates the popup menu for the column management */
    private void createPopup() {
      popupMenu = new JPopupMenu();
   
      /* show columns list */
      ArrayList cols = ttModel.getColumns();
      ResourceColumn col;
    int size = cols.size();
View Full Code Here

  @Override
  public void actionPerformed(ActionEvent e) {
    final Collection<AnalyzerBeanDescriptor<?>> descriptors = _configuration.getDescriptorProvider()
        .getAnalyzerBeanDescriptors();

    final JPopupMenu popup = new DescriptorPopupMenu<AnalyzerBeanDescriptor<?>>(descriptors) {

      private static final long serialVersionUID = 1L;

      @Override
      protected JMenuItem createMenuItem(final AnalyzerBeanDescriptor<?> descriptor) {
        if (descriptor.getAnnotation(OutputWriterAnalyzer.class) != null) {
          return null;
        }
        if (descriptor.isExploringAnalyzer()) {
          return null;
        }
        JMenuItem menuItem = new DescriptorMenuItem(descriptor);
        menuItem.addActionListener(new ActionListener() {
          @SuppressWarnings("unchecked")
          @Override
          public void actionPerformed(ActionEvent e) {
            Class<?> analyzerClass = descriptor.getComponentClass();
            if (descriptor.isExploringAnalyzer()) {
              _analysisJobBuilder.addExploringAnalyzer((Class<? extends ExploringAnalyzer<?>>) analyzerClass);
            } else {
              _analysisJobBuilder
                  .addRowProcessingAnalyzer((Class<? extends RowProcessingAnalyzer<?>>) analyzerClass);
            }

            UsageLogger.getInstance().log("Add analyzer: " + descriptor.getDisplayName());
          }
        });

        return menuItem;
      }
    };

    Component source = (Component) e.getSource();
    popup.show(source, 0, source.getHeight());
  }
View Full Code Here

  @Override
  public void actionPerformed(ActionEvent e) {
    final Collection<FilterBeanDescriptor<?, ?>> descriptors = _configuration.getDescriptorProvider()
        .getFilterBeanDescriptors();

    final JPopupMenu popup = new DescriptorPopupMenu<FilterBeanDescriptor<?, ?>>(descriptors) {

      private static final long serialVersionUID = 1L;

      @Override
      protected JMenuItem createMenuItem(final FilterBeanDescriptor<?, ?> descriptor) {
        JMenuItem menuItem = new DescriptorMenuItem(descriptor);
        menuItem.addActionListener(new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            _analysisJobBuilder.addFilter(descriptor);

            UsageLogger.getInstance().log("Add filter: " + descriptor.getDisplayName());

            _filterListPanel.updateUI();
          }
        });
        return menuItem;
      }
    };

    final Component source = (Component) e.getSource();
    popup.show(source, 0, source.getHeight());
  }
View Full Code Here

TOP

Related Classes of javax.swing.JPopupMenu$PopupMouseEventPreprocessor

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.