use of org.kie.workbench.common.stunner.core.client.session.ClientFullSession in project kie-wb-common by kiegroup.
the class StunnerClientLogger method logSessionInfo.
public static void logSessionInfo(final AbstractClientSession session) {
log("************ Session Info ****************");
if (null != session) {
log("Session = " + session.toString());
log("Canvas = " + session.getCanvas().toString());
if (null != session.getCanvasHandler()) {
final CanvasHandler canvasHandler = session.getCanvasHandler();
log("CanvasHandler = " + canvasHandler.toString());
final Diagram diagram = canvasHandler.getDiagram();
if (null != diagram) {
log("Diagram name = " + diagram.getName());
log("Graph uuid = " + (null != diagram.getGraph() ? diagram.getGraph().getUUID() : "null"));
final Metadata metadata = diagram.getMetadata();
if (null != metadata) {
log("Metadata defSetId = " + metadata.getDefinitionSetId());
log("Metadata shapeSetId = " + metadata.getShapeSetId());
log("Metadata canvas root = " + metadata.getCanvasRootUUID());
log("Metadata title = " + metadata.getTitle());
} else {
log("Metadata = null");
}
} else {
log("Diagram = null");
}
} else {
log("CanvasHandler = null");
}
if (session instanceof ClientFullSession) {
logFullSessionInfo((ClientFullSession) session);
}
} else {
log("Session is null");
}
log("******************************************");
}
use of org.kie.workbench.common.stunner.core.client.session.ClientFullSession in project kie-wb-common by kiegroup.
the class AbstractSelectionDevCommand method execute.
@Override
@SuppressWarnings("unchecked")
public void execute() {
try {
boolean found = false;
final ClientFullSession session = (ClientFullSession) getSession();
final Collection<String> selectedItems = session.getSelectionControl().getSelectedItems();
if (null != selectedItems) {
final String uuid = selectedItems.stream().findFirst().orElse(null);
if (null != uuid) {
execute(selectedItems.stream().map(this::getViewElement).collect(Collectors.toList()));
found = true;
}
}
if (!found) {
LOGGER.log(Level.WARNING, "No items selected.");
}
} catch (final ClassCastException e) {
LOGGER.log(Level.WARNING, "Session is not an instance of ClientFullSession");
}
}
Aggregations