Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » OpenEditor on an input object (instead of a file)
OpenEditor on an input object (instead of a file) [message #329578] Sat, 28 June 2008 09:44 Go to next message
Eclipse UserFriend
Originally posted by: jp.schoch.smartesting.com

Hello,

I am trying to create an editor that will allow me to edit text extracte
d from a UML element. I am using an Editor that inherits from TextEditor
(I started from the JavaEditor example) and defined a class implementing
IEditorInput. I call openEditor as shown below by passing it an instance
of my editor input class (input) and the ID of my editor :

IWorkbenchPage page =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage(); try {
IEditorPart part = page.openEditor(input, "my.editor.id");
...

What I get is an editor page whose contents is a duplicate of whatever
other editor I have displayed in my workspace (or an empty editor if no
other editor is displayed).

I checked for instance that the createDocument of my document provider
is correctly called with the correct editor input.

I am at a complete loss to understand what's going on. I have tried to
find examples of editors but they are all based on files. Does anyone
would have such an example or a clue of what I could be doing wrong?

Thanks
JP
Re: OpenEditor on an input object (instead of a file) [message #329685 is a reply to message #329578] Tue, 01 July 2008 06:22 Go to previous message
Eclipse UserFriend
Jean-Pierre (JP) Schoch wrote:
> Hello,
>
> I am trying to create an editor that will allow me to edit text
> extracte d from a UML element. I am using an Editor that inherits from
> TextEditor (I started from the JavaEditor example) and defined a class
> implementing IEditorInput. I call openEditor as shown below by passing
> it an instance of my editor input class (input) and the ID of my editor :
>
> IWorkbenchPage page =
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage();
> try {
> IEditorPart part = page.openEditor(input, "my.editor.id");
> ...
>
> What I get is an editor page whose contents is a duplicate of whatever
> other editor I have displayed in my workspace (or an empty editor if
> no other editor is displayed).
Not sure I understand: you mean a new editor is indeed opened but it
shows the stuff from the previous editor?

Dani
>
> I checked for instance that the createDocument of my document provider
> is correctly called with the correct editor input.
>
> I am at a complete loss to understand what's going on. I have tried to
> find examples of editors but they are all based on files. Does anyone
> would have such an example or a clue of what I could be doing wrong?
>
> Thanks
> JP
Previous Topic:Code completion broken in Eclipse SDK?
Next Topic:Re: NullPointerException in AbstractDecoratedTextEditor
Goto Forum:
  


Current Time: Mon Jun 02 18:23:54 EDT 2025

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

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

Back to the top