コード例 #1
0
ファイル: DistributionTable.java プロジェクト: bsinno/hawkbit
  private void assignDsTag(final DragAndDropEvent event) {
    final com.vaadin.event.dd.TargetDetails taregtDet = event.getTargetDetails();
    final Table distTable = (Table) taregtDet.getTarget();
    final Set<DistributionSetIdName> distsSelected = getTableValue(distTable);
    final Set<Long> distList = new HashSet<>();

    final AbstractSelectTargetDetails dropData =
        (AbstractSelectTargetDetails) event.getTargetDetails();
    final Object distItemId = dropData.getItemIdOver();

    if (!distsSelected.contains(distItemId)) {
      distList.add(((DistributionSetIdName) distItemId).getId());
    } else {
      distList.addAll(distsSelected.stream().map(t -> t.getId()).collect(Collectors.toList()));
    }

    final String distTagName =
        HawkbitCommonUtil.removePrefix(
            event.getTransferable().getSourceComponent().getId(),
            SPUIDefinitions.DISTRIBUTION_TAG_ID_PREFIXS);

    final DistributionSetTagAssignmentResult result =
        distributionSetManagement.toggleTagAssignment(distList, distTagName);

    uiNotification.displaySuccess(
        HawkbitCommonUtil.createAssignmentMessage(distTagName, result, i18n));
    if (result.getAssigned() >= 1
        && managementUIState.getDistributionTableFilters().isNoTagSelected()) {
      refreshFilter();
    }
  }
コード例 #2
0
ファイル: DistributionTable.java プロジェクト: bsinno/hawkbit
 private void showMetadataDetails(final Object itemId) {
   final DistributionSetIdName distIdName =
       (DistributionSetIdName)
           getContainerDataSource()
               .getItem(itemId)
               .getItemProperty(SPUILabelDefinitions.VAR_DIST_ID_NAME)
               .getValue();
   final DistributionSet ds =
       distributionSetManagement.findDistributionSetByIdWithDetails(distIdName.getId());
   UI.getCurrent().addWindow(dsMetadataPopupLayout.getWindow(ds, null));
 }
コード例 #3
0
ファイル: DistributionTable.java プロジェクト: bsinno/hawkbit
 @Override
 protected DistributionSet findEntityByTableValue(final DistributionSetIdName lastSelectedId) {
   return distributionSetManagement.findDistributionSetByIdWithDetails(lastSelectedId.getId());
 }