Search in sources :

Example 1 with Profile

use of org.kie.workbench.common.stunner.core.profile.Profile in project kie-wb-common by kiegroup.

the class ProfileSelector method bind.

public ProfileSelector bind(final Supplier<AbstractSession> sessionSupplier) {
    final AbstractSession session = sessionSupplier.get();
    final Metadata metadata = session.getCanvasHandler().getDiagram().getMetadata();
    final String definitionSetId = metadata.getDefinitionSetId();
    final String profileId = metadata.getProfileId();
    useDefinitionSet(definitionSetId);
    useProfile(definitionSetId, profileId);
    selector.setValueChangedCommand(() -> {
        final Profile item = selector.getSelectedItem();
        metadata.setProfileId(item.getProfileId());
        requestSessionRefreshEvent.fire(new RequestSessionRefreshEvent(session.getSessionUUID()));
    });
    return this;
}
Also used : Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) Profile(org.kie.workbench.common.stunner.core.profile.Profile) RequestSessionRefreshEvent(org.kie.workbench.common.stunner.client.widgets.presenters.session.RequestSessionRefreshEvent) AbstractSession(org.kie.workbench.common.stunner.core.client.session.impl.AbstractSession)

Example 2 with Profile

use of org.kie.workbench.common.stunner.core.profile.Profile in project kie-wb-common by kiegroup.

the class ProfileSelector method useProfile.

private void useProfile(final String defSetId, final String profileId) {
    final Profile profile = profileManager.getProfile(defSetId, profileId);
    setSelectedItem(profile);
}
Also used : Profile(org.kie.workbench.common.stunner.core.profile.Profile)

Aggregations

Profile (org.kie.workbench.common.stunner.core.profile.Profile)2 RequestSessionRefreshEvent (org.kie.workbench.common.stunner.client.widgets.presenters.session.RequestSessionRefreshEvent)1 AbstractSession (org.kie.workbench.common.stunner.core.client.session.impl.AbstractSession)1 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)1