Java Code Examples for org.vaadin.spring.events.EventBus.UIEventBus#subscribe()

The following examples show how to use org.vaadin.spring.events.EventBus.UIEventBus#subscribe() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractTableDetailsLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
protected AbstractTableDetailsLayout(final VaadinMessageSource i18n, final UIEventBus eventBus,
        final SpPermissionChecker permissionChecker, final ManagementUIState managementUIState) {
    this.i18n = i18n;
    this.permissionChecker = permissionChecker;
    this.managementUIState = managementUIState;
    detailsLayout = createTabLayout();
    descriptionLayout = createTabLayout();
    logLayout = createTabLayout();
    attributesLayout = createTabLayout();
    tagsLayout = createTabLayout();
    createComponents();
    buildLayout();
    if (doSubscribeToEventBus()) {
        eventBus.subscribe(this);
    }
}
 
Example 2
Source File: CreateOrUpdateFilterTable.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
CreateOrUpdateFilterTable(final VaadinMessageSource i18n, final UIEventBus eventBus,
        final FilterManagementUIState filterManagementUIState) {
    this.i18n = i18n;
    this.filterManagementUIState = filterManagementUIState;
    this.eventBus = eventBus;

    setStyleName("sp-table");
    setSizeFull();
    setImmediate(true);
    setHeight(100.0F, Unit.PERCENTAGE);
    addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
    addStyleName(ValoTheme.TABLE_SMALL);
    setColumnCollapsingAllowed(true);
    addCustomGeneratedColumns();
    restoreOnLoad();
    populateTableData();
    setId(UIComponentIdProvider.CUSTOM_FILTER_TARGET_TABLE_ID);
    setSelectable(false);
    eventBus.subscribe(this);
    setItemDescriptionGenerator(new AssignInstalledDSTooltipGenerator());
}
 
Example 3
Source File: CreateOrUpdateFilterHeader.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
CreateOrUpdateFilterHeader(final VaadinMessageSource i18n, final UIEventBus eventBus,
        final FilterManagementUIState filterManagementUIState,
        final TargetFilterQueryManagement targetFilterQueryManagement, final SpPermissionChecker permissionChecker,
        final UINotification notification, final UiProperties uiProperties, final EntityFactory entityFactory,
        final AutoCompleteTextFieldComponent queryTextField) {
    this.i18n = i18n;
    this.eventBus = eventBus;
    this.filterManagementUIState = filterManagementUIState;
    this.targetFilterQueryManagement = targetFilterQueryManagement;
    this.permissionChecker = permissionChecker;
    this.notification = notification;
    this.uiProperties = uiProperties;
    this.entityFactory = entityFactory;
    this.queryTextField = queryTextField;

    createComponents();
    createListeners();
    buildLayout();
    restoreOnLoad();
    setUpCaptionLayout(filterManagementUIState.isCreateFilterViewDisplayed());
    eventBus.subscribe(this);
}
 
Example 4
Source File: AbstractTableHeader.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
protected AbstractTableHeader(final VaadinMessageSource i18n, final SpPermissionChecker permChecker,
        final UIEventBus eventBus, final ManagementUIState managementUIState,
        final ManageDistUIState manageDistUIstate, final ArtifactUploadState artifactUploadState) {
    this.i18n = i18n;
    this.permChecker = permChecker;
    this.eventBus = eventBus;
    this.managementUIState = managementUIState;
    this.manageDistUIstate = manageDistUIstate;
    this.artifactUploadState = artifactUploadState;
    createComponents();
    buildLayout();
    restoreState();
    if (doSubscribeToEventBus()) {
        eventBus.subscribe(this);
    }
}
 
