Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Creating default elements during startup
Creating default elements during startup [message #32779] Tue, 29 August 2006 09:39 Go to next message
Eclipse UserFriend
Originally posted by: ganesh.mohan.hp.com

Hi,

Is there a way i can create default elements while starting the
application.

eg: Suppose i want some default vxml tags to come up while startup. How
would i do that. As soon as a new project is created, default elements
should be displayed on the editor with the semantic model updated
appropriately.

Thanx,
Ganesh
Re: Creating default elements during startup [message #32900 is a reply to message #32779] Tue, 29 August 2006 10:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vcciubot.uwaterloo.ca

Look at AbstractEditHelper#getConfigureCommand().

You have to register an edit helper with the type of your top model
element.

In this edit helper override getConfigureCommand() to create the necessary
children.

Here's an example from my code. For a complete example check out the gmf
logic example from cvs.

vlad

protected ICommand getConfigureCommand(final ConfigureRequest req) {

return new ConfigurePipeStageCommand(req, Bluenose2Package.eINSTANCE
.getPipeStage()) {

protected CommandResult doExecuteWithResult(
IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {

/*
* testing purposes right now
*/
PipeStage stage = (PipeStage) req.getElementToConfigure();
BlkInterface blkInterface = createBlkInterface(stage, monitor);
createPort (blkInterface, monitor);
createPort (blkInterface, monitor);

Arbiter arbiter = createArbiter(stage, monitor);
MkRA mkRA = createMkRA (stage, monitor);
createConnection(arbiter, mkRA, monitor);

return CommandResult.newOKCommandResult(stage);
}
};
}


On Tue, 29 Aug 2006 13:39:44 +0000, Ganesh Mohan wrote:

> Hi,
>
> Is there a way i can create default elements while starting the
> application.
>
> eg: Suppose i want some default vxml tags to come up while startup. How
> would i do that. As soon as a new project is created, default elements
> should be displayed on the editor with the semantic model updated
> appropriately.
>
> Thanx,
> Ganesh
Re: Creating default elements during startup [message #33257 is a reply to message #32779] Tue, 29 August 2006 16:41 Go to previous message
Eclipse UserFriend
Originally posted by: khai.n.situvista.com

One way of doing this is to add your model object and diagram views in
the generated XXXDiagramEditorUtil.createNewDiagramFile().

The generated code is pretty easy to follow and only has a few basic steps.

-- Khai --


Ganesh Mohan wrote:
> Hi,
>
> Is there a way i can create default elements while starting the
> application.
>
> eg: Suppose i want some default vxml tags to come up while startup. How
> would i do that. As soon as a new project is created, default elements
> should be displayed on the editor with the semantic model updated
> appropriately.
>
> Thanx,
> Ganesh
>
Previous Topic:Strange compartment problem
Next Topic:Border item problem
Goto Forum:
  


Current Time: Sat May 10 03:49:27 EDT 2025

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

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

Back to the top