@Override
public void onClick(AjaxRequestTarget target) {
List<JcrNode> nodes = getSelectedNodes();
if (!nodes.isEmpty()) {
Brix brix = ((BrixNode) nodes.iterator().next()).getBrix();
JcrWorkspace targetWorkspace = brix.getCurrentSession(targetWorkspaceId).getWorkspace();
Map<JcrNode, List<JcrNode>> dependencies = JcrUtil.getUnsatisfiedDependencies(
nodes, targetWorkspace);
;
if (!dependencies.isEmpty()) {
message.setDefaultModelObject(getDependenciesMessage(dependencies));
} else {
JcrNode rootNode = targetNode.getObject();
if (rootNode == null) {
rootNode = targetWorkspace.getSession().getRootNode();
}
PrototypePlugin.get().restoreNodes(nodes, rootNode);
findParent(ModalWindow.class).close(target);
}
} else {