How to show my dialog on top of Applet [message #534781] |
Thu, 20 May 2010 10:27  |
Eclipse User |
|
|
|
hi,
I use browser.setUrl("/applet.html");
When I click a button, then show me a dialog.I found the part of the dialog will be showed below the applet.
my dialog extends jface dialog.
thanks all of you
but I am a new one in rap, I can not understand how to do about
4) Upon notification, have the listener overlay a tranparent IFrame on top of the plugin content.
5) When the window or shell is closed, remove the IFrame shim.
Please give me some code, thanks a lot.
now I add some code for my dialog like that:
shell.getDisplay().addFilter(SWT.Activate, new Listener() {
public void handleEvent(Event event) {
System.out.println("------------====handleEvent");
}
});
I know when I open my dialog. but how to do 4 and 5 in this listener. some code.....
thanks
tyki
[Updated on: Fri, 21 May 2010 02:09] by Moderator Report message to a moderator
|
|
|
Re: How to show my dialog on top of Applet [message #534860 is a reply to message #534781] |
Thu, 20 May 2010 14:00   |
Eclipse User |
|
|
|
Hi Zezhenyan,
The reason this is happening is because the natural z-order of plugin content (in this case the java plugin) is on top of most other content.
We encountered a similar issue while using the Google Earth plugin in our RAP app. I don't recall if there is a conventional RAP approach to this problem, but I do know that the topic has been discussed in the newsgroup before.
A common solution is to use a shimming technique which places an element with a higher z-order than the plugin content, below the content that needs to show on top. Usually this involves an iFrame.
Hope this helps.
|
|
|
Re: How to show my dialog on top of Applet [message #534875 is a reply to message #534781] |
Thu, 20 May 2010 14:30   |
Eclipse User |
|
|
|
Hi Zezhenyan,
To be a little more helpful, the first approach that we took was:
1) Provide a listener in our system that would be notified when any shell was opened.
2) Centralize the opening of shells in the system from a helper service that would notify the listeners after opening the shell. (This obviously does not work for shells that are opened from the workbench, so another option is to just override open() in Shell or Window to provide the notification.)
3) Register this new window listener for the module with the java applet.
4) Upon notification, have the listener overlay a tranparent IFrame on top of the plugin content.
5) When the window or shell is closed, remove the IFrame shim. (This can all be done from SWT and does not require any custom widget code.)
The result is that the dialog can be moved freely on top of the plugin content.
Drawbacks:
For non-modal windows, the plugin content cannot be interacted with while the dialog is up.
I would love to hear some other approaches from other people. It seems like there should be some RAP framework convenience for this. I would be happy to contribute a solution if we get some input from others on the RAP team.
|
|
|
Re: How to show my dialog on top of Applet [message #534890 is a reply to message #534875] |
Thu, 20 May 2010 14:46   |
Eclipse User |
|
|
|
Hi,
regarding integrating helper support for this could be discussed after
the 1.3 release. Maybe just post it to the dev list.
Regarding your 1) and 2) point: Instead of introducing a helper-service,
you could use display.addFilter( SWT.Activate, new Listener() {...}.
This should inform you when any shell is activated (either your own or
workbench shells).
Regards,
Ben
Austin Riddle wrote:
> Hi Zezhenyan,
>
> To be a little more helpful, the first approach that we took was:
>
> 1) Provide a listener in our system that would be notified when any
> shell was opened.
> 2) Centralize the opening of shells in the system from a helper service
> that would notify the listeners after opening the shell. (This
> obviously does not work for shells that are opened from the workbench,
> so another option is to just override open() in Shell or Window to
> provide the notification.)
>
> 3) Register this new window listener for the module with the java applet.
>
> 4) Upon notification, have the listener overlay a tranparent IFrame on
> top of the plugin content.
>
> 5) When the window or shell is closed, remove the IFrame shim. (This
> can all be done from SWT and does not require any custom widget code.)
>
> The result is that the dialog can be moved freely on top of the plugin
> content.
>
> Drawbacks:
>
> For non-modal windows, the plugin content cannot be interacted with
> while the dialog is up.
>
>
> I would love to hear some other approaches from other people. It seems
> like there should be some RAP framework convenience for this. I would
> be happy to contribute a solution if we get some input from others on
> the RAP team.
--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource
|
|
|
Re: How to show my dialog on top of Applet [message #535005 is a reply to message #534875] |
Fri, 21 May 2010 02:10   |
Eclipse User |
|
|
|
thanks all of you
but I am a new one in rap, I can not understand how to do about
4) Upon notification, have the listener overlay a tranparent IFrame on top of the plugin content.
5) When the window or shell is closed, remove the IFrame shim.
Please give me some code, thanks a lot.
now I add some code for my dialog like that:
shell.getDisplay().addFilter(SWT.Activate, new Listener() {
public void handleEvent(Event event) {
System.out.println("------------====handleEvent");
}
});
I know when I open my dialog. but how to do 4 and 5 in this listener. some code.....
thanks
tyki
|
|
|
|
Re: How to show my dialog on top of Applet [message #535290 is a reply to message #535006] |
Fri, 21 May 2010 22:00   |
Eclipse User |
|
|
|
Hi,
I can't provide you any code at the moment, but since you are already using an IFrame (Browser widget) you have a few options:
1) When a shell is activated you could just change the content of your browser widget. Side-effect: you loose any state that the applet was in. When the shell is dispensed you can return to your applet.
2) You could set the browser widget to be invisible when a shell is activated. Side-effect: User may not understand why this is happening.
3) You could use a StackLayout to swap out a message composite that would indicate that the applet was paused.
Side-effect: User cannot see what was on the applet which may be important for why the shell is active.
4) You could use an absolute layout to overlay another browser widget which is semi-transparent.
Hope this helps.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04770 seconds