|
Re: Passing the diagram filename to a model element property ?? [message #122259 is a reply to message #122248] |
Fri, 27 April 2007 12:36 |
Eclipse User |
|
|
|
Originally posted by: angelo.marguglio.eng.it
Hi! You can use this code:
FileDiagramEditor editor = (FileDiagramEditor)
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePag().getActiveEditor();
editor.getEditorInput();
From this object you can find what you want!
BYE
"Ben Renwart" <renwart@lippmann.lu> ha scritto nel messaggio
news:f0sq2o$9go$1@build.eclipse.org...
> Hi everybody,
>
> I'd like to get the filename (and if possible the full path) of a diagram
> and assign it to a property ("name") of my model element...
>
> Thanks in advance for any help.
>
> benren.
|
|
|
|
Re: Passing the diagram filename to a model element property ?? [message #122315 is a reply to message #122271] |
Fri, 27 April 2007 14:12 |
Eclipse User |
|
|
|
Originally posted by: bagnard.natacha.free.fr
Hi Boris,
I'm really interested by the tips you give here but I don't know how you
get your diagram object. I searched for it but can't find it.
Could you explain me how you get it ?
Natacha
Boris Blajer a écrit :
> Hi Ben,
>
> org.eclipse.emf.workspace.util.WorkspaceSynchronizer.getFile (diagram.eResource())
> will give you the IFile that stores the diagram.
>
> Best regards,
> Boris
|
|
|
|
Re: Passing the diagram filename to a model element property ?? [message #123303 is a reply to message #122248] |
Wed, 02 May 2007 12:06 |
Eclipse User |
|
|
|
Originally posted by: evaandoli.dodo.com.au
Ben ,
I finally got around to spending too much time on this and came up with the
following solution:-
Look at class (replace YourDiagramDomain with yours)
<YourDiagramDomain>DiagramEditorUtil
It contains a method called:-
createDiagram(
Which itself contains a method called:-
protected CommandResult doExecuteWithResult(
In here you get access to the top level model created.
So you can do somthing like:-
model.setName(modelURI.path());
Anyway that is how I did it,
Stuart
"Ben Renwart" <renwart@lippmann.lu> wrote in message
news:f0sq2o$9go$1@build.eclipse.org...
> Hi everybody,
>
> I'd like to get the filename (and if possible the full path) of a diagram
> and assign it to a property ("name") of my model element...
>
> Thanks in advance for any help.
>
> benren.
|
|
|
Powered by
FUDForum. Page generated in 0.04276 seconds