Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » WindowBuilder » SWT Designer - DnD not working
SWT Designer - DnD not working [message #1407629] Wed, 13 August 2014 04:21 Go to next message
Artha Wijendra is currently offline Artha WijendraFriend
Messages: 2
Registered: August 2014
Junior Member
I have been working on the Window Builder's SWING Designer before and now there is a requirement to work on the Eclipse SWT framework.

For this I need to use the SWT designer and I have been having a DnD issue.

I have a org.eclipse.jface.dialogs.Dialog instance as shown below.

import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.swt.widgets.Display;

public class Tezst extends Dialog 
{	
	   public Tezst(final Shell parent)
	   {		   
	      super(parent);
	      
	      final Label label = new Label(parent, SWT.NONE);
	   }	
}


Now when I switch to the designer I cannot use the controls as I cannot DnD from the pallet. The cursor shows a red icon when I move the cursor on top of the designer.

Re: SWT Designer - DnD not working [message #1407842 is a reply to message #1407629] Wed, 13 August 2014 15:42 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric ClaybergFriend
Messages: 979
Registered: July 2009
Location: Boston, MA
Senior Member
The Swing Designer and SWT Designer palettes work exactly the same way. If it works in one, it should work in the other. It worked fine for me in both cases.

The problem is with the example code you are using. It isn't a valid JFace Dialog template (it doesn't create a proper "dialog area" in which to drop controls). You should use the wizards provided with WB to create the dialog.
Re: SWT Designer - DnD not working [message #1408053 is a reply to message #1407842] Thu, 14 August 2014 05:57 Go to previous messageGo to next message
Artha Wijendra is currently offline Artha WijendraFriend
Messages: 2
Registered: August 2014
Junior Member
I had used the Create Class option and defined the super class JFace Dialog.

using the template solved the issue.

Thanks a lot!
Re: SWT Designer - DnD not working [message #1408319 is a reply to message #1408053] Thu, 14 August 2014 19:26 Go to previous message
Eric Clayberg is currently offline Eric ClaybergFriend
Messages: 979
Registered: July 2009
Location: Boston, MA
Senior Member
The Eclipse Create Class wizard knows nothing about JFace Dialogs (you would need to add all the needed boilerplate yourself), so using the dedicated wizard is much easier.
Previous Topic:exporting / eternalize window properties
Next Topic:JGoodies FormLayout - Which version is supported?
Goto Forum:
  


Current Time: Tue Aug 04 03:22:49 GMT 2020

Powered by FUDForum. Page generated in 0.02327 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top