return;
}
}
}
Perspective newPerspective = null;
try {
newPerspective = new Perspective(newPerspectiveName, getWindowLayout());
} catch (SalsaPerspectiveException e) {
LOGGER.warn("Cannot create new perspective {} {}", newPerspectiveName, e.getMessage());
LOGGER.trace("Stack trace", e);
}
perspectivesManager.addPerspective(newPerspective);
perspectivesManager.updateJMenu(newPerspectiveName);
for (int i = 0; i < this.perspectivesManager.getMenuBarViewTool().getMenuPerspective().getItemCount() - 3; i++) {
if (this.perspectivesManager.getMenuBarViewTool().getMenuPerspective().getItem(i).isSelected()) {
this.perspectivesManager.getMenuBarViewTool().getMenuPerspective().getItem(i).setSelected(false);
}
}
this.perspectivesManager.getMenuBarViewTool().getMenuPerspective()
.getItem(this.perspectivesManager.getMenuBarViewTool().getMenuPerspective().getItemCount() - 4)
.setSelected(true);
perspectivesManager.setCurrentPerspective(newPerspective);
UIPreferences.getInstance().setLastPerspectiveName(newPerspective.getName());
}
}