Designer don't recognize ancestor layout ? ....

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Designer don't recognize ancestor layout ? ....

Postby ncister » Wed Sep 14, 2005 7:45 am

Hi all,
My use case is the following:
I design a standard JFrame called for example "BaseFrame" and ALL my application frames inherit from it.
BaseFrame defines a protected "SpringLayout" layout into its constructor and all components are corrected aligned ....
Now when i try to design a new Frame that inherits from BaseFrame (for example "Frame1"), the ancestor components are NOT aligned correctly.
Again, if i try to add others components on Frame1, the designer automatically add a new instance of layout .... so its components are aligned correctly .... but the ancestor components not .......
So two comments and a question:

1) If a frame inherits from a custom JFrame, it must correctly recognize all ancestor "protected" objects, including layouts.

2) Could be very interesting the possibility to set in an Option Pane the default scoping of Swing components. In my case (but i think that this setting could be the best default for all users....) i need to set "protected" ... so all inherited frames can point ancestor components.

3) When i define a swing component as "protected" and i try to change its name ("variable" bean property), designer display this message: "Filed..... is not private; use Refactoring commands to rename. ...... WHY so complex ?

Regards.
Nicola.
ncister
 
Posts: 14
Joined: Wed Jan 19, 2005 1:57 am

Re: Designer don't recognize ancestor layout ? ....

Postby Eric Clayberg » Thu Sep 15, 2005 5:29 am

ncister wrote:1) If a frame inherits from a custom JFrame, it must correctly recognize all ancestor "protected" objects, including layouts..

Visual inheritance is not yet support for SpringLayout. Ancestor widgets with accessors are recognized. Widgets in protected or public fields are not yet recognized, but that will be added soon.

ncister wrote:2) Could be very interesting the possibility to set in an Option Pane the default scoping of Swing components. In my case (but i think that this setting could be the best default for all users....) i need to set "protected" ... so all inherited frames can point ancestor components.

We may add an option like that in the future. At the moment, you will need to use the "Expose Component" command to make a widget visible to a sublcass or to a consumer class in the case of a reusable JPanel.

ncister wrote:3) When i define a swing component as "protected" and i try to change its name ("variable" bean property), designer display this message: "Filed..... is not private; use Refactoring commands to rename. ...... WHY so complex ?

When Designer renames a widget, that is a an operation local to the current class. If you have a public or protected field which can be acessed from another class, you need to use the full Eclipse refactoring function to make sure and change all its references.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to Swing Designer

Who is online

Users browsing this forum: No registered users and 1 guest