當前位置: 首頁>>代碼示例>>Java>>正文


Java InputMap.remove方法代碼示例

本文整理匯總了Java中javax.swing.InputMap.remove方法的典型用法代碼示例。如果您正苦於以下問題:Java InputMap.remove方法的具體用法?Java InputMap.remove怎麽用?Java InputMap.remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.InputMap的用法示例。


在下文中一共展示了InputMap.remove方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: CheckTreeView

import javax.swing.InputMap; //導入方法依賴的package包/類
/** Creates a new instance of CheckTreeView */
public CheckTreeView() {
    
    setFocusable( false );
    
    CheckListener l = new CheckListener();
    tree.addMouseListener( l );
    tree.addKeyListener( l );

    CheckRenderer check = new CheckRenderer();
    tree.setCellRenderer( check );
    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    
    tree.setShowsRootHandles(false);
    
    InputMap input = tree.getInputMap( JTree.WHEN_FOCUSED );
    if( null != input )
        input.remove( KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0) );
    
    setBorder( UIManager.getBorder("ScrollPane.border") );
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:22,代碼來源:CheckTreeView.java

示例2: initKeysAndActions

import javax.swing.InputMap; //導入方法依賴的package包/類
/**
 * Right-arrow key expands a row, left-arrow collapses a row, enter invokes
 * row's default action (if any).
 */
private void initKeysAndActions() {
    unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0));
    unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0));
    unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0));
    unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_F10, KeyEvent.SHIFT_DOWN_MASK));

    expandAction = new ExpandAction();
    collapseAction = new CollapseAction();
    defaultAction = new DefaultAction();
    showPopupAction = new ShowPopupAction();

    InputMap imp = getInputMap();
    InputMap impAncestor = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    ActionMap am = getActionMap();

    imp.put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0), ACTION_EXPAND);
    imp.put(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0), ACTION_COLLAPSE);
    imp.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), ACTION_DEFAULT);
    imp.put(KeyStroke.getKeyStroke(KeyEvent.VK_F10, KeyEvent.SHIFT_DOWN_MASK), ACTION_SHOW_POPUP);

    impAncestor.remove(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0));
    impAncestor.remove(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0));
    impAncestor.remove(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0));
    impAncestor.remove(KeyStroke.getKeyStroke(KeyEvent.VK_F10, KeyEvent.SHIFT_DOWN_MASK));

    am.put(ACTION_EXPAND, expandAction);
    am.put(ACTION_COLLAPSE, collapseAction);
    am.put(ACTION_DEFAULT, defaultAction);
    am.put(ACTION_SHOW_POPUP, showPopupAction);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:35,代碼來源:TreeList.java

示例3: createCommandField

import javax.swing.InputMap; //導入方法依賴的package包/類
@Override
protected JTextComponent createCommandField() {
    JTextArea res = new DynamicWidthTA();
    res.setRows(1);
    res.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 1));
    // disable default Swing's Ctrl+Shift+O binding to enable our global action
    InputMap curIm = res.getInputMap(JComponent.WHEN_FOCUSED);
    while (curIm != null) {
        curIm.remove(KeyStroke.getKeyStroke(
                KeyEvent.VK_O, KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK));
        curIm = curIm.getParent();
    }
    return res;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:15,代碼來源:QuickSearchComboBar.java

示例4: fixCtrlH

import javax.swing.InputMap; //導入方法依賴的package包/類
/**
 * Removes the "Ctrl+H <=> Backspace" behavior that Java shows, for some
 * odd reason...
 */
private void fixCtrlH() {
	InputMap inputMap = getInputMap();
	KeyStroke char010 = KeyStroke.getKeyStroke("typed \010");
	InputMap parent = inputMap;
	while (parent != null) {
		parent.remove(char010);
		parent = parent.getParent();
	}
	if (inputMap != null) { // Just for Sonar
		KeyStroke backspace = KeyStroke.getKeyStroke("BACK_SPACE");
		inputMap.put(backspace, DefaultEditorKit.deletePrevCharAction);
	}
}
 
開發者ID:Thecarisma,項目名稱:powertext,代碼行數:18,代碼來源:RTextArea.java

示例5: configureActionMaps

import javax.swing.InputMap; //導入方法依賴的package包/類
/**
 * Installs the keyListener in the textArea and editorPane
 * for handling the enter keystroke and updating the modified state.
 */
