Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » cycle editors in display order (tab order)
cycle editors in display order (tab order) [message #526221] Fri, 09 April 2010 09:31 Go to next message
Jason Stillwell is currently offline Jason StillwellFriend
Messages: 2
Registered: April 2010
Junior Member
I want to cycle through the open editors, in the order they are displayed on screen. I'm trying to mimic the behavior of tabs in vim with the 'gt' and 'gT' commands. That also means cycling from beginning to end of the tab list.

ctrl-F6 (org.eclipse.ui.window.nextEditor) cycles through them in "activation order" which is not the same as display order. Also it opens a UI stack widget. Which stays open, oddly, when you call the internal command directly from a plugin, instead using a keymap.

I can easily mimic org.eclipse.ui.window.nextEditor by calling activePage.getEditorReferences(). But that too, is the activation order.

ctrl-pagedown/up cycles through the editors, but its an swt keymap, not an eclipse one. furthermore it stops when you hit the beginning/end of the tab list.

I think I can manually cycle, or at least get the visibl order of tabs, if i can get the CTabFolder from the IWorkbenchPage. but I can't find the API to link the 2 together.

See these for motivation:

* http://stackoverflow.com/questions/516704/enumerating-all-my -eclipse-editors
* http://dev.eclipse.org/newslists/news.eclipse.platform/msg72 043.html

And a plug for the eclipse plugin I'm trying to help out with.

* http://vrapper.sourceforge.net/home/
Re: cycle editors in display order (tab order) [message #526268 is a reply to message #526221] Fri, 09 April 2010 12:24 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

There is no API to get the CTabFolder. The physical order (as opposed
to the MRU activation list, which is what is displayed in CTRL+F6) is
contained in the presentation somewhere.

snippets of code:

WorkbenchPage wbp = (WorkbenchPage) page;
EditorAreaHelper eah = wbp.getEditorPresentation();
eah.displayEditorList();

EditorStack activeWorkbook = editorArea.getActiveWorkbook();

The EditorStack deals directly with the presentation, which should be a
TabbedStackPresentation.


But those are all internal, so the usual caveats apply.

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


Re: cycle editors in display order (tab order) [message #526367 is a reply to message #526268] Fri, 09 April 2010 20:44 Go to previous messageGo to next message
Jason Stillwell is currently offline Jason StillwellFriend
Messages: 2
Registered: April 2010
Junior Member
Thanks, this worked great. Now I just need to decide if I want the feature to work, at the expense of using internal apis.
Re: cycle editors in display order (tab order) [message #526620 is a reply to message #526367] Mon, 12 April 2010 12:10 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Jason Stillwell wrote:
> Thanks, this worked great. Now I just need to decide if I want the
> feature to work, at the expense of using internal apis.

And just as an example of the risk: this code has disappeared
completely from the e4/Eclipse 4.0 workbench. It's not even in the
compatibility layer.

But as long as you stick to Eclipse 3.x (3.6, 3.7, etc) it is only the
standard risk.

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:local changes undone when comparing with repository
Next Topic:Change EditorReference image
Goto Forum:
  


Current Time: Thu Apr 25 02:32:08 GMT 2024

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

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

Back to the top