Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » opening a second editor
opening a second editor [message #188646] Thu, 21 July 2005 14:23 Go to next message
Eclipse UserFriend
Originally posted by: smoreno.business-innovations.biz

Hi

Hi:

by default eclipse allows only one editor for the same file
what i want to do is open a second editor double clicking a figure from the
first editor  


some sugestions?
--
Sergio Moreno
Re: opening a second editor [message #188699 is a reply to message #188646] Fri, 22 July 2005 14:28 Go to previous messageGo to next message
kiril mitov is currently offline kiril mitovFriend
Messages: 128
Registered: July 2009
Senior Member
There are several approaches to solve this problem.
I have recently developed an editor(for example EditorFirst). When
clicking a figure(for example Figure1) from EditorFirst a second gef
editor(EditorSecond) opens and I edit Figure1 in EditorSecond.

The input I pass to EditorSecond contains Figure1.
Opening the editor is not very difficult.
I have an ui action called "Edit Figure1".
In the run method of the action I execute this:
IWorkbenchWindow window =
getWorkbenchPart().getSite().getWorkbenchWindow();
window.getActivePage().openEditor(input,"EditorSecondID");
In the getAdapter() method of the input of EditorSecond I get Figure1 and
edit it using EditorSecond.
In eclipse the input of an editor does NOT have to be a file. So this
gives you freedom (and much flexability) with one editor to edit various
things. Not just files.

There is also another approache. - Multipage editor.
I have also worked on a multipage editor. The first page is a GEF editor,
and the second is page are just some jface controls.

Maybe it will be better to have a multipage editor.

kiril


Sergio Moreno wrote:

> Hi

> Hi:

> by default eclipse allows only one editor for the same file
> what i want to do is open a second editor double clicking a figure from the
> first editor


> some sugestions?
Re: opening a second editor [message #188867 is a reply to message #188699] Fri, 22 July 2005 19:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: smoreno.business-innovations.biz

Thanks for the answer
I have created the action that opens the new editor and activates only when
the figure is selected
but its not so clear to me the getAdapter method part of your answer
Do I have to create a implementation of IEditorInput passing the editpart of
the selected figure?
it would'nt be a problem that this editpart is asociated with one figure
that is not a layer (or a panel)?
it will be great if you have some links to a examples where this is
implemented.....


"Kiril Mitov" <kiril_mitov@abv.bg> escribi
Re: opening a second editor [message #188898 is a reply to message #188646] Fri, 22 July 2005 21:53 Go to previous message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"Sergio Moreno" <smoreno@business-innovations.biz> wrote in message
news:dbp07j$j1q$2@news.eclipse.org...
> Hi
>
> Hi:
>
> by default eclipse allows only one editor for the same file
> what i want to do is open a second editor double clicking a figure from
> the
> first editor
>
Eclipse 3.1 allows you to open multiple editors for the same file.
---
Sunil
Previous Topic:Refreshing Images
Next Topic:A Dash Line is Possible?
Goto Forum:
  


Current Time: Tue Dec 03 09:40:25 GMT 2024

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

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

Back to the top