SWT/Swing Designer Suggestions

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

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

SWT/Swing Designer Suggestions

Postby afinnell » Fri Jul 02, 2004 8:31 am

First and foremost I would like to state that this product is the best designer I've seen for Swing and the only I've seen for SWT. However I feel there are some improvements that are needed for it to become usable in a professinal environment. If these have already been posted I apologize I havent read through all the postings yet.

1) Swt-Designer UI Layout. Possibly remove the properties editor and use the built-in Eclipse properties editor instead. Move the 'widget' controls into a seperate eclipse window so that it can be docked anywhere. This would give tremendous space to the actual Form's that are displayed and it would be more cohesive with the environment. Right now it's hard to have a decent window size and im running at 1600x1200

2) The code generation for the designer is hard to use. All variables are declared final within a single method block. This makes manipulating the form's and widget near impossible because they all have block scope within the method. They should become private member fields and a single method called 'initComponents' or something similar should be used to initialize all of the widgets.

I would suggest looking at the code generation that Visual Studio .NET WinForms generates. I _personally_ enjoy designing UI's with it. I also think that swt-designer can become the defacto for developing UI's if some of these issues were resolved.

The biggest one for me is the code generation. In an attempt to move some of the components out of the method block swt-designer started inserting code in the wrong method.

-
Andrew
afinnell
 
Posts: 2
Joined: Fri Jul 02, 2004 8:21 am

Re: SWT/Swing Designer Suggestions

Postby Eric Clayberg » Fri Jul 02, 2004 1:11 pm

afinnell wrote:1) Swt-Designer UI Layout. Possibly remove the properties editor and use the built-in Eclipse properties editor instead. Move the 'widget' controls into a seperate eclipse window so that it can be docked anywhere. This would give tremendous space to the actual Form's that are displayed and it would be more cohesive with the environment. Right now it's hard to have a decent window size and im running at 1600x1200

The basic Eclipse property editor does not support varioius features that we need, so we would need to create our own property pane to plug into the property view. At that point, there isn't much benefit over our current approach. Have you look at the various Designer editor layout options? WIth those, you can position the various panes relative to one another in a variety of combinations. One benefit to our current appoach is that you can double-click to expand the Designer editor and hide all of the non-Designer views while keeping only the Designer panes visible. With separate views, that is hard to do. Separate views also require you to close the extra views once you are done with them.

afinnell wrote:2) The code generation for the designer is hard to use. All variables are declared final within a single method block. This makes manipulating the form's and widget near impossible because they all have block scope within the method. They should become private member fields and a single method called 'initComponents' or something similar should be used to initialize all of the widgets.

It sounds like you are decribing only one of Designer's many code generation options. Designer is extremely flexible in terms of its code generation and can support many different styles. If you want all (or just some) of the widgets created as fields, that option is readily supported. You can also convert a widget from being a local variable to a field (and back) very easily using the tools provided by Designer. As to the code gen, you can use block mode or flat mode, have widgets defined as fields or local variables, define variables at the top of the method or where first used, as final or not. etc. We also offer high-end capabilities for sharing variables (like multiple labels or multiple layout data objects).

As to which method the widgets are defined in, you can use any method (including initComponents()) that you like. Just change it in the code and keep going. Unlike other tools, Designer supports and almost unlimited number of user refactorings or other hand-made changes. You can rename the generated method, split it into sub methods, insert your own code anywhere you want, etc.
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 afinnell » Fri Jul 02, 2004 3:17 pm

Eric,

Thank you for the quick response. I didn't realize the options existed in the preferences menu. I didn't notice the 'Designer' item in the preferences. It does appear there is a lot of flexability to how things are created and the layout. I'll work with these options and see how they work out.

Thanks,

Andrew
afinnell
 
Posts: 2
Joined: Fri Jul 02, 2004 8:21 am

Postby Eric Clayberg » Fri Jul 02, 2004 3:31 pm

afinnell wrote:I didn't realize the options existed in the preferences menu. I didn't notice the 'Designer' item in the preferences. It does appear there is a lot of flexability to how things are created and the layout. I'll work with these options and see how they work out.

