Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Opening an Editor ... but Site is incorrect !!!!
Opening an Editor ... but Site is incorrect !!!! [message #420561] Thu, 07 April 2005 19:15 Go to next message
JANS is currently offline JANSFriend
Messages: 7
Registered: July 2009
Junior Member
I am on "Eclipse 31M6" since 3 days and find it a fantastic IDE as a
fantastic RCP paltform ... I am stuck with one "easy" thing ( I presume that
this is easy ) ... I simply try to open an Editor when i click on a Table
which is part of a View .... This means that i have added a Listener on the
Table ( FocusListener ) and from there i want to open an editor ... Here
are some pieces of code ...

METHODS IN THE PERSPECTIVE
public void createInitialLayout(IPageLayout layout) {
String editorArea = layout.getEditorArea();
layout.setEditorAreaVisible(true);

METHODS IN THE LISTENER ...

final IWorkbenchPage page = getSite().getWorkbenchWindow().getActivePage();

table.addFocusListener(new FocusListener(){
public void focusGained(FocusEvent e) {
IEditorInput input = new TestInput();
try {
IDE.openEditor(page,input,"Test.editor2");
} catch (PartInitException e1) {
e1.printStackTrace();
}
}

THE ERROR MESSAGE
Unable to create editor. This message may be due to a bug in the editor, not
a problem with the file you are trying to edit. First close this error
message and then use "Open With..." to open the file in a different editor.
Reason for the failure: Editor initialization failed: Test.editor2. Site is
incorrect.

Any idea ... Daniel JANS
Re: Opening an Editor ... but Site is incorrect !!!! [message #421226 is a reply to message #420561] Mon, 11 April 2005 00:57 Go to previous message
JANS is currently offline JANSFriend
Messages: 7
Registered: July 2009
Junior Member
Got my answer ... Forgot to overwrite the setSite Method ... Well this
feature was not that well documented .... Anybody knows about a good book
about RCP and only RCP ( only ... not plugin ).

Daniel.
"Daniel JANS" <djans@cogitosum.com> wrote in message
news:d3413v$81e$1@news.eclipse.org...
>I am on "Eclipse 31M6" since 3 days and find it a fantastic IDE as a
>fantastic RCP paltform ... I am stuck with one "easy" thing ( I presume
>that this is easy ) ... I simply try to open an Editor when i click on a
>Table which is part of a View .... This means that i have added a Listener
>on the Table ( FocusListener ) and from there i want to open an editor ...
>Here are some pieces of code ...
>
> METHODS IN THE PERSPECTIVE
> public void createInitialLayout(IPageLayout layout) {
> String editorArea = layout.getEditorArea();
> layout.setEditorAreaVisible(true);
>
> METHODS IN THE LISTENER ...
>
> final IWorkbenchPage page =
> getSite().getWorkbenchWindow().getActivePage();
>
> table.addFocusListener(new FocusListener(){
> public void focusGained(FocusEvent e) {
> IEditorInput input = new TestInput();
> try {
> IDE.openEditor(page,input,"Test.editor2");
> } catch (PartInitException e1) {
> e1.printStackTrace();
> }
> }
>
> THE ERROR MESSAGE
> Unable to create editor. This message may be due to a bug in the editor,
> not a problem with the file you are trying to edit. First close this error
> message and then use "Open With..." to open the file in a different
> editor. Reason for the failure: Editor initialization failed:
> Test.editor2. Site is incorrect.
>
> Any idea ... Daniel JANS
>
Previous Topic:Default update options
Next Topic:Feature Details
Goto Forum:
  


Current Time: Wed Nov 26 04:33:14 GMT 2014

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

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