Example 5
Source File: MultipleTargetFilter.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
MultipleTargetFilter(final SpPermissionChecker permChecker, final ManagementUIState managementUIState,
        final VaadinMessageSource i18n, final UIEventBus eventBus,
        final ManagementViewClientCriterion managementViewClientCriterion, final UINotification notification,
        final EntityFactory entityFactory, final TargetFilterQueryManagement targetFilterQueryManagement,
        final TargetTagManagement targetTagManagement) {
    this.filterByButtons = new TargetTagFilterButtons(eventBus, managementUIState, managementViewClientCriterion,
            i18n, notification, permChecker, entityFactory, targetTagManagement);
    this.targetFilterQueryButtonsTab = new TargetFilterQueryButtons(managementUIState, eventBus);
    this.filterByStatusFooter = new FilterByStatusLayout(i18n, eventBus, managementUIState);
    this.customTargetTagFilterButtonClick = new CustomTargetTagFilterButtonClick(eventBus, managementUIState,
            targetFilterQueryManagement);
    this.permChecker = permChecker;
    this.managementUIState = managementUIState;
    this.i18n = i18n;
    this.eventBus = eventBus;
    this.uiNotification = notification;
    this.entityFactory = entityFactory;
    this.targetTagManagement = targetTagManagement;
    buildComponents();
    eventBus.subscribe(this);
}
 
Example 6
Source File: AbstractTable.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
protected AbstractTable(final UIEventBus eventBus, final VaadinMessageSource i18n,
        final UINotification notification, final SpPermissionChecker permChecker) {
    this.eventBus = eventBus;
    this.i18n = i18n;
    this.notification = notification;
    this.permChecker = permChecker;
    setStyleName("sp-table");
    setSizeFull();
    setImmediate(true);
    setHeight(100.0F, Unit.PERCENTAGE);
    addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
    addStyleName(ValoTheme.TABLE_SMALL);
    setSortEnabled(false);
    setId(getTableId());
    addCustomGeneratedColumns();
    addDeleteColumn();
    setDefault();
    addValueChangeListener(event -> onValueChange());
    setPageLength(SPUIDefinitions.PAGE_SIZE);
    if (doSubscribeToEventBus()) {
        eventBus.subscribe(this);
    }
}
 
Example 7
Source File: ArtifactDetailsLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Constructor for ArtifactDetailsLayout
 * 
 * @param i18n
 *            VaadinMessageSource
 * @param eventBus
 *            UIEventBus
 * @param artifactUploadState
 *            ArtifactUploadState
 * @param uINotification
 *            UINotification
 * @param artifactManagement
 *            ArtifactManagement
 * @param softwareManagement
 *            SoftwareManagement
 */
public ArtifactDetailsLayout(final VaadinMessageSource i18n, final UIEventBus eventBus,
        final ArtifactUploadState artifactUploadState, final UINotification uINotification,
        final ArtifactManagement artifactManagement, final SoftwareModuleManagement softwareManagement) {
    this.i18n = i18n;
    this.eventBus = eventBus;
    this.artifactUploadState = artifactUploadState;
    this.uINotification = uINotification;
    this.artifactManagement = artifactManagement;
    this.softwareModuleManagement = softwareManagement;

    final Optional<SoftwareModule> selectedSoftwareModule = findSelectedSoftwareModule();

    String labelSoftwareModule = "";
    if (selectedSoftwareModule.isPresent()) {
        labelSoftwareModule = HawkbitCommonUtil.getFormattedNameVersion(selectedSoftwareModule.get().getName(),
                selectedSoftwareModule.get().getVersion());
    }
    createComponents();
    buildLayout();
    eventBus.subscribe(this);

    if (selectedSoftwareModule.isPresent()) {
        populateArtifactDetails(selectedSoftwareModule.get().getId(), labelSoftwareModule);
    }

    if (isMaximized()) {
        maximizedArtifactDetailsView();
    }
}
 
Example 8
Source File: AbstractTagToken.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
protected AbstractTagToken(final SpPermissionChecker checker, final VaadinMessageSource i18n,
        final UINotification uinotification, final UIEventBus eventBus, final ManagementUIState managementUIState) {
    this.checker = checker;
    this.i18n = i18n;
    this.uinotification = uinotification;
    this.eventBus = eventBus;
    this.managementUIState = managementUIState;
    createTagPanel();
    if (doSubscribeToEventBus()) {
        eventBus.subscribe(this);
    }
}
 
