|
|
Re: Adding link to browser bookmarks [message #125470 is a reply to message #125238] |
Wed, 18 March 2009 04:19  |
Eclipse User |
|
|
|
Hi,
I haven't tried it but maybe you can do this by adding a PhaseListener
in the SelectionListener of your Button, e.g.:
final Display display = Display.getCurrent();
RWT.getLifeCycle().addPhaseListener(new PhaseListener(){
private static final long serialVersionUID = 0L;
public void beforePhase(final PhaseEvent event){
// do nothing
}
public void afterPhase(final PhaseEvent event){
if (display == Display.getCurrent()) {
try {
final HtmlResponseWriter writer =
ContextProvider.getStateInfo().getResponseWriter();
final String jsCode = "window.sidebar.addPanel('Your
app', urlToApp, '');";
writer.write(jsCode);
} catch (final Exception e) {
e.printStackTrace();
} finally {
RWT.getLifeCycle().removePhaseListener(this);
}
}
}
public PhaseId getPhaseId(){
return PhaseId.RENDER;
}
});
}
Regards,
Stefan.
Sergey N.Yashin schrieb:
> Hi!
>
> Can i somehow add link to the browser bookmarks from RAP without
> creating a custom widget ?
>
> Thanks.
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03756 seconds