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


Java ActionMap.remove方法代码示例

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


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

示例1: initActions

import javax.swing.ActionMap; //导入方法依赖的package包/类
private void initActions() {
    InputMap inputMap = getInputMap(JComponent.WHEN_FOCUSED);
    inputMap.put( KeyStroke.getKeyStroke( KeyEvent.VK_ENTER, 0, false ), "defaultAction" );
    inputMap.put( KeyStroke.getKeyStroke( KeyEvent.VK_F10, KeyEvent.SHIFT_DOWN_MASK, false ), "popup" );

    ActionMap map = getActionMap();
    map.put( "defaultAction", new DefaultAction( this ) );
    map.put( "popup", new PopupAction() );
    map.put( "selectPreviousRow", new MoveFocusAction( map.get( "selectPreviousRow" ), false ) );
    map.put( "selectNextRow", new MoveFocusAction( map.get( "selectNextRow" ), true ) );
    map.put( "selectPreviousColumn", new MoveFocusAction( new ChangeColumnAction( map.get( "selectPreviousColumn" ), false ), false ) );
    map.put( "selectNextColumn", new MoveFocusAction( new ChangeColumnAction( map.get( "selectNextColumn" ), true ), true ) );
    Node categoryNode = category.getLookup().lookup(org.openide.nodes.Node.class);
    if( null != categoryNode )
        map.put( "paste", new Utils.PasteItemAction( categoryNode ) );
    else
        map.remove( "paste" );
    map.put( "copy", new CutCopyAction( true ) );
    map.put( "cut", new CutCopyAction( false ) );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:CategoryList.java

示例2: detachSystemActionPerformer

import javax.swing.ActionMap; //导入方法依赖的package包/类
private void detachSystemActionPerformer(JTextComponent c){
    if (c == null) return;

    Action action = getEditorAction(c);
    if (action == null) return;

    Action globalSystemAction = getSystemAction(c);
    if (globalSystemAction == null) return;

    if (globalSystemAction instanceof CallbackSystemAction){
        Object key = ((CallbackSystemAction)globalSystemAction).getActionMapKey();
        ActionMap am = c.getActionMap();
        if (am != null) {
            Object ea = am.get(key);
            if (action.equals(ea)) {
                am.remove(key);
            }
        }
    }                        
                        
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:NbEditorUI.java

示例3: installKeyboardActions

import javax.swing.ActionMap; //导入方法依赖的package包/类
@Override
protected void installKeyboardActions() {
	super.installKeyboardActions();
	ActionMap am = SwingUtilities.getUIActionMap(graph);
	am.remove(TransferHandler.getCutAction().getValue(Action.NAME));
	am.remove(TransferHandler.getCopyAction().getValue(Action.NAME));
	am.remove(TransferHandler.getPasteAction().getValue(Action.NAME));
	SwingUtilities.replaceUIActionMap(graph, am);
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:10,代码来源:JmtGraphUI.java

示例4: installKeyboardActions

import javax.swing.ActionMap; //导入方法依赖的package包/类
@Override
protected void installKeyboardActions() {
	super.installKeyboardActions();
	ActionMap am = SwingUtilities.getUIActionMap(graph);

	am.remove(TransferHandler.getCutAction().getValue(Action.NAME));
	am.remove(TransferHandler.getCopyAction().getValue(Action.NAME));
	am.remove(TransferHandler.getPasteAction().getValue(Action.NAME));

	SwingUtilities.replaceUIActionMap(graph, am);

}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:13,代码来源:JmtGraphUI.java


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