Example 9
Source File: AbstractFilterLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
protected AbstractFilterLayout(final AbstractFilterHeader filterHeader, final AbstractFilterButtons filterButtons,
        final UIEventBus eventBus) {
    this.filterHeader = filterHeader;
    this.filterButtons = filterButtons;
    this.eventBus = eventBus;
    buildLayout();
    eventBus.subscribe(this);
}
 
Example 10
Source File: RolloutGroupTargetsListHeader.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
public RolloutGroupTargetsListHeader(final UIEventBus eventBus, final VaadinMessageSource i18n,
        final RolloutUIState rolloutUiState) {
    super(null, rolloutUiState, i18n);
    this.eventBus = eventBus;

    eventBus.subscribe(this);
}
 
Example 11
Source File: UploadProgressButtonLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Creates a new {@link UploadProgressButtonLayout} instance.
 * 
 * @param i18n
 *            the {@link VaadinMessageSource}
 * @param eventBus
 *            the {@link UIEventBus} for listening to ui events
 * @param artifactUploadState
 *            the {@link ArtifactUploadState} for state information
 * @param multipartConfigElement
 *            the {@link MultipartConfigElement}
 * @param softwareManagement
 *            the {@link SoftwareModuleManagement} for retrieving the
 *            {@link SoftwareModule}
 * @param artifactManagement
 *            the {@link ArtifactManagement} for storing the uploaded
 *            artifacts
 * @param uploadLock
 *            A common upload lock that enforced sequential upload within an UI instance
 */
public UploadProgressButtonLayout(final VaadinMessageSource i18n, final UIEventBus eventBus,
        final ArtifactUploadState artifactUploadState, final MultipartConfigElement multipartConfigElement,
        final ArtifactManagement artifactManagement, final SoftwareModuleManagement softwareManagement, final Lock uploadLock) {
    this.artifactUploadState = artifactUploadState;
    this.artifactManagement = artifactManagement;
    this.uploadInfoWindow = new UploadProgressInfoWindow(eventBus, artifactUploadState, i18n);
    this.uploadInfoWindow.addCloseListener(event -> {
        // ensure that the progress button is hidden when the progress
        // window is closed and no more uploads running
        if (artifactUploadState.areAllUploadsFinished()) {
            hideUploadProgressButton();
        }
    });
    this.i18n = i18n;
    this.multipartConfigElement = multipartConfigElement;
    this.softwareModuleManagement = softwareManagement;
    this.upload = new UploadFixed();
    this.uploadLock = uploadLock;

    createComponents();
    buildLayout();
    restoreState();
    ui = UI.getCurrent();

    eventBus.subscribe(this);
}
 
Example 12
Source File: TargetFilterTable.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
public TargetFilterTable(final VaadinMessageSource i18n, final UINotification notification,
        final UIEventBus eventBus, final FilterManagementUIState filterManagementUIState,
        final TargetFilterQueryManagement targetFilterQueryManagement, final TargetManagement targetManagement,
        final SpPermissionChecker permChecker, final EntityFactory entityFactory) {
    this.i18n = i18n;
    this.notification = notification;
    this.eventBus = eventBus;
    this.filterManagementUIState = filterManagementUIState;
    this.targetFilterQueryManagement = targetFilterQueryManagement;
    this.permChecker = permChecker;

    this.dsSelectWindow = new DistributionSetSelectWindow(i18n, eventBus, notification, targetManagement,
            targetFilterQueryManagement, entityFactory);

    setStyleName("sp-table");
    setSizeFull();
    setImmediate(true);
    setHeight(100.0F, Unit.PERCENTAGE);
    addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
    addStyleName(ValoTheme.TABLE_SMALL);
    addCustomGeneratedColumns();
    populateTableData();
    setColumnCollapsingAllowed(true);
    setColumnProperties();
    setId(UIComponentIdProvider.TARGET_FILTER_TABLE_ID);
    eventBus.subscribe(this);
}
 
