Search in sources :

Example 1 with MPartDescriptor

use of org.eclipse.e4.ui.model.application.descriptor.basic.MPartDescriptor in project n4js by eclipse.

the class N4JSApplicationWorkbenchWindowAdvisor method reviewDisabledCategoriesFromAppModel.

/**
 * The 'Show View' dialog behavior slightly changed with E4. Even if the views are properly removed via activities
 * (by the unique view IDs) the content provider creates the root category for the unavailable views as well since
 * it is using the {@link MApplication}.
 */
private void reviewDisabledCategoriesFromAppModel() {
    final IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    final MApplication service = workbenchWindow.getService(MApplication.class);
    for (Iterator<MPartDescriptor> itr = service.getDescriptors().iterator(); itr.hasNext(); ) /**/
    {
        final MPartDescriptor descriptor = itr.next();
        if (isView(descriptor) && isDisabledView(descriptor)) {
            itr.remove();
        }
    }
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) MPartDescriptor(org.eclipse.e4.ui.model.application.descriptor.basic.MPartDescriptor) MApplication(org.eclipse.e4.ui.model.application.MApplication)

Aggregations

MApplication (org.eclipse.e4.ui.model.application.MApplication)1 MPartDescriptor (org.eclipse.e4.ui.model.application.descriptor.basic.MPartDescriptor)1 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)1