JDK-5110295 : Confusing statements in the AWT Focus specs
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_8
  • CPU: sparc
  • Submitted: 2004-10-01
  • Updated: 2006-07-27
  • Resolved: 2006-07-27
Related Reports
Duplicate :  
Description
The AWT Focus spec, section Pogrammatic Traversal, states:

  Also note that hiding or disabling the focus owner, directly or indirectly 
  via an ancestor, or making the focus owner non-displayable or non-focusable,
  initiates an automatic, forward focus traversal. While hiding any ancestor,
  lightweight or heavyweight, will always indirectly hide its children, only
  disabling a heavyweight ancestor will disable its children. Thus, disabling 
  a lightweight ancestor of the focus owner does not automatically initiate a
  focus traversal.

There are several questions about this section:

- It's unclear why disabling the focus owner initiates a traversal, because
  according to the spec, "A disabled Component may be the focus owner" (see 
  section Requesting Focus).

- It states an important difference between disabling a lightweight container
  and disabling a heavyweight one. Is it really true? I couldn't find anything
  about it in the javadoc. However, the Chan/Lee book (2nd Edition) doesn't 
  mention any differences. What's more confusing, this book (p.422) states
  that children of a disabled container will not receive any input events
  yet retain the enabled appearance.

It would be very useful to clarify behavior for enabling/disabling containers 
for all possible scenarios (lightwight/heavyweight ancestors, lightweight/
heavyweight children). I realize this may look like a different issue, but 
the Focus spec is the only place so far that mentions it.

###@###.### 2004-10-01

Comments
EVALUATION The question about moving focus from enabled component has been answered in the evaluation and I do not think we need to explain this in the spec. Enabling/disabling of lightweight/heavyweight containers was described as part of fix for 6449894, thus closing as duplicate of this bug.
27-07-2006

EVALUATION "It's unclear why disabling the focus owner initiates a traversal, because according to the spec, "A disabled Component may be the focus owner" (see section Requesting Focus)." - this is correct. When focus owner is becomes disabled, we try to move focus forward. However, if focus is requested to a disabled component, we allow such requests to pass. "behavior for enabling/disabling containers for all possible scenarios (lightwight/heavyweight ancestors, lightweight/heavyweight children)" - see Component.setEnabled(boolean). I agree that it however requires more details explanations, with mentioning of the mixed weight cases. ###@###.### 10/4/04 08:12 GMT
04-10-2004