-
Enhancement
-
Resolution: Unresolved
-
P5
-
None
-
6
-
x86
-
windows_xp
A DESCRIPTION OF THE REQUEST :
Currently the access methods to horizontal and vertical groups are private. They should be make public. When this layout manger was part of swing labs they were public.
JUSTIFICATION :
When constructing windows it would be useful to have public access to the groups directly from the layout manager as was when this was in swing labs.
This way I can use creational utilities (reusable code) to help build pages faster (coding effort not runtime)
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Please make these methods made public.
ACTUAL -
The methods are currently private.
---------- BEGIN SOURCE ----------
See below for work around.
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Currently I use a custom reflection utility to gain access to the methods and invoke them.
example:
public static GroupLayout.Group getGroup(String type, GroupLayout layoutManager)
throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException
{
Method method = layoutManager.getClass().getDeclaredMethod("get" + type + "Group") ;
method.setAccessible(true) ;
return (GroupLayout.Group) method.invoke(layoutManager) ;
}
}
Currently the access methods to horizontal and vertical groups are private. They should be make public. When this layout manger was part of swing labs they were public.
JUSTIFICATION :
When constructing windows it would be useful to have public access to the groups directly from the layout manager as was when this was in swing labs.
This way I can use creational utilities (reusable code) to help build pages faster (coding effort not runtime)
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Please make these methods made public.
ACTUAL -
The methods are currently private.
---------- BEGIN SOURCE ----------
See below for work around.
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Currently I use a custom reflection utility to gain access to the methods and invoke them.
example:
public static GroupLayout.Group getGroup(String type, GroupLayout layoutManager)
throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException
{
Method method = layoutManager.getClass().getDeclaredMethod("get" + type + "Group") ;
method.setAccessible(true) ;
return (GroupLayout.Group) method.invoke(layoutManager) ;
}
}