Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » dynamic EditorInput
dynamic EditorInput [message #299367] Wed, 15 February 2006 12:36 Go to next message
Eclipse UserFriend
Originally posted by: jgreen.upb.de

Hi everyone,
I seek for a solution in following scenario:

I have a hierarchic model (which is emf, but the following is rather a
workbench question) where the root model is typically opened by the main
editor and maintained there. Now, other editors may edit particular
submodels of this model which are stored in separate files.

mainmodel1.model
- submodel1.model
- submodel2.model
- submodel3.model

Now, loading these sub-models would cause to resolve the main model they
depend on as a new model instance from the file. But, I would like to
provide the previously loaded instance by the main editor.

There could also be a scenario where the main editor did not yet open
the main model, but sub-model editors open the different models
submodel1, submodel2, ... All these editors should also be able to work
on a sub-model referencing the same main model instance.

As I see it, I need to maintain the main model at a higher level. Then,
I also would like to keep the any EditorParts' init()-method as simple
as possible. Most convenient would be to assemble an EditorInput
somewhere that has the maintained, single instantiated main model
attached to it.

What would be the best way to do this? Are there any eclipse-mechanisms
supporting this? Any similar experience? Problems doing so?

Thanks for helping!

Joel
Re: dynamic EditorInput [message #299412 is a reply to message #299367] Thu, 16 February 2006 09:54 Go to previous message
Eclipse UserFriend
Your IEditorInput should contain something that identifies the model (or
submodel). Then your editor should go to some ModelProvider, and ask it
to get you the model that you need.

That way if your IEditorInput references a submodel, when you ask the
ModelProvider it will correctly open the main model and provide back the
submodel.

There is a similar pattern with a normal file editor input, IDocument,
and IDocumentProvider.

Later,
PW
Previous Topic:what is the best way to reference an external jar from a plugin?
Next Topic:What really calls the enablement calculation on ActionBars.
Goto Forum:
  


Current Time: Tue May 06 10:12:33 EDT 2025

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

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

Back to the top