use of org.kie.workbench.common.stunner.core.client.session.impl.AbstractClientFullSession in project kie-wb-common by kiegroup.
the class AbstractProjectDiagramEditor method open.
@SuppressWarnings("unchecked")
protected void open(final ProjectDiagram diagram) {
showLoadingViews();
setOriginalHash(diagram.hashCode());
final Metadata metadata = diagram.getMetadata();
sessionManager.getSessionFactory(metadata, ClientFullSession.class).newSession(metadata, s -> {
final AbstractClientFullSession session = (AbstractClientFullSession) s;
presenter = sessionPresenterFactory.newPresenterEditor();
getView().setWidget(presenter.getView());
presenter.withToolbar(false).withPalette(true).displayNotifications(type -> true).open(diagram, session, new SessionPresenter.SessionPresenterCallback<AbstractClientFullSession, Diagram>() {
@Override
public void afterSessionOpened() {
}
@Override
public void afterCanvasInitialized() {
}
@Override
public void onSuccess() {
bindCommands();
updateTitle(diagram.getMetadata().getTitle());
hideLoadingViews();
setOriginalHash(getCurrentDiagramHash());
}
@Override
public void onError(final ClientRuntimeError error) {
onLoadError(error);
}
});
});
}
use of org.kie.workbench.common.stunner.core.client.session.impl.AbstractClientFullSession in project kie-wb-common by kiegroup.
the class SessionDiagramEditorScreen method openDiagram.
private void openDiagram(Diagram diagram, Command callback) {
final Metadata metadata = diagram.getMetadata();
sessionManager.getSessionFactory(metadata, ClientFullSession.class).newSession(metadata, s -> {
final AbstractClientFullSession session = (AbstractClientFullSession) s;
presenter = sessionPresenterFactory.newPresenterEditor();
screenPanelView.setWidget(presenter.getView());
presenter.withToolbar(true).withPalette(true).displayNotifications(type -> true).open(diagram, session, new ScreenPresenterCallback(callback));
});
}
use of org.kie.workbench.common.stunner.core.client.session.impl.AbstractClientFullSession in project kie-wb-common by kiegroup.
the class SessionDiagramEditorScreen method openDiagram.
private void openDiagram(final Diagram diagram, final Command callback) {
sessionManager.getSessionFactory(diagram.getMetadata(), ClientFullSession.class).newSession(diagram.getMetadata(), s -> {
final AbstractClientFullSession session = (AbstractClientFullSession) s;
presenter = sessionPresenterFactory.newPresenterEditor();
screenPanelView.setWidget(presenter.getView());
presenter.withToolbar(true).withPalette(true).displayNotifications(type -> true).open(diagram, session, new ScreenPresenterCallback(callback));
expressionEditor.init(presenter);
});
}
use of org.kie.workbench.common.stunner.core.client.session.impl.AbstractClientFullSession in project kie-wb-common by kiegroup.
the class ProjectDiagramPropertiesScreen method handleSession.
@SuppressWarnings("unchecked")
private void handleSession(final ClientSession session) {
boolean done = false;
view.showLoading();
if (null != session) {
this.session = session;
try {
final AbstractClientFullSession fullSession = (AbstractClientFullSession) session;
// Show the loading view.
view.showLoading();
// Open the forms properties widget for the current session.
formPropertiesWidget.bind(fullSession).show(() -> view.hideLoading());
done = true;
} catch (ClassCastException e) {
// No writteable session. Do not show properties until read mode available.
log(Level.INFO, "Session discarded for opening as not instance of full session.");
}
}
if (!done) {
formPropertiesWidget.unbind();
view.hideLoading();
this.session = null;
}
}
Aggregations