Example usage for com.vaadin.ui Component getId

List of usage examples for com.vaadin.ui Component getId

Introduction

In this page you can find the example usage for com.vaadin.ui Component getId.

Prototype

public String getId();

Source Link

Document

Gets currently set debug identifier.

Usage

From source file:org.eclipse.hawkbit.ui.artifacts.event.UploadViewAcceptCriteria.java

License:Open Source License

@Override
protected String getComponentId(final Component component) {
    String id = component.getId();
    if (id != null && id.startsWith(UIComponentIdProvider.UPLOAD_TYPE_BUTTON_PREFIX)) {
        id = UIComponentIdProvider.UPLOAD_TYPE_BUTTON_PREFIX;
    }/*from   w w  w  .  j a va2s  .c  o m*/
    return id;
}

From source file:org.eclipse.hawkbit.ui.artifacts.footer.SMDeleteActionsLayout.java

License:Open Source License

@Override
protected void processDroppedComponent(final DragAndDropEvent event) {
    final Component sourceComponent = event.getTransferable().getSourceComponent();
    if (sourceComponent instanceof Table) {
        final Table sourceTable = (Table) event.getTransferable().getSourceComponent();
        addToDeleteList(sourceTable, (TableTransferable) event.getTransferable());
        updateSWActionCount();//w  ww .j  a va 2s .  c om
    }
    if (sourceComponent.getId().startsWith(UIComponentIdProvider.UPLOAD_TYPE_BUTTON_PREFIX)) {

        final String swModuleTypeName = sourceComponent.getId()
                .replace(UIComponentIdProvider.UPLOAD_TYPE_BUTTON_PREFIX, "");
        if (artifactUploadState.getSoftwareModuleFilters().getSoftwareModuleType()
                .map(type -> type.getName().equalsIgnoreCase(swModuleTypeName)).orElse(false)) {
            notification.displayValidationError(
                    i18n.getMessage("message.swmodule.type.check.delete", new Object[] { swModuleTypeName }));
        } else {
            deleteSWModuleType(swModuleTypeName);
            updateSWActionCount();
        }

    }
}

From source file:org.eclipse.hawkbit.ui.distributions.event.DistributionsViewAcceptCriteria.java

License:Open Source License

@Override
protected String getComponentId(final Component component) {
    String id = component.getId();
    if (isDistributionTypeButtonId(component.getId())) {
        id = SPUIDefinitions.DISTRIBUTION_TYPE_ID_PREFIXS;
    } else if (isSoftwareTypeButtonId(component.getId())) {
        id = SPUIDefinitions.SOFTWARE_MODULE_TAG_ID_PREFIXS;
    }/* w  w  w. j  a v a  2  s.c om*/
    return id;
}

From source file:org.eclipse.hawkbit.ui.distributions.footer.DSDeleteActionsLayout.java

License:Open Source License

@Override
protected void processDroppedComponent(final DragAndDropEvent event) {
    final Component sourceComponent = event.getTransferable().getSourceComponent();
    if (sourceComponent instanceof Table) {
        final Table sourceTable = (Table) event.getTransferable().getSourceComponent();
        if (isDistributionTable(sourceTable)) {
            addInDeleteDistributionList(sourceTable, (TableTransferable) event.getTransferable());
            updateDSActionCount();/*from   w w  w  .  ja  va  2  s.  c  om*/
        } else if (isSoftwareModuleTable(sourceTable)) {
            addToSWDeleteList(sourceTable, (TableTransferable) event.getTransferable());
            updateDSActionCount();
        }
    } else if (sourceComponent.getId().startsWith(SPUIDefinitions.DISTRIBUTION_SET_TYPE_ID_PREFIXS)) {
        processDeleteDitSetType(sourceComponent.getId());
    } else if (sourceComponent.getId().startsWith(SPUIDefinitions.SOFTWARE_MODULE_TAG_ID_PREFIXS)) {
        processDeleteSWType(sourceComponent.getId());

    }

}

