org.vaadin.spring.events.EventScope Java Examples

The following examples show how to use org.vaadin.spring.events.EventScope. 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: DistributionTable.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final PinUnpinEvent pinUnpinEvent) {
    UI.getCurrent().access(() -> {
        if (pinUnpinEvent == PinUnpinEvent.PIN_TARGET) {
            refreshFilter();
            styleDistributionTableOnPinning();
            // unstyleDistPin
            if (distributionPinnedBtn != null) {
                distributionPinnedBtn.setStyleName(getPinStyle());
            }
        } else if (pinUnpinEvent == PinUnpinEvent.UNPIN_TARGET) {
            refreshFilter();
            restoreDistributionTableStyle();
        }
    });
}
 
Example #2
Source File: DistributionsView.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final SoftwareModuleEvent event) {
    if (BaseEntityEventType.MINIMIZED == event.getEventType()) {
        minimizeSwTable();
    } else if (BaseEntityEventType.MAXIMIZED == event.getEventType()) {
        maximizeSwTable();
    }
}
 
Example #3
Source File: RolloutView.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final RolloutEvent event) {
    if (event == RolloutEvent.SHOW_ROLLOUTS) {
        rolloutUIState.setShowRollOuts(true);
        rolloutUIState.setShowRolloutGroups(false);
        rolloutUIState.setShowRolloutGroupTargets(false);
        buildLayout();
    } else if (event == RolloutEvent.SHOW_ROLLOUT_GROUPS) {
        rolloutUIState.setShowRollOuts(false);
        rolloutUIState.setShowRolloutGroups(true);
        rolloutUIState.setShowRolloutGroupTargets(false);
        buildLayout();
    } else if (event == RolloutEvent.SHOW_ROLLOUT_GROUP_TARGETS) {
        rolloutUIState.setShowRollOuts(false);
        rolloutUIState.setShowRolloutGroups(false);
        rolloutUIState.setShowRolloutGroupTargets(true);
        buildLayout();
    }
}
 
Example #4
Source File: RolloutGroupTargetsListGrid.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final RolloutEvent event) {
    if (RolloutEvent.SHOW_ROLLOUT_GROUP_TARGETS != event) {
        return;
    }
    ((LazyQueryContainer) getContainerDataSource()).refresh();
    eventBus.publish(this, RolloutEvent.SHOW_ROLLOUT_GROUP_TARGETS_COUNT);
}
 
Example #5
Source File: UploadProgressButtonLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final FileUploadProgress fileUploadProgress) {
    final FileUploadProgress.FileUploadStatus uploadProgressEventType = fileUploadProgress.getFileUploadStatus();
    switch (uploadProgressEventType) {
    case UPLOAD_STARTED:
        ui.access(this::onStartOfUpload);
        break;
    case UPLOAD_FAILED:
    case UPLOAD_SUCCESSFUL:
    case UPLOAD_IN_PROGRESS:
        break;
    case UPLOAD_FINISHED:
        ui.access(this::onUploadFinished);
        break;
    default:
        throw new IllegalArgumentException("Enum " + FileUploadProgress.FileUploadStatus.class.getSimpleName()
                + " doesn't contain value " + uploadProgressEventType);
    }
}
 
Example #6
Source File: UploadProgressInfoWindow.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final FileUploadProgress fileUploadProgress) {
    switch (fileUploadProgress.getFileUploadStatus()) {
    case UPLOAD_STARTED:
        ui.access(() -> onUploadStarted(fileUploadProgress));
        break;
    case UPLOAD_IN_PROGRESS:
    case UPLOAD_FAILED:
    case UPLOAD_SUCCESSFUL:
        ui.access(() -> updateUploadProgressInfoRowObject(fileUploadProgress));
        break;
    case UPLOAD_FINISHED:
        ui.access(this::onUploadFinished);
        break;
    default:
        break;
    }
}
 
