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?

Best,
Holger

[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

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic:Problem with Eclipse missing /usr/lib/eclipse/startup.jar on Unbuntu
Next Topic:SaveAll Action
Goto Forum:
  


Current Time: Fri Apr 26 09:06:16 GMT 2024

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

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

Back to the top