Package java.awt

Examples of java.awt.FocusTraversalPolicy


      : aContainer.getFocusCycleRootAncestor();

  // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's
  // traversal policy is non-legacy, then honor it.
  if (root != null) {
      FocusTraversalPolicy policy = root.getFocusTraversalPolicy();
      if (policy != gluePolicy) {
    return policy.getComponentBefore(root, aComponent);
      }

      comparator.setComponentOrientation(root.getComponentOrientation());
      return layoutPolicy.getComponentBefore(root, aComponent);
  }
View Full Code Here


      : aContainer.getFocusCycleRootAncestor();

  // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's
  // traversal policy is non-legacy, then honor it.
  if (root != null) {
      FocusTraversalPolicy policy = root.getFocusTraversalPolicy();
      if (policy != gluePolicy) {
    return policy.getFirstComponent(root);
      }

      comparator.setComponentOrientation(root.getComponentOrientation());
      return layoutPolicy.getFirstComponent(root);
  }
View Full Code Here

      : aContainer.getFocusCycleRootAncestor();

  // Support for mixed 1.4/pre-1.4 focus APIs. If a particular root's
  // traversal policy is non-legacy, then honor it.
  if (root != null) {
      FocusTraversalPolicy policy = root.getFocusTraversalPolicy();
      if (policy != gluePolicy) {
    return policy.getLastComponent(root);
      }

      comparator.setComponentOrientation(root.getComponentOrientation());
      return layoutPolicy.getLastComponent(root);
  }
View Full Code Here

        // See if the component is inside of policy provider
        Container ftp = getTopmostProvider(aContainer, aComponent);
        if (ftp != null) {
            if (log.isLoggable(Level.FINE)) log.fine("### Asking FTP " + ftp.getName() + " for component after " + aComponent.getName());
            // FTP knows how to find component after the given. We don't.
            FocusTraversalPolicy policy = ftp.getFocusTraversalPolicy();
            Component retval = policy.getComponentAfter(ftp, aComponent);
            if (retval == policy.getFirstComponent(ftp)) {
                retval = null;
            }
           
            if (retval != null) {
                if (log.isLoggable(Level.FINE)) log.fine("### FTP returned " + retval.getName());
View Full Code Here

        // See if the component is inside of policy provider
        Container ftp = getTopmostProvider(aContainer, aComponent);
        if (ftp != null) {
            if (log.isLoggable(Level.FINE)) log.fine("### Asking FTP " + ftp.getName() + " for component after " + aComponent.getName());
            // FTP knows how to find component after the given. We don't.
            FocusTraversalPolicy policy = ftp.getFocusTraversalPolicy();
            Component retval = policy.getComponentBefore(ftp, aComponent);
            if (retval == policy.getLastComponent(ftp)) {
                retval = null;
            }
            if (retval != null) {
                if (log.isLoggable(Level.FINE)) log.fine("### FTP returned " + retval.getName());
                return retval;
View Full Code Here

  public boolean requestFocusInWindow() {
    // If we are in an ArrayField
    if (ArrayFieldCellHelper.getArrayField(this) != null) {

      // We should have a FocusTraversalPolicy (setup in GridFieldCellEditor)
          FocusTraversalPolicy traversal = this.getFocusTraversalPolicy();

      if (ForteKeyboardFocusManager.getTraversalReason() == Constants.FC_KEYPREV) {
        return traversal.getLastComponent(this).requestFocusInWindow();
      }
      else {
        return traversal.getFirstComponent(this).requestFocusInWindow();
      }
    }
    else {
      return super.requestFocusInWindow();
    }
View Full Code Here

          else if (root instanceof JWindow) {
            root = ((JWindow)root).getContentPane();
          }
        }
        if (root != null) {
          FocusTraversalPolicy policy = root.getFocusTraversalPolicy();
         
          // CraigM:01/09/2008 - Switch off the special ArrayField focus handling as it causes an endless loop
          if (policy instanceof ForteLayoutFocusTraversalPolicy) {
            ((ForteLayoutFocusTraversalPolicy)policy).setSwingDisplayerIgnoreArrayField(true);
          }
         
          // DK:30/09/2008:With some of the forms lastComponent is null and component after the last one
          //is the first one and we do not need to continue to avoid endless loop.
          Component firstComponent = policy.getFirstComponent(container);
          Component lastComponent = policy.getLastComponent(container);
        Component child = firstComponent;
          while (child != null) {
            // TF:28/10/2008:There are some situation where getComponentAfter returns the same component, so prevent infinite looping
            if (result.contains(child)) {
              break;
            }
            result.add(child);
          if (child == lastComponent) {
              break;
            }
            child = policy.getComponentAfter(root, child);

            if (child == firstComponent) {
              break;
            }
          }
View Full Code Here

  public boolean requestFocusInWindow() {
    // If we are in an ArrayField
    if (ArrayFieldCellHelper.getArrayField(this) != null) {

      // We should have a FocusTraversalPolicy (setup in GridFieldCellEditor)
          FocusTraversalPolicy traversal = this.getFocusTraversalPolicy();

      if (ForteKeyboardFocusManager.getTraversalReason() == Constants.FC_KEYPREV) {
        return traversal.getLastComponent(this).requestFocusInWindow();
      }
      else {
        return traversal.getFirstComponent(this).requestFocusInWindow();
      }
    }
    else {
      return super.requestFocusInWindow();
    }
View Full Code Here

          else if (root instanceof JWindow) {
            root = ((JWindow)root).getContentPane();
          }
        }
        if (root != null) {
          FocusTraversalPolicy policy = root.getFocusTraversalPolicy();
         
          // CraigM:01/09/2008 - Switch off the special ArrayField focus handling as it causes an endless loop
          if (policy instanceof ForteLayoutFocusTraversalPolicy) {
            ((ForteLayoutFocusTraversalPolicy)policy).setSwingDisplayerIgnoreArrayField(true);
          }
         
          // DK:30/09/2008:With some of the forms lastComponent is null and component after the last one
          //is the first one and we do not need to continue to avoid endless loop.
          Component firstComponent = policy.getFirstComponent(container);
          Component lastComponent = policy.getLastComponent(container);
        Component child = firstComponent;
          while (child != null) {
            // TF:28/10/2008:There are some situation where getComponentAfter returns the same component, so prevent infinite looping
            if (result.contains(child)) {
              break;
            }
            result.add(child);
          if (child == lastComponent) {
              break;
            }
            child = policy.getComponentAfter(root, child);

            if (child == firstComponent) {
              break;
            }
          }
View Full Code Here

                        // CraigM:15/10/2008 - If we are a grid field in an array field
                        if (focusedComponent.getParent() instanceof GridField && ArrayFieldCellHelper.getArrayField(focusedComponent.getParent()) != null) {

                          // We should have a FocusTraversalPolicy somewhere on a gridfield (setup in GridFieldCellEditor)
                          FocusTraversalPolicy traversal = null;
                          Component componentWithTraveralPolicy = focusedComponent;
                          while (componentWithTraveralPolicy != null && traversal == null) {
                            componentWithTraveralPolicy = componentWithTraveralPolicy.getParent();
                            if (componentWithTraveralPolicy instanceof Container) {
                              traversal = ((Container)componentWithTraveralPolicy).getFocusTraversalPolicy();
                            }
                          }

                          // If this is null, it means we didn't find the FocusTraversalPolicy manager.
                          if (traversal != null && componentWithTraveralPolicy instanceof Container) {
                            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);
                             
                              // 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

TOP

Related Classes of java.awt.FocusTraversalPolicy

Copyright © 2018 www.massapicom. 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.