Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Problem with the editor site
Problem with the editor site [message #308236] Mon, 18 September 2006 03:27 Go to next message
Eclipse UserFriend
Originally posted by: shilpa.pramati.com

Hello all,

I am facing problem with editor site.

I have GMF diagram editor which acts as a contributor to the tabbed
properties view. I have multiple tabs in my tabbed properties view. In one
of the tabs i have button displayed which when clicked should open up
language editor in a modal dialog. I use below lines of code to instantiate
the language editor.
RuleEditor ruleEditor = new RuleEditor();
ruleEditor.setSite(this.site); //
this.site is equal to
StateMachineDiagramEditorPlugin.getInstance().getWorkbench() .getActiveWorkbenchWindow
().getActivePage().getActiveEditor().getEditorSite();
ruleEditor.setInput(this.site.getPage().getActiveEditor().ge tEditorInput());
ruleEditor.getDocumentProvider().getDocument(ruleEditor.getE ditorInput()).set(this.docSource);
//this.docSource is some template used to populate the language
editor
ruleEditor.createPartControl(parent);

I dispose of the rule editor when the dialog is closed.
After the language editor dialog is closed , any selection on the GMF
editor is not working ?? It does not recognize any selection event on the
editor ??

I feel it has something to do with the editor site. How do i restore the
editor site back to the workbench active editor ?

Any pointers on this would be helpful .........


Thanks n Regards
Shilpa
Re: Problem with the editor site [message #308262 is a reply to message #308236] Mon, 18 September 2006 12:36 Go to previous message
Eclipse UserFriend
The short answer is you can't.

There's a good chance the RuleEditor#setSite(IEditorSite) causes the
RuleEditor to make changes to the editor site, like updating the
selection provider (that would kill your selection service).

Plus, from a lifecycle point of view, the EditorSite should be disposed
immediately after (or during) the editor dispose().

EditorSites *cannot* be reused between editors.


Check out the internal EditorManager@createSite(*) to see how much
information an EditorSite needs to be useful.

Later,
PW
Previous Topic:Creating Extra Composites
Next Topic:Problems in getting an image from a source folder
Goto Forum:
  


Current Time: Sun May 04 05:21:31 EDT 2025

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

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

Back to the top