Creating default elements during startup [message #32779] |
Tue, 29 August 2006 09:39  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
>
|
|
|
Powered by
FUDForum. Page generated in 0.04203 seconds