Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Knowing if an editor is visible
Knowing if an editor is visible [message #334780] Fri, 27 February 2009 10:49 Go to next message
Youmm P. is currently offline Youmm P.Friend
Messages: 140
Registered: July 2009
Senior Member
Hello,

How can I know, from all the opened editors, which one are visible to
the user? I mean visible as "we see the tab and the content" of the
editor. Most of the time there is only one editor visible, sometimes
more if you split your window into several editors.

I tried to iterate on each editor with:
getSite ().getPage ().getEditorReferences ()

and then we can get the IWorkbenchPart with editor.getEditorSite
().getPart ()

but can't find a way to know if it is visible or not.


I also tried to register a PartListener on the Page but can't we just
add a part listener only on the editor self?
Re: Knowing if an editor is visible [message #334790 is a reply to message #334780] Fri, 27 February 2009 14:33 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You would have to get the IEditorParts (make sure you don't deliberately
instantiate them), and then you can use
org.eclipse.ui.IWorkbenchPage.isPartVisible(IWorkbenchPart)

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/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Previous Topic:Ganymede Update - why does it not work? What is the point?
Next Topic:Debug: mouseover to look at value
Goto Forum:
  


Current Time: Thu Apr 25 20:59:34 GMT 2024

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

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

Back to the top