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:Chopbox anchor feedback
Next Topic:Draw2D: figures with real coordinates.
Goto Forum:
  


Current Time: Thu Apr 25 06:01:42 GMT 2024

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

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

Back to the top