setSelectionProvider to an editor without Viewers [message #657222] |
Wed, 02 March 2011 00:47 |
Dila Messages: 6 Registered: March 2011 |
Junior Member |
|
|
Hi,
I am trying to set(Selection provider) to my Editor through the
Handler class. But I am constantly failing.
I have a view class where I list down the various SWT widgets,
I drag and drop the widget from the view to my editor,
However, I am done with this part. But the problem occurs when I try
to relate the Properties View to the widgets in the editor which was
dropped.
As mentioned, please find below, the execute(..) method of the handler, which
is responsible in dropping the widget to my editor.
public Object execute(ExecutionEvent event) throws ExecutionException
{
final Composite composite =
MyDragnDropUtil.getDesignEditorComposite();
final Composite dspComp = (Composite) composite.getChildren()[0];//
[1];
final Button logger = new Button(dspComp, SWT.BORDER);
logger.setText("Button");
DroppedWidgetItem dwi = new DroppedWidgetItem(logger, "Button");
ndclist_static.add(dwi);
System.out.println("size:"+ndclist_static.getChildren().size());
return null;
}
I am unable to view the Properties View when I select the dropped
widget, since I am unable to set my SelectionProvider to the dropped
Widget composite.
I am aware of setting the Selection Provider through the Viewer.
However, I do not intend to use Viewer in the editor. As you can see
in the code above, I am using a composite.
Could you please suggest a workaround towards this issue? Or am I doing something wrong?
Thanks,
|
|
|
|
Re: setSelectionProvider to an editor without Viewers [message #657491 is a reply to message #657349] |
Thu, 03 March 2011 01:02 |
Dila Messages: 6 Registered: March 2011 |
Junior Member |
|
|
Hi Paul,
For a better understanding of my problem please find the code snippets below...
I create the Composite of my MultipageEditor dynamically using a handler..
The composite creation of the editor prior to Handler execution is as follows in my Editor Class:
************************
private void createComposite(Composite composite) {
Composite comp = new Composite(composite, SWT.NONE);
comp.setLayout(new GridLayout());
comp.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
}
************************
In the above code, I am keeping a Initial composite space ready for the dynamic widget creation.
And once the handler is invoked(execute method), I drop my widgets to this composite as in the code below(in the Handler Class) :
*****************************
private NexdigmDroppedComponentList ndclist_static=new NexdigmDroppedComponentList();
public Object execute(ExecutionEvent event) throws ExecutionException
{
final Composite composite =MyDragnDropUtil.getDesignEditorComposite();
final Composite dspComp = (Composite) composite.getChildren()[0];
final Button logger = new Button(dspComp, SWT.BORDER);
logger.setText("Button");
//Passing the Button as an DroppedWidgetItem (extends IAdaptable)as an IAdaptable element
DroppedWidgetItem dwi = new DroppedWidgetItem(logger, "Button");
// Adding the IAdaptable widgets to the IAdaptable list to link to the Property View
ndclist_static.add(dwi);
return null;
}
*****************************
I am however unable to set Selection Provider for this issue since the Button Widget is not a Viewer.
I am now trying to set SelectionProvider to this Composite so as to display the related Properties in the Property View when I setFocus on the Widgets dropped in the editor composite.
I hope I am clear with my explaination..
Thanks,
Dila
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04873 seconds