Example #7
Source File: ArtifactDetailsLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final SoftwareModuleEvent softwareModuleEvent) {
    if (softwareModuleEvent.getEventType() == BaseEntityEventType.SELECTED_ENTITY) {
        UI.getCurrent().access(() -> {
            if (softwareModuleEvent.getEntity() != null) {
                populateArtifactDetails(softwareModuleEvent.getEntity());
            } else {
                populateArtifactDetails(null, null);
            }
        });
    }
    if (isArtifactChangedEvent(softwareModuleEvent) && areEntityIdsNotEmpty(softwareModuleEvent)) {
        UI.getCurrent().access(() -> findSelectedSoftwareModule().ifPresent(selectedSoftwareModule -> {
            if (hasSelectedSoftwareModuleChanged(softwareModuleEvent.getEntityIds(), selectedSoftwareModule)) {
                populateArtifactDetails(selectedSoftwareModule);
            }
        }));
    }
}
 
Example #8
Source File: DistributionTable.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onDistributionSetUpdateEvents(final DistributionSetUpdatedEventContainer eventContainer) {

    final List<Long> visibleItemIds = (List<Long>) getVisibleItemIds();

    if (allOfThemAffectCompletedSetsThatAreNotVisible(eventContainer.getEvents(), visibleItemIds)) {
        refreshContainer();
    } else if (!checkAndHandleIfVisibleDsSwitchesFromCompleteToIncomplete(eventContainer.getEvents(),
            visibleItemIds)) {
        updateVisableTableEntries(eventContainer.getEvents(), visibleItemIds);
    }
    final Long lastSelectedDsIdName = managementUIState.getLastSelectedDsIdName();
    eventContainer.getEvents().stream().filter(event -> event.getEntityId().equals(lastSelectedDsIdName))
            .filter(Objects::nonNull).findAny().ifPresent(event -> getEventBus().publish(this,
                    new DistributionTableEvent(BaseEntityEventType.SELECTED_ENTITY, event.getEntity())));
}
 
Example #9
Source File: TargetTable.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onTargetUpdatedEvents(final TargetUpdatedEventContainer eventContainer) {
    @SuppressWarnings("unchecked")
    final List<Long> visibleItemIds = (List<Long>) getVisibleItemIds();
    if (isFilterEnabled()) {
        refreshTargets();
    } else {
        eventContainer.getEvents().stream().filter(event -> visibleItemIds.contains(event.getEntityId()))
                .filter(Objects::nonNull).forEach(event -> updateVisibleItemOnEvent(event.getEntity()));
    }
    publishTargetSelectedEntityForRefresh(eventContainer.getEvents().stream());
}
 
Example #10
Source File: CountMessageLabel.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * TenantAwareEvent Listener for Pinning Distribution.
 *
 * @param event
 */
@EventBusListenerMethod(scope = EventScope.UI)
public void onEvent(final PinUnpinEvent event) {
    final Optional<Long> pinnedDist = managementUIState.getTargetTableFilters().getPinnedDistId();

    if (event == PinUnpinEvent.PIN_DISTRIBUTION && pinnedDist.isPresent()) {
        displayCountLabel(pinnedDist.get());
    } else {
        setValue("");
        displayTargetCountStatus();
    }
}
 
Example #11
Source File: DistSMTypeFilterLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final DistributionsUIEvent event) {
    if (event == DistributionsUIEvent.HIDE_SM_FILTER_BY_TYPE) {
        setVisible(false);
    }
    if (event == DistributionsUIEvent.SHOW_SM_FILTER_BY_TYPE) {
        setVisible(true);
    }
}
 
Example #12
Source File: DeploymentView.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final ManagementUIEvent mgmtUIEvent) {
    if (mgmtUIEvent == ManagementUIEvent.MAX_ACTION_HISTORY) {
        UI.getCurrent().access(this::maximizeActionHistory);
    }
    if (mgmtUIEvent == ManagementUIEvent.MIN_ACTION_HISTORY) {
        UI.getCurrent().access(this::minimizeActionHistory);
    }
}
 
