Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Open new GraphicalEditors for a single resource.
Open new GraphicalEditors for a single resource. [message #196416] Mon, 19 September 2005 17:36 Go to next message
drew frantz is currently offline drew frantzFriend
Messages: 340
Registered: July 2009
Senior Member
What is the trick for creating an action that will allow me to open multiple
instances of a GraphicalEditorWithFlyoutPalette? I have have a file format
that contains many different views (diagrms inputs) .

I think the trick is to use the openEditor call below? But i tried this and
the and the same instance of the editor is always opened (preseumably
because the theEditorInput never chnages, since there is only one file
resource)

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().openEdi
tor(theEditorInput, "THE_EDITOR_ID");
Re: Open new GraphicalEditors for a single resource. [message #196420 is a reply to message #196416] Mon, 19 September 2005 18:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zx.us.ibm.com

Drew wrote:
> What is the trick for creating an action that will allow me to open multiple
> instances of a GraphicalEditorWithFlyoutPalette? I have have a file format
> that contains many different views (diagrms inputs) .
>
> I think the trick is to use the openEditor call below? But i tried this and
> the and the same instance of the editor is always opened (preseumably
> because the theEditorInput never chnages, since there is only one file
> resource)
>
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().openEdi
> tor(theEditorInput, "THE_EDITOR_ID");
>
>

The platform checks your editorinput against all the editor's open to
see if one is open already. It does this by the .equals() method found
on the editor input. You'd have to create your own editor input and come
up with a scheme to decide when you would be able to open another
editor. I assume you're using the FileEditorInput. You need to create
your own version of the FileEditorInput. A problem you may have is what
happens when you have multiple editors open that are modifying the same
resources?

This seems more like a platform question then a GEF question :/

Cheers,

~ Chris
Re: Open new GraphicalEditors for a single resource. [message #196470 is a reply to message #196416] Tue, 20 September 2005 16:16 Go to previous message
Eclipse UserFriend
Originally posted by: none.unknown.com

In 3.1, platform allows you to open multiple editors on the same file
(Window -> New Editor). You can look at that action's code or ask on the
platform newsgroup. You can also go the route of having multiple pages in
your editor.
\
"Drew" <drew@acm.org> wrote in message news:dgmsuk$v8l$1@news.eclipse.org...
> What is the trick for creating an action that will allow me to open
multiple
> instances of a GraphicalEditorWithFlyoutPalette? I have have a file
format
> that contains many different views (diagrms inputs) .
>
> I think the trick is to use the openEditor call below? But i tried this
and
> the and the same instance of the editor is always opened (preseumably
> because the theEditorInput never chnages, since there is only one file
> resource)
>
>
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().openEdi
> tor(theEditorInput, "THE_EDITOR_ID");
>
>
Previous Topic:DirectedGraphLayout
Next Topic:ScaledGraphics
Goto Forum:
  


Current Time: Fri Jan 24 04:48:47 GMT 2025

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

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

Back to the top