Search in sources :

Example 1 with IViewDescriptor

use of org.eclipse.ui.views.IViewDescriptor in project tdi-studio-se by Talend.

the class RefreshView method refreshAll.

public static void refreshAll() {
    IWorkbenchWindow workBenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (workBenchWindow == null) {
        return;
    }
    IWorkbenchPage workBenchPage = workBenchWindow.getActivePage();
    if (workBenchPage == null) {
        return;
    }
    for (IViewDescriptor desc : PlatformUI.getWorkbench().getViewRegistry().getViews()) {
        IViewPart viewPart = workBenchPage.findView(desc.getId());
        // show the view again in order to see the change
        if (viewPart != null) {
            workBenchPage.hideView(viewPart);
        }
    }
    workBenchPage.resetPerspective();
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) IViewDescriptor(org.eclipse.ui.views.IViewDescriptor) IViewPart(org.eclipse.ui.IViewPart) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage)

Aggregations

IViewPart (org.eclipse.ui.IViewPart)1 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)1 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)1 IViewDescriptor (org.eclipse.ui.views.IViewDescriptor)1