Search in sources :

Example 1 with ClientSession

use of org.kie.workbench.common.stunner.core.client.session.ClientSession in project kie-wb-common by kiegroup.

the class ProjectDiagramExplorerScreen method updateTitle.

private void updateTitle() {
    final ClientSession session = clientSessionManager.getCurrentSession();
    updateTitle(session);
}
Also used : AbstractClientSession(org.kie.workbench.common.stunner.core.client.session.impl.AbstractClientSession) ClientSession(org.kie.workbench.common.stunner.core.client.session.ClientSession)

Example 2 with ClientSession

use of org.kie.workbench.common.stunner.core.client.session.ClientSession in project kie-wb-common by kiegroup.

the class ProjectMessagesListener method fireNotification.

void fireNotification(final AbstractNotification notification) {
    final ClientSession session = clientSessionManager.getCurrentSession();
    final Path path = session.getCanvasHandler().getDiagram().getMetadata().getPath();
    final SystemMessage systemMessage = new SystemMessage();
    final ArrayList<SystemMessage> messagesList = new ArrayList<>();
    switch(notification.getType()) {
        case ERROR:
            systemMessage.setLevel(Level.ERROR);
            break;
        case WARNING:
            systemMessage.setLevel(Level.WARNING);
            break;
        case INFO:
            systemMessage.setLevel(Level.INFO);
            break;
    }
    systemMessage.setText(notification.getMessage());
    systemMessage.setPath(path);
    messagesList.add(systemMessage);
    PublishMessagesEvent messages = new PublishMessagesEvent();
    messages.setMessagesToPublish(messagesList);
    publishMessagesEvent.fire(messages);
}
Also used : Path(org.uberfire.backend.vfs.Path) SystemMessage(org.guvnor.messageconsole.events.SystemMessage) PublishMessagesEvent(org.guvnor.messageconsole.events.PublishMessagesEvent) ClientSession(org.kie.workbench.common.stunner.core.client.session.ClientSession) ArrayList(java.util.ArrayList)

Example 3 with ClientSession

use of org.kie.workbench.common.stunner.core.client.session.ClientSession in project kie-wb-common by kiegroup.

the class ProjectDiagramPropertiesScreen method onOpen.

@OnOpen
public void onOpen() {
    log(Level.INFO, "Opening ProjectDiagramPropertiesScreen.");
    final ClientSession current = clientSessionManager.getCurrentSession();
    handleSession(current);
}
Also used : ClientSession(org.kie.workbench.common.stunner.core.client.session.ClientSession) OnOpen(org.uberfire.lifecycle.OnOpen)

Aggregations

ClientSession (org.kie.workbench.common.stunner.core.client.session.ClientSession)3 ArrayList (java.util.ArrayList)1 PublishMessagesEvent (org.guvnor.messageconsole.events.PublishMessagesEvent)1 SystemMessage (org.guvnor.messageconsole.events.SystemMessage)1 AbstractClientSession (org.kie.workbench.common.stunner.core.client.session.impl.AbstractClientSession)1 Path (org.uberfire.backend.vfs.Path)1 OnOpen (org.uberfire.lifecycle.OnOpen)1