Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Editor questions
Editor questions [message #415316] Wed, 12 December 2007 10:12 Go to next message
Eclipse UserFriend
Originally posted by: philipp_jordan.yahoo.de

Hi,

I'm currently starting with EMF and so far it works surprisingly well and straight forward. However, I've come accross a few problems now. My goal is to create a tree editor that displays multiple instances of an xsd based model (pjtest.xsd). What I tried was to just load other Resources via editingDomain.loadResource("file:/path_to_xml_file"). That works, however the editor view's title always remains like the filename of the initial instance. For example if the first created model instance is called 1.pjtest and I load other Resources (2.pjtest, 3.pjtest, ...) via load the view's title always remains 1.pjtest. The view is somehow fixed to one instance. How can I change that?

Also I'd like new instances (created via New->Other->Example EMF Model Creation Wizards -> PJTEST Model) to be added to the existing tree editor as another resource instead of opening up a new editor. Is that possible?

I try to change the editor in a way that instead of platform:/xxxxx or file:/xxxxx it will display the content from a "name" tag inside the loaded xmlfile as the root element label. How would I do that?

One thing that I also would like to change is the ability to move the editor view (or the editor view tab) to, for example, the package explorer view. Normally all views in eclipse can be moved around whereever you like to. The Editor, however, can't be moved out of a certain area. I hope you understand what I mean.

I'd really appreciate your help.
Re: Editor questions [message #415328 is a reply to message #415316] Wed, 12 December 2007 14:48 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Philipp,

Comments below.

Philipp Jordan wrote:
> Hi,
>
> I'm currently starting with EMF and so far it works surprisingly well and straight forward. However, I've come accross a few problems now. My goal is to create a tree editor that displays multiple instances of an xsd based model (pjtest.xsd). What I tried was to just load other Resources via editingDomain.loadResource("file:/path_to_xml_file"). That works, however the editor view's title always remains like the filename of the initial instance. For example if the first created model instance is called 1.pjtest and I load other Resources (2.pjtest, 3.pjtest, ...) via load the view's title always remains 1.pjtest. The view is somehow fixed to one instance. How can I change that?
>
I think the editors title is just the result of the IEditorInput's
getName method. Editors aren't generally expected to change their name.
> Also I'd like new instances (created via New->Other->Example EMF Model Creation Wizards -> PJTEST Model) to be added to the existing tree editor as another resource instead of opening up a new editor. Is that possible?
>
Each generated editor has a resource listener so it can know an file was
created in the workspace. I'm not sure how it can know to load it as a
resource. You might also have multiple editors up. Should they all
open it? Each generated editor implemented IEditingDomainProvider so
something external to the editor could get at the editing domain's
resource set and load a resource into it.
> I try to change the editor in a way that instead of platform:/xxxxx or file:/xxxxx it will display the content from a "name" tag inside the loaded xmlfile as the root element label. How would I do that?
>
I think you'd need to specialized the editor input for that. I suppose
you could specialize the init method to construct an IEditorInput
wrapper over which you'd have more control.
> One thing that I also would like to change is the ability to move the editor view (or the editor view tab) to, for example, the package explorer view. Normally all views in eclipse can be moved around whereever you like to. The Editor, however, can't be moved out of a certain area. I hope you understand what I mean.
>
These are pages within a multi-page editor. You can't do that with
them. You'd have to provide an actual Eclipse view, like the outline
view to support that.
> I'd really appreciate your help.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Prevent editors for subpackages
Next Topic:Reflective evaluation of EOperations
Goto Forum:
  


Current Time: Fri Apr 19 23:09:51 GMT 2024

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

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

Back to the top