Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Dynamic MultiEditor
Dynamic MultiEditor [message #289743] Wed, 10 August 2005 15:05 Go to next message
Joseph George Variam is currently offline Joseph George VariamFriend
Messages: 19
Registered: July 2009
Junior Member
Hi,
Is it possible to add more editors to a MultiEditor after it has been initialized?
(btw, Im using the latest patch from
https://bugs.eclipse.org/bugs/show_bug.cgi?id=96129)

thanks,
joe.
Re: Dynamic MultiEditor [message #289773 is a reply to message #289743] Wed, 10 August 2005 17:19 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Joseph George wrote:
>
> Hi,
> Is it possible to add more editors to a MultiEditor after it has been
> initialized?
> (btw, Im using the latest patch from
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=96129)

AFAIK, you can't add extra files to a MultiEditor after it's been
initialized. The inner editors (one per input) are created/init'd
during the MultiEditor creation. There's no code to add it later.

Later,
PW


Re: Dynamic MultiEditor [message #289816 is a reply to message #289773] Thu, 11 August 2005 07:58 Go to previous messageGo to next message
Joseph George Variam is currently offline Joseph George VariamFriend
Messages: 19
Registered: July 2009
Junior Member
Paul Webster wrote:
> Joseph George wrote:
>
>>
>> Hi,
>> Is it possible to add more editors to a MultiEditor after it has been
>> initialized?
>> (btw, Im using the latest patch from
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=96129)
>
>
> AFAIK, you can't add extra files to a MultiEditor after it's been
> initialized. The inner editors (one per input) are created/init'd
> during the MultiEditor creation. There's no code to add it later.
>
> Later,
> PW

Thanks Paul....but suppose I modify the eclipse source in order to do
that...could you please give me some pointers on how i could write up some code
to add more editors to a multi editor.

thanks,
joe.
Re: Dynamic MultiEditor [message #289833 is a reply to message #289816] Thu, 11 August 2005 12:08 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Joseph George wrote:
> Thanks Paul....but suppose I modify the eclipse source in order to do
> that...could you please give me some pointers on how i could write up
> some code to add more editors to a multi editor.
>
> thanks,
> joe.

Hmmmm ... I'd be worried about editor lifecycle, but if you really did
want to, you could add some of the code to your MultiEditor subclass.

Basically you'll want to implement the inner editor creation cycle.
Look for uses of EditorManager#openMultiEditor(...) and
MultiEditor#createInnerPartControl(...) ... after that you'd probably
have to activate the MultiEditor to get it to re-layout with the new child.

You'd have to not lose the inner children in MultiEditor and
EditorReference, and probably update the MultiEditorInput in your
MultiEditor so it was consistent. Most of the above is in internal
classes.

MultiEditor REALLY wasn't designed to open up extra editors later.

MultiPageEditorPart looks a lot more promising, with the same kind of
work being done by MPEP#addPage(...) and IEditorPart#setInput(...) (to
make the input consistent with the pages if they represent different
editor parts). The difference would be MultiEditor can show editors
side by side and MPEP shows the inner editors as tabs.

Later,
PW


Re: Dynamic MultiEditor [message #289855 is a reply to message #289833] Thu, 11 August 2005 14:48 Go to previous messageGo to next message
Joseph George Variam is currently offline Joseph George VariamFriend
Messages: 19
Registered: July 2009
Junior Member
>
> Hmmmm ... I'd be worried about editor lifecycle, but if you really did
> want to, you could add some of the code to your MultiEditor subclass.
>
Well, I played around with the classes u mentioned, and I finally did manage to
get the multieditor to add editors after it was initialized. (so now i can just
double-click on stuff and tabs get added to my multieditor)
U're right! editor lifecycle is screwed up...but more on that later in a
different post.

> Basically you'll want to implement the inner editor creation cycle. Look
> for uses of EditorManager#openMultiEditor(...) and
> MultiEditor#createInnerPartControl(...) ... after that you'd probably
> have to activate the MultiEditor to get it to re-layout with the new child.
>
> You'd have to not lose the inner children in MultiEditor and
> EditorReference, and probably update the MultiEditorInput in your
> MultiEditor so it was consistent. Most of the above is in internal
> classes.
>
> MultiEditor REALLY wasn't designed to open up extra editors later.
>
> MultiPageEditorPart looks a lot more promising, with the same kind of
> work being done by MPEP#addPage(...) and IEditorPart#setInput(...) (to
> make the input consistent with the pages if they represent different
> editor parts). The difference would be MultiEditor can show editors
> side by side and MPEP shows the inner editors as tabs.

oops...
What i need is a way to display multiple editors within a single editor with the
sub-editors organized in a tab-folder. I did take a look at MPEP, but the
problem is that i can't get the tabs to display a close icon...if this is
possible then there wouldn't be any need for me to hack the MultiEditor code...

so, the question is, with a MultiPageEditorPart, can I:
? have different editors in its own tab with a close button
? each editor with its own different EditorInput and hence preserving the editor
lifecycle


-joe
Re: Dynamic MultiEditor [message #289862 is a reply to message #289855] Thu, 11 August 2005 15:38 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Joseph George wrote:
>>
>> Hmmmm ... I'd be worried about editor lifecycle, but if you really did
>> want to, you could add some of the code to your MultiEditor subclass.
>>
> Well, I played around with the classes u mentioned, and I finally did
> manage to get the multieditor to add editors after it was initialized.
> (so now i can just double-click on stuff and tabs get added to my
> multieditor)
> U're right! editor lifecycle is screwed up...but more on that later in a
> different post.
> [... snip ...]
>
> oops...
> What i need is a way to display multiple editors within a single editor
> with the sub-editors organized in a tab-folder. I did take a look at
> MPEP, but the problem is that i can't get the tabs to display a close
> icon...if this is possible then there wouldn't be any need for me to
> hack the MultiEditor code...
>
> so, the question is, with a MultiPageEditorPart, can I:
> ? have different editors in its own tab with a close button
> ? each editor with its own different EditorInput and hence preserving
> the editor lifecycle

So I'm not sure how those close buttons work, but there don't seem to be
any on MPEP. There is a corresponding removePage(int) that allows a
page to be remove dynamically ... it takes care of disposing of the
page's IEditorPart. Some kind of "close inner tab" action in the
context menu would allow you to call it dynamically, and
setInputWithNotify you could updated your MPEP editorinput to be
consistent with the number of pages that you have open.


But (like mentioned in the other MPEP thread) can you not just use
editors in their normal tabs? Since you would be opening them using
your own action, you can let them open as individual editor parts but
tie them into whatever extra service/synchronization your plugin offers
using listeners and some common data ...

Later,
PW


Previous Topic:Tooltip text not showing up unless toolbar has focus
Next Topic:CVS module-alias names
Goto Forum:
  


Current Time: Thu Apr 25 07:01:53 GMT 2024

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

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

Back to the top