Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Opening semantic models with the graphical editor
Opening semantic models with the graphical editor [message #119296] Sat, 14 April 2007 05:20 Go to next message
Eclipse UserFriend
Originally posted by: christian.daenekas.informatik.uni-oldenburg.de

Hi there,

I´ve got a (maybe really simple) question. My GMF editor application
produces two files per diagram. The editor is registered for the
filetype XXX_diagam. I´ve already managed to write a class that provides
the possibility to produce a _diagram file from a sematic model. If I
want to create a diagram from a semantic model I call the appropriate
method and create to diagram file which I can open by using the
openDiagram Method. When I want to use this functionality outside of the
plugin that represent the editor application this approach produces a
dependency of the plugin that uses this towards the editor plugin. To
get rid of this dependency I´d like to register the file extension of
the semantic model and go from there. Now I just can´t find out where
I´ve got to make modifications to let my editor also handle the semantic
models. So to speak if some plugin calls openEditor(sematicModelFile),
where do I have to apply changes to let the editor create a diagram file
and open it? The logic to do this is already there, I just can´t find
the right place to put it in. Maybe I´m just missing something really
simple. I´d be nice if someone could help me.

Greetings,
Christian
Re: Opening semantic models with the graphical editor [message #119479 is a reply to message #119296] Mon, 16 April 2007 07:12 Go to previous messageGo to next message
Eclipse UserFriend
Hello Christian,

If you'd like to place diagram into domain model file then you can use "Same
File For Diagram And Model" option of GenEditorGenerator.

If you have to create new diagram for exisitng domain model - just use "Initialize
.... diagram file" popup menu action.

-----------------
Alex Shatalin
Re: Opening semantic models with the graphical editor [message #119606 is a reply to message #119479] Mon, 16 April 2007 09:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.daenekas.informatik.uni-oldenburg.de

Hello,

I know this options, but they don´t apply to my goal. The model and
diagram should be kept in different models in my case. I´m also
developing the editor as a part (perspective) of a big Rich Client
Application. I´ve applied the initialize diagram file action to my needs
in context of the rcp application. What I do right now is calling the
action to initialize a diagram file from a model. When this happens from
another perspective (meaning the action is called from a different
plugin used in the rich client application) this produces a dependency
to the editors diagram plugin. That not really nice, since the plugin
that uses this functionality should be independent from the presence of
the editor. So the idea is to register my model file extension via the
extension point (like it happens with the diagram file). Now this isn´t
enough obviously. I seek for the place to let the editor know, how to
handle the semantic model file. This way I could call the action to
initialize the diagram file when a semantic model file should be opened.
This way I would get rid of the dependencies of other plugins toward my
editor. If it is not present in the configuration of the application the
user would just get "No editor present to open this file". I hope it´s
more clear what I want to do. Can you give me advice where I have to
modify code to achieve this? There must be specified somewhere how the
edior handles a certain filetype, is it?

Greetings,
Christian Dänekas

Alex Shatalin schrieb:
> Hello Christian,
>
> If you'd like to place diagram into domain model file then you can use
> "Same File For Diagram And Model" option of GenEditorGenerator.
>
> If you have to create new diagram for exisitng domain model - just use
> "Initialize .... diagram file" popup menu action.
>
> -----------------
> Alex Shatalin
>
>
>
Re: Opening semantic models with the graphical editor [message #119655 is a reply to message #119606] Mon, 16 April 2007 10:20 Go to previous message
Eclipse UserFriend
Hello Christian,

> seek for the place to let the editor know, how to handle the semantic
> model file. This way I could call the action to initialize the diagram
> file when a semantic model file should be opened. This way I would get
> rid of the dependencies of other plugins toward my editor. If it is
"org.eclipse.ui.editors" extension point provide you with the possibility
to associate editor with the particular file extension. You can use this
extension point to register your diagram editor for the domain model file
and then modify generated code to correctly initialize diagram if necessary.

-----------------
Alex Shatalin
Previous Topic:Audit rules order
Next Topic:Allowing drop support into the diagram
Goto Forum:
  


Current Time: Wed Jul 23 08:08:41 EDT 2025

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

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

Back to the top