Open multiple editors and associating the editors with every figure [message #195745] |
Tue, 13 September 2005 12:39 |
Eclipse User |
|
|
|
Originally posted by: seshasai.aesv.softwareag.com
Hi All
I need to open a new editor everytime I click on a new Instance of an
figure I drag and drop from a pallette,I need to associate the every
editor with its instance.
Currently even when I click on diffrent instances of a figure I open the
same editor.
I have used the
IDE.openEditor(IWorkbenchPage page, IFile input,
String editorId, boolean activate)
How can I associate a figure with its editor?
Thanks in Advance
Sai
|
|
|
|
|
Re: Open multiple editors and associating the editors with every figure [message #195885 is a reply to message #195766] |
Wed, 14 September 2005 05:19 |
Eclipse User |
|
|
|
Originally posted by: seshasai.aesv.softwareag.com
Thanks Swapna
I did it the other way around like
IWorkbenchPage page =
((DefaultEditDomain)getViewer().getEditDomain()).getEditorPa rt().getSite().getPage();
IFile newFile = createNewFile(((Shape)this.getModel()).hashCode()+".seq");
IDE.openEditor(page, newFile, true);
I will try your way some time later ,well do you see any thing wrong in
using the above workaround.
regards
SAI
|
|
|
Re: Open multiple editors and associating the editors with every figure [message #195906 is a reply to message #195745] |
Wed, 14 September 2005 09:26 |
Eclipse User |
|
|
|
Originally posted by: wjancz.\/\/asko.pl(change \/\/ with w)
> I need to open a new editor everytime I click on a new Instance of an
> figure I drag and drop from a pallette,I need to associate the every
> editor with its instance.
>
> Currently even when I click on diffrent instances of a figure I open the
> same editor.
>
> I have used the
> IDE.openEditor(IWorkbenchPage page, IFile input,
> String editorId, boolean activate)
>
> How can I associate a figure with its editor?
>
Maybe the problem is in editor input ?
We are doing it like this:
final IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page= window.getActivePage();
IEditorInput input = OUR_EDITOR_INPUT;
page.openEditor(input, EditorId);
the hack is in OUR_EDITOR_INPUT which overrides an equals() method.
I think this method is important!
Try to prepare your own IEditorInput - put there an instance of your figure
and ovveride equals() method.
When you call openEditor like we (se above) Eclipse should open a new
editor.
Good Luck :)
...::WojT::..
|
|
|
Powered by
FUDForum. Page generated in 0.02550 seconds