src/share/classes/javax/swing/SortingFocusTraversalPolicy.java
Print this page
@@ -269,19 +269,23 @@
Component afterComp = policy.getComponentAfter(provider, aComponent);
// Null result means that we overstepped the limit of the FTP's cycle.
// In that case we must quit the cycle, otherwise return the component found.
if (afterComp != null) {
- if (log.isLoggable(PlatformLogger.FINE)) log.fine("### FTP returned " + afterComp);
+ if (log.isLoggable(PlatformLogger.FINE)) {
+ log.fine("### FTP returned " + afterComp);
+ }
return afterComp;
}
aComponent = provider;
}
List<Component> cycle = getFocusTraversalCycle(aContainer);
- if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
+ if (log.isLoggable(PlatformLogger.FINE)) {
+ log.fine("### Cycle is " + cycle + ", component is " + aComponent);
+ }
int index = getComponentIndex(cycle, aComponent);
if (index < 0) {
if (log.isLoggable(PlatformLogger.FINE)) {
@@ -358,11 +362,13 @@
Component beforeComp = policy.getComponentBefore(provider, aComponent);
// Null result means that we overstepped the limit of the FTP's cycle.
// In that case we must quit the cycle, otherwise return the component found.
if (beforeComp != null) {
- if (log.isLoggable(PlatformLogger.FINE)) log.fine("### FTP returned " + beforeComp);
+ if (log.isLoggable(PlatformLogger.FINE)) {
+ log.fine("### FTP returned " + beforeComp);
+ }
return beforeComp;
}
aComponent = provider;
// If the provider is traversable it's returned.
@@ -371,11 +377,13 @@
}
}
List<Component> cycle = getFocusTraversalCycle(aContainer);
- if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
+ if (log.isLoggable(PlatformLogger.FINE)) {
+ log.fine("### Cycle is " + cycle + ", component is " + aComponent);
+ }
int index = getComponentIndex(cycle, aComponent);
if (index < 0) {
if (log.isLoggable(PlatformLogger.FINE)) {
@@ -422,11 +430,13 @@
* @throws IllegalArgumentException if aContainer is null
*/
public Component getFirstComponent(Container aContainer) {
List<Component> cycle;
- if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Getting first component in " + aContainer);
+ if (log.isLoggable(PlatformLogger.FINE)) {
+ log.fine("### Getting first component in " + aContainer);
+ }
if (aContainer == null) {
throw new IllegalArgumentException("aContainer cannot be null");
}
if (this.cachedRoot == aContainer) {
@@ -434,14 +444,18 @@
} else {
cycle = getFocusTraversalCycle(aContainer);
}
if (cycle.size() == 0) {
- if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is empty");
+ if (log.isLoggable(PlatformLogger.FINE)) {
+ log.fine("### Cycle is empty");
+ }
return null;
}
- if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle);
+ if (log.isLoggable(PlatformLogger.FINE)) {
+ log.fine("### Cycle is " + cycle);
+ }
for (Component comp : cycle) {
if (accept(comp)) {
return comp;
} else if (comp != aContainer &&
@@ -464,11 +478,13 @@
* or null if no suitable Component can be found
* @throws IllegalArgumentException if aContainer is null
*/
public Component getLastComponent(Container aContainer) {
List<Component> cycle;
- if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Getting last component in " + aContainer);
+ if (log.isLoggable(PlatformLogger.FINE)) {
+ log.fine("### Getting last component in " + aContainer);
+ }
if (aContainer == null) {
throw new IllegalArgumentException("aContainer cannot be null");
}
@@ -477,14 +493,18 @@
} else {
cycle = getFocusTraversalCycle(aContainer);
}
if (cycle.size() == 0) {
- if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is empty");
+ if (log.isLoggable(PlatformLogger.FINE)) {
+ log.fine("### Cycle is empty");
+ }
return null;
}
- if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle);
+ if (log.isLoggable(PlatformLogger.FINE)) {
+ log.fine("### Cycle is " + cycle);
+ }
for (int i= cycle.size() - 1; i >= 0; i--) {
Component comp = cycle.get(i);
if (accept(comp)) {
return comp;