Package java.awt

Examples of java.awt.Component.requestFocus()


                    // These are the only states we can post this event in, ignore the rest
                    break;
                default:
                    return;
            }
            postTarget.requestFocus();
            // We post a double click event when the button is pressed and this control can
            // fire double clicks and the click count is even.
            boolean canDoubleClick = ClickListener.canFireDoubleClickEvents(postTarget);
            if (e.getButton() == MouseEvent.BUTTON3 && canDoubleClick && ((e.getClickCount() & 1) == 0)) {
                ClientEventManager.postEvent(postTarget, "DoubleClickOuter", ClickListener.makeParamList(e));
View Full Code Here


                    // These are the only states we can post this event in, ignore the rest
                    break;
                default:
                    return;
            }
            postTarget.requestFocus();
            // We post a double click event when the button is pressed and this control can
            // fire double clicks and the click count is even.
            boolean canDoubleClick = ClickListener.canFireDoubleClickEvents(e.getComponent());
            if (e.getButton() == MouseEvent.BUTTON2 && canDoubleClick && ((e.getClickCount() & 1) == 0)) {
                ClientEventManager.postEvent(postTarget, "DoubleClickMiddle", ClickListener.makeParamList(e));
View Full Code Here

                        this.setReason(Constants.FC_KEYPREV);
                    }
                    else {
                        this.setReason(Constants.FC_KEYNEXT);
                    }
                    comp.requestFocus();
                }
            }
        }
    }
View Full Code Here

                            if (!e.isShiftDown()) {
                              Component comp = traversal.getComponentAfter((Container)componentWithTraveralPolicy, focusedComponent);
 
                              // If we can transfer the focus inside the GridField, do it
                              if (comp != null && comp != traversal.getFirstComponent((Container)componentWithTraveralPolicy)) {
                                comp.requestFocus();
                                e.consume();
                              }
                            }
                            else {
                              Component comp = traversal.getComponentBefore((Container)componentWithTraveralPolicy, focusedComponent);
View Full Code Here

                            else {
                              Component comp = traversal.getComponentBefore((Container)componentWithTraveralPolicy, focusedComponent);
                             
                              // If we can transfer the focus inside the GridField, do it
                              if (comp != null && comp != traversal.getLastComponent((Container)componentWithTraveralPolicy)) {
                                comp.requestFocus();
                                e.consume();
                              }
                            }
                          }
                        }
View Full Code Here

    //TODO: implement a more robust searching mechanism instead of the above
    //If a component is below the src, but to the left or right of the center:
    //it should still be detected when you press the down arrow key.

    if(comp!=null && comp!=src && comp!=window && (!(comp instanceof JPanel))) {
      comp.requestFocus();
      return true;
    }
    return false;
  }
 
View Full Code Here

            default:
                return;
        }

        if (postTarget instanceof Graphic || postTarget.isEnabled()) {
            postTarget.requestFocus();
            // We post a double click event when the button is pressed and this control can
            // fire double clicks and the click count is even.
            boolean canDoubleClick = ClickListener.canFireDoubleClickEvents(postTarget);
            if (e.getButton() == MouseEvent.BUTTON1 && canDoubleClick && ((e.getClickCount() & 1) == 0)) {
                if (ListViewListenerHelper.isMemberOfListView(postTarget)){
View Full Code Here

                    // These are the only states we can post this event in, ignore the rest
                    break;
                default:
                    return;
            }
            postTarget.requestFocus();
            // We post a double click event when the button is pressed and this control can
            // fire double clicks and the click count is even.
            boolean canDoubleClick = ClickListener.canFireDoubleClickEvents(postTarget);
            if (e.getButton() == MouseEvent.BUTTON3 && canDoubleClick && ((e.getClickCount() & 1) == 0)) {
                ClientEventManager.postEvent(postTarget, "DoubleClickOuter", ClickListener.makeParamList(e));
View Full Code Here

                    // These are the only states we can post this event in, ignore the rest
                    break;
                default:
                    return;
            }
            postTarget.requestFocus();
            // We post a double click event when the button is pressed and this control can
            // fire double clicks and the click count is even.
            boolean canDoubleClick = ClickListener.canFireDoubleClickEvents(e.getComponent());
            if (e.getButton() == MouseEvent.BUTTON2 && canDoubleClick && ((e.getClickCount() & 1) == 0)) {
                ClientEventManager.postEvent(postTarget, "DoubleClickMiddle", ClickListener.makeParamList(e));
View Full Code Here

                        this.setReason(Constants.FC_KEYPREV);
                    }
                    else {
                        this.setReason(Constants.FC_KEYNEXT);
                    }
                    comp.requestFocus();
                }
            }
        }
    }
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.