How to open a href link in a FormToolkit of eclipse -
made hyperlink not opening webpage.
toolkit = new formtoolkit(parent.getdisplay()); form = toolkit.createscrolledform(parent); form.settext("hello, abhishek eclipse form"); gridlayout layout = new gridlayout(); form.getbody().setlayout(layout); final hyperlink link = toolkit.createhyperlink(form.getbody(), "click here.", swt.wrap); link.sethref("http://www.google.com");
as per above piece of code,how should open webpage in formtoolkit view
the hyperlink widget isn't browser link. doesn't know how handle links. work button, in listen click event , need to.
you can find examples on how work forms here:
http://www.eclipse.org/articles/article-forms/article.html
here how listen link activation:
link.addhyperlinklistener(new hyperlinkadapter() { public void linkactivated(hyperlinkevent e) { system.out.println("link activated!"); }
to replace contents of view web page quite bit more complicated. have dispose of widgets in view (such hyperlink), create browser widget , point @ appropriate url.
Comments
Post a Comment