javax.swing.JPopupMenu.addPopupMenuListener()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中javax.swing.JPopupMenu.addPopupMenuListener()方法的一些代码示例,展示了JPopupMenu.addPopupMenuListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JPopupMenu.addPopupMenuListener()方法的具体详情如下:
包路径:javax.swing.JPopupMenu
类名称:JPopupMenu
方法名:addPopupMenuListener

JPopupMenu.addPopupMenuListener介绍

暂无

代码示例

代码示例来源:origin: skylot/jadx

private void addMenuItems(JClass jCls) {
  Action findUsage = new FindUsageAction(contentPanel, this, jCls);
  JPopupMenu popup = getPopupMenu();
  popup.addSeparator();
  popup.add(findUsage);
  popup.addPopupMenuListener((PopupMenuListener) findUsage);
}

代码示例来源:origin: magefree/mage

menu.addPopupMenuListener(new PopupMenuListener() {
  @Override
  public void popupMenuWillBecomeVisible(PopupMenuEvent e) {

代码示例来源:origin: org.netbeans.api/org-openide-awt

@Override
public void mousePressed( MouseEvent e ) {
  popupMenuOperation = false;
  JPopupMenu menu = getPopupMenu();
  if ( menu != null && getModel() instanceof Model ) {
    Model model = (Model) getModel();
    if ( !model._isPressed() ) {
      if( isInArrowArea( e.getPoint() ) && menu.getComponentCount() > 0 ) {
        model._press();
        menu.addPopupMenuListener( getMenuListener() );
        menu.show( DropDownButton.this, 0, getHeight() );
        popupMenuOperation = true;
      }
    } else {
      model._release();
      menu.removePopupMenuListener( getMenuListener() );
      popupMenuOperation = true;
    }
  }
}

代码示例来源:origin: org.netbeans.api/org-openide-awt

@Override
public void mousePressed( MouseEvent e ) {
  popupMenuOperation = false;
  JPopupMenu menu = getPopupMenu();
  if ( menu != null && getModel() instanceof Model ) {
    Model model = (Model) getModel();
    if ( !model._isPressed() ) {
      if( isInArrowArea( e.getPoint() ) && menu.getComponentCount() > 0 ) {
        model._press();
        menu.addPopupMenuListener( getMenuListener() );
        menu.show( DropDownToggleButton.this, 0, getHeight() );
        popupMenuOperation = true;
      }
    } else {
      model._release();
      menu.removePopupMenuListener( getMenuListener() );
      popupMenuOperation = true;
    }
  }
}

代码示例来源:origin: org.netbeans.api/org-openide-awt

if (popupMenu != null) {
  final JPopupMenu dummy = new JPopupMenu();
  dummy.addPopupMenuListener(new PopupMenuListener() {
    @Override
    public void popupMenuWillBecomeVisible(PopupMenuEvent e) {

代码示例来源:origin: i2p/i2p.i2p

menu.addPopupMenuListener(new PopupMenuListener() {
  public void popupMenuCanceled(PopupMenuEvent e)            { /* frame.setVisible(false); */ }
  public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { frame.setVisible(false); }

代码示例来源:origin: com.fifesoft.rtext/fife.common

/**
 * Adds a listener to this menu button's popup menu.
 *
 * @param l The listener to add.
 * @see #removePopupMenuListener(PopupMenuListener)
 */
public void addPopupMenuListener(PopupMenuListener l) {
  popupMenu.addPopupMenuListener(l);
}

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

public void setPopupMenu(JPopupMenu popupMenu) {
  if (this.popupMenu != null) {
    popupMenu.removePopupMenuListener(handler);
  }
  this.popupMenu = popupMenu;
  if (this.popupMenu != null) {
    popupMenu.addPopupMenuListener(handler);
  }
}

代码示例来源:origin: tulskiy/musique

public final void setJPopupMenu(JPopupMenu menu) {
    if (this.menu != null) {
      this.menu.removePopupMenuListener(popupListener);
    }
    this.menu = menu;
    menu.addPopupMenuListener(popupListener);
  }
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-widgets

protected void createPopup() {
  $objectMap.put("popup", popup = new JPopupMenu());
  
  popup.setName("popup");
  popup.addPopupMenuListener(JAXXUtil.getEventListener(PopupMenuListener.class, "popupMenuCanceled", this, "doPopupMenuCanceled__on__popup"));
  popup.addPopupMenuListener(JAXXUtil.getEventListener(PopupMenuListener.class, "popupMenuWillBecomeInvisible", this, "doPopupMenuWillBecomeInvisible__on__popup"));
  popup.addPopupMenuListener(JAXXUtil.getEventListener(PopupMenuListener.class, "popupMenuWillBecomeVisible", this, "doPopupMenuWillBecomeVisible__on__popup"));
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-widgets

protected void createPopup() {
  $objectMap.put("popup", popup = new JPopupMenu());
  
  popup.setName("popup");
  popup.addPopupMenuListener(JAXXUtil.getEventListener(PopupMenuListener.class, "popupMenuCanceled", this, "doPopupMenuCanceled__on__popup"));
  popup.addPopupMenuListener(JAXXUtil.getEventListener(PopupMenuListener.class, "popupMenuWillBecomeInvisible", this, "doPopupMenuWillBecomeInvisible__on__popup"));
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-runtime-swing-widget

protected void createPopup() {
  popup = new javax.swing.JPopupMenu();
  $objectMap.put("popup", popup);
  popup.setName("popup");
  popup.addPopupMenuListener((javax.swing.event.PopupMenuListener) jaxx.runtime.Util.getEventListener(javax.swing.event.PopupMenuListener.class, "popupMenuCanceled", content, "doPopupMenuCanceled__on__popup"));
  popup.addPopupMenuListener((javax.swing.event.PopupMenuListener) jaxx.runtime.Util.getEventListener(javax.swing.event.PopupMenuListener.class, "popupMenuWillBecomeInvisible", content, "doPopupMenuWillBecomeInvisible__on__popup"));
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-widgets

protected void createPopup() {
  $objectMap.put("popup", popup = new JPopupMenu());
  
  popup.setName("popup");
  popup.addPopupMenuListener(JAXXUtil.getEventListener(PopupMenuListener.class, "popupMenuCanceled", this, "doPopupMenuCanceled__on__popup"));
  popup.addPopupMenuListener(JAXXUtil.getEventListener(PopupMenuListener.class, "popupMenuWillBecomeInvisible", this, "doPopupMenuWillBecomeInvisible__on__popup"));
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-runtime-swing-widget

protected void createPopup() {
  popup = new javax.swing.JPopupMenu();
  $objectMap.put("popup", popup);
  popup.setName("popup");
  popup.addPopupMenuListener((javax.swing.event.PopupMenuListener) jaxx.runtime.Util.getEventListener(javax.swing.event.PopupMenuListener.class, "popupMenuCanceled", $Table0, "doPopupMenuCanceled__on__popup"));
  popup.addPopupMenuListener((javax.swing.event.PopupMenuListener) jaxx.runtime.Util.getEventListener(javax.swing.event.PopupMenuListener.class, "popupMenuWillBecomeInvisible", $Table0, "doPopupMenuWillBecomeInvisible__on__popup"));
}

代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java16

/**
 * Private constructor so users use the more action-oriented
 * {@link #install} method.
 */
private ComboBoxPopupLocationFix(JComboBox comboBox) {
  this.comboBox = comboBox;
  this.popupMenu = (JPopupMenu)comboBox.getUI().getAccessibleChild(comboBox, 0);
  popupMenu.addPopupMenuListener(listener);
}

代码示例来源:origin: com.haulmont.thirdparty/glazedlists

/**
 * Private constructor so users use the more action-oriented
 * {@link #install} method.
 */
private ComboBoxPopupLocationFix(JComboBox comboBox) {
  this.comboBox = comboBox;
  this.popupMenu = (JPopupMenu)comboBox.getUI().getAccessibleChild(comboBox, 0);
  popupMenu.addPopupMenuListener(listener);
}

代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java15

/**
 * Private constructor so users use the more action-oriented
 * {@link #install} method.
 */
private ComboBoxPopupLocationFix(JComboBox comboBox) {
  this.comboBox = comboBox;
  this.popupMenu = (JPopupMenu)comboBox.getUI().getAccessibleChild(comboBox, 0);
  popupMenu.addPopupMenuListener(listener);
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-desktop

/**
 * Private constructor so users use the more action-oriented
 * {@link #install} method.
 */
private MacOSXPopupLocationFix(JComboBox comboBox) {
  this.comboBox = comboBox;
  this.popupMenu = (JPopupMenu)comboBox.getUI().getAccessibleChild(comboBox, 0);
  
  popupMenu.addPopupMenuListener(listener);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/skinlf

/**
 * Description of the Method
 */
public void installListeners() {
 super.installListeners();
 if (Boolean.TRUE.equals(UIManager.get("PopupMenu.animation"))) {
  popupMenu.addAncestorListener(m_AncestorListener = new SkinPopupAncestorListener());
  popupMenu.addPopupMenuListener(m_PopupListener = new SkinPopupMenuListener());
 }
}

代码示例来源:origin: freeplane/freeplane

@Override
public void visit(Entry target) {
  nodePopupMenu.addPopupMenuListener(new PopupMenuListenerForEntry(target, popupListener));
  new EntryAccessor().setComponent(target, nodePopupMenu);
}

相关文章

JPopupMenu类方法