Example 13
Source File: TargetFilterCountMessageLabel.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
public TargetFilterCountMessageLabel(final FilterManagementUIState filterManagementUIState,
        final VaadinMessageSource i18n, final UIEventBus eventBus) {
    this.filterManagementUIState = filterManagementUIState;
    this.i18n = i18n;

    applyStyle();
    displayTargetFilterMessage();
    eventBus.subscribe(this);
}
 
Example 14
Source File: RolloutGroupTargetsCountLabelMessage.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
RolloutGroupTargetsCountLabelMessage(final RolloutUIState rolloutUIState,
        final RolloutGroupTargetsListGrid rolloutGroupTargetsListGrid, final VaadinMessageSource i18n,
        final UIEventBus eventBus) {
    this.rolloutUIState = rolloutUIState;
    this.rolloutGroupTargetsListGrid = rolloutGroupTargetsListGrid;
    this.i18n = i18n;

    applyStyle();
    displayRolloutGroupTargetMessage();
    eventBus.subscribe(this);
}
 
Example 15
Source File: UploadDropAreaLayout.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Creates a new {@link UploadDropAreaLayout} instance.
 * 
 * @param i18n
 *            the {@link VaadinMessageSource}
 * @param eventBus
 *            the {@link EventBus} used to send/retrieve events
 * @param uiNotification
 *            {@link UINotification} for showing notifications
 * @param artifactUploadState
 *            the {@link ArtifactUploadState} for state information
 * @param multipartConfigElement
 *            the {@link MultipartConfigElement}
 * @param softwareManagement
 *            the {@link SoftwareModuleManagement} for retrieving the
 *            {@link SoftwareModule}
 * @param artifactManagement
 *            the {@link ArtifactManagement} for storing the uploaded
 *            artifacts
 */
public UploadDropAreaLayout(final VaadinMessageSource i18n, final UIEventBus eventBus,
        final UINotification uiNotification, final ArtifactUploadState artifactUploadState,
        final MultipartConfigElement multipartConfigElement, final SoftwareModuleManagement softwareManagement,
        final ArtifactManagement artifactManagement) {
    this.i18n = i18n;
    this.uiNotification = uiNotification;
    this.artifactUploadState = artifactUploadState;
    this.multipartConfigElement = multipartConfigElement;
    this.softwareManagement = softwareManagement;
    this.artifactManagement = artifactManagement;
    this.uploadButtonLayout = new UploadProgressButtonLayout(i18n, eventBus, artifactUploadState,
            multipartConfigElement, artifactManagement, softwareManagement, uploadLock);

    buildLayout();

    eventBus.subscribe(this);
}
 
Example 16
Source File: CountMessageLabel.java    From hawkbit with Eclipse Public License 1.0 3 votes vote down vote up
/**
 * Constructor
 * 
 * @param eventBus
 *            UIEventBus
 * @param targetManagement
 *            TargetManagement
 * @param i18n
 *            I18N
 * @param managementUIState
 *            ManagementUIState
 * @param targetTable
 *            TargetTable
 */
public CountMessageLabel(final UIEventBus eventBus, final TargetManagement targetManagement,
        final VaadinMessageSource i18n, final ManagementUIState managementUIState, final TargetTable targetTable) {
    this.targetManagement = targetManagement;
    this.i18n = i18n;
    this.managementUIState = managementUIState;
    this.targetTable = targetTable;

    applyStyle();
    eventBus.subscribe(this);
}
 
Example 17
Source File: TargetTagFilterLayout.java    From hawkbit with Eclipse Public License 1.0 3 votes vote down vote up
/**
 * Constructor
 * 
 * @param i18n
 *            VaadinMessageSource
 * @param managementUIState
 *            ManagementUIState
 * @param managementViewClientCriterion
 *            ManagementViewClientCriterion
 * @param permChecker
 *            SpPermissionChecker
 * @param eventBus
 *            UIEventBus
 * @param notification
 *            UINotification
 * @param entityFactory
 *            EntityFactory
 * @param targetFilterQueryManagement
 *            TargetFilterQueryManagement
 * @param targetTagManagement
 *            TargetTagManagement
 */
