Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » MultiPageEditor -- Single or multiple DocumentProvider(s)?
MultiPageEditor -- Single or multiple DocumentProvider(s)? [message #11318] Tue, 08 August 2006 19:33 Go to next message
Eclipse UserFriend
Originally posted by: khai.n.situvista.com

I have a metamodel that contains a root element PageSet and subroot
elements Page. I'm implementing a MultiPageEditor where:
* Each Page element is in a separate tab of the MultiPageEditor
* Each tab is hosting the GMF generated editor
* Page is the canvas root of the generated editor
* Each MultiPageEditor has a unique instance of
TransactionalEditingDomain
* All editors within the same MultiPageEditor share the same
editing domain.
* All editors within the same MultiPageEditor operate on the same
single model file and single diagram file.
* Each embedded editor is given a custom IEditorInput that can
locate the correct Page to load.
* Any modification to any element, in any embedded editor, marks
the 'parent' MultiPageEditor as dirty.
* Executing a save would save all changes in all embedded editor.


Q. Should all editors within the same MultiPageEditor share the same
DocumentProvider?


The GMF generated editors each instantiates its own DocumentProvider but
all pointing to the same file resource. I'm thinking of implementing a
DocumentProvider factory to allow all editors within the same
MultiPageEditor to use the same DocumentProdiver; this would
'centralize' the loading/unloading of the resource (as opposed to
executing load/unload iteratively for each embedded editor).

I'm not clear on how the separate DocumentProviders interact with shared
resources so I'm not clear whether this extra step is even needed.

Any hints will be appreciated! :-)

Thanks!

-- Khai --
Re: MultiPageEditor -- Single or multiple DocumentProvider(s)? [message #19506 is a reply to message #11318] Tue, 15 August 2006 11:14 Go to previous message
Eclipse UserFriend
Hello Khai,

I think, this modification is not necessary, but you can do it. All the generated
XXXDocumentProviders are responsible for saving correct resources and marking
editor as dirty on any modifications (once this functionality will be moved
to FileDiagramDocumentProvider generated code will start using FileDiagramDocumentProvider).


So, if you are afraid of code duplication and extra listeners installed -
you can patch generated code to reuse only one instance of any XXXDocumentProvider,
but i do not think that it bring any visible changes. At least before you'll
face any problems caused by this. ;-)

-----------------
Alex Shatalin
Previous Topic:Any plans to provide layouts implementions ?
Next Topic:ScrollBars in the CompartmentShapeEditPart
Goto Forum:
  


Current Time: Tue Jun 24 16:52:04 EDT 2025

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

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

Back to the top