boolean isEditMode = SessionManager.getPanelSession(getPanel()).isEditMode();
if (workspacesIdentifiers != null && workspacesIdentifiers.size() > 0) {
Iterator itWorkspacesIdentifiers = workspacesIdentifiers.iterator();
while (itWorkspacesIdentifiers.hasNext()) {
String id = (String) itWorkspacesIdentifiers.next();
WorkspaceImpl workspace;
try {
workspace = (WorkspaceImpl) UIServices.lookup().getWorkspacesManager().getWorkspace(id);
} catch (Exception e) {
throw new FormatterException("No workspace found: ", e);
}
MenuItem menuItem = new WorkspaceMenuItem();
menuItem.setId(workspace.getId());
menuItem.setText(workspace.getName());
menuItem.setUrl(menuDriver.getChangeWorkspaceLink(request, response, workspace.getId()));
menuItem.setSelected(Boolean.valueOf(selectedWorkspaceIds.contains(workspace.getId())));
menuItem.setVisible(Boolean.TRUE);
if (workspace.getId().equals(getWorkspace().getId())) {
menuItem.setCurrent(Boolean.TRUE);
} else {
menuItem.setCurrent(Boolean.FALSE);
}
renderItem(menuItem, selectedWorkspaceIds.contains(MenuDriver.PARAMETER_ALL_ITEMS), isEditMode);