Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Multiple Different Editors for a Single Resource
Multiple Different Editors for a Single Resource [message #512294] Thu, 04 February 2010 15:19 Go to next message
Holger is currently offline HolgerFriend
Messages: 1
Registered: February 2010
Junior Member
Hi all,

When I want to open an editor from code I use the corresponding IDE.openEditor(...) method. If I have in my runtime a DiagramDocumentEditor opened on a certain IEditorInput and I want to open the same file in a DefaultTextEditor, calling

IDE.openEditor(new FileEditorInput(file), "org.eclipse.ui.DefaultTextEditor");

just activates the diagram editor that is already opened.

The developers guide on org.eclipse.ui.editors states "Only one editor can be open for any particular editor input in a workbench page. For example, if the user is editing readme.txt in the workbench, opening it again in the same perspective will activate the same editor. (You can open another editor on the same file from a different workbench window or perspective)"

But if I use "Open With -> Text Editor" in the package explorer or "Window -> New Editor" it is possible to open another editor in the same window (and in the same perspective).

Could anyone please point me to the actions associated with "Window->New Editor" or to "Open With -> Text Editor" in the package explorer? Or explain how they call IDE.openEditor(...) to open a second editor?


[Updated on: Thu, 04 February 2010 15:20]

Report message to a moderator

Re: Multiple Different Editors for a single Resource [message #512576 is a reply to message #512294] Fri, 05 February 2010 14:21 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You would use org.eclipse.ui.IWorkbenchPage.openEditor(IEditorInput,
String, boolean, int) which takes various IWorkbenchPage.MATCH_* flags


Paul Webster .platform.doc.isv/guide/workbench.htm

Previous Topic:file format of .project
Next Topic:influencing progress monitor of a launch configuration
Goto Forum:

Current Time: Thu May 24 12:27:14 GMT 2018

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

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

Back to the top