Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Is there a way to get Shells by Z-Order?
Is there a way to get Shells by Z-Order? [message #1702308] Tue, 21 July 2015 13:28 Go to next message
Eclipse UserFriend
If there are more than one Shell for a Display,
some Shells could cover others,
I want to get all Shells by Z-Order: Top first.
Is there a way?

Thanks.

Frank
Re: Is there a way to get Shells by Z-Order? [message #1702348 is a reply to message #1702308] Tue, 21 July 2015 16:17 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 757
Registered: January 2012
Senior Member

I don't see a portable way of accomplishing this. You can determine what is the top element (Display#getActiveShell()). You might be lucky and find Display#getShells() returns the shells in Z-order, but it's not listed as a feature on its doc.

What are you trying to accomplish?

Brian.


Eclipse Platform committer. Ask me about Eclipse support, training, and consulting.
Re: Is there a way to get Shells by Z-Order? [message #1702668 is a reply to message #1702348] Fri, 24 July 2015 00:15 Go to previous messageGo to next message
Eclipse UserFriend
"Brian de Alwis" <forums-noreply@xxxxxxxx> 写入消息
news:molrbj$nf0$1@xxxxxxxxe.org...
> I don't see a portable way of accomplishing this. You can determine what
> is the top element (Display#getActiveShell()). You might be lucky and
> find Display#getShells() returns the shells in Z-order, but it's not
> listed as a feature on its doc.
>
> What are you trying to accomplish?
>

Well, since DND does not support dragging position (for drawing a rectangle
just like eclipse does), I implement myDND.
When dragging, I try to count which shell and which composite (with
ImyDropTarget interface) is dragover by mouse.
If shells are not covered to each other, I can get right shell & right
composite,
but if any shell(s) are covered to other(s), I cannot get right shell (and
neither right composite) sometimes.
That's why I need to get shells by Z-order.

Frank
Re: Is there a way to get Shells by Z-Order? [message #1702972 is a reply to message #1702668] Mon, 27 July 2015 15:35 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 757
Registered: January 2012
Senior Member

So it sounds like you're trying to reproduce something like how Eclipse draws a rectangle to preview the expected drop location when dragging views/editors around the workbench window? That functionality is all accomplished using SWT DND. You can see the implementation in the "dndaddon" found at:

https://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon

Brian.



Eclipse Platform committer. Ask me about Eclipse support, training, and consulting.
Re: Is there a way to get Shells by Z-Order? [message #1703154 is a reply to message #1702972] Wed, 29 July 2015 02:41 Go to previous message
Eclipse UserFriend
"Brian de Alwis" <forums-noreply@xxxxxxxx> 写入消息
news:mp5j34$f7d$1@xxxxxxxxe.org...
> So it sounds like you're trying to reproduce something like how Eclipse
> draws a rectangle to preview the expected drop location when dragging
> views/editors around the workbench window? That functionality is all
> accomplished using SWT DND. You can see the implementation in the
> "dndaddon" found at:
>
> https://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon
>
> Brian.

Thanks
Previous Topic:Button-captions in table's rows
Next Topic:MenuManager in TableViewer does not work on mobile device (tablet with Win 8)
Goto Forum:
  


Current Time: Sun Jun 24 01:10:06 GMT 2018

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

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

Back to the top