Examples of InputMap


Examples of javax.swing.InputMap

        tlb.setMargin(new Insets(0, 0, 0, 2));

        // The toolbar carries all the key bindings that are valid for the whole
        // window.
        ActionMap am = tlb.getActionMap();
        InputMap im = tlb.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);

        im.put(prefs.getKey("Close entry editor"), "close");
        am.put("close", closeAction);
        im.put(prefs.getKey("Entry editor, store field"), "store");
        am.put("store", storeFieldAction);
        im.put(prefs.getKey("Autogenerate BibTeX keys"), "generateKey");
        am.put("generateKey", generateKeyAction);
        im.put(prefs.getKey("Automatically link files"), "autoLink");
        am.put("autoLink", autoLink);
        im.put(prefs.getKey("Entry editor, previous entry"), "prev");
        am.put("prev", prevEntryAction);
        im.put(prefs.getKey("Entry editor, next entry"), "next");
        am.put("next", nextEntryAction);
        im.put(prefs.getKey("Undo"), "undo");
        am.put("undo", undoAction);
        im.put(prefs.getKey("Redo"), "redo");
        am.put("redo", redoAction);
        im.put(prefs.getKey("Help"), "help");
        am.put("help", helpAction);

        tlb.setFloatable(false);

        // Add actions (and thus buttons)
View Full Code Here

Examples of javax.swing.InputMap

     */
    public void setupJTextComponent(JTextComponent ta) {


        // Set up key bindings and focus listener for the FieldEditor.
        InputMap im = ta.getInputMap(JComponent.WHEN_FOCUSED);
        ActionMap am = ta.getActionMap();

        // im.put(KeyStroke.getKeyStroke(GUIGlobals.closeKey), "close");
        // am.put("close", closeAction);
        im.put(prefs.getKey("Entry editor, store field"), "store");
        am.put("store", storeFieldAction);

        im.put(prefs.getKey("Entry editor, next panel"), "right");
        im.put(prefs.getKey("Entry editor, next panel 2"), "right");
        am.put("right", switchRightAction);

        im.put(prefs.getKey("Entry editor, previous panel"), "left");
        im.put(prefs.getKey("Entry editor, previous panel 2"), "left");
        am.put("left", switchLeftAction);

        im.put(prefs.getKey("Help"), "help");
        am.put("help", helpAction);
        im.put(prefs.getKey("Save database"), "save");
        am.put("save", saveDatabaseAction);

        im.put(Globals.prefs.getKey("Next tab"), "nexttab");
        am.put("nexttab", frame.nextTab);
        im.put(Globals.prefs.getKey("Previous tab"), "prevtab");
        am.put("prevtab", frame.prevTab);
        try {
            HashSet<AWTKeyStroke> keys = new HashSet<AWTKeyStroke>(ta
                .getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS));
            keys.clear();
View Full Code Here

Examples of javax.swing.InputMap

          public void actionPerformed(ActionEvent e) {
            diag.dispose();
          }
        };
        ActionMap am = contentPane.getActionMap();
        InputMap im = contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
        im.put(Globals.prefs.getKey("Close dialog"), "close");
        am.put("close", closeAction);
       
        diag.addWindowListener(new WindowAdapter() {
            public void windowOpened(WindowEvent e) {
                contentPane.setDividerLocation(0.5f);
View Full Code Here

Examples of javax.swing.InputMap

          public void actionPerformed(ActionEvent e) {
            dispose();
          }
        };
        ActionMap am = contentPane.getActionMap();
        InputMap im = contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
        im.put(Globals.prefs.getKey("Close dialog"), "close");
        am.put("close", closeAction);

    }
View Full Code Here

Examples of javax.swing.InputMap

    /**
     * Creates aciton and input -Map and assigns it to each component.
     */
    private void registerActions() {
        JPanel thePanel = (JPanel) this.getContentPane();
        InputMap inputMap = thePanel
                .getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
        inputMap.put(CTRL_UP, moveUpAction);
        inputMap.put(CTRL_DOWN, moveDownAction);
        inputMap.put(ESCAPE, abortAction);
        inputMap.put(ENTER, okAction);
        ActionMap actionMap = thePanel.getActionMap();
        actionMap.put(moveUpAction, moveUpAction);
        actionMap.put(moveDownAction, moveDownAction);
        actionMap.put(okAction, okAction);
        actionMap.put(abortAction, abortAction);
View Full Code Here

Examples of javax.swing.InputMap

        // Add the action to the component
    }

    void addAction(Action action, KeyStroke keyStroke) {
        InputMap inputMap = getInputMap();
        inputMap.put(keyStroke, action.getValue(Action.NAME));
        getActionMap().put(action.getValue(Action.NAME), action);
    }
View Full Code Here

Examples of javax.swing.InputMap

                }
            }
        });
        {

            InputMap inputMap = getInputMap();
            inputMap.setParent(getTreeTable().getInputMap(JComponent.WHEN_FOCUSED));
            getTreeTable().setInputMap(JComponent.WHEN_FOCUSED, inputMap);
            ActionMap actionMap= getActionMap();
            actionMap.setParent(getTreeTable().getActionMap());
            getTreeTable().setActionMap(actionMap);
View Full Code Here

Examples of javax.swing.InputMap

    {
        return this.getTreeTable().getTree();
    }
   
    public void setAction(Action action) {
        InputMap inputMap = new InputMap();

        inputMap.put((KeyStroke) action.getValue(Action.ACCELERATOR_KEY),
                action.getValue(Action.NAME));

        inputMap.setParent(getTreeTable().getInputMap(JComponent.WHEN_FOCUSED));
        getTreeTable().setInputMap(JComponent.WHEN_FOCUSED, inputMap);

        // Add the action to the component
        getTreeTable().getActionMap().put(action.getValue(Action.NAME), action);
    }
View Full Code Here

Examples of javax.swing.InputMap

        SearchBox.setFont(font.deriveFont((float) 14.0).deriveFont(Font.BOLD));
        SearchBox.setSize(width + 4, textHeight);
        SearchBox.setBorder(BorderFactory.createEmptyBorder());
        SearchBox.setBackground(Color.decode("#EEEEDD"));
        SearchBox.getDocument().addDocumentListener(listener);
        InputMap im = SearchBox.getInputMap();
        ActionMap am = SearchBox.getActionMap();
        im.put(KeyStroke.getKeyStroke("ENTER"), COMMIT_ACTION);
        am.put(COMMIT_ACTION, new CommitAction());
       
        Switchboard.InfoBox = new JTextField();
        Switchboard.InfoBox.setBorder(BorderFactory.createTitledBorder(""));
        Switchboard.InfoBox.setSize(width, textHeight);
View Full Code Here

Examples of javax.swing.InputMap

   * Installs keys bound to actions.
   */
  private void installKeyboardActions() {
    ActionMap actions = getActionMap();     
    // As no menu is created for this pane, change its input map to ensure accelerators work
    InputMap inputMap = getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    inputMap.put((KeyStroke)actions.get(ActionType.SHOW_PREVIOUS).getValue(Action.ACCELERATOR_KEY),
        ActionType.SHOW_PREVIOUS);
    inputMap.put((KeyStroke)actions.get(ActionType.SHOW_NEXT).getValue(Action.ACCELERATOR_KEY),
        ActionType.SHOW_NEXT);
    inputMap.put((KeyStroke)actions.get(ActionType.CLOSE).getValue(Action.ACCELERATOR_KEY),
        ActionType.CLOSE);
    inputMap.put((KeyStroke)actions.get(ActionType.SEARCH).getValue(Action.ACCELERATOR_KEY),
        ActionType.SEARCH);
  }
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.