Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Open GEF Editor Programmatically
Open GEF Editor Programmatically [message #158961] Sun, 21 November 2004 18:55 Go to next message
Eclipse UserFriend
Originally posted by: CH_FA.gmx.net

Hello all,

i am trying to open my Gef Editor programmatically.
I am using this code:

IWorkbenchPage page = ...
String editorId = "gef.example.helloworld.editor";
GEFEditorInput input = new GEGEditorInput();

try
{
page.openEditor(input, editorId, true);
}
catch ( PartInitException e )
{
e.printStackTrace();
}

I get allways the error Msg:
Editor initialization failed:
gef.example.helloworld.editor. Site is incorrect.

This error i get since i've implemented the
"public void init( IEditorSite site, IEditorInput input ) throws
PartInitException" Method in my HelloWorldEditor Class.

Does anybody know what i am doing wrong?

Thx for any proposals.
Re: Open GEF Editor Programmatically [message #158969 is a reply to message #158961] Sun, 21 November 2004 22:59 Go to previous messageGo to next message
Michal Bergmann is currently offline Michal BergmannFriend
Messages: 19
Registered: July 2009
Junior Member
I'm using following code in new file wizard to open editor.
final IFile modelFile = getModelFile();
IWorkbenchWindow workbenchWindow =
workbench.getActiveWorkbenchWindow();
IWorkbenchPage page = workbenchWindow.getActivePage();
try {
//page.openEditor(modelFile);
IDE.openEditor(page, modelFile, true);
} catch (PartInitException exception) {
MessageDialog.openError(workbenchWindow.getShell(), "Error
opening editor", exception
.getMessage());
return false;
}
M.

"Christian Farra" <CH_FA@gmx.net> wrote in message
news:cnqob2$1rf$1@www.eclipse.org...
> Hello all,
>
> i am trying to open my Gef Editor programmatically.
> I am using this code:
>
> IWorkbenchPage page = ...
> String editorId = "gef.example.helloworld.editor";
> GEFEditorInput input = new GEGEditorInput();
>
> try {
> page.openEditor(input, editorId, true);
> }
> catch ( PartInitException e )
> {
> e.printStackTrace();
> }
>
> I get allways the error Msg:
> Editor initialization failed: gef.example.helloworld.editor. Site is
> incorrect.
>
> This error i get since i've implemented the "public void init( IEditorSite
> site, IEditorInput input ) throws PartInitException" Method in my
> HelloWorldEditor Class.
>
> Does anybody know what i am doing wrong?
>
> Thx for any proposals.
>
>
>
Re: Open GEF Editor Programmatically [message #158983 is a reply to message #158961] Mon, 22 November 2004 04:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

Christian Farra wrote:
> Hello all,
>
> i am trying to open my Gef Editor programmatically.
> I am using this code:
>
> IWorkbenchPage page = ...
> String editorId = "gef.example.helloworld.editor";
> GEFEditorInput input = new GEGEditorInput();
>
> try {
> page.openEditor(input, editorId, true);
> }
> catch ( PartInitException e )
> {
> e.printStackTrace();
> }
>
> I get allways the error Msg:
> Editor initialization failed: gef.example.helloworld.editor. Site is
> incorrect.
>
> This error i get since i've implemented the "public void init(
> IEditorSite site, IEditorInput input ) throws PartInitException" Method
> in my HelloWorldEditor Class.
>

Your problem is probably here. How did you implement this method?



> Does anybody know what i am doing wrong?
>
> Thx for any proposals.
>
>
>


--
Respectfully,


CL Gilbert

"Verily, verily, I say unto you, He that entereth not by the door() into
the sheepfold{}, but climbeth up some other *way, the same is a thief
and a robber."

GnuPG Key Fingerprint:
82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D

For a free Java interface to Freechess.org see
http://www.rigidsoftware.com/Chess/chess.html
Re: Open GEF Editor Programmatically [message #159007 is a reply to message #158983] Mon, 22 November 2004 10:15 Go to previous message
Eclipse UserFriend
Originally posted by: CH_FA.gmx.net

I've found a soloution for my Problem.

CL [dnoyeb] Gilbert wrote:
I did'nt call the super.init(site, input) Method in my init Method!
public void init( IEditorSite site, IEditorInput input ) throws
PartInitException
{
super.init( site, input );
....
...
}


> Christian Farra wrote:
>> Hello all,
>>
>> i am trying to open my Gef Editor programmatically.
>> I am using this code:
>>
>> IWorkbenchPage page = ...
>> String editorId = "gef.example.helloworld.editor";
>> GEFEditorInput input = new GEGEditorInput();
>>
>> try {
>> page.openEditor(input, editorId, true);
>> }
>> catch ( PartInitException e )
>> {
>> e.printStackTrace();
>> }
>>
>> I get allways the error Msg:
>> Editor initialization failed: gef.example.helloworld.editor. Site is
>> incorrect.
>>
>> This error i get since i've implemented the "public void init(
>> IEditorSite site, IEditorInput input ) throws PartInitException" Method
>> in my HelloWorldEditor Class.
>>

> Your problem is probably here. How did you implement this method?



>> Does anybody know what i am doing wrong?
>>
>> Thx for any proposals.
>>
>>
>>
Previous Topic:where to store customized palette?
Next Topic:Draw2D DirectedGraph with feedback
Goto Forum:
  


Current Time: Fri Apr 26 06:39:22 GMT 2024

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

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

Back to the top