From source file:org.eclipse.hawkbit.ui.distributions.footer.DSDeleteActionsLayout.java

License:Open Source License

private boolean isDistributionTable(final Component source) {
    return UIComponentIdProvider.DIST_TABLE_ID.equals(source.getId());
}

From source file:org.eclipse.hawkbit.ui.distributions.footer.DSDeleteActionsLayout.java

License:Open Source License

private boolean isSoftwareModuleTable(final Component source) {
    return UIComponentIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE.equals(source.getId());
}

From source file:org.eclipse.hawkbit.ui.management.event.ManagementViewAcceptCriteria.java

License:Open Source License

@Override
protected String getComponentId(final Component component) {
    String id = component.getId();
    if (isTargetTagId(component.getId())) {
        id = SPUIDefinitions.TARGET_TAG_ID_PREFIXS;
    } else if (isDistributionTagId(component.getId())) {
        id = SPUIDefinitions.DISTRIBUTION_TAG_ID_PREFIXS;
    }/*from  www  . j av a  2  s. com*/
    return id;
}

From source file:org.eclipse.hawkbit.ui.management.footer.DeleteActionsLayout.java

License:Open Source License

private boolean tagNotInUSeInBulkUpload(final Component source) {
    final String tagName = HawkbitCommonUtil.removePrefix(source.getId(),
            SPUIDefinitions.TARGET_TAG_ID_PREFIXS);
    if (managementUIState.getTargetTableFilters().getBulkUpload().getAssignedTagNames().contains(tagName)) {
        notification.displayValidationError(i18n.getMessage("message.tag.use.bulk.upload", tagName));
        return false;
    }/*from w w w.  j  ava2  s  .com*/
    return true;
}

From source file:org.eclipse.hawkbit.ui.management.footer.DeleteActionsLayout.java

License:Open Source License

private void deleteDistributionTag(final Component source) {
    final String tagName = HawkbitCommonUtil.removePrefix(source.getId(),
            SPUIDefinitions.DISTRIBUTION_TAG_ID_PREFIXS);
    if (managementUIState.getDistributionTableFilters().getDistSetTags().contains(tagName)) {
        notification.displayValidationError(i18n.getMessage("message.tag.delete", tagName));
    } else {/* w ww .  ja va 2 s .  c  o  m*/
        distributionSetTagManagement.delete(tagName);

        if (source instanceof DragAndDropWrapper) {
            final Long id = DeleteActionsLayoutHelper.getDistributionTagId((DragAndDropWrapper) source);
            eventBus.publish(this,
                    new DistributionSetTagTableEvent(BaseEntityEventType.REMOVE_ENTITY, Arrays.asList(id)));
        }

        notification.displaySuccess(i18n.getMessage("message.delete.success", tagName));
    }
}

From source file:org.eclipse.hawkbit.ui.management.footer.DeleteActionsLayout.java

License:Open Source License

private void deleteTargetTag(final Component source) {
    final String tagName = HawkbitCommonUtil.removePrefix(source.getId(),
            SPUIDefinitions.TARGET_TAG_ID_PREFIXS);
    if (managementUIState.getTargetTableFilters().getClickedTargetTags().contains(tagName)) {
        notification.displayValidationError(i18n.getMessage("message.tag.delete", tagName));
    } else {//from  ww  w.  ja  v  a 2  s. c  o m
        targetTagManagement.delete(tagName);

        if (source instanceof DragAndDropWrapper) {
            final Long id = DeleteActionsLayoutHelper.getTargetTagId((DragAndDropWrapper) source);
            eventBus.publish(this,
                    new TargetTagTableEvent(BaseEntityEventType.REMOVE_ENTITY, Arrays.asList(id)));
        }

        notification.displaySuccess(i18n.getMessage("message.delete.success", tagName));
    }
}