How to make nebula widgets available in swt designer

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

How to make nebula widgets available in swt designer

Postby kubikconcepts » Sun Jun 03, 2007 5:13 am

Hello,
I need to use some eclipse nebula widgets in my application. I use SWTDesigner. How do I make the nebula widgets available in the swt designer palette? Also, installation wise, should i drop those nebula jars into the plugins directory" OR should i create my own wrapper plugin?

Thanks,
KTC
kubikconcepts
 
Posts: 4
Joined: Thu May 17, 2007 11:38 am

Re: How to make nebula widgets available in swt designer

Postby Eric Clayberg » Sun Jun 03, 2007 7:52 am

kubikconcepts wrote:I need to use some eclipse nebula widgets in my application. I use SWTDesigner. How do I make the nebula widgets available in the swt designer palette?

You can add any custom widget that conforms to SWT standard protocols via the Palette Manager.

Image

kubikconcepts wrote:Also, installation wise, should i drop those nebula jars into the plugins directory" OR should i create my own wrapper plugin?

It doesn't make any difference.
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

Unable to get nebula widgets to work

Postby kubikconcepts » Fri Jun 08, 2007 4:26 am

Hello,
I added the pshelf widgets to the palette manager. I was able to add the pshelf widget to a rcp viewpart. However the widget does not show up in the designer. Designer let me graphically drop the pshelf widget onto the view but the pshelf widget itself is not visible.

Also at runtime it raises exception about not being able to use pshelf.

What is the best way to work with custom widgets, eclipse, and swt designer? Would it be possible for instantiations to write a short, very brief tutorial on using nebula widgets with swt designer?

Thanks,
KTC
kubikconcepts
 
Posts: 4
Joined: Thu May 17, 2007 11:38 am

Re: Unable to get nebula widgets to work

Postby Eric Clayberg » Fri Jun 08, 2007 4:46 am

kubikconcepts wrote:Also at runtime it raises exception about not being able to use pshelf.

What exception? It would be helpful to see the entire log entry.

When I drop a PShelf widget into Designer, I can see it, change its color, etc.

As I said earlier, you can add any custom widget that conforms to SWT standard protocols. The problem with some custom widgets is that they either don't conform to normal SWT conventions (usually by missing the standard two-argument SWT constructor) or they throw some sort of exception at design time. I don't see either of those problems with PShelf, however.

Also note that SWT Designer is freely available to anyone on the Nebula project team that wants to test their widgets.
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 BillBlalock » Sat Nov 17, 2007 2:13 pm

I am trying to add the Nebula widgets
org.eclipse.nebula.widgets.formattedtext.NumberFormatter
org.eclipse.nebula.widgets.formattedtext.MaskFormatter
to SWT Designer (6.5.0).

I copied
org.eclipse.nebula.widgets.formattedtext_1.0.0.jar
into the plugins folder.

The widgets in this jar weren't available to SWT Designer (after restarting it) when I tried to add a new entry to the palette. The formattedtext plugin showed in Help > About > Plug-in Details.

Then I added the plugin jar to the project I am working on using
Project > Properties > Java Build Path > Libraries > Add Variable > ECLIPSE_HOME > Expand

Now new entry in the palette manager can see the classes. I added to new entries in a new category for Nebula widgets.

NumberFormatter and MaskFormatter appear on the Palette but I can't drag them into the designer.

What am I doing wrong? I am guessing it has something to do with how the numberformatter_1.0.0.jar file set up for the class path.

Thanks!
Bill Blalock
BillBlalock
 
Posts: 2
Joined: Wed Nov 14, 2007 5:06 pm
Location: Tuscaloosa, AL

Postby Eric Clayberg » Sat Nov 17, 2007 2:55 pm

Currently, SWT Designer only supports custom SWT widgets. Neither NumberFormatter or MaskFormatter is a custom SWT widget. They appear to be some sort of custom decorator component meant to wrapper a Text widget.

Supporting them in SWT Designer will require a significant amount of custom support on our end. We do plan to add support for the various Nebula widgets and widget-like classes, but we will probaly wait until more of the components are out of alpha and at least into beta.
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 BillBlalock » Sun Nov 18, 2007 6:03 am

Eric:

Thanks for the prompt reply and clear explanation. I understand the reasoning for not support these widgets and agree with them. I think these widgets are needed and Eclipse will eventually provide them.

Do you have suggestions about how to implement most of the functionality of these "widgets" with the tools available in SWT Designer? The latest version offers some facinating posibilities. For example it seems like a Validator could ignore any keystroke which wasn't 0-9, a decimal symbol or negative sign.

I think users trying to understand and use data binding would appreciate samples / snippets of using SWT Designer with data binding for different kinds of editing, validation and formatting. That is what I was looking for with these Nebula widgets. (Sorry if I am wandering off topic here).

For example, the data binding currency example helped me understand using Converter but it could go further.
- allow fractional dollars
- check the input for numbers only, reject negative numbers, ignore more deicmal places than the currency supports.
- Show a message when validation fails.

I have been exploring the Eclipse Wiki articles on data binding.

Thank again.
Bill Blalock
BillBlalock
 
Posts: 2
Joined: Wed Nov 14, 2007 5:06 pm
Location: Tuscaloosa, AL

Postby Eric Clayberg » Sun Nov 18, 2007 1:14 pm

BillBlalock wrote:Thanks for the prompt reply and clear explanation. I understand the reasoning for not support these widgets and agree with them. I think these widgets are needed and Eclipse will eventually provide them.

We do plan to support all of Nebula eventually but many of those components will require special support since they don't follow normal SWT rules. We will also wait for them to mature a bit, so we aren't wasting engineering effort adding support for them prematurely.

BillBlalock wrote:Do you have suggestions about how to implement most of the functionality of these "widgets" with the tools available in SWT Designer?

If I were the author of those components, I would simply re-write them to be real widgets - either Text subclasses or Composites holding onto a single Text widget. If I wanted to use them right now, I would simply wrapper them in a custom Composite. The following could be used as a custom widget in Designer directly:

Code: Select all
import org.eclipse.nebula.widgets.formattedtext.FormattedText;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;

public class MyFormattedText extends Composite {
   private FormattedText ft;
   public MyFormattedText(Composite parent, int style) {
      super(parent, style);
      setLayout(new FillLayout());
      ft = new FormattedText(this, style);
   }
   public String getText() {
      return ft.getControl().getText();
   }
   public void setText(String text) {
      ft.getControl().setText(text);
   }
}

BillBlalock wrote:I think users trying to understand and use data binding would appreciate samples / snippets of using SWT Designer with data binding for different kinds of editing, validation and formatting.

A number of different DB examples are included in our DB docs.

Keep in mind that we did not create the DB framework itself. It is the responsibility of Eclipse.org to supply docs, examples and snippets to show how to use the DB API. Any examples we provide are intended to show how to access the DB API from Designer. They are not provided as an exhaustive tutorial on what you can do with the DB API itself.
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 SWT Designer

Who is online

Users browsing this forum: No registered users and 2 guests