Code parsing sometimes does not work

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

Code parsing sometimes does not work

Postby jonaumann » Fri Dec 09, 2005 1:40 am

Sometimes the code parsing stops working when working with inheritence and no inherited components are shown on the child-class Panel.
It works again, however, if I make a new JPanel, copy the old code of the inherited class into the new JPanel class, and let the child-class panel inherit this new class. Then all components are shown correctly. Is there a way to force swing designer to parse a class hierarchy again by deleting some files where this information is stored?
jonaumann
 
Posts: 7
Joined: Tue Nov 01, 2005 3:02 am

Re: Code parsing sometimes does not work

Postby Eric Clayberg » Fri Dec 09, 2005 5:57 am

jonaumann wrote:Sometimes the code parsing stops working when working with inheritence and no inherited components are shown on the child-class Panel.

Any exceptions in your Eclipse ".log" file. The cause for any parsing error should be recorded to your log.

Can you provide a test case? It would be hard to recommend any changes without seeing your actual code.

jonaumann wrote:Is there a way to force swing designer to parse a class hierarchy again by deleting some files where this information is stored?

I'm not sure what you mean. What "information" do you want to delete?

The only way to get Designer to parse a class is to fix whatever is causing the parsing problem. Without seeing your code and/or the exceptions in your log, I don't know what the problem might be.
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

Postby jonaumann » Fri Dec 09, 2005 7:15 am

there is no error in the log file. Designer just does not show any components in the inherited JPanel.

What I mean by "deleting information" is that I saw that when that error ocurred Designer spend no time to parse any changes I made in the father-class that should be reflected in the child-class - but usually it takes a while for Designer to parse these informations, so I thought that maybe Designer stores layout-information in a cache or something that is not correctly updated. Another hint for this was, that when I make a new class with the same code (that was not working before) it works. So somehow Designer remembers what class it already parsed or what class was already opened in the Designer??

The steps I took were:
1. Created a new rather complex JPanel (lets call it father-class)
2. Created a new JPanel that inherits from that father class. (lets call it child class)
3. changed layout related stuff in the father-class.
4. switched to child class, Designer spend no time to reparse anything, no errors in the log, just did not display any inherited component.
5. copied the code of father-class into a newly created JPanel (lets call it father-copy)
6. changed inheritance of child-class to father-copy
7. now Designer displays everything correctly.


It would be hard to provide a test case, because of the nature of the problem. If I send you the code, it will work, because for your Designer it will be the first time you open this class.
jonaumann
 
Posts: 7
Joined: Tue Nov 01, 2005 3:02 am

Postby Eric Clayberg » Fri Dec 09, 2005 9:05 am

jonaumann wrote:What I mean by "deleting information" is that I saw that when that error ocurred Designer spend no time to parse any changes I made in the father-class that should be reflected in the child-class - but usually it takes a while for Designer to parse these informations, so I thought that maybe Designer stores layout-information in a cache or something that is not correctly updated.

If your parent class has an error of some sort, Designer won't be able to instantiate it, so none of the inherited controls will appear.

Designer only parses the class you are editing; it does not parse the parent class. The parent class is simply instantiated using its default constructor.

jonaumann wrote:The steps I took were:
1. Created a new rather complex JPanel (lets call it father-class)
2. Created a new JPanel that inherits from that father class. (lets call it child class)
3. changed layout related stuff in the father-class.
4. switched to child class, Designer spend no time to reparse anything, no errors in the log, just did not display any inherited component.

I tried the above several times, and it worked fine every time. All of the inherited controls were visible. In fact, every time I switched back to the parent class and made a change, that change was reflected in the subclass as soon as I switched back.

jonaumann wrote:It would be hard to provide a test case, because of the nature of the problem. If I send you the code, it will work, because for your Designer it will be the first time you open this class.

At the moment, I can't reproduce the problem you describe, so I am going to need some kind of test case. In your example above, if you switch back to the parent class and make a change, is it reflected in the subclass or not?
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