@Override
public void actionPerformed(ActionEvent e) {
//Close other perspective
for (Perspective g : perspectives) {
if (g != perspective) {
TopComponentGroup tpg = WindowManager.getDefault().findTopComponentGroup(g.getName());
tpg.close();
}
}
//Open perspective
TopComponentGroup tpg = WindowManager.getDefault().findTopComponentGroup(perspective.getName());
tpg.open();
PerspectiveMember[] members = Lookup.getDefault().lookupAll(PerspectiveMember.class).toArray(new PerspectiveMember[0]);
//Close members
Perspective closingPerspective = getPerspective(selectedPerspective);