Package java.awt

Examples of java.awt.Component.requestFocusInWindow()


           
            // CraigM:06/08/2008 - Set the traversal reason to be done by the application
            ForteKeyboardFocusManager.setApplicationTraversal();
           
            if (c.isFocusable()) {
              c.requestFocusInWindow();
            }
            else {
              c.transferFocus();
            }
          }
View Full Code Here


                      if (root != null) {
                          FocusTraversalPolicy policy = root.getFocusTraversalPolicy();
                          Component previousFocus = policy.getComponentBefore(root, component);
                          Component nextFocus = policy.getComponentAfter(root, previousFocus == null ? component : previousFocus);
                          if (nextFocus != null) {
                              nextFocus.requestFocusInWindow();
                          }
                      }
                  }
                }
View Full Code Here

        while (!w.isFocused() && (System.currentTimeMillis() - startTime) < MAX_WAIT_TIME) {
            Thread.sleep(10);
        }
        SwingUtilities.invokeAndWait(new Runnable() {
            public void run() {
                final boolean result = comp.requestFocusInWindow();
                assertTrue("focus can be gained", result || comp.isFocusOwner());
            }
        });
        startTime = System.currentTimeMillis();
        while (!comp.isFocusOwner() && (System.currentTimeMillis() - startTime) < MAX_WAIT_TIME) {
View Full Code Here

          public void ancestorMoved(final AncestorEvent event) {
          }
          public void ancestorRemoved(final AncestorEvent event) {
            final Component selectedComponent = Controller.getCurrentController().getMapViewManager().getSelectedComponent();
            if(selectedComponent != null)
              selectedComponent.requestFocusInWindow();
            quickEditor.removeAncestorListener(this);
          }
        });
      }
    }
View Full Code Here

    tipPopup = new JPopupMenu();
    tipPopup.setLayout(new GridLayout(1, 1));
    tipPopup.add(tip);
    mouseInsideTooltipListener = new MouseInsideListener(tipPopup);
    tipPopup.show(nearComponent, 0, nearComponent.getHeight());
    focusOwner.requestFocusInWindow();
        exitTimer.start();
  }

  private void hideTipWindow() {
    insideComponent = null;
View Full Code Here

          keyEv = new KeyEvent(editor.getEditorComponent(), KeyEvent.KEY_TYPED, e.getWhen(),
              e.getModifiers(), KeyEvent.VK_UNDEFINED, e.getKeyChar(), KeyEvent.KEY_LOCATION_UNKNOWN);
          retValue = SwingUtilities.processKeyBindings(keyEv);
        }
        else {
          editorComponent.requestFocusInWindow();
          retValue = true;
        }
      }
    }
    if (ks.getKeyCode() == KeyEvent.VK_SPACE) {
View Full Code Here

          parentDockable.getDockingProperties().setActive(true);
      }
      c.removeFocusListener(this);
        }
    });                        
      c.requestFocusInWindow();
        }

        // if we're in a hidden tab, then bring the tab to the front
        if(parentComp.getParent() instanceof JTabbedPane) {
            JTabbedPane tabPane = (JTabbedPane)parentComp.getParent();
View Full Code Here

                // on hiding the popup the focusmanager transfers
                // focus back to the old permanentFocusOwner
                // before showing the popup, that is the picker
                // or the editor. So we have to force it back ...
                hidePopup();
                comp.requestFocusInWindow();
                // this has no effect as focus changes are asynchronous
//                inHide = false;
            }
        }
       
View Full Code Here

          case XEMBED_FOCUS_FIRST:
              SunToolkit.executeOnEventHandlerThread(embedded.target, new Runnable() {
                      public void run() {
                          Component comp = ((Container)embedded.target).getFocusTraversalPolicy().getFirstComponent((Container)embedded.target);
                          if (comp != null) {
                              comp.requestFocusInWindow();
                          }
                      }});
              break;
          case XEMBED_FOCUS_LAST:
              SunToolkit.executeOnEventHandlerThread(embedded.target, new Runnable() {
View Full Code Here

          case XEMBED_FOCUS_LAST:
              SunToolkit.executeOnEventHandlerThread(embedded.target, new Runnable() {
                      public void run() {
                          Component comp = ((Container)embedded.target).getFocusTraversalPolicy().getLastComponent((Container)embedded.target);
                          if (comp != null) {
                              comp.requestFocusInWindow();
                          }
                      }});
              break;
        }
    }
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.