Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » List Open Files
List Open Files [message #334508] Fri, 13 February 2009 11:05 Go to next message
Stuart Harper is currently offline Stuart HarperFriend
Messages: 5
Registered: July 2009
Junior Member
Is there an Eclipse platform API to list the currently open files in the
editor?

Ideally I'd like to be able to get all the open files of a particular type
(e.g. all open XML files) but I can only see a way to get the currently
active editor and which editor is associated with which file.
Re: List Open Files [message #334515 is a reply to message #334508] Fri, 13 February 2009 16:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 2/13/2009 6:05 AM, Stuart Harper wrote:
> Is there an Eclipse platform API to list the currently open files in the
> editor?
>
> Ideally I'd like to be able to get all the open files of a particular
> type (e.g. all open XML files) but I can only see a way to get the
> currently active editor and which editor is associated with which file.

Here is one way that works with no context:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().getEditorReferences()

It could be shorter if you have enough context to get the
IWorkbenchWindow or IWorkbenchPage directly.

Hope this helps,
Eric
Re: List Open Files [message #334531 is a reply to message #334515] Mon, 16 February 2009 13:37 Go to previous message
Stuart Harper is currently offline Stuart HarperFriend
Messages: 5
Registered: July 2009
Junior Member
Eric Rizzo wrote:
>
> Here is one way that works with no context:
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().getEditorReferences()
>
>
> It could be shorter if you have enough context to get the
> IWorkbenchWindow or IWorkbenchPage directly.
>
> Hope this helps,
> Eric
This works perfectly, thank you!
Previous Topic:How to change Console encoding?
Next Topic:Synchronizing open editors on the same file
Goto Forum:
  


Current Time: Tue Jul 16 11:52:23 GMT 2024

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

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

Back to the top