Package javax.swing

Examples of javax.swing.InputMap.clear()


  /**
   * Installs default keys bound to actions.
   */
  private void installDefaultKeyboardActions() {
    InputMap inputMap = getInputMap(WHEN_FOCUSED);
    inputMap.clear();
    inputMap.put(KeyStroke.getKeyStroke("DELETE"), ActionType.DELETE_SELECTION);
    inputMap.put(KeyStroke.getKeyStroke("BACK_SPACE"), ActionType.DELETE_SELECTION);
    inputMap.put(KeyStroke.getKeyStroke("ESCAPE"), ActionType.ESCAPE);
    inputMap.put(KeyStroke.getKeyStroke("LEFT"), ActionType.MOVE_SELECTION_LEFT);
    inputMap.put(KeyStroke.getKeyStroke("shift LEFT"), ActionType.MOVE_SELECTION_FAST_LEFT);
View Full Code Here


  /**
   * Installs keys bound to actions during edition.
   */
  private void installEditionKeyboardActions() {
    InputMap inputMap = getInputMap(WHEN_FOCUSED);
    inputMap.clear();
    inputMap.put(KeyStroke.getKeyStroke("ESCAPE"), ActionType.ESCAPE);
    inputMap.put(KeyStroke.getKeyStroke("shift ESCAPE"), ActionType.ESCAPE);
    inputMap.put(KeyStroke.getKeyStroke("ENTER"), ActionType.DEACTIVATE_EDITIION);
    inputMap.put(KeyStroke.getKeyStroke("shift ENTER"), ActionType.DEACTIVATE_EDITIION);
    if (OperatingSystem.isMacOSX()) {
View Full Code Here

    harness.check(k[1], KeyStroke.getKeyStroke('b'));
    map.put(KeyStroke.getKeyStroke('b'), null);
    k = map.keys();
    harness.check(k.length, 1);
    harness.check(k[0], KeyStroke.getKeyStroke('a'));   
    map.clear();
    k = map.keys();
    harness.check(k.length, 0);
   
    // check that no keys from the parent are used
    InputMap p = new InputMap();
View Full Code Here

public class clear implements Testlet
{
  public void test(TestHarness harness)
  {
    InputMap m = new InputMap();
    m.clear();
    harness.check(m.size(), 0);
    m.put(KeyStroke.getKeyStroke('a'), "AAA");
    harness.check(m.size(), 1);
    m.clear();
    harness.check(m.size(), 0);
View Full Code Here

    InputMap m = new InputMap();
    m.clear();
    harness.check(m.size(), 0);
    m.put(KeyStroke.getKeyStroke('a'), "AAA");
    harness.check(m.size(), 1);
    m.clear();
    harness.check(m.size(), 0);
   
    // confirm that this method doesn't change the parent
    InputMap p = new InputMap();
    p.put(KeyStroke.getKeyStroke('z'), "ZZZ");
View Full Code Here

    /**
     * @param inputMap
     */
    private void uninstallKeyBindings(int type) {
        InputMap inputMap = monthView.getInputMap(type);
        inputMap.clear();
    }

    protected void uninstallKeyboardActions() {}

    protected void installListeners() {
View Full Code Here

                map = new ComponentInputMapUIResource(c);
                SwingUtilities.replaceUIInputMap(c,
                        JComponent.WHEN_IN_FOCUSED_WINDOW, map);
            }
           
            map.clear();
           
            //TODO is ALT_MASK right for all platforms?
            map.put(KeyStroke.getKeyStroke(m, InputEvent.ALT_MASK, false),
                    pressed);
            map.put(KeyStroke.getKeyStroke(m, InputEvent.ALT_MASK, true),
View Full Code Here

            map.put(KeyStroke.getKeyStroke(m, InputEvent.ALT_MASK, true),
                    released);
            map.put(KeyStroke.getKeyStroke(m, 0, true), released);
        } else {
            if (map != null) {
                map.clear();
            }
        }
    }
   
    private static Component[] getChildren(Component c) {
View Full Code Here

        getViewport().setBackground(unfocusedBackgroundColor);
        fileTable.setBackground(unfocusedBackgroundColor);

        // Remove default action mappings that conflict with corresponding mu actions
        InputMap inputMap = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
        inputMap.clear();
        inputMap.setParent(null);
       
        fileTable.addFocusListener(this);
       
     // Enable drop support to copy/move/change current folder when files are dropped on the FileTable
View Full Code Here

        this.mainFrame   = mainFrame;
        this.folderPanel = folderPanel;

        // Remove all default action mappings as they conflict with corresponding mu actions
        InputMap inputMap = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
        inputMap.clear();
        inputMap.setParent(null);

        // Initializes the table.
        cellRenderer     = new FileTableCellRenderer(this);
        getColumnModel().getColumn(convertColumnIndexToView(Column.NAME.ordinal())).setCellEditor(filenameEditor = new FilenameEditor(new JTextField()));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.