wizard during command execution [message #234229] |
Wed, 16 May 2007 14:31 |
Aleksandr Kravets Messages: 30 Registered: July 2009 |
Member |
|
|
Hello,
When I create an object for a palette, I need to display a wizard. Right
now I am doing it like this in class that extends XYLayoutEditPolicy:
protected Command getCreateCommand(CreateRequest request) {
Command command = null;
AbstractProcessFlowObject newObject = (AbstractProcessFlowObject)
request.getNewObject();
ProcessFlowContainer container = (ProcessFlowContainer)
getHost().getModel();
//Rectangle bounds = (Rectangle) getConstraintFor(request);
if (newObject.getClass() != StartObject.class &&
newObject.isDesignerNativeObject()){
DesignerObjectWizard wizard = new DesignerObjectWizard(false,
newObject, container.getServerURI());
WizardDialog dialog = new
WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWin dow().getShell(),wizard);
dialog.setMinimumPageSize(350, 350);
if (dialog.open() == Window.CANCEL) {
wizard.performCancel();
return null;
}
command = new PFlowObjectCreateCommand(
(AbstractProcessFlowObject)request.getNewObject(),
(ProcessFlowContainer)getHost().getModel(),
(Rectangle)getConstraintFor(request));
}
return command;
}
However, the wizard is being called every time the position of where the
object should be dropped on the editor changes. Before I had wizard show
up in execute() method of the command, but that caused some problems
with command stack. Reading newsgroup I found this thread:
http://dev.eclipse.org/newslists/news.eclipse.tools.gef/msg1 2972.html.
So it this the right way to display wizard during object creation and my
approach is totally wrong?
thanks,
Alex
|
|
|
Powered by
FUDForum. Page generated in 0.05123 seconds