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 10:19 Go to next message
Holger is currently offline Holger
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 10: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 09:21 Go to previous message
Paul Webster is currently offline Paul Webster
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: Mon Sep 01 19:39:12 EDT 2014

Powered by FUDForum. Page generated in 0.09352 seconds