protected void configureActionMaps()
{
	InputMap editorInputMap = editorPane.getInputMap();
	InputMap textInputMap = textArea.getInputMap();

	// Adds handling for the escape key to cancel editing
	editorInputMap.put(escapeKeystroke, cancelEditingAction);
	textInputMap.put(escapeKeystroke, cancelEditingAction);

	// Adds handling for shift-enter and redirects enter to stop editing
	if (graphComponent.isEnterStopsCellEditing())
	{
		editorInputMap.put(shiftEnterKeystroke, editorEnterActionMapKey);
		textInputMap.put(shiftEnterKeystroke, textEnterActionMapKey);

		editorInputMap.put(enterKeystroke, SUBMIT_TEXT);
		textInputMap.put(enterKeystroke, SUBMIT_TEXT);
	}
	else
	{
		editorInputMap.put(enterKeystroke, editorEnterActionMapKey);
		textInputMap.put(enterKeystroke, textEnterActionMapKey);

		if (isShiftEnterSubmitsText())
		{
			editorInputMap.put(shiftEnterKeystroke, SUBMIT_TEXT);
			textInputMap.put(shiftEnterKeystroke, SUBMIT_TEXT);
		}
		else
		{
			editorInputMap.remove(shiftEnterKeystroke);
			textInputMap.remove(shiftEnterKeystroke);
		}
	}
}
 
開發者ID:GDSRS,項目名稱:TrabalhoFinalEDA2,代碼行數:40,代碼來源:mxCellEditor.java

示例6: configureActionMaps

import javax.swing.InputMap; //導入方法依賴的package包/類
/**
 * Installs the keyListener in the textArea and editorPane for handling the enter keystroke and
 * updating the modified state.
 */
protected void configureActionMaps() {
  InputMap editorInputMap = editorPane.getInputMap();
  InputMap textInputMap = textArea.getInputMap();

  // Adds handling for the escape key to cancel editing
  editorInputMap.put(escapeKeystroke, cancelEditingAction);
  textInputMap.put(escapeKeystroke, cancelEditingAction);

  // Adds handling for shift-enter and redirects enter to stop editing
  if (graphComponent.isEnterStopsCellEditing()) {
    editorInputMap.put(shiftEnterKeystroke, editorEnterActionMapKey);
    textInputMap.put(shiftEnterKeystroke, textEnterActionMapKey);

    editorInputMap.put(enterKeystroke, SUBMIT_TEXT);
    textInputMap.put(enterKeystroke, SUBMIT_TEXT);
  } else {
    editorInputMap.put(enterKeystroke, editorEnterActionMapKey);
    textInputMap.put(enterKeystroke, textEnterActionMapKey);

    if (isShiftEnterSubmitsText()) {
      editorInputMap.put(shiftEnterKeystroke, SUBMIT_TEXT);
      textInputMap.put(shiftEnterKeystroke, SUBMIT_TEXT);
    } else {
      editorInputMap.remove(shiftEnterKeystroke);
      textInputMap.remove(shiftEnterKeystroke);
    }
  }
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:33,代碼來源:mxCellEditor.java

示例7: initKeysAndActions

import javax.swing.InputMap; //導入方法依賴的package包/類
@Override
protected void initKeysAndActions() {
    super.initKeysAndActions();
    unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0));
    unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0));

    expandAction = new ExpandAction();
    collapseAction = new CollapseAction();
    edClassAction = new EditorClassAction();

    InputMap imp = getInputMap();
    InputMap impAncestor = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    ActionMap am = getActionMap();
    KeyStroke ks = KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_MASK);
    imp.put(ks, null);

    imp.put(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0), ACTION_EXPAND);

    imp.put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0), ACTION_COLLAPSE);

    if (!GraphicsEnvironment.isHeadless()) {
    imp.put(
        KeyStroke.getKeyStroke(
            KeyEvent.VK_HOME, KeyEvent.SHIFT_DOWN_MASK | Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()
        ), ACTION_EDCLASS
    );
    }

    imp.put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), ACTION_NEXT);

    imp.put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, KeyEvent.SHIFT_DOWN_MASK), ACTION_PREV);

    impAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, KeyEvent.CTRL_DOWN_MASK), ACTION_CUSTOM_EDITOR);

    impAncestor.remove(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0));
    impAncestor.remove(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0));

    am.put(ACTION_EXPAND, expandAction);
    am.put(ACTION_COLLAPSE, collapseAction);

    am.put(ACTION_CUSTOM_EDITOR, getCustomEditorAction());
    am.put(ACTION_EDCLASS, edClassAction);

    Action defaultAction = am.get( "selectNextRow" );
    if( null != defaultAction ) {
        am.put("selectNextRow", new IncrementAction(false, defaultAction));
}
    defaultAction = am.get( "selectPreviousRow" );
    if( null != defaultAction ) {
        am.put("selectPreviousRow", new IncrementAction(true, defaultAction));
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:53,代碼來源:SheetTable.java


注:本文中的javax.swing.InputMap.remove方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。