Where is my "Expose Widget..." option?

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

Where is my "Expose Widget..." option?

Postby paulsschwarz » Wed Jan 10, 2007 6:56 am

I am running Window Designer 6.0.0 with Eclipse 3.2.1.

My aim is to create a custom widget that is a panel with some heading text. I have done this by creating a Composite, adding a label, and adding a vertical panel. I have created a fairly normal looking constructor method for my composite, and an add method, a setHeaderText method, etc. All the things you'd expect.

Right, now I have added my widget to the main project, and in the Design view I see my widget in a nice WYSIWYG way. Now I click on Image to try to add an image to my new "panel"-type control, but it refuses because Designer obviously isn't picking up that my control is a panel that can have children. Incidently, the variable headerText shows up in the Properties list, which is very cool but I don't know what I did to make that work, it just worked. Can anyone tell me what I did right here?

Now back to the panel. So I found this tutorial on your site http://download.instantiations.com/DesignerDoc/integration/latest/docs/html/gwt/gwt_composites.html and it looks like that's just what I want to do, but notice in about step 2 or 3 the tutorial clicks on a widget and clicks "Expose Widget...", well my menu doens't give that option. Any idea why? And if not, can someone please tell me what Designer would do if I clicked that? The reason I ask is: can I go ahead an manually implement a certain method, or make public a certain class variable that will suddenly make my custom widget expose its panel to the WYSIWYG view?

Great product from Instantiations!

Thanks
Paul Schwarz
paulsschwarz
 
Posts: 2
Joined: Mon Jan 08, 2007 11:29 pm
Location: Kenya

Re: Where is my "Expose Widget..." option?

Postby Eric Clayberg » Wed Jan 10, 2007 8:22 am

paulsschwarz wrote:I am running Window Designer 6.0.0 with Eclipse 3.2.1.

Note that this is an old version of GWT Designer. You should use the latest 6.0.1/1.0.1 build of Designer.

paulsschwarz wrote:Incidently, the variable headerText shows up in the Properties list, which is very cool but I don't know what I did to make that work, it just worked. Can anyone tell me what I did right here?

You either added getter/setter accessors for it manually or you used the "Expose Property" command (which generates the accessors for you).

Designer automatically picks up custom properties via reflection as long as there is a matching getter/setter accessor pair. This works for all common data types (Strings, ints, etc.).

paulsschwarz wrote:notice in about step 2 or 3 the tutorial clicks on a widget and clicks "Expose Widget...", well my menu doesn't give that option. Any idea why?

Yes. That page reflects the latest version of the product, so you need to be using Designer 6.0.1/1.0.1 in order to see that command.

paulsschwarz wrote:can someone please tell me what Designer would do if I clicked that?

Designer creates a public getter for the widget. You can then access any properties of that widget in a consuming class. If the exposed widget is a panel, you will be able to add widgets to it in the consuming class.

paulsschwarz wrote:The reason I ask is: can I go ahead an manually implement a certain method, or make public a certain class variable that will suddenly make my custom widget expose its panel to the WYSIWYG view?

Yes. You can add the public accessor for the widget manually as well.
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