Bug 317250 [Compatibility] second Java perspective in perspective switcher
bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.java
menu.dispose();
					}
				});
			}
			public void menuShown(MenuEvent e) {
				
			}
		});
	}
	private void addCloseItem(final Menu menu) {
		MenuItem menuItem = new MenuItem(menu, SWT.NONE);
		menuItem.setText("&Close");
		menuItem.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				MPerspective persp = (MPerspective) menu.getData();
				if (persp != null)
					closePerspective(persp);
			}
		});
	}
	private void closePerspective(MPerspective persp) {
		MPerspectiveStack ps = getPerspectiveStack();
		for (MWindow win : persp.getWindows()) {
			win.setToBeRendered(false);
		}
		
		List<MTrimBar> bars = modelService.findElements(window, null, MTrimBar.class, null);
		List<MToolControl> toRemove = new ArrayList<MToolControl>();
		for (MTrimBar bar : bars) {
			for (MUIElement barKid : bar.getChildren()) {