Skip to main content



      Home
Home » Eclipse Projects » GEF » Alternative ways of starting a gef editor
Alternative ways of starting a gef editor [message #93226] Wed, 10 September 2003 05:14 Go to next message
Eclipse UserFriend
Originally posted by: please.ask.me.my.address.com

Dear all,

I have created a gef editor which is currrently started by double clicking
on a particular file type and extension. The editor does not persist the
diagram or anything like that, therefore the file used to start the editor
is purely there as a bootstrap.

What are the alternate ways to start the editor? Is it possible to have the
editor start by a toolbar button or double clicking on a user defined
element in a jface tree viewer? I am trying to get away from the file aspect
of starting an editor and in particular a gef editor.

Many thanks for your help - this ng is a saviour at times!
Raj
Re: Alternative ways of starting a gef editor [message #93241 is a reply to message #93226] Wed, 10 September 2003 05:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: scheglov_ke.nlmk.ru

Rajeev Sudra <please.ask.me@my.address.com> wrote:

You can open editor at any time by calling method IWorkbenchPage.openEditor
There are many overloaded methods, most probably you need
(IEditorInput input, String editorId).
Here are two utility methods for accesing IWorkbenchPage.

public IWorkbench getWorkbench() {
return PlatformUI.getWorkbench();
}
public IWorkbenchPage getActivePage() {
IWorkbenchWindow window= getWorkbench().getActiveWorkbenchWindow();
if (window == null)
return null;
return getWorkbench().getActiveWorkbenchWindow().getActivePage();
}



> I have created a gef editor which is currrently started by double clicking
> on a particular file type and extension. The editor does not persist the
> diagram or anything like that, therefore the file used to start the editor
> is purely there as a bootstrap.

> What are the alternate ways to start the editor? Is it possible to have the
> editor start by a toolbar button or double clicking on a user defined
> element in a jface tree viewer? I am trying to get away from the file aspect
> of starting an editor and in particular a gef editor.

> Many thanks for your help - this ng is a saviour at times!
> Raj



--
SY, Konstantin.
Advanced Eclipse SWT Designer (http://www.swt-designer.com)
Re: Alternative ways of starting a gef editor [message #93429 is a reply to message #93241] Wed, 10 September 2003 12:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ask.me.for.it.com

Many thanks for the response. In the end I created a a NullEditorInput and
passed that to the openEditor() method. I have also created an action on a
toolbar to kick it all off.

I take it that the IEditorInput is a proxy for the thing which represents
the persisted version of the diagram? Getting the IPersistableElement is
actually like getting a file or a connection to a database or a serialized
version then ...?

Thanks for the quick response.
Raj
Re: Alternative ways of starting a gef editor [message #93673 is a reply to message #93429] Thu, 11 September 2003 00:42 Go to previous message
Eclipse UserFriend
Originally posted by: scheglov_ke.nlmk.ru

Rajeev Sudra <ask.me@for.it.com> wrote:

> I take it that the IEditorInput is a proxy for the thing which represents
> the persisted version of the diagram? Getting the IPersistableElement is
> actually like getting a file or a connection to a database or a serialized
> version then ...?
I think IEditorInput is just want do you want. This is your GEF editor, so
you are free to create any implementation of IEditorInput that provides info
needed for you editor.

--
SY, Konstantin.
Advanced Eclipse SWT Designer (http://www.swt-designer.com)
Previous Topic:how to configure GEF 2.1 on Eclispe 3.0 M3?
Next Topic:EmptyStackException can occur when undoing using the keyboard shortcuts
Goto Forum:
  


Current Time: Wed May 07 15:07:33 EDT 2025

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

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

Back to the top