Custom Composite not showing in "Choose Composite"

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

Custom Composite not showing in "Choose Composite"

Postby NickAltix » Mon Jul 19, 2004 1:27 pm

Hello, I'm wrapping SWT widgets (Text, Combo, Table) in Composites to add functionnalities to each widget. I have created an abstract class called IControlModel that contains code used by each new control. Im extending this new class for each new widget i want to create. I cannot choose the new, for example, "TextModel" class from the "Choose Composite" dialog. However if i insert a Text widget and change its type to TextModel i can see it in the design window.

I suppose the software doesnt recognize my new Composite since its inheriting from another abstract class.

Here is the classes definition to help you understand my problem.

Code: Select all
public abstract class IControlModel extends Composite implements Observer {

   public IControlModel(Composite parent, int style) {
      super(parent, style);
   }
   
   //Some abstract methods
   //Some concrete methods
   
}

public class TextModel extends IControlModel  {

   private Text txtModel;
   
   public TextModel(Composite parent, int style ) {
      super(parent, style, objName);
      setLayout(new FillLayout());
      {
         txtModel = new Text(this, SWT.BORDER);
      }
   }
   //added functionnalities
}



Thanks

Nicolas Laplante
Altix Solutions
NickAltix
 
Posts: 1
Joined: Mon Jul 19, 2004 1:08 pm

Re: Custom Composite not showing in "Choose Composite&q

Postby Eric Clayberg » Mon Jul 19, 2004 8:07 pm

NickAltix wrote:I suppose the software doesnt recognize my new Composite since its inheriting from another abstract class.

No. Designer would not care what the inheritance hierarchy is.

When I tried your example code, it worked just fine. I was able to choose the TextModel class and drop an instance in the design view.

I would suggest trying it with the latest v2.0.1 build to see if it makes any difference. If not, I will need you to send the complete source for both classes to us at support@swt-designer.com.
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 1 guest