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

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

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

JPopupMenu.setInvoker介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

JOptionPane.showMessageDialog(this, "Clicked " + mi.getText());
JPopupMenu popupMenu = mnuFile.getPopupMenu();
popupMenu.setInvoker(mnuFile);

代码示例来源:origin: stackoverflow.com

if(popupMenu == null) {
  this.popupMenu = new JScrollPopupMenu();
  popupMenu.setInvoker(this);
  popupListener = createWinListener(popupMenu);

代码示例来源:origin: JGillam/burp-co2

private void showPopup(MouseEvent e) {
    popupMsg.setInvoker(wordList);
    actionRemoveSelected.setEnabled(responseList.getSelectedIndices().length > 0);
    popupMsg.show(e.getComponent(), e.getX(), e.getY());
  }
});

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

public void dispose()
{
  // Menues that are also shown in the main window Session menu might
  // be in this popup. If we don't remove them, the Session won't be Garbage Collected.
  _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();
}

代码示例来源:origin: stackoverflow.com

final JPopupMenu popup = new JPopupMenu();
popup.setLightWeightPopupEnabled(false);
popup.setInvoker(myJFrame);

代码示例来源:origin: realXuJiang/bigtable-sql

public void dispose()
{
  // Menues that are also shown in the main window Session menu might
  // be in this popup. If we don't remove them, the Session won't be Garbage Collected.
  _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();
}

代码示例来源:origin: JGillam/burp-co2

private void showPopup(MouseEvent e) {
    popupBWL.setInvoker(wordList);
    actionCopyAll.setEnabled(wordListModel.getSize() != 0);
    actionRemoveSelected.setEnabled(wordList.getSelectedIndices().length > 0);
    popupBWL.show(e.getComponent(), e.getX(), e.getY());
  }
});

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

/**
 * Lazily creates the popup menu. This method will create the popup using the <code>JScrollPopupMenu</code> class. 
 */
protected void ensurePopupMenuCreated() {
  if(popupMenu == null) {
    this.popupMenu = new JScrollPopupMenu();
    popupMenu.setInvoker(this);
    popupListener = createWinListener(popupMenu);
  }
}

代码示例来源:origin: nroduit/Weasis

private JPopupMenu getLayoutPopupMenuButton(DropDownButton dropDownButton) {
  ActionState layout = eventManager.getAction(ActionW.LAYOUT);
  JPopupMenu popupMouseButtons = new JPopupMenu();
  if (layout instanceof ComboItemListener) {
    JMenu menu = ((ComboItemListener) layout).createUnregisteredRadioMenu("layout"); //$NON-NLS-1$
    popupMouseButtons.setInvoker(dropDownButton);
    Component[] cps = menu.getMenuComponents();
    for (int i = 0; i < cps.length; i++) {
      popupMouseButtons.add(cps[i]);
    }
  }
  return popupMouseButtons;
}

代码示例来源:origin: nroduit/Weasis

@Override
  protected JPopupMenu getPopupMenu() {
    JPopupMenu popupMenu =
      (getMenuModel() == null) ? new JPopupMenu() : getMenuModel().createJPopupMenu();
    popupMenu.setInvoker(this);
    return popupMenu;
  }
};

代码示例来源:origin: nroduit/Weasis

@Override
  protected JPopupMenu getPopupMenu() {
    JPopupMenu m = (getMenuModel() == null) ? new JPopupMenu() : getMenuModel().createJPopupMenu();
    m.setInvoker(this);
    return m;
  }
};

代码示例来源:origin: nroduit/Weasis

@Override
  protected JPopupMenu getPopupMenu() {
    JPopupMenu menu = (getMenuModel() == null) ? new JPopupMenu() : getMenuModel().createJPopupMenu();
    menu.setInvoker(this);
    return menu;
  }
};

代码示例来源:origin: nroduit/Weasis

@Override
  protected JPopupMenu getPopupMenu() {
    JPopupMenu menu = (getMenuModel() == null) ? new JPopupMenu() : getMenuModel().createJPopupMenu();
    menu.setInvoker(this);
    return menu;
  }
};

代码示例来源:origin: nroduit/Weasis