Example #13
Source File: DistributionSetDetails.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final SaveActionWindowEvent saveActionWindowEvent) {
    if ((saveActionWindowEvent == SaveActionWindowEvent.SAVED_ASSIGNMENTS
            || saveActionWindowEvent == SaveActionWindowEvent.DISCARD_ALL_ASSIGNMENTS)
            && getSelectedBaseEntity() != null) {
        clearAssignments();
        getDistributionSetManagement().getWithDetails(getSelectedBaseEntityId()).ifPresent(set -> {
            setSelectedBaseEntity(set);
            UI.getCurrent().access(this::populateModule);
        });
    }
}
 
Example #14
Source File: DistributionSetDetails.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEventDiscard(final SaveActionWindowEvent saveActionWindowEvent) {
    if (saveActionWindowEvent == SaveActionWindowEvent.DISCARD_ASSIGNMENT
            || saveActionWindowEvent == SaveActionWindowEvent.DISCARD_ALL_ASSIGNMENTS
            || saveActionWindowEvent == SaveActionWindowEvent.DELETE_ALL_SOFWARE) {
        clearAssignments();
    }
}
 
Example #15
Source File: DistributionSetTable.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onDistributionSetUpdateEvents(final DistributionSetUpdatedEventContainer eventContainer) {
    @SuppressWarnings("unchecked")
    final List<Long> visibleItemIds = (List<Long>) getVisibleItemIds();
    updateVisableTableEntries(eventContainer.getEvents(), visibleItemIds);
    handleSelectedAndUpdatedDs(eventContainer.getEvents());
}
 
Example #16
Source File: DistributionSetTable.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final DistributionTableEvent event) {
    onBaseEntityEvent(event);
    if (BaseEntityEventType.UPDATED_ENTITY != event.getEventType()) {
        return;
    }
    UI.getCurrent().access(() -> updateDistributionInTable(event.getEntity()));
}
 
Example #17
Source File: DeploymentView.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final DistributionTableEvent event) {
    if (BaseEntityEventType.MINIMIZED == event.getEventType()) {
        minimizeDistTable();
    } else if (BaseEntityEventType.MAXIMIZED == event.getEventType()) {
        maximizeDistTable();
    }
}
 
Example #18
Source File: TargetTable.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final PinUnpinEvent pinUnpinEvent) {
    UI.getCurrent().access(() -> {
        if (pinUnpinEvent == PinUnpinEvent.PIN_DISTRIBUTION) {
            refreshFilter();
            styleTargetTableOnPinning();
        } else if (pinUnpinEvent == PinUnpinEvent.UNPIN_DISTRIBUTION) {
            refreshFilter();
            restoreTargetTableStyle();
        }
    });
}
 
Example #19
Source File: TargetTableHeader.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final ManagementUIEvent event) {
    if (event == ManagementUIEvent.HIDE_TARGET_TAG_LAYOUT) {
        setFilterButtonsIconVisible(true);
    } else if (event == ManagementUIEvent.SHOW_TARGET_TAG_LAYOUT) {
        setFilterButtonsIconVisible(false);
    } else if (event == ManagementUIEvent.RESET_SIMPLE_FILTERS) {
        UI.getCurrent().access(this::onSimpleFilterReset);
    } else if (event == ManagementUIEvent.RESET_TARGET_FILTER_QUERY) {
        UI.getCurrent().access(this::onCustomFilterReset);
    }
}
 
Example #20
Source File: DistributionsView.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final DistributionTableEvent event) {
    if (BaseEntityEventType.MINIMIZED == event.getEventType()) {
        minimizeDistTable();
    } else if (BaseEntityEventType.MAXIMIZED == event.getEventType()) {
        maximizeDistTable();
    }
}
 
Example #21
Source File: TargetTagFilterLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final ManagementUIEvent event) {
    if (event == ManagementUIEvent.HIDE_TARGET_TAG_LAYOUT) {
        setVisible(false);
    }
    if (event == ManagementUIEvent.SHOW_TARGET_TAG_LAYOUT) {
        setVisible(true);
    }
}
 
