Hyperlinks to open a view [message #448217] |
Wed, 19 April 2006 10:35 |
Eclipse User |
|
|
|
Originally posted by: shruthi.cn.in.bosch.com
Hello everybody,
I want to have hyperlinks in my application.
When i click on a particular link say "Open MyView" link, i want to open a
particular view.
How to do this.
Thank you very much
Best Regards
Shruthi
|
|
|
Re: Hyperlinks to open a view [message #448355 is a reply to message #448217] |
Fri, 21 April 2006 18:20 |
Eclipse User |
|
|
|
Originally posted by: sagrawal.lehman.com
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
// get prespective id from hyperlink
String perspectiveId = hyperlink.getPerspectiveId();
if (perspectiveId != null) {
try {
IWorkbenchPage page = workbench.showPerspective(
perspectiveId,
window);
} catch (WorkbenchException ex) {
}
}
String viewId = hyperlink.getViewId();
if (viewId != null) {
try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().showView(viewId);
} catch (PartInitException ex) {
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.02588 seconds