class ProfileSelector extends SelectorDelegate<Profile> {

    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;
    }

    @Inject public  ProfileSelector(final SelectorImpl<Profile> selector,
                           final ProfileManager profileManager,
                           final Event<RequestSessionRefreshEvent> requestSessionRefreshEvent);

}