New diagram wizard [message #74980] |
Mon, 06 November 2006 23:24  |
Eclipse User |
|
|
|
Hello all,
I'd like to add a page to the generated wizard that runs when I create a new
diagram, to collect some information and use it to create a base figure that
must be in all of my diagrams.
I've looked into my xxxxx.diagram.part.xxxxxCreationWizard class and have
added a page to accept a piece of information. I've also looked into my
xxxxx.diagram.part.xxxxxDiagramEditorUtil in the createInitialModel and can
create the base figure based on some hard-coded data.
Unless I'm on the wrong track, I think I have both ends (please set me
straight if I'm approaching this wrong). Can anyone tell me how to access
the value I entered in the wizard page from my createInitialModel method so
that I can use this information to create my base figure? I'm assuming that
the wizard is still "alive" when createInitialModel is running, and I've
been running debug trying to find something exposed, but to no avail as of
yet.
Any advice? Please - I'm new to this, so sample code would be *much*
appreciated.
Thanks!
|
|
|
|
|
Re: New diagram wizard [message #76366 is a reply to message #75307] |
Thu, 09 November 2006 18:55  |
Eclipse User |
|
|
|
I've got something working, but I'd like to verify my solution in case there
is a better way. From the xxxxxDiagramEditorUtil.createInitialModel
function, I can't seem to find a "hook" back to the wizard page to access
the entered values.
So I ended up adding private static attributes and public getter methods to
xxxxxCreationWizard, and I set the attributes in performFinish. This way I
can access the entered values from createInitialModel() using something like
xxxxxCreationWizard.getMyValue().
It would seem to me that xxxxxCreationWizard is still alive when
createInitialModel() runs, but I don't see any reference, function, etc.
that will give me a handle to the wizard so I can access the pages.
Any ideas? My solution is working, but something tells me there's a better
way.
Thanks!
"Alex Shatalin" <vano@borland.com> wrote in message
news:cd695fb31292a8c8d095b7ce64dd@news.eclipse.org...
> Hello John,
>
> Please take a look on generated ???CreationWizard.performFinish() method.
> Looks like you have to modify this method and put additional diagram
> initialization code there. You can access all teh valued entered in
> EcoreCreationWizardPage by calling corresponding methods on page attribute
> of this wizard. You can take a look on
> ???NewDiagramFileWizard.performFinish() - this wizard contains two pages.
>
> -----------------
> Alex Shatalin
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04476 seconds