Drop swt widget on RCP MultipageEditor page

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

Drop swt widget on RCP MultipageEditor page

Postby mpatt » Mon Nov 22, 2010 4:23 pm

I've the following requirement :-

1) I need to have a view with various swt widgets like buttons, tree, text fields/area, list boxes

etc...these widgets can be dragged from this view for dropping in an editor.
2) Ineed a multipage editor in which -
a) the first page is a widget page where i can drop the widgets dragged from the above view
b) the second page is a kind of text editor where code is automatically generated w.r.t. the

widget dropped in the first page.

(both these editor pages work together...if one page edited, the other reflects it.)

Current status :-

I'm using SWT api for this along with eclipse ui api.

I'm able to get the particular widgets view and attached a drag source to it.

Also created a multipage editor.
The text editor takes the text value of drop from the view with out any drop target attached to it.

But for the widget editor(basically a Composite page), This page has got an attached droptarget listener.

I'm explicitly creating the instances of dropped widget again and attaching to the composite page. It's

difficult to know what widget is dropped....a button, or a combobox or a text field (but I don't know how

to do it otherwise, I may have to extend the transfer types someway to take any kind of widget).

The biggest concern is :-

I'm able to drop one widget first and it's visible. But for the second drop, I've to alter the size of

editor manually (may be by mouse drag or so) for the widget to be visible.

I'm not able to activate the save button for the widget editor. So what ever data input is never saved and

lost when i close the editor.

Can someone help me on these 3 points mainly :-

1) How to save the widget editor data

2) How to make the dropped widgets visible without any manual action such as resizing.

3) How can i take my widgets as the transfer types instead of instantiating a new one every time
Posts: 1
Joined: Mon Nov 22, 2010 4:17 pm

Re: Drop swt widget on RCP MultipageEditor page

Postby Eric Clayberg » Mon Nov 22, 2010 4:48 pm

I would highly recommend asking detailed SWT/RCP usage questions like this in either the Eclipse SWT or RCP newsgroups.

We would like to keep this forum very focused on SWT Designer itself.

I would also suggest that without posting some working sample code illustrating what you have done (and giving someone the opportunity to play around with where you are now), very few people will be able to offer much help.
Eric Clayberg
Software Engineering Manager

Author: "Eclipse Plug-ins"
Eric Clayberg
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: Bing [Bot] and 1 guest