Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » wizard during command execution
wizard during command execution [message #234229] Wed, 16 May 2007 14:31
Aleksandr Kravets is currently offline Aleksandr KravetsFriend
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
Previous Topic:Separate GEF view with separate selection
Next Topic:animations in Draw2D
Goto Forum:
  


Current Time: Fri Aug 12 09:22:11 GMT 2022

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

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

Back to the top