public TargetTagFilterLayout(final VaadinMessageSource i18n, final ManagementUIState managementUIState,
        final ManagementViewClientCriterion managementViewClientCriterion, final SpPermissionChecker permChecker,
        final UIEventBus eventBus, final UINotification notification, final EntityFactory entityFactory,
        final TargetFilterQueryManagement targetFilterQueryManagement,
        final TargetTagManagement targetTagManagement) {
    super(new TargetTagFilterHeader(i18n, managementUIState, permChecker, eventBus),
            new MultipleTargetFilter(permChecker, managementUIState, i18n, eventBus, managementViewClientCriterion,
                    notification, entityFactory, targetFilterQueryManagement, targetTagManagement),
            managementUIState);
    this.eventBus = eventBus;
    eventBus.subscribe(this);
}
 
Example 18
Source File: DistributionTagLayout.java    From hawkbit with Eclipse Public License 1.0 3 votes vote down vote up
/**
 * Constructor
 * 
 * @param eventBus
 *            UIEventBus
 * @param managementUIState
 *            ManagementUIState
 * @param i18n
 *            VaadinMessageSource
 * @param permChecker
 *            SpPermissionChecker
 * @param distributionSetTagManagement
 *            DistributionSetTagManagement
 * @param entityFactory
 *            EntityFactory
 * @param uiNotification
 *            UINotification
 * @param distributionTagButtons
 *            DistributionTagButtons
 */
public DistributionTagLayout(final UIEventBus eventBus, final ManagementUIState managementUIState,
        final VaadinMessageSource i18n, final SpPermissionChecker permChecker,
        final DistributionSetTagManagement distributionSetTagManagement, final EntityFactory entityFactory,
        final UINotification uiNotification, final DistributionTagButtons distributionTagButtons) {

    super(new DistributionTagFilterHeader(i18n, managementUIState, permChecker, eventBus,
            distributionSetTagManagement, entityFactory, uiNotification, distributionTagButtons),
            distributionTagButtons, eventBus);
    this.managementUIState = managementUIState;

    restoreState();
    eventBus.subscribe(this);
}
 
Example 19
Source File: DistSMTypeFilterLayout.java    From hawkbit with Eclipse Public License 1.0 3 votes vote down vote up
/**
 * Constructor
 * 
 * @param eventBus
 *            UIEventBus
 * @param i18n
 *            VaadinMessageSource
 * @param permChecker
 *            SpPermissionChecker
 * @param manageDistUIState
 *            ManageDistUIState
 * @param entityFactory
 *            EntityFactory
 * @param uiNotification
 *            UINotification
 * @param softwareModuleTypeManagement
 *            SoftwareModuleTypeManagement
 * @param filterButtons
 *            DistSMTypeFilterButtons
 */
public DistSMTypeFilterLayout(final UIEventBus eventBus, final VaadinMessageSource i18n,
        final SpPermissionChecker permChecker, final ManageDistUIState manageDistUIState,
        final EntityFactory entityFactory, final UINotification uiNotification,
        final SoftwareModuleTypeManagement softwareModuleTypeManagement,
        final DistSMTypeFilterButtons filterButtons) {
    super(new DistSMTypeFilterHeader(i18n, permChecker, eventBus, manageDistUIState, entityFactory, uiNotification,
            softwareModuleTypeManagement, filterButtons), filterButtons, eventBus);
    this.manageDistUIState = manageDistUIState;
    restoreState();
    eventBus.subscribe(this);
}
 
Example 20
Source File: RolloutGroupsListHeader.java    From hawkbit with Eclipse Public License 1.0 3 votes vote down vote up
/**
 * Constructor for RolloutGroupsListHeader
 * 
 * @param eventBus
 *            UIEventBus
 * @param rolloutUiState
 *            RolloutUIState
 * @param i18n
 *            I18N
 */
public RolloutGroupsListHeader(final UIEventBus eventBus, final RolloutUIState rolloutUiState,
        final VaadinMessageSource i18n) {
    super(null, rolloutUiState, i18n);
    this.eventBus = eventBus;
    eventBus.subscribe(this);
}