Reputation: 17
I want to open a ViewPart from a button in the ViewPart of another button.. I am using eclipse RCP and rcp viewparts.
My code:
Button btnPush = new Button(container, SWT.NONE);
btnPush.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
// i want to display the view from here
}
});
Upvotes: 0
Views: 117
Reputation: 111216
Get the workbench page. In a view part you can use
IWorkbenchPage page = getSite().getPage();
elsewhere use:
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
Show and activate the view:
page.showView("view id");
Upvotes: 1