当前位置: 首页>>代码示例>>Java>>正文


Java JPopupMenu.addSeparator方法代码示例

本文整理汇总了Java中javax.swing.JPopupMenu.addSeparator方法的典型用法代码示例。如果您正苦于以下问题:Java JPopupMenu.addSeparator方法的具体用法?Java JPopupMenu.addSeparator怎么用?Java JPopupMenu.addSeparator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JPopupMenu的用法示例。


在下文中一共展示了JPopupMenu.addSeparator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: maybeShowPopup

import javax.swing.JPopupMenu; //导入方法依赖的package包/类
private void maybeShowPopup(MouseEvent e) {
	if (e.isPopupTrigger()) {
		JPopupMenu popupMenu = new JPopupMenu();
		popupMenu.setFocusable(false);

		popupMenu.add(jMenuItemUndo);
		popupMenu.add(jMenuItemRedo);
		popupMenu.addSeparator();
		popupMenu.add(jMenuItemCut);
		popupMenu.add(jMenuItemCopy);
		popupMenu.add(jMenuItemPaste);
		popupMenu.addSeparator();
		if (jMenuItemInsCell.getAction().isEnabled()) {
			popupMenu.add(jMenuItemInsCell);
			jMenuItemInsCell.setEnabled(true);
			popupMenu.add(jMenuItemInsRow);
			jMenuItemInsRow.setEnabled(true);
			popupMenu.addSeparator();
		}
		popupMenu.add(jMenuItemProp);
		popupMenu.show(e.getComponent(), e.getX(), e.getY());

	}
}
 
开发者ID:ser316asu,项目名称:Reinickendorf_SER316,代码行数:25,代码来源:HTMLEditor.java

示例2: buildPopup