Sounds good. Designer has a lot of options you can tweak, but that doesn't mean we can't add more to get it just right. We are in the process of adding additional code gen options, so let me know if you think of any we need.
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

User code for property values

Postby pvarma » Thu Jul 08, 2004 5:28 am

We have utility classes for obtaining fonts, colors, localized strings, images, etc. Currently there is no way to provide user function as the property value. For e.g., for composite background color, we want to always use "ThemeManager.getInstance().getCompositeBackground()" instead of hard coding color.

We would love to have some way to specify this in our template or a way to specify this in the property box rather than shifting to code editor and typing it there. NetBeans has a neat way to achieve this with its Swing editor (I think they use the term "user code"). This feature should be there for any property that needs to be set using code rather than hard coded strings.

Another very important thing is that we have a common library to bind values from XML (our model) to the UI controls by specifying data bindings (as XPath strings) at control level. We would like to see a way (may be a property called "headers" which allows us to specify multiple name-value String pairs that gets put into the widget using setData). If we hand write the code in source editor it looks like this:

Text txtOrderNo = new Text(pnlParent, SWT.NONE);
txtOrderNo.setData("yfc:DataType","OrderNo"); // our app has a common meta data repository for base and user defined data types
txtOrderNo.setData("yfc:Binding","/Order/@OrderNo");

Of course we can do all these in source editor. But the whole point is that a visual designer should really try to eliminate the need to go back and forth between design and source mode to fix all these.

I'd greatly appreciate your take on this.
pvarma
 
Posts: 6
Joined: Thu Jul 08, 2004 2:35 am

Re: User code for property values

Postby Eric Clayberg » Fri Jul 09, 2004 5:35 am

pvarma wrote:We would love to have some way to specify this in our template or a way to specify this in the property box rather than shifting to code editor and typing it there. NetBeans has a neat way to achieve this with its Swing editor (I think they use the term "user code"). This feature should be there for any property that needs to be set using code rather than hard coded strings.

Could you describe what they do in more detail (and include some screen shots, if it would help)?

pvarma wrote:Another very important thing is that we have a common library to bind values from XML (our model) to the UI controls by specifying data bindings (as XPath strings) at control level. We would like to see a way (may be a property called "headers" which allows us to specify multiple name-value String pairs that gets put into the widget using setData).

Adding a generic "setData" editor that supported String values would probably be pretty easy to add. We will look into it.
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: User code for property values

Postby Eric Clayberg » Sat Jul 10, 2004 7:17 pm

Eric Clayberg wrote:
pvarma wrote:Another very important thing is that we have a common library to bind values from XML (our model) to the UI controls by specifying data bindings (as XPath strings) at control level. We would like to see a way (may be a property called "headers" which allows us to specify multiple name-value String pairs that gets put into the widget using setData).

Adding a generic "setData" editor that supported String values would probably be pretty easy to add. We will look into it.

The latest v2.0.1 build now adds support for the setData property.
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 pvarma » Sun Jul 11, 2004 8:25 pm

WOW!! That was fast! Thanks. I will check the latest build to see the setData in action.

Meanwhile, how do I attach an image? I have a screenshot of NetBeans "user code" editor in action. I can email you if it is ok with you. Thanks again.
pvarma
 
Posts: 6
Joined: Thu Jul 08, 2004 2:35 am

Postby Eric Clayberg » Mon Jul 12, 2004 3:55 am

pvarma wrote:Meanwhile, how do I attach an image? I have a screenshot of NetBeans "user code" editor in action. I can email you if it is ok with you.

You can e-mail it to support@swt-designer.com or you can embed it in a message here using the "Img" tag around a URL pointing to the image (you would need to be able to upload the image to some poublic location on the web).
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 Eric Clayberg » Mon Jul 12, 2004 6:06 am

Eric Clayberg wrote:
pvarma wrote:Meanwhile, how do I attach an image? I have a screenshot of NetBeans "user code" editor in action. I can email you if it is ok with you.

You can e-mail it to support@swt-designer.com or you can embed it in a message here using the "Img" tag around a URL pointing to the image (you would need to be able to upload the image to some poublic location on the web).