@Override
  protected JPopupMenu getPopupMenu() {
    JPopupMenu menu = (getMenuModel() == null) ? new JPopupMenu() : getMenuModel().createJPopupMenu();
    menu.setInvoker(this);
    return menu;
  }
};

代码示例来源:origin: nroduit/Weasis

@Override
protected JPopupMenu getPopupMenu() {
  JPopupMenu menu = (getMenuModel() == null) ? new JPopupMenu() : getMenuModel().createJPopupMenu();
  menu.setInvoker(this);
  return menu;
}

代码示例来源:origin: nroduit/Weasis

@Override
  protected JPopupMenu getPopupMenu() {
    JPopupMenu menu = (getMenuModel() == null) ? new JPopupMenu() : getMenuModel().createJPopupMenu();
    menu.setInvoker(this);
    return menu;
  }
};

代码示例来源:origin: org.appdapter/org.appdapter.lib.gui

private void ensureSafePopupMenuCreated() {
  try {
    Field f = JMenu.class.getDeclaredField("popupMenu");
    f.setAccessible(true);
    JPopupMenu popupMenu = (JPopupMenu) f.get(this);
    if (!(popupMenu instanceof UISwingReplacement)) {
      SafeJPopupMenu safe;
      popupMenu = safe = new SafeJPopupMenu();
      safe.userObject = this;//.userObject our user object may not be populated yet 
      f.set(this, popupMenu);
      popupMenu.setInvoker(this);
      popupListener = createWinListener(popupMenu);
    }
  } catch (NoSuchFieldException t) {
    Debuggable.warn("Fields = " + Debuggable.toInfoStringA(JMenu.class.getDeclaredFields(), ",", 3));
  } catch (Throwable t) {
    throw Debuggable.reThrowable(t);
  }
}

代码示例来源:origin: nroduit/Weasis

private JPopupMenu getPopupMenuScroll(DropDownButton dropButton) {
  String type = dropButton.getType();
  JPopupMenu popupMouseScroll = new JPopupMenu(type);
  popupMouseScroll.setInvoker(dropButton);
  ButtonGroup groupButtons = new ButtonGroup();
  SliderChangeListener[] actions = getActions();
  for (int i = 0; i < actions.length; i++) {
    JRadioButtonMenuItem radio = new JRadioButtonMenuItem(actions[i].toString(),
      actions[i].getActionW().getSmallIcon(), actions[i].equals(currentAction));
    radio.setActionCommand(Integer.toString(i));
    radio.addActionListener(this);
    popupMouseScroll.add(radio);
    groupButtons.add(radio);
  }
  return popupMouseScroll;
}

代码示例来源:origin: sc.fiji/Simple_Neurite_Tracer

@Override
  public void actionPerformed(final ActionEvent e) {
    if (!swcTypesMenu.isVisible()) {
      final Point p = swcTypesButton.getLocationOnScreen();
      swcTypesMenu.setInvoker(swcTypesButton);
      swcTypesMenu.setLocation((int) p.getX(), (int) p.getY() + swcTypesButton.getHeight());
      swcTypesMenu.setVisible(true);
    } else {
      swcTypesMenu.setVisible(false);
    }
  }
});

代码示例来源:origin: nroduit/Weasis

private JPopupMenu getPopupMenuScroll(DropDownButton dropButton) {
  String type = dropButton.getType();
  String action = eventManager.getMouseActions().getAction(type);
  JPopupMenu popupMouseScroll = new JPopupMenu(type);
  popupMouseScroll.setInvoker(dropButton);
  ButtonGroup groupButtons = new ButtonGroup();
  for (int i = 0; i < actionsScroll.length; i++) {
    if (eventManager.isActionRegistered(actionsScroll[i])) {
      JRadioButtonMenuItem radio = new JRadioButtonMenuItem(actionsScroll[i].getTitle(),
        actionsScroll[i].getIcon(), actionsScroll[i].cmd().equals(action));
      radio.setActionCommand(actionsScroll[i].cmd());
      radio.addActionListener(this);
      popupMouseScroll.add(radio);
      groupButtons.add(radio);
    }
  }
  return popupMouseScroll;
}

相关文章

JPopupMenu类方法