Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to add a page to existing multi-page editor at runtime
How to add a page to existing multi-page editor at runtime [message #329242] Tue, 17 June 2008 11:42
Eclipse UserFriend
Originally posted by: adrian_.nerdshack.com

Hi,

I wanna add a page to an existing multi-page editor at runtime and only
if event "xyz" occurs.

I tried something like this:

IEditorPart activePart = window.getActivePage().getActiveEditor();
if (activePart instanceof MultiPageEditorPart) {
MultiPageEditorPart multiPageEditorPart = (MultiPageEditorPart)
activePart;
try {
multiPageEditorPart.addPage(new EmptyEditorPart(),
new EmptyEditorInput());
} catch (PartInitException e) {
e.printStackTrace();
}
}

That works so far.

But how is it possible to "rename" the tab?
Is it possible to do the same for existing non-multi-page editors?
Is it possible to change the origin IEditorPart to an
MultiPageEditorPart which includes the origin?
Is there an extension point for doing this in an easy way?
Or another approach?

Some background:

I only wanna have the new pages appended to the editor if the origin
files are set to have the pages, independently of content or file
extension. So some file with extension "ext" may have the extra pages
and some not.

Regards

Adrian
Previous Topic:How to get Windows List view like behaviour by JFace viewers
Next Topic:Add an action to both main menu & view context menu
Goto Forum:
  


Current Time: Wed Jul 17 21:11:09 GMT 2024

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

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

Back to the top