|
Re: Open new GraphicalEditors for a single resource. [message #196420 is a reply to message #196416] |
Mon, 19 September 2005 18:20 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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");
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03674 seconds