Examples of KeyboardFocusManager


Examples of java.awt.KeyboardFocusManager

                doReturn();
            }
        }

        private void doReturn() {
            KeyboardFocusManager fmgr =
                KeyboardFocusManager.getCurrentKeyboardFocusManager();
            Component focusOwner = fmgr.getFocusOwner();
            if(focusOwner != null && !(focusOwner instanceof JRootPane)) {
                return;
            }

            MenuSelectionManager msm = MenuSelectionManager.defaultManager();
View Full Code Here

Examples of java.awt.KeyboardFocusManager

        kit.update();
      }

    };

    KeyboardFocusManager focusManager = KeyboardFocusManager
        .getCurrentKeyboardFocusManager();
    focusManager.addPropertyChangeListener(new PropertyChangeListener() {

      /*
       * (non-Javadoc)
       */
      public void propertyChange(PropertyChangeEvent e) {
View Full Code Here

Examples of java.awt.KeyboardFocusManager

                doReturn();
            }
        }

  private void doReturn() {
            KeyboardFocusManager fmgr =
                KeyboardFocusManager.getCurrentKeyboardFocusManager();
            Component focusOwner = fmgr.getFocusOwner();
            if(focusOwner != null && !(focusOwner instanceof JRootPane)) {
                return;
            }

            MenuSelectionManager msm = MenuSelectionManager.defaultManager();
View Full Code Here

Examples of java.awt.KeyboardFocusManager

        item.addActionListener(new DefaultEditorKit.PasteAction());
        menu.add(item);
        item = new MenuItem("Select All", new MenuShortcut(KeyEvent.VK_A));
        item.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                KeyboardFocusManager kfm =
                    KeyboardFocusManager.getCurrentKeyboardFocusManager();
                Component comp = kfm.getFocusOwner();
                if (comp instanceof TextComponent) {
                    ((TextComponent) comp).selectAll();
                } else if (comp instanceof JTextComponent) {
                    ((JTextComponent) comp).selectAll();
                }
View Full Code Here

Examples of java.awt.KeyboardFocusManager

     */
    @Override
    protected void processKeyEvent( KeyEvent ke ) {
        if (ke.getKeyChar() == KeyEvent.VK_TAB) {
            if (ke.getID() == KeyEvent.KEY_TYPED) {
                KeyboardFocusManager focusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
                if (ke.isShiftDown()) {
                    focusManager.focusPreviousComponent();
                } else {
                    focusManager.focusNextComponent();
                }
            }
            ke.consume();
        } else if (ke.getKeyCode() == KeyEvent.VK_DOWN
                || ke.getKeyCode() == KeyEvent.VK_UP
View Full Code Here

Examples of java.awt.KeyboardFocusManager

        }
    }
    protected void processKeyEvent(KeyEvent ke) {
        if (ke.getKeyChar() == KeyEvent.VK_TAB) {
            if (ke.getID() == KeyEvent.KEY_TYPED) {
                KeyboardFocusManager focusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
                if (ke.isShiftDown()) {
                    focusManager.focusPreviousComponent();
                } else {
                    focusManager.focusNextComponent();
                }
            }
            ke.consume();
        } else {
            super.processKeyEvent(ke);
View Full Code Here

Examples of java.awt.KeyboardFocusManager

        }
    }
    protected void processKeyEvent(KeyEvent ke) {
        if (ke.getKeyChar() == KeyEvent.VK_TAB) {
            if (ke.getID() == KeyEvent.KEY_TYPED) {
                KeyboardFocusManager focusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
                if (ke.isShiftDown()) {
                    focusManager.focusPreviousComponent();
                } else {
                    focusManager.focusNextComponent();
                }
            }
            ke.consume();
        } else {
            super.processKeyEvent(ke);
View Full Code Here

Examples of java.awt.KeyboardFocusManager

     */
    @Override
    protected void processKeyEvent( KeyEvent ke ) {
        if (ke.getKeyChar() == KeyEvent.VK_TAB) {
            if (ke.getID() == KeyEvent.KEY_TYPED) {
                KeyboardFocusManager focusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
                if (ke.isShiftDown()) {
                    focusManager.focusPreviousComponent();
                } else {
                    focusManager.focusNextComponent();
                }
            }
            ke.consume();
        } else if (ke.getKeyCode() == KeyEvent.VK_DOWN
                || ke.getKeyCode() == KeyEvent.VK_UP
View Full Code Here

Examples of java.awt.KeyboardFocusManager

    }

    //This determines if the append row has occurred from within the table or from outside
    public void shouldIgnoreRowChange(MouseEvent event) {
        if (!table.isFocusOwner()) {
            KeyboardFocusManager fm = KeyboardFocusManager.getCurrentKeyboardFocusManager();

            if (!isAssociatedComponent((Component)fm.getFocusOwner(), false)) {
                setIgnoreRowChange(true, true);
            }
        }
    }
View Full Code Here

Examples of java.awt.KeyboardFocusManager

     * This method returns the traversal reason on the last focus change. This can be any of the FC_... constants in
     * the Constants class.
     * @return
     */
    public static int getTraversalReason() {
        KeyboardFocusManager currentMgr = KeyboardFocusManager.getCurrentKeyboardFocusManager();
        if (currentMgr instanceof ForteKeyboardFocusManager)
            return ((ForteKeyboardFocusManager)currentMgr).getReasonCode();
        else {
            IllegalStateException errorVar = new IllegalStateException("A ForteKeyboardFocusManager has not been installed for this thread, so the traveral reason cannot be determined: " + Thread.currentThread());
            ErrorMgr.addError(errorVar);
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.