Home » Eclipse Projects » GEF » Open a Wizard from the Palette?
|
Re: Open a Wizard from the Palette? [message #241412 is a reply to message #241407] |
Mon, 11 February 2008 07:20 |
Xiang Qinxian Messages: 119 Registered: July 2009 |
Senior Member |
|
|
Hi,
Normal there 2 ways handle this:
1, like normal behavior in GEF editor, click in Editor figure, handle a
location and bound, then trigger a wizard,
just in paletteRoot configure class/method create a CreationTool subclass :
CreationToolEx extends CreationTool {
@Override
mouseDoubleClick...
}
@PaletteRoot,
componentsDrawer.add(newTemplateEntry(...));
protected CombinedTemplateCreationEntry newTemplateEntry(... descripitors) {
CombinedTemplateCreationEntry creation = new
CombinedTemplateCreationEntry(...);
creation.setToolClass(CreationToolEx.class);
return creation;
}
2, handle palette EditPart, in this way, need handle
org.eclipse.gef.ui.palette.PaletteViewer
customerize it with an extended PaletteEditPartFactory,
override some intrested cretioneditpart method:
such as createXEditPart(EditPart parentEditPart, Object model) method,
f.e. createEntryEditPart
pass a new PaletteEditPart subclass,
ofcause in customerized PaletteEdtiPart need override some methods like
this:
@Override
public void performRequest(Request req) {
//start a wizard
}
if the 1st way filled requirements, recommemded.
Cheers,
Xiangya
Fredrik 写道:
> Hi,
>
> I wonder if it is possible to add an entry to the palette that uses a
> wizard to create an element. I currently don't mind where the created
> element is positioned, but wonder from which place (and which kind of
> entry) i may call a wizard dialog.
>
> Thanks in advance,
> Fredrik
>
|
|
|
Re: Open a Wizard from the Palette? [message #241506 is a reply to message #241412] |
Thu, 14 February 2008 14:06 |
Fredrik Robertssen Messages: 22 Registered: July 2009 |
Junior Member |
|
|
Hi Xiangya,
Your recommended solution nr. 1 worked nicely.
Thanks for your help!
Fredrik
Qinxian wrote:
> Hi,
> Normal there 2 ways handle this:
> 1, like normal behavior in GEF editor, click in Editor figure, handle a
> location and bound, then trigger a wizard,
> just in paletteRoot configure class/method create a CreationTool subclass :
> CreationToolEx extends CreationTool {
> @Override
> mouseDoubleClick...
> }
> @PaletteRoot,
> componentsDrawer.add(newTemplateEntry(...));
> protected CombinedTemplateCreationEntry newTemplateEntry(... descripitors) {
> CombinedTemplateCreationEntry creation = new
> CombinedTemplateCreationEntry(...);
> creation.setToolClass(CreationToolEx.class);
> return creation;
> }
> 2, handle palette EditPart, in this way, need handle
> org.eclipse.gef.ui.palette.PaletteViewer
> customerize it with an extended PaletteEditPartFactory,
> override some intrested cretioneditpart method:
> such as createXEditPart(EditPart parentEditPart, Object model) method,
> f.e. createEntryEditPart
> pass a new PaletteEditPart subclass,
> ofcause in customerized PaletteEdtiPart need override some methods like
> this:
> @Override
> public void performRequest(Request req) {
> //start a wizard
> }
> if the 1st way filled requirements, recommemded.
> Cheers,
> Xiangya
> Fredrik åé:
>> Hi,
>>
>> I wonder if it is possible to add an entry to the palette that uses a
>> wizard to create an element. I currently don't mind where the created
>> element is positioned, but wonder from which place (and which kind of
>> entry) i may call a wizard dialog.
>>
>> Thanks in advance,
>> Fredrik
>>
|
|
| |
Goto Forum:
Current Time: Wed Sep 18 22:07:22 GMT 2024
Powered by FUDForum. Page generated in 0.04392 seconds
|