Java Code Examples for org.vaadin.spring.events.EventScope#UI

The following examples show how to use org.vaadin.spring.events.EventScope#UI . 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 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 2
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 BulkUploadPopupEvent event) {
    if (BulkUploadPopupEvent.MAXIMIMIZED == event) {
        targetBulkUpdateWindow.restoreComponentsValue();
        openBulkUploadWindow();
    } else if (BulkUploadPopupEvent.CLOSED == event) {
        UI.getCurrent().access(this::enableBulkUpload);
    }
}
 
Example 3
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 4
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();
        }
    });
}
 
Example 5
Source File: RolloutListGrid.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Handles the RolloutEvent to refresh Grid.
 *
 */
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final RolloutEvent event) {
    switch (event) {
    case FILTER_BY_TEXT:
    case CREATE_ROLLOUT:
    case UPDATE_ROLLOUT:
    case SHOW_ROLLOUTS:
        refreshContainer();
        break;
    default:
        break;
    }
}
 
Example 6
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 7
Source File: UploadArtifactView.java    From hawkbit with Eclipse Public License 1.0 5 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 8
Source File: UploadDropAreaLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final SoftwareModuleEvent event) {
    final BaseEntityEventType eventType = event.getEventType();
    if (eventType == BaseEntityEventType.SELECTED_ENTITY) {
        UI.getCurrent().access(() -> {
            if (artifactUploadState.isNoSoftwareModuleSelected()
                    || artifactUploadState.isMoreThanOneSoftwareModulesSelected()) {
                dropAreaWrapper.setEnabled(false);
            } else if (artifactUploadState.areAllUploadsFinished()) {
                dropAreaWrapper.setEnabled(true);
            }
        });
    }
}
 
Example 9
Source File: TargetFilterTable.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.FILTER_BY_CUST_FILTER_TEXT
            || filterEvent == CustomFilterUIEvent.FILTER_BY_CUST_FILTER_TEXT_REMOVE
            || filterEvent == CustomFilterUIEvent.CREATE_TARGET_FILTER_QUERY
            || filterEvent == CustomFilterUIEvent.UPDATED_TARGET_FILTER_QUERY) {
        UI.getCurrent().access(this::refreshContainer);
    }
}
 
Example 10
Source File: FilterManagementView.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final CustomFilterUIEvent custFilterUIEvent) {
    if (custFilterUIEvent == CustomFilterUIEvent.TARGET_FILTER_DETAIL_VIEW) {
        viewTargetFilterDetailLayout();
    } else if (custFilterUIEvent == CustomFilterUIEvent.CREATE_NEW_FILTER_CLICK) {
        this.getUI().access(this::viewCreateTargetFilterLayout);
    } else if (custFilterUIEvent == CustomFilterUIEvent.EXIT_CREATE_OR_UPDATE_FILTRER_VIEW
            || custFilterUIEvent == CustomFilterUIEvent.SHOW_FILTER_MANAGEMENT) {
        UI.getCurrent().access(this::viewListView);
    }
}
 
Example 11
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 12
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 ManagementUIEvent managementUIEvent) {
  UI.getCurrent().access(() -> {
    if ((managementUIEvent == ManagementUIEvent.REFRESH_TARGETS_ON_FILTER_UPDATE &&
        managementUIState.getTargetTableFilters().getTargetFilterQuery().isPresent()) ||
        (tableIsFilteredByTagsAndTagWasUnassignedFromTarget(managementUIEvent) ||
            tableIsFilteredByNoTagAndTagWasAssignedToTarget(managementUIEvent))) {
      refreshFilter();
      getEventBus().publish(this, ManagementUIEvent.TARGET_TABLE_FILTER);
    }
  });
}
 
Example 13
Source File: SMTypeFilterHeader.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
private void onEvent(final SoftwareModuleTypeFilterHeaderEvent event) {
    processFilterHeaderEvent(event);
}
 
Example 14
Source File: DistributionTagFilterHeader.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
private void onEvent(final DistributionSetTagFilterHeaderEvent event) {
    processFilterHeaderEvent(event);
}
 
Example 15
Source File: SwModuleTableHeader.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final DistributionsUIEvent event) {
    if (event == DistributionsUIEvent.HIDE_SM_FILTER_BY_TYPE) {
        setFilterButtonsIconVisible(true);
    }
}
 
Example 16
Source File: SoftwareModuleTable.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final SoftwareModuleEvent event) {
    onBaseEntityEvent(event);
}
 
Example 17
Source File: AbstractDistributionSetDetails.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final DistributionTableEvent distributionTableEvent) {
    onBaseEntityEvent(distributionTableEvent);
}
 
Example 18
Source File: DSTypeFilterHeader.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
private void onEvent(final DistributionSetTypeFilterHeaderEvent event) {
    processFilterHeaderEvent(event);
}
 
Example 19
Source File: DistSMTypeFilterButtons.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
@EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final SaveActionWindowEvent event) {
    if (event == SaveActionWindowEvent.SAVED_DELETE_SW_MODULE_TYPES) {
        refreshTable();
    }
}
 
Example 20
Source File: DistributionTable.java    From hawkbit with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * DistributionTableFilterEvent.
 *
 * @param filterEvent
 *            as instance of {@link RefreshDistributionTableByFilterEvent}
 */
@EventBusListenerMethod(scope = EventScope.UI, filter = OnlyEventsFromDeploymentViewFilter.class)
void onEvent(final RefreshDistributionTableByFilterEvent filterEvent) {
    UI.getCurrent().access(this::refreshFilter);
}