Don't see Designer View tab - see faq

GWT Designer allows you to quickly create the modules, composites, panels, remote services and other elements that comprise Google Web Tookit applications.

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

Don't see Designer View tab - see faq

Postby mwaschkowski » Thu Aug 28, 2008 3:56 am

Hi,

Just wanted to mention that the inheritance checking seems a bit 'off' -> I was having some problems getting the designer to show me the design tab on a child of a parent that is a composite. So, I did a little test: I just created two test classes like so:

public class A extends Composite{

private VerticalPanel vp = new VerticalPanel();

public A(){
this.initWidget(vp);
}

}

public class B extends A{

public B(){
super();
}

}

but no design tab shows (after closing and re-opening B). But if I make B like so:

public class B extends A{

private VerticalPanel vp = new VerticalPanel();

public B(){
super();
this.initWidget(vp);
}

}

then close and reopen B, the design tab shows. Now, if I go back to:

public class B extends A{

public B(){
super();
}

}

close, and reopen, the design tab DOES show.

Not sure why I see this behavior, but wanted to mention it.

Best,

Mark
Last edited by mwaschkowski on Thu Aug 28, 2008 6:33 am, edited 1 time in total.
mwaschkowski
 
Posts: 23
Joined: Mon Jan 21, 2008 8:54 am

Re: inheritance issue

Postby Eric Clayberg » Thu Aug 28, 2008 5:10 am

This is simple, basic Eclipse behavior. It has nothing to do with inheritance.

If you don't see the Design tab, that means that you are just editing the class with the standard Java Editor and not the Desiger Editor.

Image

Image

See the Designer FAQ.
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

Re: inheritance issue

Postby mwaschkowski » Thu Aug 28, 2008 6:31 am

OK, very good, thanks for pointing out the reference in the faq, that helps (I read through the rest of the faq as well to refresh as its been months since I last used GWT Designer).

The only thing that I find confusing is when I create a brand new class, eclipse starts off editing it using the Java Editor. When I then use: 'extends Composite' as in:

public class T extends Composite{

}

the next time I open class T, it opens with the Designer Editor automatically (!) ie. does not use the last editor as suggested in the faq. GWT Designer seems 'help out' in this case (by opening the Designer Editor - which is nice, I like this). However, if I then create a new class U and then extend T:

public class U extends T{

}

close and re-open T, GWT Designer doesn't 'help out', and the standard Java Editor is still used. A different behavior than I was expecting, I would have liked to have seen GWT Designer 'help out' in this case too. Not a biggie though...

Best,

Mark
mwaschkowski
 
Posts: 23
Joined: Mon Jan 21, 2008 8:54 am

Re: inheritance issue

Postby Eric Clayberg » Thu Aug 28, 2008 8:04 am

Eclipse locks in the last editor opened via the Open With command. You can switch back and forth between using the standard Java Editor and the Desigenr Editor and the system will continue to use the last editor you selected. When you create a new Java file and open it, it will initially be opened in the Java Editor which is the default for simple Java files. Each time you open a Java file via Open or double-clicking on it, Eclipse will analyze the file and pick the appropriate default editor (as soon as you use Open With, the editor choice is locked in). If the contents of the file have changed, other editor types may become the default editor based on the content of the file. The Designer Editor is set as the primary default for Java GUI classes (e.g., Java classes that reference/import known GUI elements like Composite). As soon as you add the "extends Composite" and associated import, that class will be recognized as a GUI class the next time you double-click on it. If you remove the "extends Composite" and associated import, it will go back to being opened by the Java Editor the next time. As soon as you use Open With, the choice of editor for that specific file becomes permanent regardless of its content. The second class that you created does not reference any known GUI classes yet, so it will continue to use the Java Editor by default.
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

Re: Don't see Designer View tab - see faq

Postby mwaschkowski » Thu Aug 28, 2008 10:30 am

As soon as you use Open With, the choice of editor for that specific file becomes permanent regardless of its content. The second class that you created does not reference any known GUI classes yet, so it will continue to use the Java Editor by default.


Phew. It all makes sense. Not ideal in this particular case, but I see that its out of your hands...

Thanks very much for the explanation.

Best,

Mark
mwaschkowski
 
Posts: 23
Joined: Mon Jan 21, 2008 8:54 am

Re: Don't see Designer View tab - see faq

Postby Eric Clayberg » Thu Aug 28, 2008 10:55 am

mwaschkowski wrote:Not ideal in this particular case

How so? It seems to work pretty well and works as I would expect.

Eclipse allows you to use any editor that you want by default, so you can always use Open With > Designer Editor on any file, if you like.

Designer adds the additional ability of detecting GUI files and using the Designer Editor with them by default. WIthout that, you would need to use Open With on every file that you create by hand.
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

Re: Don't see Designer View tab - see faq

Postby mwaschkowski » Thu Aug 28, 2008 11:56 am

Designer adds the additional ability of detecting GUI files and using the Designer Editor with them by default. WIthout that, you would need to use Open With on every file that you create by hand.


OK, but why not then have the designer editor smarter by not only detecting classes that extend Composite, but any class that has Composite as a parent in the class hierarchy?
mwaschkowski
 
Posts: 23
Joined: Mon Jan 21, 2008 8:54 am

Re: Don't see Designer View tab - see faq

Postby Eric Clayberg » Thu Aug 28, 2008 4:47 pm

mwaschkowski wrote:OK, but why not then have the designer editor smarter by not only detecting classes that extend Composite, but any class that has Composite as a parent in the class hierarchy?

It's not an issue of how smart the Designer Editor itself is as the decision of which editor is used by default happens before it even gets a look at the class.

That kind of type binding information is not available to the editor preprocessor that selects the default editor type. It deals with a raw text stream and has to decide very quickly based on the raw contents of the text stream (for example, does it contain the text "com.google.gwt.user.client.ui").
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

Re: Don't see Designer View tab - see faq

Postby mwaschkowski » Thu Aug 28, 2008 5:50 pm

the editor pre-processor...has to decide very quickly based on the raw contents of the text stream (for example, does it contain the text "com.google.gwt.user.client.ui").


Thats fine, and thank you for being able to describe that so clearly (you must have a very good memory). I suggest that most people aren't going to know about the above and most would expect that if the editor pre-processor can guess the correct editor to use when opening a class that extends Composite that the editor could also guess to use the correct editor if Composite is a parent of a parent - the fact that its technically unfeasible (as you described/defined above) is not relevant when dealing with expectation, only with implementation.

I respect your opinion:
...works as I would expect
but would gently disagree that this is the ideal. Reasonable (given the circumstances you have stated) yes, but ideal no. The ideal would be to have the editor pre-processor open a given java file with a designer tab if it was appropriate, not just when a class extends from Composite. But, I can now see that this is out of your hands...

Best,

Mark
mwaschkowski
 
Posts: 23
Joined: Mon Jan 21, 2008 8:54 am

Re: Don't see Designer View tab - see faq

Postby Eric Clayberg » Thu Aug 28, 2008 5:57 pm

Keep in mind one other nuance...when a wizard creates a new file, it can immediately set the default editor for the file. Any time you create a new GWT GUI class using GWT Designer, it automatically sets the editor type for that file. Thus, the situation you ran into is an exceeding rare edge case in practice. Most folks will simply use GWT Designer's Composite wizard to create a new Composite, and will never have this problem to begin with.
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 GWT Designer

Who is online

Users browsing this forum: No registered users and 3 guests