Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Overlays via custom widget?(Discussing the possibility to extend RAP to offer overlays.)
Overlays via custom widget? [message #991371] Tue, 18 December 2012 19:59 Go to next message
Ray Pendergraph is currently offline Ray PendergraphFriend
Messages: 6
Registered: July 2009
Junior Member
I have read in several other posts on this forum and around the web that SWT does not provide really the ability to overlay transparent panes (like a glass pane)for additional "floating" controls, drawing, etc. A Composite does not seem to be able to have a clear background. Documentation and other posts here and elsewhere would seem to suggest that Shell (using SWT.NO_TRIM | SWT.ON_TOP) can have a clear background for overlay type operations but this does not seem to be the case in RWT. At least I cannot seem to get it to work as the Shell always occludes what's under it in the browser. Setting alpha only works for the entire Shell and its contents which is not what we need. Giving each control on the overlay layer it's own Shell sized to the control works but seems like a hack. We need the ability to have a layer that obeys the normal layout of a UI but need the ability to layer other controls or drawings over certain points on the page. My questions are these:

  • Is the inability to provide this type of UI layering (Glass pane effect) an omission in SWT or in RAP/RWT (or both)?
  • If it's a shortcoming of the SWT API then would it be possible to write a custom javascript widget or extension understanding that this would be stepping away from SWT portability?
  • Is there any good direction on how to do this like RWT JavaScript API documents?
  • Am I going down a wrong path here? Is there a better approach?


I looked here but the API says TBD.

[Updated on: Tue, 18 December 2012 20:24]

Report message to a moderator

Re: Overlays via custom widget? [message #991454 is a reply to message #991371] Wed, 19 December 2012 08:57 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Ray,

SWT does not support transparent shells because this is not directly
possible on the desktop. There is a way to simulate transparent shells
in SWT [1] but this does not work with RAP.

RAP currently does not support transparent shells (not even by theming),
feel free to open a feature request [2] and describe your problem.

However, you can create a transparent Composite in RAP by setting a
custom variant:

composite.setData( RWT.CUSTOM_VARIANT, "transparent" );

and adding this rule in a theme contribution:

Composite.transparent {
background-color: transparent;
background-image: none;
}

When this composite is a child of the maximized main shell, you can
bring it to the top with

composite.moveAbove( null );

Then this composite would be your transparent pane. Of course it would
only cover the main shell, not any dialog shells.

If you need something like a lightbox effect for the entire page,
chances are that Tim can help you out with a JavaScript snippet. Which
version do you use?

HTH, Ralf

[1]
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet180.java
[2] http://eclipse.org/rap/bugs/

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Overlays via custom widget? [message #991954 is a reply to message #991454] Thu, 20 December 2012 14:47 Go to previous message
Ray Pendergraph is currently offline Ray PendergraphFriend
Messages: 6
Registered: July 2009
Junior Member
Thank you for your quick response. This seems to meet the need of having a "glass pane" perfectly.
Previous Topic:keybindings and mouse events with a browser widget
Next Topic:Key listener needed BEFORE databinding triggers
Goto Forum:
  


Current Time: Thu Apr 25 05:15:30 GMT 2024

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

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

Back to the top