use of org.kie.workbench.common.stunner.core.client.session.impl.EditorSession in project kie-wb-common by kiegroup.
the class DMNDiagramEditor method onFocus.
@OnFocus
public void onFocus() {
final EditorSession session = presenter.getInstance();
log(Level.INFO, "FOCUS [" + session + "]");
if (null != session) {
sessionFocusedEvent.fire(new SessionFocusedEvent(session));
}
}
use of org.kie.workbench.common.stunner.core.client.session.impl.EditorSession in project kie-wb-common by kiegroup.
the class StunnerClientLogger method logSessionInfo.
public static void logSessionInfo(final AbstractSession session) {
log("************ Session Info ****************");
if (null != session) {
log("Session = " + session.toString());
log("Session id = " + session.getSessionUUID());
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 profileId = " + metadata.getProfileId());
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 EditorSession) {
logFullSessionInfo((EditorSession) session);
}
} else {
log("Session is null");
}
log("******************************************");
}
use of org.kie.workbench.common.stunner.core.client.session.impl.EditorSession in project kie-wb-common by kiegroup.
the class FormPropertiesWidget method show.
private void show(final String graphUuid, final DomainObject domainObject, final Command callback) {
final String domainObjectUUID = domainObject.getDomainObjectUUID();
final String domainObjectName = translationService.getTranslation(domainObject.getDomainObjectNameTranslationKey());
final Diagram<?, ?> diagram = formSessionHandler.getDiagram();
if (Objects.isNull(diagram)) {
return;
}
final Metadata metadata = diagram.getMetadata();
if (Objects.isNull(metadata)) {
return;
}
final Path diagramPath = metadata.getPath();
final RenderMode renderMode = formSessionHandler.getSession() instanceof EditorSession ? RenderMode.EDIT_MODE : RenderMode.READ_ONLY_MODE;
formsContainer.render(graphUuid, domainObjectUUID, domainObject, diagramPath, (fieldName, newValue) -> {
try {
formSessionHandler.executeUpdateDomainObjectProperty(domainObject, fieldName, newValue);
} catch (final Exception ex) {
log(Level.SEVERE, "Something wrong happened refreshing the DomainObject '" + domainObject + "' for field '" + fieldName + "': " + ex.getCause());
} finally {
if (null != callback) {
callback.execute();
}
}
}, renderMode);
fireFormsPropertiesOpenedEvent(domainObjectUUID, domainObjectName);
resetLastElementRenderedCache();
}
Aggregations