Here's the screen shot you sent so that everyone else can see it...

    Image

That looks interesting. We will talk it over...
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

setData editor and NLS feature

Postby pvarma » Wed Jul 14, 2004 12:37 am

I downloaded latest build and setData editor works great! Thanks. I do have one small enhancement there though. SetData editor should also work for TableColumn widget. It works for everything including Table. For TableColumn it does not show up.

I tried the NLS demo. Very nice indeed. But, when I tried it, it hangs everytime I click "Externalize". I am using Win2K professional, Eclipse 3.0, and your latest build (July 11th).

By the way, how do I reuse an existing bundle (normally we have a common bundle for the whole plugin and not for every package). Every time it seems to create a new bundle within that package where the form is. I want to be able to browse to an existing bundle (or better, make it as default for all forms in that project).
pvarma
 
Posts: 6
Joined: Thu Jul 08, 2004 2:35 am

Re: setData editor and NLS feature

Postby Eric Clayberg » Wed Jul 14, 2004 6:28 am

pvarma wrote:I downloaded latest build and setData editor works great! Thanks. I do have one small enhancement there though. SetData editor should also work for TableColumn widget. It works for everything including Table. For TableColumn it does not show up.

OK. We'll make sure to add that for the next build.

pvarma wrote:I tried the NLS demo. Very nice indeed. But, when I tried it, it hangs everytime I click "Externalize". I am using Win2K professional, Eclipse 3.0, and your latest build (July 11th).

"Hangs" as in locks Eclipse up, or just doesn't work? Any exceptions in your Eclipse ".log" file? Does this happen with a window that is being externalized for the first time or one that you have already externalized?

pvarma wrote:By the way, how do I reuse an existing bundle (normally we have a common bundle for the whole plugin and not for every package). Every time it seems to create a new bundle within that package where the form is. I want to be able to browse to an existing bundle (or better, make it as default for all forms in that project).

Initially, it will create a new bundle, but you can move it or redirect it to a different place. The generated Message file points to the bundle that should be used. If you change that class to point to a different package, it should still work. Adding an option to let you pick an existing resource bundle would be a good idea.
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

NLS Feature

Postby pvarma » Wed Jul 14, 2004 7:04 am

Thanks Eric. When I said hangs, I meant that the whole IDE freezes and I have to use Windows task manager to kill it. This happens everytime I open the NLS dialog, select strings, types in a bundle name, and then click "Externalize".

When I reopen the IDE, the bundle and the message class are actually created. But the strings that I chose to externalize have not been externalized. So, when I open that form and bring up NLS dialog, I have to start all over and then it hangs again. I am using Eclipse 3.0 release with SWT Designer latest build.

I do not have access to the system now. I will see if there are any logs when I get to my laptop.
pvarma
 
Posts: 6
Joined: Thu Jul 08, 2004 2:35 am

Re: NLS Feature

Postby Eric Clayberg » Wed Jul 14, 2004 8:37 am

pvarma wrote:Thanks Eric. When I said hangs, I meant that the whole IDE freezes and I have to use Windows task manager to kill it. This happens everytime I open the NLS dialog, select strings, types in a bundle name, and then click "Externalize".

When I reopen the IDE, the bundle and the message class are actually created. But the strings that I chose to externalize have not been externalized. So, when I open that form and bring up NLS dialog, I have to start all over and then it hangs again. I am using Eclipse 3.0 release with SWT Designer latest build.

I do not have access to the system now. I will see if there are any logs when I get to my laptop.

Sounds like an exception of some sort. Please send that to us when you get a chance.
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

NLS feature

Postby pvarma » Wed Jul 14, 2004 9:32 am

I reinstalled Eclipse 3.0 and just SWT-Designer latest build. I had installed couple of other plug-ins and I wanted to make sure that is not the reason.

I still have the same issue. I searched for .log files and there are none. By the way, my license message says "0 days remaining". Do you think it has anything to do with expired eval license?
pvarma
 
Posts: 6
Joined: Thu Jul 08, 2004 2:35 am

Next

Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 1 guest