Example usage for com.vaadin.ui Button getData

List of usage examples for com.vaadin.ui Button getData

Introduction

In this page you can find the example usage for com.vaadin.ui Button getData.

Prototype

public Object getData() 

Source Link

Document

Gets the application specific data.

Usage

From source file:org.eclipse.hawkbit.ui.distributions.smtype.DistSMTypeFilterButtonClick.java

License:Open Source License

@Override
protected void filterClicked(final Button clickedButton) {
    softwareModuleTypeManagement.getByName(clickedButton.getData().toString()).ifPresent(smType -> {
        manageDistUIState.getSoftwareModuleFilters().setSoftwareModuleType(smType);
        eventBus.publish(this, new RefreshSoftwareModuleByFilterEvent());
    });/*ww w.j  av  a2s. c om*/
}

From source file:org.eclipse.hawkbit.ui.management.dstable.DistributionTable.java

License:Open Source License

private void saveDistributionPinnedBtn(final Button pinBtn) {
    if (pinBtn.getData() == null) {
        return;/*w w  w .  j a  v  a  2  s. c o  m*/
    }

    final Long pinnedId = ((DistributionSetIdName) pinBtn.getData()).getId();

    if (managementUIState.getTargetTableFilters().getPinnedDistId().map(pinnedId::equals).orElse(false)) {
        setDistributionPinnedBtn(pinBtn);
    }
}

From source file:org.eclipse.hawkbit.ui.management.dstable.DistributionTable.java

License:Open Source License

private void checkifAlreadyPinned(final Button eventBtn) {
    final Long newPinnedDistItemId = ((DistributionSetIdName) eventBtn.getData()).getId();
    final Long pinnedDistId = managementUIState.getTargetTableFilters().getPinnedDistId().orElse(null);

    if (pinnedDistId == null) {
        distPinned = !distPinned;//from   w w w  .j a va2s.  c om
        managementUIState.getTargetTableFilters().setPinnedDistId(newPinnedDistItemId);
    } else if (newPinnedDistItemId.equals(pinnedDistId)) {
        distPinned = false;
    } else {
        distPinned = true;
        managementUIState.getTargetTableFilters().setPinnedDistId(newPinnedDistItemId);
        distributionPinnedBtn.setStyleName(getPinStyle());
    }
    distributionPinnedBtn = eventBtn;
}

From source file:org.eclipse.hawkbit.ui.management.dstag.DistributionTagButtonClick.java

License:Open Source License

@Override
protected void filterUnClicked(final Button clickedButton) {
    if (clickedButton.getData().equals(SPUIDefinitions.NO_TAG_BUTTON_ID)) {
        managementUIState.getDistributionTableFilters().setNoTagSelected(false);
    } else {/*from   ww w .  ja  v a2s .co m*/
        managementUIState.getDistributionTableFilters().getDistSetTags().remove(clickedButton.getId());
    }
    eventBus.publish(this, new RefreshDistributionTableByFilterEvent());
}

From source file:org.eclipse.hawkbit.ui.management.dstag.DistributionTagButtonClick.java

License:Open Source License

@Override
protected void filterClicked(final Button clickedButton) {
    if (clickedButton.getData().equals(SPUIDefinitions.NO_TAG_BUTTON_ID)) {
        managementUIState.getDistributionTableFilters().setNoTagSelected(true);
    } else {/*  w w w  .ja  v a 2s .c  om*/
        managementUIState.getDistributionTableFilters().getDistSetTags().add(clickedButton.getId());
    }
    eventBus.publish(this, new RefreshDistributionTableByFilterEvent());
}

From source file:org.eclipse.hawkbit.ui.management.targettable.TargetTable.java

License:Open Source License

private void checkifAlreadyPinned(final Button eventBtn) {
    final TargetIdName newPinnedTargetItemId = (TargetIdName) eventBtn.getData();
    final TargetIdName targetId = managementUIState.getDistributionTableFilters().getPinnedTarget()
            .orElse(null);// w  w  w  .  j av a  2 s .c  o  m

    if (targetId == null) {
        targetPinned = !targetPinned;
        managementUIState.getDistributionTableFilters().setPinnedTarget(newPinnedTargetItemId);
    } else if (targetId.equals(newPinnedTargetItemId)) {
        targetPinned = Boolean.FALSE;
    } else {
        targetPinned = true;
        managementUIState.getDistributionTableFilters().setPinnedTarget(newPinnedTargetItemId);
        if (null != targetPinnedBtn) {
            resetPinStyle(targetPinnedBtn);
        }
    }
    targetPinnedBtn = eventBtn;
}

From source file:org.eclipse.hawkbit.ui.management.targettable.TargetTable.java

License:Open Source License

private void resetPinStyle(final Button pinBtn) {
    pinBtn.removeStyleName(TARGET_PINNED);
    pinBtn.addStyleName(SPUIStyleDefinitions.TARGET_STATUS_PIN_TOGGLE);
    final TargetIdName targetIdname = (TargetIdName) pinBtn.getData();
    HawkbitCommonUtil.applyStatusLblStyle(this, pinBtn, targetIdname.getTargetId());
}

From source file:org.eclipse.hawkbit.ui.management.targettag.CustomTargetTagFilterButtonClick.java

License:Open Source License

@Override
protected void filterClicked(final Button clickedButton) {
    targetFilterQueryManagement.get((Long) clickedButton.getData()).ifPresent(targetFilterQuery -> {
        this.managementUIState.getTargetTableFilters().setTargetFilterQuery(targetFilterQuery.getId());
        this.eventBus.publish(this, TargetFilterEvent.FILTER_BY_TARGET_FILTER_QUERY);
    });//from w ww.  j a v a  2 s .co  m
}

From source file:org.eclipse.hawkbit.ui.management.targettag.filter.TargetTagFilterButtonClick.java

License:Open Source License

@Override
protected void filterUnClicked(final Button clickedButton) {
    if (clickedButton.getData().equals(SPUIDefinitions.NO_TAG_BUTTON_ID)) {
        if (managementUIState.getTargetTableFilters().isNoTagSelected()) {
            managementUIState.getTargetTableFilters().setNoTagSelected(false);
            eventBus.publish(this, TargetFilterEvent.FILTER_BY_TAG);
        }/*from ww w  . ja  v  a  2  s  .  c  o  m*/
    } else {
        if (null != managementUIState.getTargetTableFilters().getClickedTargetTags() && managementUIState
                .getTargetTableFilters().getClickedTargetTags().contains(clickedButton.getId())) {
            managementUIState.getTargetTableFilters().getClickedTargetTags().remove(clickedButton.getId());
            eventBus.publish(this, TargetFilterEvent.FILTER_BY_TAG);
        }

    }
}

From source file:org.eclipse.hawkbit.ui.management.targettag.filter.TargetTagFilterButtonClick.java

License:Open Source License

@Override
protected void filterClicked(final Button clickedButton) {
    if (clickedButton.getData().equals(SPUIDefinitions.NO_TAG_BUTTON_ID)) {
        managementUIState.getTargetTableFilters().setNoTagSelected(true);
        eventBus.publish(this, TargetFilterEvent.FILTER_BY_TAG);
    } else {//  w  w  w.  ja v  a  2s .c o  m
        managementUIState.getTargetTableFilters().getClickedTargetTags().add(clickedButton.getId());
        eventBus.publish(this, TargetFilterEvent.FILTER_BY_TAG);
    }
}