Java 类org.eclipse.core.runtime.dynamichelpers.IExtensionChangeHandler 实例源码

项目:Hydrograph    文件:PerspectiveRemover.java   
private void removePerspetives(IPerspectiveRegistry perspectiveRegistry, List<IPerspectiveDescriptor> removePerspectiveDesc) {
    // If the list is non-empty then remove all such perspectives from the IExtensionChangeHandler
    if(perspectiveRegistry instanceof IExtensionChangeHandler && !removePerspectiveDesc.isEmpty()) {
        IExtensionChangeHandler extChgHandler = (IExtensionChangeHandler) perspectiveRegistry;
        extChgHandler.removeExtension(null, removePerspectiveDesc.toArray());
    }
}
项目:scouter    文件:RCPUtil.java   
public static void hidePerspectives(String[] ids) {
    IPerspectiveRegistry registry = PlatformUI.getWorkbench().getPerspectiveRegistry();
    IPerspectiveDescriptor[] descriptors = registry.getPerspectives();
    List ignoredPerspectives = Arrays.asList(ids);
    List removePerspectiveDesc = new ArrayList();
    for (IPerspectiveDescriptor desc : descriptors) {
        if (ignoredPerspectives.contains(desc.getId())) {
            removePerspectiveDesc.add(desc);
        }
    }
    if (registry instanceof IExtensionChangeHandler && !removePerspectiveDesc.isEmpty()) {
        IExtensionChangeHandler extChgHandler = (IExtensionChangeHandler) registry;
        extChgHandler.removeExtension(null, removePerspectiveDesc.toArray());
    }
}