Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Is there a way to get all Eclipse instance's widgets ?(SWT widgets children)
Is there a way to get all Eclipse instance's widgets ? [message #1736142] Mon, 27 June 2016 06:29 Go to next message
opendev cartu38 is currently offline opendev cartu38Friend
Messages: 14
Registered: June 2016
Junior Member
I would iterate over all Eclipse workbench instance's widgets. Is there a way to get them all ?
Re: Is there a way to get all Eclipse instance's widgets ? [message #1736189 is a reply to message #1736142] Mon, 27 June 2016 12:07 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30353
Registered: July 2009
Senior Member
PlatformUI.getWorkbench().getWorkbenchWindows() is something you can
iterate over. Each IWorkbenchWindow has a getShell() which has
getChildren() and for Controls that are composites you can navigate
recursively into their getChildren.


On 27.06.2016 07:55, opendev cartu38 wrote:
> I would iterate over all Eclipse workbench instance's widgets. Is
> there a way to get them all ?
Re: Is there a way to get all Eclipse instance's widgets ? [message #1737244 is a reply to message #1736189] Wed, 06 July 2016 14:45 Go to previous messageGo to next message
opendev cartu38 is currently offline opendev cartu38Friend
Messages: 14
Registered: June 2016
Junior Member
Thanks such is helpful as at least confirms my on going trials. Having some doubts initially as not getting back properly Menu(s) etc ... but sounds some progress about iterating over Controls using getMenu() method.

Now facing concerns trying to retrieve all TreeItem from a Tree. My today result is only providing me children nodes if such are end user visible (i.e. expanded first) ... any advice about ?

PS : I've tried already ((TreeItem) item).setExpanded(true) but not ending with same result as UI based end user tree expansion activity
Re: Is there a way to get all Eclipse instance's widgets ? [message #1737249 is a reply to message #1737244] Wed, 06 July 2016 15:27 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30353
Registered: July 2009
Senior Member
Note that a tree could potentially be infinitely expandable.

I have a feeling that calling setExpanded doesn't produce a notification
so org.eclipse.jface.viewers.AbstractTreeViewer.hookControl(Control)
wouldn't see an event. So you might need to create an event and notify
the tree so the viewer sees it. But I'm not sure about that.


On 06.07.2016 16:45, opendev cartu38 wrote:
> Thanks such is helpful as at least confirms my on going trials. Having
> some doubts initially as not getting back properly Menu(s) etc ... but
> sounds some progress about iterating over Controls using getMenu()
> method.
>
> Now facing concerns trying to retrieve all TreeItem from a Tree. My
> today result is only providing me children nodes if such are end user
> visible (i.e. expanded first) ... any advice about ?
> PS : I've tried already ((TreeItem) item).setExpanded(true) but not
> ending with same result as UI based end user tree expansion activity
Previous Topic:Scala in Eclipse
Next Topic:[HELP] Cannot checkout from svn
Goto Forum:
  


Current Time: Wed Aug 21 01:48:48 GMT 2019

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

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

Back to the top