public static void hidePropertiesView() {
hideView("org.eclipse.ui.views.PropertySheet");
}
public static void hideView(final String theViewId) {
invokeOnDisplayThread(new Runnable() {
public void run() {
try {
IWorkbenchPage activePage = getActivePage();
IViewPart iviewpart = activePage.findView(theViewId);
activePage.hideView(iviewpart);
} catch (Exception ex) {
ex.printStackTrace();
}
}
});
}
public static void invokeOnDisplayThread(Runnable runnable) {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow windows[] = workbench.getWorkbenchWindows();
if (windows != null && windows.length > 0) {
Display display = windows[0].getShell().getDisplay();
display.syncExec(runnable);
} else {
runnable.run();
}
}