|
|
|
Re: Dynamic MultiEditor [message #289833 is a reply to message #289816] |
Thu, 11 August 2005 12:08 |
|
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
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
Re: Dynamic MultiEditor [message #289855 is a reply to message #289833] |
Thu, 11 August 2005 14:48 |
Joseph George Variam 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 |
|
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
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
Powered by
FUDForum. Page generated in 0.03598 seconds