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

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

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

JPopupMenu.remove介绍

暂无

代码示例

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

@Override
public void remove(JMenuItem item) {
  if(popupMenu != null){
    popupMenu.remove(item);
  }
}

代码示例来源:origin: org.cytoscape/swing-application-impl

private void removeFactory(TaskFactory factory) {
  JMenuItem item = popupMap.remove(factory);
  if (item != null)
    popup.remove(item);
  CyAction action = popupActions.remove(factory);
  if (action != null)
    popup.removePopupMenuListener(action);
}

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

@Override
public void remove(Component c) {
  if(popupMenu != null){
    popupMenu.remove(c);
  }
}

代码示例来源:origin: org.cytoscape/vizmap-gui-impl

public void onTaskFactoryUnregistered(final TaskFactory taskFactory, final Map<?, ?> properties) {
  final JMenuItem menuItem = taskFactories.remove(taskFactory);
  
  if (menuItem != null) {
    vizMapperMainPanel.getMainMenu().remove(menuItem);
    vizMapperMainPanel.getEditSubMenu().remove(menuItem);
    
    if (menuItem.getAction() instanceof PopupMenuListener) {
      vizMapperMainPanel.getMainMenu().removePopupMenuListener((PopupMenuListener)menuItem.getAction());
      vizMapperMainPanel.getContextMenu().removePopupMenuListener((PopupMenuListener)menuItem.getAction());
    }
  }
}

代码示例来源:origin: org.everit.osgi.dev/org.everit.osgi.dev.richconsole

@Override
public void removeMenuItemFromContextMenu(final JMenuItem menuItem) {
  jPopupMenu.remove(menuItem);
}

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

popupMenu.remove(pos);

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

@Override
public void remove(int pos) {
  if(pos < 0) {
    throw new IllegalArgumentException("index less than zero.");
  }
  if(pos > getItemCount()) {
    throw new IllegalArgumentException("index greater than the number of items.");
  }
  if(popupMenu != null){
    popupMenu.remove(pos);
  }
}

代码示例来源:origin: org.cytoscape/swing-util-api

@Override
public void removeComponent(final Component component) {
  if (componentGravity.remove(component) != null)
    menu.remove(menu.getComponentIndex(component));
}

代码示例来源:origin: org.openspml/openspml

/**
 * Remove a JMenuItem from a JPopupMenu.
 */
public static void removeItem(JPopupMenu popup, String name) {
JMenuItem item = findItem(popup, name);
if (item != null)
  popup.remove(item);
}

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

protected void initPopup() {
  if (popupMenu == null) {
    popupMenu = new JPopupMenu("TabPopup");
    popupMenu.add(new SelectNextTabAction());
    popupMenu.add(new SelectPreviousTabAction());
    popupMenu.addSeparator();
  }
  for (int i = 3, size = popupMenu.getComponentCount(); i < size; i++)
    popupMenu.remove(3);
  for (ToolWindowTab tab : toolWindow.getToolWindowTabs())
    popupMenu.add(new SelectTabAction(tab));
}

代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf

protected void enableUserDefined() {
  DockedTypeDescriptor descriptor = (DockedTypeDescriptor) toolWindow.getTypeDescriptor(ToolWindowType.DOCKED);
  if (old != null) {
    popupMenu.remove(old);
  }
  JMenu menu = descriptor.getToolsMenu();
  if (menu.getMenuComponentCount() > 0) {
    popupMenu.add(menu, 4);
    old = menu;
  }
}

代码示例来源:origin: org.apache.airavata/airavata-xbaya-gui

private void prepareNodePopupMenu(Node node) {
  this.nodePopup.remove(rerunItem);
  this.nodePopup.remove(breakPointItem);
  if (this.engine.getGUI().getWorkflow().getExecutionState() == WorkflowExecutionState.PAUSED && !(node instanceof InputNode)) {
    this.nodePopup.add(rerunItem);
  }
  if (this.engine.getGUI().getWorkflow().getExecutionState() != WorkflowExecutionState.NONE) {
    if (node.isBreak()) {
      breakPointItem.setText("Remove break Point");
    } else {
      breakPointItem.setText("Add break Point");
    }
    this.nodePopup.add(breakPointItem);
  }
  }

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction(jsDoc = REMOVE_JSDOC, params = {"component"})
@Override
public void remove(JComponent aComp) {
  super.remove(aComp);
  super.revalidate();
  super.repaint();
}

代码示例来源:origin: org.orbisgis/orbisgis-view

@Override
public void remove(Component component) {
    if(getComponentPopupMenu()==null) {
        super.remove(component);
    } else {
        getComponentPopupMenu().remove(component);
    }
}

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

public void remove(int index) {
  // can't remove the scrollbar
  ++index;
  super.remove(index);
  if(maximumVisibleRows >= getComponentCount()-1) {
    getScrollBar().setVisible(false);
  }
}

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

@Override
public void remove(Component component) {
    if(getComponentPopupMenu()==null) {
        super.remove(component);
    } else {
        getComponentPopupMenu().remove(component);
    }
}

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

@Override
public void remove(int index) {
  // can't remove the scrollbar
  ++index;
  super.remove(index);
  if (maximumVisibleRows >= getComponentCount() - 1) {
    getScrollBar().setVisible(false);
  }
}

代码示例来源:origin: girtel/Net2Plan

public void remove(int index)
{
  // can't remove the scrollbar
  ++index;
  super.remove(index);
  if (maximumVisibleRows >= getComponentCount() - 1)
  {
    getScrollBar().setVisible(false);
  }
}

代码示例来源:origin: xyz.cofe/docking-frames-core

/**
 * Removes an action from the list of all known actions.
 * @param index the location of the action
 */
private void remove( int index ){
  DockAction action = actions.remove( index );
  DropDownItemHandle item = items.remove( action );
  if( item != null ){
    if( item.getView().getItem() != null ){
      menu.remove( item.getView().getItem() );
    }
    item.unbind();
  }
}

代码示例来源:origin: org.zaproxy/zap

/**
 * Removes all separators from the given pop up menu.
 * 
 * @param popupMenu the pop up menu whose separators will be removed
 * @see javax.swing.JPopupMenu.Separator
 */
public static void removeAllSeparators(JPopupMenu popupMenu) {
  for (int i = 0; i < popupMenu.getComponentCount(); i++) {
    if (isPopupMenuSeparator(popupMenu.getComponent(i))) {
      popupMenu.remove(i);
      i--;
    }
  }
}

相关文章

JPopupMenu类方法