import javax.swing.JPopupMenu; //导入方法依赖的package包/类
@Override
public JPopupMenu buildPopup(int row) {
  final JPopupMenu m = new JPopupMenu();
  final Action playAction = new Player.LaunchAction(ModuleManagerWindow.this, file);
  playAction.setEnabled(!Info.isModuleTooNew(metadata.getVassalVersion()));
  m.add(playAction);
  final Action editAction = new Editor.ListLaunchAction(ModuleManagerWindow.this, file);
  editAction.setEnabled(!Info.isModuleTooNew(metadata.getVassalVersion()));
  m.add(editAction);
  m.add(new AbstractAction(Resources.getString("General.remove")) {
    private static final long serialVersionUID = 1L;

    public void actionPerformed(ActionEvent e) {
      removeModule(file);
      cleanupTileCache();
    }
  });

  m.addSeparator();
  m.add(addFolderAction);
  m.addSeparator();
  m.add(newExtensionAction);
  m.add(addExtensionAction);
  return m;
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:26,代码来源:ModuleManagerWindow.java

示例3: createPopupMenu

import javax.swing.JPopupMenu; //导入方法依赖的package包/类
/**
 * Creates a popup menu for the resource tree.
 * @param node tree node that the mouse is over
 */
JPopupMenu createPopupMenu(TreeNode node) {
    JPopupMenu res = new JPopupMenu();
    res.setFocusable(false);
    res.add(getActions().getNewAction(getResourceKind()));
    if (node instanceof ResourceTreeNode) {
        res.add(getActions().getEditAction(getResourceKind()));
        res.addSeparator();
        res.add(getActions().getCopyAction(getResourceKind()));
        res.add(getActions().getDeleteAction(getResourceKind()));
        res.add(getActions().getRenameAction(getResourceKind()));
        if (getResourceKind().isEnableable()) {
            res.addSeparator();
            res.add(getActions().getEnableAction(getResourceKind()));
        }
    }
    return res;
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:22,代码来源:AbstractResourceTree.java

示例4: build

import javax.swing.JPopupMenu; //导入方法依赖的package包/类
/**
 * This method builds the popup menu.
 */
private void build(ActionMap actionMap) {
    
    popupPresenter = new JPopupMenu();
    
    cutAction = actionMap.get(DefaultEditorKit.cutAction);
    copyAction = actionMap.get(DefaultEditorKit.copyAction);
    pasteAction = actionMap.get(DefaultEditorKit.pasteAction);
    selectAllAction = actionMap.get(DefaultEditorKit.selectAllAction);
    
    popupPresenter.add(createMenuItem("CTL_MenuItem_Cut", KeyEvent.VK_X, cutAction));
    popupPresenter.add(createMenuItem("CTL_MenuItem_Copy", KeyEvent.VK_C, copyAction));
    popupPresenter.add(createMenuItem("CTL_MenuItem_Paste", KeyEvent.VK_V, pasteAction));
    popupPresenter.addSeparator();
    popupPresenter.add(createMenuItem("CTL_MenuItem_SelectAll", KeyEvent.VK_A, selectAllAction));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:CommitPopupBuilder.java

示例5: maybeShowPopup

import javax.swing.JPopupMenu; //导入方法依赖的package包/类
private void maybeShowPopup(MouseEvent e) {
    if (e.isPopupTrigger()) {
        JPopupMenu popupMenu = new JPopupMenu();
        popupMenu.setFocusable(false);

        popupMenu.add(jMenuItemUndo);
        popupMenu.add(jMenuItemRedo);
        popupMenu.addSeparator();
        popupMenu.add(jMenuItemCut);
        popupMenu.add(jMenuItemCopy);
        popupMenu.add(jMenuItemPaste);
        popupMenu.addSeparator();
        if (jMenuItemInsCell.getAction().isEnabled()) {
            popupMenu.add(jMenuItemInsCell);
            jMenuItemInsCell.setEnabled(true);
            popupMenu.add(jMenuItemInsRow);
            jMenuItemInsRow.setEnabled(true);
            popupMenu.addSeparator();
        }
        popupMenu.add(jMenuItemProp);
        popupMenu.show(e.getComponent(), e.getX(), e.getY());

    }
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:25,代码来源:HTMLEditor.java

示例6: populatePopupMenu

import javax.swing.JPopupMenu; //导入方法依赖的package包/类
public void populatePopupMenu(final JPopupMenu menu) {
	menu.add(ROW_ACTION);
	menu.add(COLUMN_ACTION);

	if (getTableHeader() != null) {
		menu.addSeparator();
		menu.add(FIT_COLUMN_ACTION);
		menu.add(FIT_ALL_COLUMNS_ACTION);
		menu.add(EQUAL_WIDTHS_ACTION);
	}

	if (isSortable()) {
		menu.addSeparator();
		menu.add(SORTING_ASCENDING_ACTION);
		menu.add(SORTING_DESCENDING_ACTION);
	}

	if (getTableHeader() != null) {
		if (getTableHeader().getReorderingAllowed()) {
			menu.addSeparator();
			menu.add(SORT_COLUMNS_BY_NAME_ACTION);
			menu.add(RESTORE_COLUMN_ORDER_ACTION);
		}
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:26,代码来源:ExtendedJTable.java

示例7: XMLTreeListener

import javax.swing.JPopupMenu; //导入方法依赖的package包/类
public XMLTreeListener(TreeViewPanel panel)
{
	super(panel);
	popupMenu = new JPopupMenu();
       JMenuItem expandAllAttributesMenuItem = new JMenuItem("Expand all attributes");
       expandAllAttributesMenuItem.addActionListener(this);
       JMenuItem collapseAllAttributesMenuItem = new JMenuItem("Collapse all attributes");
       collapseAllAttributesMenuItem.addActionListener(this);
       JMenuItem expandAllNodesMenuItem = new JMenuItem("Expand all nodes");
       expandAllNodesMenuItem.addActionListener(this);
       JMenuItem collapseAllNodesMenuItem = new JMenuItem("Collapse all nodes");
       collapseAllNodesMenuItem.addActionListener(this);      
       JMenuItem increaseVerticalNodeDistanceMenuItem = new JMenuItem("Increase vertical node distance");
       increaseVerticalNodeDistanceMenuItem.addActionListener(this);
       JMenuItem decreaseVerticalNodeDistanceMenuItem = new JMenuItem("Decrease vertical node distance");
       decreaseVerticalNodeDistanceMenuItem.addActionListener(this);
       JMenuItem increaseHorizontalNodeDistanceMenuItem = new JMenuItem("Increase horizontal node distance");
       increaseHorizontalNodeDistanceMenuItem.addActionListener(this);
       JMenuItem decreaseHorizontalNodeDistanceMenuItem = new JMenuItem("Decrease horizontal node distance");
       decreaseHorizontalNodeDistanceMenuItem.addActionListener(this);  
       JMenuItem toggleEdgyLinesMenuItem = new JMenuItem("Toggle edgy lines");
       toggleEdgyLinesMenuItem.addActionListener(this); 
       JMenuItem savePaneToFileMenuItem = new JMenuItem("Save tree display ...");
       savePaneToFileMenuItem.addActionListener(this);
       popupMenu.add(expandAllAttributesMenuItem);
       popupMenu.add(collapseAllAttributesMenuItem);
       popupMenu.addSeparator();
       popupMenu.add(expandAllNodesMenuItem);
       popupMenu.add(collapseAllNodesMenuItem);
       popupMenu.addSeparator();
       popupMenu.add(increaseVerticalNodeDistanceMenuItem);
       popupMenu.add(decreaseVerticalNodeDistanceMenuItem);
       popupMenu.addSeparator();
       popupMenu.add(increaseHorizontalNodeDistanceMenuItem);
       popupMenu.add(decreaseHorizontalNodeDistanceMenuItem);
       popupMenu.addSeparator();
       popupMenu.add(toggleEdgyLinesMenuItem);
       popupMenu.addSeparator();
       popupMenu.add(savePaneToFileMenuItem);  
}
 
开发者ID:spetitjean,项目名称:TuLiPA-frames,代码行数:41,代码来源:XMLTreeListener.java

示例8: addFilterItems

import javax.swing.JPopupMenu; //导入方法依赖的package包/类
/** Adds menu items to start or stop filtering the selected paths. */
void addFilterItems(JPopupMenu menu) {
    TreePath[] selectedValues = getSelectionPaths();
    if (isFiltering() && selectedValues != null) {
        menu.add(new FilterAction(selectedValues, true));
        menu.add(new FilterAction(selectedValues, false));
        menu.addSeparator();
    }
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:10,代码来源:LabelTree.java

示例9: addAction

import javax.swing.JPopupMenu; //导入方法依赖的package包/类
private void addAction(JPopupMenu popup, Action action) {
    if (action == null) {
        popup.addSeparator();
    } else {
        Class cls = (Class)action.getValue(KEY_CLASS);
        if (Boolean.class.equals(cls)) {
            Boolean boolvalue = (Boolean)action.getValue(KEY_BOOLVALUE);
            JCheckBoxMenuItem item = new JCheckBoxMenuItem(action);
            item.setSelected(boolvalue);
            popup.add(item);
        } else {
            popup.add(action);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:DropdownButton.java

示例10: init

import javax.swing.JPopupMenu; //导入方法依赖的package包/类
void init(String layersXMLName) throws IOException {
		Vector layers = ParseLink.parse(URLFactory.url(haxby.map.MapApp.TEMP_BASE_URL + "GMA/Layers/" + layersXMLName));
	//	ParseLink.printProperties( layers, 0);
		rootEntry = new LayerEntry(null, new Vector(), "layers", "", null);
		layers = ParseLink.getProperties( layers, "layer");
		for( int i=0 ; i<layers.size() ; i++) {
			addLayers( (Vector)layers.get(i), rootEntry);
		}
		layerTree = new JTree(rootEntry);
		layerTree.setRootVisible(false);
		layerTree.setShowsRootHandles(true);
/*
		layerTree.addMouseListener( new MouseAdapter() {
			public void mouseReleased(MouseEvent e) {
				if(e.isPopupTrigger()) {
					popup(e);
				}
			}
			public void mousePressed(MouseEvent e) {
				if(e.isPopupTrigger()) {
					popup(e);
				}
			}
		});
*/
		renderer = new JLabel("");
		renderer.setOpaque(true);
	//	layerTree.setCellRenderer(this);
	//	layerTree.setBackground( new Color(215,215,215) );
		renderer.setBackground( new Color(225,225,255) );
		pop = new JPopupMenu();
		popLabel = new JLabel("");
		popLabel.setHorizontalAlignment( JLabel.CENTER );
		on = new JCheckBoxMenuItem( "display");
		pop.add( popLabel );
		pop.addSeparator();
		pop.add( on );
		pop.add( "edit properties");
	}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:40,代码来源:LayerModel.java

示例11: createOperatorPopupMenu

import javax.swing.JPopupMenu; //导入方法依赖的package包/类
/** Creates a new popup menu for the selected operator. */
private JPopupMenu createOperatorPopupMenu() {
	JPopupMenu menu = new JPopupMenu();
	menu.add(this.INFO_OPERATOR_ACTION);
	menu.addSeparator();
	menu.add(new ResourceAction(true, "add_operator_now") {

		private static final long serialVersionUID = 4363124048356045034L;

		@Override
		public void actionPerformed(final ActionEvent e) {
			insertSelected();
		}
	});
	menu.add(new DeleteUserDefinedAction() {

		@Override
		protected OperatorDescription getOperatorDescription() {
			Object selectedOperator = operatorGroupTree.getSelectionPath().getLastPathComponent();
			if (selectedOperator != null && selectedOperator instanceof OperatorDescription) {
				return (OperatorDescription)selectedOperator;
			} else {
				return null;
			}
		}

		private static final long serialVersionUID = 2563324048356045034L;

	});
	return menu;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:32,代码来源:NewOperatorGroupTree.java

示例12: createPopupMenu

import javax.swing.JPopupMenu; //导入方法依赖的package包/类
private JPopupMenu createPopupMenu() {
    JPopupMenu menu = new JPopupMenu();
    for (Action action : getActions()) {
        if (action == null)
            menu.addSeparator();
        else {
            action.putValue(Action.NAME, GlobalResourcesManager
                    .getString((String) action
                            .getValue(Action.ACTION_COMMAND_KEY)));
            menu.add(action);
        }
    }
    return menu;
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:15,代码来源:ModelPropertiesDialog.java

示例13: configureMenu

import javax.swing.JPopupMenu; //导入方法依赖的package包/类
@Override
public void configureMenu(JPopupMenu menu, Project proj) {
	this.circState = proj.getCircuitState();
	boolean enabled = circState != null;

	this.edit = createItem(enabled, Strings.get("ramEditMenuItem"));
	this.reset = createItem(enabled, Strings.get("ramClearMenuItem"));
	menu.addSeparator();
	menu.add(this.edit);
	menu.add(this.reset);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:12,代码来源:ProgrammableGenerator.java

示例14: createTextPopupMenu

import javax.swing.JPopupMenu; //导入方法依赖的package包/类
private JPopupMenu createTextPopupMenu() {
	JPopupMenu menu = new JPopupMenu();
	menu.add(CUT_ACTION);
	menu.add(COPY_ACTION);
	menu.add(PASTE_ACTION);
	menu.add(DELETE_ACTION);
	// menu.addSeparator();
	// menu.add(CLEAR_ALL_ACTION);
	// menu.add(SELECT_ALL_ACTION);
	menu.addSeparator();
	menu.add(SEARCH_AND_REPLACE_ACTION);
	return menu;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:14,代码来源:JEditTextArea.java

示例15: getPopupMenu

import javax.swing.JPopupMenu; //导入方法依赖的package包/类
@Override
public JPopupMenu getPopupMenu(Widget widget, Point point) {
    JPopupMenu menu = diagramScene.createPopupMenu();
    menu.addSeparator();

    JMenu predecessors = new JMenu("Nodes Above");
    predecessors.addMenuListener(new NeighborMenuListener(predecessors, getFigure(), false));
    menu.add(predecessors);

    JMenu successors = new JMenu("Nodes Below");
    successors.addMenuListener(new NeighborMenuListener(successors, getFigure(), true));
    menu.add(successors);

    return menu;
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:16,代码来源:FigureWidget.java


注:本文中的javax.swing.JPopupMenu.addSeparator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。