Example #22
Source File: TargetFilterQueryButtons.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final CustomFilterUIEvent filterEvent) {
  if (filterEvent == CustomFilterUIEvent.CREATE_TARGET_FILTER_QUERY ||
      filterEvent == CustomFilterUIEvent.UPDATED_TARGET_FILTER_QUERY ||
      filterEvent == CustomFilterUIEvent.REMOVE_TARGET_FILTERQUERY) {
    UI.getCurrent().access(this::refreshContainer);
  }
  if (filterEvent == CustomFilterUIEvent.REMOVE_TARGET_FILTERQUERY) {
    customTargetTagFilterButtonClick.clearAppliedTargetFilterQuery();
  } else if (filterEvent == CustomFilterUIEvent.UPDATED_TARGET_FILTER_QUERY) {
    this.eventBus.publish(this, ManagementUIEvent.REFRESH_TARGETS_ON_FILTER_UPDATE);
  }
}
 
Example #23
Source File: FilterByStatusLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final ManagementUIEvent event) {
    if (event == ManagementUIEvent.RESET_SIMPLE_FILTERS && isStatusFilterApplied()) {
        removeClickedStyle();
        managementUIState.getTargetTableFilters().getClickedStatusTargetTags().clear();
        eventBus.publish(this, TargetFilterEvent.REMOVE_FILTER_BY_STATUS);
    }
}
 
Example #24
Source File: TargetTagFilterButtons.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final ManagementUIEvent event) {
    if (event == ManagementUIEvent.RESET_SIMPLE_FILTERS
            && !managementUIState.getTargetTableFilters().getClickedTargetTags().isEmpty()) {
        ((TargetTagFilterButtonClick) getFilterButtonClickBehaviour()).clearTargetTagFilters();
    }
}
 
Example #25
Source File: CountMessageLabel.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final TargetTableEvent event) {
    if (TargetTableEvent.TargetComponentEvent.SELECT_ALL == event.getTargetComponentEvent()
            || TargetComponentEvent.REFRESH_TARGETS == event.getTargetComponentEvent()) {
        displayTargetCountStatus();
    }
}
 
Example #26
Source File: CountMessageLabel.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * TenantAwareEvent Listener to show the message count.
 *
 * @param event
 *            ManagementUIEvent which describes the action to execute
 */
@EventBusListenerMethod(scope = EventScope.UI)
public void onEvent(final ManagementUIEvent event) {
    if (event == ManagementUIEvent.TARGET_TABLE_FILTER || event == ManagementUIEvent.SHOW_COUNT_MESSAGE) {
        displayTargetCountStatus();
    }
}
 
Example #27
Source File: DistributionTableHeader.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final ManagementUIEvent event) {
    if (event == ManagementUIEvent.HIDE_DISTRIBUTION_TAG_LAYOUT) {
        setFilterButtonsIconVisible(true);
    } else if (event == ManagementUIEvent.SHOW_DISTRIBUTION_TAG_LAYOUT) {
        setFilterButtonsIconVisible(false);
    }
}
 
Example #28
Source File: DistributionTable.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final ManagementUIEvent managementUIEvent) {
    UI.getCurrent().access(() -> {
        if (tableIsFilteredByTagsAndTagWasUnassignedFromDistSet(managementUIEvent)
                || tableIsFilteredByNoTagAndTagWasAssignedToDistSet(managementUIEvent)) {
            refreshFilter();
        }
    });
}
 
Example #29
Source File: DSTypeFilterLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final DistributionsUIEvent event) {
    if (event == DistributionsUIEvent.HIDE_DIST_FILTER_BY_TYPE) {
        setVisible(false);
    }
    if (event == DistributionsUIEvent.SHOW_DIST_FILTER_BY_TYPE) {
        setVisible(true);
    }
}
 
Example #30
Source File: SwModuleTable.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final DistributionsUIEvent event) {
    UI.getCurrent().access(() -> {
        if (event == DistributionsUIEvent.ORDER_BY_DISTRIBUTION) {
            refreshFilter();
            styleTableOnDistSelection();
        }
    });
}