repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/HawkbitUIErrorHandler.java
HawkbitUIErrorHandler.buildNotification
protected HawkbitErrorNotificationMessage buildNotification(final Throwable ex) { LOG.error("Error in UI: ", ex); final String errorMessage = extractMessageFrom(ex); final VaadinMessageSource i18n = SpringContextHelper.getBean(VaadinMessageSource.class); return new HawkbitErrorNotificationMessage(STYLE, i18n.getMessage("caption.error"), errorMessage, true); }
java
protected HawkbitErrorNotificationMessage buildNotification(final Throwable ex) { LOG.error("Error in UI: ", ex); final String errorMessage = extractMessageFrom(ex); final VaadinMessageSource i18n = SpringContextHelper.getBean(VaadinMessageSource.class); return new HawkbitErrorNotificationMessage(STYLE, i18n.getMessage("caption.error"), errorMessage, true); }
[ "protected", "HawkbitErrorNotificationMessage", "buildNotification", "(", "final", "Throwable", "ex", ")", "{", "LOG", ".", "error", "(", "\"Error in UI: \"", ",", "ex", ")", ";", "final", "String", "errorMessage", "=", "extractMessageFrom", "(", "ex", ")", ";", ...
Method to build a notification based on an exception. @param ex the throwable @return a hawkbit error notification message
[ "Method", "to", "build", "a", "notification", "based", "on", "an", "exception", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/HawkbitUIErrorHandler.java#L98-L106
train
eclipse/hawkbit
hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaSoftwareModuleManagement.java
JpaSoftwareModuleManagement.assertMetaDataQuota
private void assertMetaDataQuota(final Long moduleId, final int requested) { final int maxMetaData = quotaManagement.getMaxMetaDataEntriesPerSoftwareModule(); QuotaHelper.assertAssignmentQuota(moduleId, requested, maxMetaData, SoftwareModuleMetadata.class, SoftwareModule.class, softwareModuleMetadataRepository::countBySoftwareModuleId); }
java
private void assertMetaDataQuota(final Long moduleId, final int requested) { final int maxMetaData = quotaManagement.getMaxMetaDataEntriesPerSoftwareModule(); QuotaHelper.assertAssignmentQuota(moduleId, requested, maxMetaData, SoftwareModuleMetadata.class, SoftwareModule.class, softwareModuleMetadataRepository::countBySoftwareModuleId); }
[ "private", "void", "assertMetaDataQuota", "(", "final", "Long", "moduleId", ",", "final", "int", "requested", ")", "{", "final", "int", "maxMetaData", "=", "quotaManagement", ".", "getMaxMetaDataEntriesPerSoftwareModule", "(", ")", ";", "QuotaHelper", ".", "assertAs...
Asserts the meta data quota for the software module with the given ID. @param moduleId The software module ID. @param requested Number of meta data entries to be created.
[ "Asserts", "the", "meta", "data", "quota", "for", "the", "software", "module", "with", "the", "given", "ID", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaSoftwareModuleManagement.java#L548-L552
train
eclipse/hawkbit
hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/specifications/ActionSpecifications.java
ActionSpecifications.hasTargetAssignedArtifact
public static Specification<JpaAction> hasTargetAssignedArtifact(final String controllerId, final String sha1Hash) { return (actionRoot, query, criteriaBuilder) -> { final Join<JpaAction, JpaDistributionSet> dsJoin = actionRoot.join(JpaAction_.distributionSet); final SetJoin<JpaDistributionSet, JpaSoftwareModule> modulesJoin = dsJoin.join(JpaDistributionSet_.modules); final ListJoin<JpaSoftwareModule, JpaArtifact> artifactsJoin = modulesJoin .join(JpaSoftwareModule_.artifacts); return criteriaBuilder.and(criteriaBuilder.equal(artifactsJoin.get(JpaArtifact_.sha1Hash), sha1Hash), criteriaBuilder.equal(actionRoot.get(JpaAction_.target).get(JpaTarget_.controllerId), controllerId)); }; }
java
public static Specification<JpaAction> hasTargetAssignedArtifact(final String controllerId, final String sha1Hash) { return (actionRoot, query, criteriaBuilder) -> { final Join<JpaAction, JpaDistributionSet> dsJoin = actionRoot.join(JpaAction_.distributionSet); final SetJoin<JpaDistributionSet, JpaSoftwareModule> modulesJoin = dsJoin.join(JpaDistributionSet_.modules); final ListJoin<JpaSoftwareModule, JpaArtifact> artifactsJoin = modulesJoin .join(JpaSoftwareModule_.artifacts); return criteriaBuilder.and(criteriaBuilder.equal(artifactsJoin.get(JpaArtifact_.sha1Hash), sha1Hash), criteriaBuilder.equal(actionRoot.get(JpaAction_.target).get(JpaTarget_.controllerId), controllerId)); }; }
[ "public", "static", "Specification", "<", "JpaAction", ">", "hasTargetAssignedArtifact", "(", "final", "String", "controllerId", ",", "final", "String", "sha1Hash", ")", "{", "return", "(", "actionRoot", ",", "query", ",", "criteriaBuilder", ")", "->", "{", "fin...
Specification which joins all necessary tables to retrieve the dependency between a target and a local file assignment through the assigned action of the target. All actions are included, not only active actions. @param controllerId the target to verify if the given artifact is currently assigned or had been assigned @param sha1Hash of the local artifact to check wherever the target had ever been assigned @return a specification to use with spring JPA
[ "Specification", "which", "joins", "all", "necessary", "tables", "to", "retrieve", "the", "dependency", "between", "a", "target", "and", "a", "local", "file", "assignment", "through", "the", "assigned", "action", "of", "the", "target", ".", "All", "actions", "...
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/specifications/ActionSpecifications.java#L51-L61
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/AbstractMetadataPopupLayout.java
AbstractMetadataPopupLayout.getWindow
public CommonDialogWindow getWindow(final E entity, final String metaDatakey) { selectedEntity = entity; metadataWindow = new WindowBuilder(SPUIDefinitions.CREATE_UPDATE_WINDOW).caption(getMetadataCaption()) .content(this).cancelButtonClickListener(event -> onCancel()) .id(UIComponentIdProvider.METADATA_POPUP_ID).layout(mainLayout).i18n(i18n) .saveDialogCloseListener(new SaveOnDialogCloseListener()).buildCommonDialogWindow(); metadataWindow.setHeight(550, Unit.PIXELS); metadataWindow.setWidth(800, Unit.PIXELS); metadataWindow.getMainLayout().setSizeFull(); metadataWindow.getButtonsLayout().setHeight("45px"); setUpDetails(entity.getId(), metaDatakey); return metadataWindow; }
java
public CommonDialogWindow getWindow(final E entity, final String metaDatakey) { selectedEntity = entity; metadataWindow = new WindowBuilder(SPUIDefinitions.CREATE_UPDATE_WINDOW).caption(getMetadataCaption()) .content(this).cancelButtonClickListener(event -> onCancel()) .id(UIComponentIdProvider.METADATA_POPUP_ID).layout(mainLayout).i18n(i18n) .saveDialogCloseListener(new SaveOnDialogCloseListener()).buildCommonDialogWindow(); metadataWindow.setHeight(550, Unit.PIXELS); metadataWindow.setWidth(800, Unit.PIXELS); metadataWindow.getMainLayout().setSizeFull(); metadataWindow.getButtonsLayout().setHeight("45px"); setUpDetails(entity.getId(), metaDatakey); return metadataWindow; }
[ "public", "CommonDialogWindow", "getWindow", "(", "final", "E", "entity", ",", "final", "String", "metaDatakey", ")", "{", "selectedEntity", "=", "entity", ";", "metadataWindow", "=", "new", "WindowBuilder", "(", "SPUIDefinitions", ".", "CREATE_UPDATE_WINDOW", ")", ...
Returns metadata popup. @param entity entity for which metadata data is displayed @param metaDatakey metadata key to be selected @return {@link CommonDialogWindow}
[ "Returns", "metadata", "popup", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/AbstractMetadataPopupLayout.java#L131-L145
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadProgressButtonLayout.java
UploadProgressButtonLayout.restoreState
public void restoreState() { if (artifactUploadState.areAllUploadsFinished()) { artifactUploadState.clearUploadTempData(); hideUploadProgressButton(); upload.setEnabled(true); } else if (artifactUploadState.isAtLeastOneUploadInProgress()) { showUploadProgressButton(); } }
java
public void restoreState() { if (artifactUploadState.areAllUploadsFinished()) { artifactUploadState.clearUploadTempData(); hideUploadProgressButton(); upload.setEnabled(true); } else if (artifactUploadState.isAtLeastOneUploadInProgress()) { showUploadProgressButton(); } }
[ "public", "void", "restoreState", "(", ")", "{", "if", "(", "artifactUploadState", ".", "areAllUploadsFinished", "(", ")", ")", "{", "artifactUploadState", ".", "clearUploadTempData", "(", ")", ";", "hideUploadProgressButton", "(", ")", ";", "upload", ".", "setE...
Is called when view is shown to the user
[ "Is", "called", "when", "view", "is", "shown", "to", "the", "user" ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadProgressButtonLayout.java#L165-L173
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/ConfirmationDialog.java
ConfirmationDialog.buttonClick
@Override public void buttonClick(final ClickEvent event) { if (window.getParent() != null) { isImplicitClose = true; UI.getCurrent().removeWindow(window); } callback.response(event.getSource().equals(okButton)); }
java
@Override public void buttonClick(final ClickEvent event) { if (window.getParent() != null) { isImplicitClose = true; UI.getCurrent().removeWindow(window); } callback.response(event.getSource().equals(okButton)); }
[ "@", "Override", "public", "void", "buttonClick", "(", "final", "ClickEvent", "event", ")", "{", "if", "(", "window", ".", "getParent", "(", ")", "!=", "null", ")", "{", "isImplicitClose", "=", "true", ";", "UI", ".", "getCurrent", "(", ")", ".", "remo...
TenantAwareEvent handler for button clicks. @param event the click event.
[ "TenantAwareEvent", "handler", "for", "button", "clicks", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/ConfirmationDialog.java#L295-L302
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTable.java
AbstractTable.getTableValue
@SuppressWarnings("unchecked") public static <T> Set<T> getTableValue(final Table table) { final Object value = table.getValue(); Set<T> idsReturn; if (value == null) { idsReturn = Collections.emptySet(); } else if (value instanceof Collection) { final Collection<T> ids = (Collection<T>) value; idsReturn = ids.stream().filter(Objects::nonNull).collect(Collectors.toSet()); } else { final T id = (T) value; idsReturn = Collections.singleton(id); } return idsReturn; }
java
@SuppressWarnings("unchecked") public static <T> Set<T> getTableValue(final Table table) { final Object value = table.getValue(); Set<T> idsReturn; if (value == null) { idsReturn = Collections.emptySet(); } else if (value instanceof Collection) { final Collection<T> ids = (Collection<T>) value; idsReturn = ids.stream().filter(Objects::nonNull).collect(Collectors.toSet()); } else { final T id = (T) value; idsReturn = Collections.singleton(id); } return idsReturn; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "Set", "<", "T", ">", "getTableValue", "(", "final", "Table", "table", ")", "{", "final", "Object", "value", "=", "table", ".", "getValue", "(", ")", ";", "Set", "<"...
Gets the selected item id or in multiselect mode the selected ids. @param table the table to retrieve the selected ID(s) @return the ID(s) which are selected in the table
[ "Gets", "the", "selected", "item", "id", "or", "in", "multiselect", "mode", "the", "selected", "ids", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTable.java#L141-L155
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTable.java
AbstractTable.getSelectedEntitiesByTransferable
public Set<Long> getSelectedEntitiesByTransferable(final TableTransferable transferable) { final Set<Long> selectedEntities = getTableValue(this); final Set<Long> ids = new HashSet<>(); final Long transferableData = (Long) transferable.getData(SPUIDefinitions.ITEMID); if (transferableData == null) { return ids; } if (entityToBeDeletedIsSelectedInTable(transferableData, selectedEntities)) { ids.addAll(selectedEntities); } else { ids.add(transferableData); } return ids; }
java
public Set<Long> getSelectedEntitiesByTransferable(final TableTransferable transferable) { final Set<Long> selectedEntities = getTableValue(this); final Set<Long> ids = new HashSet<>(); final Long transferableData = (Long) transferable.getData(SPUIDefinitions.ITEMID); if (transferableData == null) { return ids; } if (entityToBeDeletedIsSelectedInTable(transferableData, selectedEntities)) { ids.addAll(selectedEntities); } else { ids.add(transferableData); } return ids; }
[ "public", "Set", "<", "Long", ">", "getSelectedEntitiesByTransferable", "(", "final", "TableTransferable", "transferable", ")", "{", "final", "Set", "<", "Long", ">", "selectedEntities", "=", "getTableValue", "(", "this", ")", ";", "final", "Set", "<", "Long", ...
Return the entity which should be deleted by a transferable @param transferable the table transferable @return set of entities id which will deleted
[ "Return", "the", "entity", "which", "should", "be", "deleted", "by", "a", "transferable" ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTable.java#L291-L305
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTable.java
AbstractTable.selectEntity
public void selectEntity(final Long entityId) { E entity = null; if (entityId != null) { entity = findEntityByTableValue(entityId).orElse(null); } setLastSelectedEntityId(entityId); publishSelectedEntityEvent(entity); }
java
public void selectEntity(final Long entityId) { E entity = null; if (entityId != null) { entity = findEntityByTableValue(entityId).orElse(null); } setLastSelectedEntityId(entityId); publishSelectedEntityEvent(entity); }
[ "public", "void", "selectEntity", "(", "final", "Long", "entityId", ")", "{", "E", "entity", "=", "null", ";", "if", "(", "entityId", "!=", "null", ")", "{", "entity", "=", "findEntityByTableValue", "(", "entityId", ")", ".", "orElse", "(", "null", ")", ...
Finds the entity object of the given entity ID and performs the publishing of the BaseEntityEventType.SELECTED_ENTITY event @param entityId ID of the current entity
[ "Finds", "the", "entity", "object", "of", "the", "given", "entity", "ID", "and", "performs", "the", "publishing", "of", "the", "BaseEntityEventType", ".", "SELECTED_ENTITY", "event" ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTable.java#L615-L623
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/GroupsLegendLayout.java
GroupsLegendLayout.reset
public void reset() { totalTargetsLabel.setVisible(false); populateGroupsLegendByTargetCounts(Collections.emptyList()); if (groupsLegend.getComponentCount() > MAX_GROUPS_TO_BE_DISPLAYED) { groupsLegend.getComponent(MAX_GROUPS_TO_BE_DISPLAYED).setVisible(false); } }
java
public void reset() { totalTargetsLabel.setVisible(false); populateGroupsLegendByTargetCounts(Collections.emptyList()); if (groupsLegend.getComponentCount() > MAX_GROUPS_TO_BE_DISPLAYED) { groupsLegend.getComponent(MAX_GROUPS_TO_BE_DISPLAYED).setVisible(false); } }
[ "public", "void", "reset", "(", ")", "{", "totalTargetsLabel", ".", "setVisible", "(", "false", ")", ";", "populateGroupsLegendByTargetCounts", "(", "Collections", ".", "emptyList", "(", ")", ")", ";", "if", "(", "groupsLegend", ".", "getComponentCount", "(", ...
Resets the display of the legend and total targets.
[ "Resets", "the", "display", "of", "the", "legend", "and", "total", "targets", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/GroupsLegendLayout.java#L78-L84
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/GroupsLegendLayout.java
GroupsLegendLayout.populateTotalTargets
public void populateTotalTargets(final Long totalTargets) { if (totalTargets == null) { totalTargetsLabel.setVisible(false); } else { totalTargetsLabel.setVisible(true); totalTargetsLabel.setValue(getTotalTargetMessage(totalTargets)); } }
java
public void populateTotalTargets(final Long totalTargets) { if (totalTargets == null) { totalTargetsLabel.setVisible(false); } else { totalTargetsLabel.setVisible(true); totalTargetsLabel.setValue(getTotalTargetMessage(totalTargets)); } }
[ "public", "void", "populateTotalTargets", "(", "final", "Long", "totalTargets", ")", "{", "if", "(", "totalTargets", "==", "null", ")", "{", "totalTargetsLabel", ".", "setVisible", "(", "false", ")", ";", "}", "else", "{", "totalTargetsLabel", ".", "setVisible...
Displays the total targets or hides the label when null is supplied. @param totalTargets null to hide the label or a count to be displayed as total targets message
[ "Displays", "the", "total", "targets", "or", "hides", "the", "label", "when", "null", "is", "supplied", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/GroupsLegendLayout.java#L141-L148
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/GroupsLegendLayout.java
GroupsLegendLayout.populateGroupsLegendByTargetCounts
public void populateGroupsLegendByTargetCounts(final List<Long> listOfTargetCountPerGroup) { loadingLabel.setVisible(false); for (int i = 0; i < getGroupsWithoutToBeContinuedLabel(listOfTargetCountPerGroup.size()); i++) { final Component component = groupsLegend.getComponent(i); final Label label = (Label) component; if (listOfTargetCountPerGroup.size() > i) { final Long targetCount = listOfTargetCountPerGroup.get(i); label.setValue(getTargetsInGroupMessage(targetCount, i18n.getMessage("textfield.rollout.group.default.name", i + 1))); label.setVisible(true); } else { label.setValue(""); label.setVisible(false); } } showOrHideToBeContinueLabel(listOfTargetCountPerGroup); unassignedTargetsLabel.setValue(""); unassignedTargetsLabel.setVisible(false); }
java
public void populateGroupsLegendByTargetCounts(final List<Long> listOfTargetCountPerGroup) { loadingLabel.setVisible(false); for (int i = 0; i < getGroupsWithoutToBeContinuedLabel(listOfTargetCountPerGroup.size()); i++) { final Component component = groupsLegend.getComponent(i); final Label label = (Label) component; if (listOfTargetCountPerGroup.size() > i) { final Long targetCount = listOfTargetCountPerGroup.get(i); label.setValue(getTargetsInGroupMessage(targetCount, i18n.getMessage("textfield.rollout.group.default.name", i + 1))); label.setVisible(true); } else { label.setValue(""); label.setVisible(false); } } showOrHideToBeContinueLabel(listOfTargetCountPerGroup); unassignedTargetsLabel.setValue(""); unassignedTargetsLabel.setVisible(false); }
[ "public", "void", "populateGroupsLegendByTargetCounts", "(", "final", "List", "<", "Long", ">", "listOfTargetCountPerGroup", ")", "{", "loadingLabel", ".", "setVisible", "(", "false", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "getGroupsWithout...
Populates the legend based on a list of anonymous groups. They can't have unassigned targets. @param listOfTargetCountPerGroup list of target counts
[ "Populates", "the", "legend", "based", "on", "a", "list", "of", "anonymous", "groups", ".", "They", "can", "t", "have", "unassigned", "targets", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/GroupsLegendLayout.java#L157-L178
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/GroupsLegendLayout.java
GroupsLegendLayout.populateGroupsLegendByValidation
public void populateGroupsLegendByValidation(final RolloutGroupsValidation validation, final List<RolloutGroupCreate> groups) { loadingLabel.setVisible(false); if (validation == null) { return; } final List<Long> targetsPerGroup = validation.getTargetsPerGroup(); final long unassigned = validation.getTotalTargets() - validation.getTargetsInGroups(); final int labelsToUpdate = (unassigned > 0) ? (getGroupsWithoutToBeContinuedLabel(groups.size()) - 1) : groupsLegend.getComponentCount(); for (int i = 0; i < getGroupsWithoutToBeContinuedLabel(groups.size()); i++) { final Component component = groupsLegend.getComponent(i); final Label label = (Label) component; if (targetsPerGroup.size() > i && groups.size() > i && labelsToUpdate > i) { final Long targetCount = targetsPerGroup.get(i); final String groupName = groups.get(i).build().getName(); label.setValue(getTargetsInGroupMessage(targetCount, groupName)); label.setVisible(true); } else { label.setValue(""); label.setVisible(false); } } showOrHideToBeContinueLabel(groups); if (unassigned > 0) { unassignedTargetsLabel.setValue(getTargetsInGroupMessage(unassigned, "Unassigned")); unassignedTargetsLabel.setVisible(true); } else { unassignedTargetsLabel.setValue(""); unassignedTargetsLabel.setVisible(false); } }
java
public void populateGroupsLegendByValidation(final RolloutGroupsValidation validation, final List<RolloutGroupCreate> groups) { loadingLabel.setVisible(false); if (validation == null) { return; } final List<Long> targetsPerGroup = validation.getTargetsPerGroup(); final long unassigned = validation.getTotalTargets() - validation.getTargetsInGroups(); final int labelsToUpdate = (unassigned > 0) ? (getGroupsWithoutToBeContinuedLabel(groups.size()) - 1) : groupsLegend.getComponentCount(); for (int i = 0; i < getGroupsWithoutToBeContinuedLabel(groups.size()); i++) { final Component component = groupsLegend.getComponent(i); final Label label = (Label) component; if (targetsPerGroup.size() > i && groups.size() > i && labelsToUpdate > i) { final Long targetCount = targetsPerGroup.get(i); final String groupName = groups.get(i).build().getName(); label.setValue(getTargetsInGroupMessage(targetCount, groupName)); label.setVisible(true); } else { label.setValue(""); label.setVisible(false); } } showOrHideToBeContinueLabel(groups); if (unassigned > 0) { unassignedTargetsLabel.setValue(getTargetsInGroupMessage(unassigned, "Unassigned")); unassignedTargetsLabel.setVisible(true); } else { unassignedTargetsLabel.setValue(""); unassignedTargetsLabel.setVisible(false); } }
[ "public", "void", "populateGroupsLegendByValidation", "(", "final", "RolloutGroupsValidation", "validation", ",", "final", "List", "<", "RolloutGroupCreate", ">", "groups", ")", "{", "loadingLabel", ".", "setVisible", "(", "false", ")", ";", "if", "(", "validation",...
Populates the legend based on a groups validation and a list of groups that is used for resolving their names. Positions of the groups in the groups list and the validation need to be in correct order. Can have unassigned targets that are displayed on top of the groups list which results in one group less to be displayed @param validation A rollout validation object that contains a list of target counts and the total targets @param groups List of groups with their name
[ "Populates", "the", "legend", "based", "on", "a", "groups", "validation", "and", "a", "list", "of", "groups", "that", "is", "used", "for", "resolving", "their", "names", ".", "Positions", "of", "the", "groups", "in", "the", "groups", "list", "and", "the", ...
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/GroupsLegendLayout.java#L216-L250
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/GroupsLegendLayout.java
GroupsLegendLayout.populateGroupsLegendByGroups
public void populateGroupsLegendByGroups(final List<RolloutGroup> groups) { loadingLabel.setVisible(false); for (int i = 0; i < getGroupsWithoutToBeContinuedLabel(groups.size()); i++) { final Component component = groupsLegend.getComponent(i); final Label label = (Label) component; if (groups.size() > i) { final int targetCount = groups.get(i).getTotalTargets(); final String groupName = groups.get(i).getName(); label.setValue(getTargetsInGroupMessage((long) targetCount, groupName)); label.setVisible(true); } else { label.setValue(""); label.setVisible(false); } } showOrHideToBeContinueLabel(groups); }
java
public void populateGroupsLegendByGroups(final List<RolloutGroup> groups) { loadingLabel.setVisible(false); for (int i = 0; i < getGroupsWithoutToBeContinuedLabel(groups.size()); i++) { final Component component = groupsLegend.getComponent(i); final Label label = (Label) component; if (groups.size() > i) { final int targetCount = groups.get(i).getTotalTargets(); final String groupName = groups.get(i).getName(); label.setValue(getTargetsInGroupMessage((long) targetCount, groupName)); label.setVisible(true); } else { label.setValue(""); label.setVisible(false); } } showOrHideToBeContinueLabel(groups); }
[ "public", "void", "populateGroupsLegendByGroups", "(", "final", "List", "<", "RolloutGroup", ">", "groups", ")", "{", "loadingLabel", ".", "setVisible", "(", "false", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "getGroupsWithoutToBeContinuedLabe...
Populates the legend based on a list of groups. @param groups List of groups with their name
[ "Populates", "the", "legend", "based", "on", "a", "list", "of", "groups", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/GroupsLegendLayout.java#L258-L277
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/filter/FilterByStatusLayout.java
FilterByStatusLayout.getTargetFilterStatuses
private void getTargetFilterStatuses() { unknown = SPUIComponentProvider.getButton(UIComponentIdProvider.UNKNOWN_STATUS_ICON, TargetUpdateStatus.UNKNOWN.toString(), i18n.getMessage(UIMessageIdProvider.TOOLTIP_TARGET_STATUS_UNKNOWN), SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class); inSync = SPUIComponentProvider.getButton(UIComponentIdProvider.INSYNCH_STATUS_ICON, TargetUpdateStatus.IN_SYNC.toString(), i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_INSYNC), SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class); pending = SPUIComponentProvider.getButton(UIComponentIdProvider.PENDING_STATUS_ICON, TargetUpdateStatus.PENDING.toString(), i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_PENDING), SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class); error = SPUIComponentProvider.getButton(UIComponentIdProvider.ERROR_STATUS_ICON, TargetUpdateStatus.ERROR.toString(), i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_ERROR), SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class); registered = SPUIComponentProvider.getButton(UIComponentIdProvider.REGISTERED_STATUS_ICON, TargetUpdateStatus.REGISTERED.toString(), i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_REGISTERED), SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class); overdue = SPUIComponentProvider.getButton(UIComponentIdProvider.OVERDUE_STATUS_ICON, OVERDUE_CAPTION, i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_OVERDUE), SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class); applyStatusBtnStyle(); unknown.setData("filterStatusOne"); inSync.setData("filterStatusTwo"); pending.setData("filterStatusThree"); error.setData("filterStatusFour"); registered.setData("filterStatusFive"); overdue.setData("filterStatusSix"); unknown.addClickListener(this); inSync.addClickListener(this); pending.addClickListener(this); error.addClickListener(this); registered.addClickListener(this); overdue.addClickListener(this); }
java
private void getTargetFilterStatuses() { unknown = SPUIComponentProvider.getButton(UIComponentIdProvider.UNKNOWN_STATUS_ICON, TargetUpdateStatus.UNKNOWN.toString(), i18n.getMessage(UIMessageIdProvider.TOOLTIP_TARGET_STATUS_UNKNOWN), SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class); inSync = SPUIComponentProvider.getButton(UIComponentIdProvider.INSYNCH_STATUS_ICON, TargetUpdateStatus.IN_SYNC.toString(), i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_INSYNC), SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class); pending = SPUIComponentProvider.getButton(UIComponentIdProvider.PENDING_STATUS_ICON, TargetUpdateStatus.PENDING.toString(), i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_PENDING), SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class); error = SPUIComponentProvider.getButton(UIComponentIdProvider.ERROR_STATUS_ICON, TargetUpdateStatus.ERROR.toString(), i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_ERROR), SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class); registered = SPUIComponentProvider.getButton(UIComponentIdProvider.REGISTERED_STATUS_ICON, TargetUpdateStatus.REGISTERED.toString(), i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_REGISTERED), SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class); overdue = SPUIComponentProvider.getButton(UIComponentIdProvider.OVERDUE_STATUS_ICON, OVERDUE_CAPTION, i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_OVERDUE), SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class); applyStatusBtnStyle(); unknown.setData("filterStatusOne"); inSync.setData("filterStatusTwo"); pending.setData("filterStatusThree"); error.setData("filterStatusFour"); registered.setData("filterStatusFive"); overdue.setData("filterStatusSix"); unknown.addClickListener(this); inSync.addClickListener(this); pending.addClickListener(this); error.addClickListener(this); registered.addClickListener(this); overdue.addClickListener(this); }
[ "private", "void", "getTargetFilterStatuses", "(", ")", "{", "unknown", "=", "SPUIComponentProvider", ".", "getButton", "(", "UIComponentIdProvider", ".", "UNKNOWN_STATUS_ICON", ",", "TargetUpdateStatus", ".", "UNKNOWN", ".", "toString", "(", ")", ",", "i18n", ".", ...
Get - status of FILTER.
[ "Get", "-", "status", "of", "FILTER", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/filter/FilterByStatusLayout.java#L154-L189
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/filter/FilterByStatusLayout.java
FilterByStatusLayout.applyStatusBtnStyle
private void applyStatusBtnStyle() { unknown.addStyleName("unknownBtn"); inSync.addStyleName("inSynchBtn"); pending.addStyleName("pendingBtn"); error.addStyleName("errorBtn"); registered.addStyleName("registeredBtn"); overdue.addStyleName("overdueBtn"); }
java
private void applyStatusBtnStyle() { unknown.addStyleName("unknownBtn"); inSync.addStyleName("inSynchBtn"); pending.addStyleName("pendingBtn"); error.addStyleName("errorBtn"); registered.addStyleName("registeredBtn"); overdue.addStyleName("overdueBtn"); }
[ "private", "void", "applyStatusBtnStyle", "(", ")", "{", "unknown", ".", "addStyleName", "(", "\"unknownBtn\"", ")", ";", "inSync", ".", "addStyleName", "(", "\"inSynchBtn\"", ")", ";", "pending", ".", "addStyleName", "(", "\"pendingBtn\"", ")", ";", "error", ...
Apply - status style.
[ "Apply", "-", "status", "style", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/filter/FilterByStatusLayout.java#L194-L201
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/filter/FilterByStatusLayout.java
FilterByStatusLayout.processOverdueFilterStatus
private void processOverdueFilterStatus() { overdueBtnClicked = !overdueBtnClicked; managementUIState.getTargetTableFilters().setOverdueFilterEnabled(overdueBtnClicked); if (overdueBtnClicked) { buttonClicked.addStyleName(BTN_CLICKED); eventBus.publish(this, TargetFilterEvent.FILTER_BY_STATUS); } else { buttonClicked.removeStyleName(BTN_CLICKED); eventBus.publish(this, TargetFilterEvent.REMOVE_FILTER_BY_STATUS); } }
java
private void processOverdueFilterStatus() { overdueBtnClicked = !overdueBtnClicked; managementUIState.getTargetTableFilters().setOverdueFilterEnabled(overdueBtnClicked); if (overdueBtnClicked) { buttonClicked.addStyleName(BTN_CLICKED); eventBus.publish(this, TargetFilterEvent.FILTER_BY_STATUS); } else { buttonClicked.removeStyleName(BTN_CLICKED); eventBus.publish(this, TargetFilterEvent.REMOVE_FILTER_BY_STATUS); } }
[ "private", "void", "processOverdueFilterStatus", "(", ")", "{", "overdueBtnClicked", "=", "!", "overdueBtnClicked", ";", "managementUIState", ".", "getTargetTableFilters", "(", ")", ".", "setOverdueFilterEnabled", "(", "overdueBtnClicked", ")", ";", "if", "(", "overdu...
Process - OVERDUE.
[ "Process", "-", "OVERDUE", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/filter/FilterByStatusLayout.java#L264-L276
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/filter/FilterByStatusLayout.java
FilterByStatusLayout.processCommonFilterStatus
private void processCommonFilterStatus(final TargetUpdateStatus status, final boolean buttonPressed) { if (buttonPressed) { buttonClicked.addStyleName(BTN_CLICKED); managementUIState.getTargetTableFilters().getClickedStatusTargetTags().add(status); eventBus.publish(this, TargetFilterEvent.FILTER_BY_STATUS); } else { buttonClicked.removeStyleName(BTN_CLICKED); managementUIState.getTargetTableFilters().getClickedStatusTargetTags().remove(status); eventBus.publish(this, TargetFilterEvent.REMOVE_FILTER_BY_STATUS); } }
java
private void processCommonFilterStatus(final TargetUpdateStatus status, final boolean buttonPressed) { if (buttonPressed) { buttonClicked.addStyleName(BTN_CLICKED); managementUIState.getTargetTableFilters().getClickedStatusTargetTags().add(status); eventBus.publish(this, TargetFilterEvent.FILTER_BY_STATUS); } else { buttonClicked.removeStyleName(BTN_CLICKED); managementUIState.getTargetTableFilters().getClickedStatusTargetTags().remove(status); eventBus.publish(this, TargetFilterEvent.REMOVE_FILTER_BY_STATUS); } }
[ "private", "void", "processCommonFilterStatus", "(", "final", "TargetUpdateStatus", "status", ",", "final", "boolean", "buttonPressed", ")", "{", "if", "(", "buttonPressed", ")", "{", "buttonClicked", ".", "addStyleName", "(", "BTN_CLICKED", ")", ";", "managementUIS...
Process - COMMON PROCESS. @param status as enum @param buttonReset as t|F
[ "Process", "-", "COMMON", "PROCESS", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/filter/FilterByStatusLayout.java#L286-L298
train
eclipse/hawkbit
hawkbit-rest/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java
DdiRootController.checkAndCancelExpiredAction
private void checkAndCancelExpiredAction(final Action action) { if (action != null && action.hasMaintenanceSchedule() && action.isMaintenanceScheduleLapsed()) { try { controllerManagement.cancelAction(action.getId()); } catch (final CancelActionNotAllowedException e) { LOG.info("Cancel action not allowed exception :{}", e); } } }
java
private void checkAndCancelExpiredAction(final Action action) { if (action != null && action.hasMaintenanceSchedule() && action.isMaintenanceScheduleLapsed()) { try { controllerManagement.cancelAction(action.getId()); } catch (final CancelActionNotAllowedException e) { LOG.info("Cancel action not allowed exception :{}", e); } } }
[ "private", "void", "checkAndCancelExpiredAction", "(", "final", "Action", "action", ")", "{", "if", "(", "action", "!=", "null", "&&", "action", ".", "hasMaintenanceSchedule", "(", ")", "&&", "action", ".", "isMaintenanceScheduleLapsed", "(", ")", ")", "{", "t...
If the action has a maintenance schedule defined but is no longer valid, cancel the action. @param action is the {@link Action} to check.
[ "If", "the", "action", "has", "a", "maintenance", "schedule", "defined", "but", "is", "no", "longer", "valid", "cancel", "the", "action", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-rest/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java#L575-L583
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/DefineGroupsLayout.java
DefineGroupsLayout.populateByRollout
public void populateByRollout(final Rollout rollout) { if (rollout == null) { return; } removeAllRows(); final List<RolloutGroup> groups = rolloutGroupManagement .findByRollout(PageRequest.of(0, quotaManagement.getMaxRolloutGroupsPerRollout()), rollout.getId()) .getContent(); for (final RolloutGroup group : groups) { final GroupRow groupRow = addGroupRow(); groupRow.populateByGroup(group); } updateValidation(); }
java
public void populateByRollout(final Rollout rollout) { if (rollout == null) { return; } removeAllRows(); final List<RolloutGroup> groups = rolloutGroupManagement .findByRollout(PageRequest.of(0, quotaManagement.getMaxRolloutGroupsPerRollout()), rollout.getId()) .getContent(); for (final RolloutGroup group : groups) { final GroupRow groupRow = addGroupRow(); groupRow.populateByGroup(group); } updateValidation(); }
[ "public", "void", "populateByRollout", "(", "final", "Rollout", "rollout", ")", "{", "if", "(", "rollout", "==", "null", ")", "{", "return", ";", "}", "removeAllRows", "(", ")", ";", "final", "List", "<", "RolloutGroup", ">", "groups", "=", "rolloutGroupMa...
Populate groups by rollout @param rollout the rollout
[ "Populate", "groups", "by", "rollout" ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/DefineGroupsLayout.java#L235-L252
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/DefineGroupsLayout.java
DefineGroupsLayout.setGroupsValidation
private void setGroupsValidation(final RolloutGroupsValidation validation) { final int runningValidation = runningValidationsCounter.getAndSet(0); if (runningValidation > 1) { validateRemainingTargets(); return; } groupsValidation = validation; final int lastIdx = groupRows.size() - 1; final GroupRow lastRow = groupRows.get(lastIdx); if (groupsValidation != null && groupsValidation.isValid() && validationStatus != ValidationStatus.INVALID) { lastRow.resetError(); setValidationStatus(ValidationStatus.VALID); } else { lastRow.setError(i18n.getMessage("message.rollout.remaining.targets.error")); setValidationStatus(ValidationStatus.INVALID); } // validate the single groups final int maxTargets = quotaManagement.getMaxTargetsPerRolloutGroup(); final boolean hasRemainingTargetsError = validationStatus == ValidationStatus.INVALID; for (int i = 0; i < groupRows.size(); ++i) { final GroupRow row = groupRows.get(i); // do not mask the 'remaining targets' error if (hasRemainingTargetsError && row.equals(lastRow)) { continue; } row.resetError(); final Long count = groupsValidation.getTargetsPerGroup().get(i); if (count != null && count > maxTargets) { row.setError(i18n.getMessage(MESSAGE_ROLLOUT_MAX_GROUP_SIZE_EXCEEDED, maxTargets)); setValidationStatus(ValidationStatus.INVALID); } } }
java
private void setGroupsValidation(final RolloutGroupsValidation validation) { final int runningValidation = runningValidationsCounter.getAndSet(0); if (runningValidation > 1) { validateRemainingTargets(); return; } groupsValidation = validation; final int lastIdx = groupRows.size() - 1; final GroupRow lastRow = groupRows.get(lastIdx); if (groupsValidation != null && groupsValidation.isValid() && validationStatus != ValidationStatus.INVALID) { lastRow.resetError(); setValidationStatus(ValidationStatus.VALID); } else { lastRow.setError(i18n.getMessage("message.rollout.remaining.targets.error")); setValidationStatus(ValidationStatus.INVALID); } // validate the single groups final int maxTargets = quotaManagement.getMaxTargetsPerRolloutGroup(); final boolean hasRemainingTargetsError = validationStatus == ValidationStatus.INVALID; for (int i = 0; i < groupRows.size(); ++i) { final GroupRow row = groupRows.get(i); // do not mask the 'remaining targets' error if (hasRemainingTargetsError && row.equals(lastRow)) { continue; } row.resetError(); final Long count = groupsValidation.getTargetsPerGroup().get(i); if (count != null && count > maxTargets) { row.setError(i18n.getMessage(MESSAGE_ROLLOUT_MAX_GROUP_SIZE_EXCEEDED, maxTargets)); setValidationStatus(ValidationStatus.INVALID); } } }
[ "private", "void", "setGroupsValidation", "(", "final", "RolloutGroupsValidation", "validation", ")", "{", "final", "int", "runningValidation", "=", "runningValidationsCounter", ".", "getAndSet", "(", "0", ")", ";", "if", "(", "runningValidation", ">", "1", ")", "...
YOU SHOULD NOT CALL THIS METHOD MANUALLY. It's only for the callback. Only 1 runningValidation should be executed. If this runningValidation is done, then this method is called. Maybe then a new runningValidation is executed.
[ "YOU", "SHOULD", "NOT", "CALL", "THIS", "METHOD", "MANUALLY", ".", "It", "s", "only", "for", "the", "callback", ".", "Only", "1", "runningValidation", "should", "be", "executed", ".", "If", "this", "runningValidation", "is", "done", "then", "this", "method",...
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/DefineGroupsLayout.java#L314-L350
train
eclipse/hawkbit
hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaControllerManagement.java
JpaControllerManagement.getMinPollingTime
@Override public String getMinPollingTime() { return systemSecurityContext.runAsSystem(() -> tenantConfigurationManagement .getConfigurationValue(TenantConfigurationKey.MIN_POLLING_TIME_INTERVAL, String.class).getValue()); }
java
@Override public String getMinPollingTime() { return systemSecurityContext.runAsSystem(() -> tenantConfigurationManagement .getConfigurationValue(TenantConfigurationKey.MIN_POLLING_TIME_INTERVAL, String.class).getValue()); }
[ "@", "Override", "public", "String", "getMinPollingTime", "(", ")", "{", "return", "systemSecurityContext", ".", "runAsSystem", "(", "(", ")", "->", "tenantConfigurationManagement", ".", "getConfigurationValue", "(", "TenantConfigurationKey", ".", "MIN_POLLING_TIME_INTERV...
Returns the configured minimum polling interval. @return current {@link TenantConfigurationKey#MIN_POLLING_TIME_INTERVAL}.
[ "Returns", "the", "configured", "minimum", "polling", "interval", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaControllerManagement.java#L190-L194
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/CountMessageLabel.java
CountMessageLabel.onEvent
@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(); } }
java
@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(); } }
[ "@", "EventBusListenerMethod", "(", "scope", "=", "EventScope", ".", "UI", ")", "public", "void", "onEvent", "(", "final", "PinUnpinEvent", "event", ")", "{", "final", "Optional", "<", "Long", ">", "pinnedDist", "=", "managementUIState", ".", "getTargetTableFilt...
TenantAwareEvent Listener for Pinning Distribution. @param event
[ "TenantAwareEvent", "Listener", "for", "Pinning", "Distribution", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/CountMessageLabel.java#L103-L113
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/VaadinMessageSource.java
VaadinMessageSource.getMessage
public String getMessage(final Locale local, final String code, final Object... args) { try { return source.getMessage(code, args, local); } catch (final NoSuchMessageException ex) { LOG.error("Failed to retrieve message!", ex); return code; } }
java
public String getMessage(final Locale local, final String code, final Object... args) { try { return source.getMessage(code, args, local); } catch (final NoSuchMessageException ex) { LOG.error("Failed to retrieve message!", ex); return code; } }
[ "public", "String", "getMessage", "(", "final", "Locale", "local", ",", "final", "String", "code", ",", "final", "Object", "...", "args", ")", "{", "try", "{", "return", "source", ".", "getMessage", "(", "code", ",", "args", ",", "local", ")", ";", "}"...
Tries to resolve the message based on the provided Local. Returns message code if fitting message could not be found. @param local to determinate the Language. @param code the code to lookup up. @param args Array of arguments that will be filled in for params within the message. @return the resolved message, or the message code if the lookup fails.
[ "Tries", "to", "resolve", "the", "message", "based", "on", "the", "provided", "Local", ".", "Returns", "message", "code", "if", "fitting", "message", "could", "not", "be", "found", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/VaadinMessageSource.java#L75-L82
train
eclipse/hawkbit
hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/repository/RolloutHelper.java
RolloutHelper.verifyRolloutGroupConditions
public static void verifyRolloutGroupConditions(final RolloutGroupConditions conditions) { if (conditions.getSuccessCondition() == null) { throw new ValidationException("Rollout group is missing success condition"); } if (conditions.getSuccessAction() == null) { throw new ValidationException("Rollout group is missing success action"); } }
java
public static void verifyRolloutGroupConditions(final RolloutGroupConditions conditions) { if (conditions.getSuccessCondition() == null) { throw new ValidationException("Rollout group is missing success condition"); } if (conditions.getSuccessAction() == null) { throw new ValidationException("Rollout group is missing success action"); } }
[ "public", "static", "void", "verifyRolloutGroupConditions", "(", "final", "RolloutGroupConditions", "conditions", ")", "{", "if", "(", "conditions", ".", "getSuccessCondition", "(", ")", "==", "null", ")", "{", "throw", "new", "ValidationException", "(", "\"Rollout ...
Verifies that the required success condition and action are actually set. @param conditions input conditions and actions
[ "Verifies", "that", "the", "required", "success", "condition", "and", "action", "are", "actually", "set", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/repository/RolloutHelper.java#L38-L45
train
eclipse/hawkbit
hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/repository/RolloutHelper.java
RolloutHelper.verifyRolloutGroupHasConditions
public static RolloutGroup verifyRolloutGroupHasConditions(final RolloutGroup group) { if (group.getTargetPercentage() < 1F || group.getTargetPercentage() > 100F) { throw new ValidationException("Target percentage has to be between 1 and 100"); } if (group.getSuccessCondition() == null) { throw new ValidationException("Rollout group is missing success condition"); } if (group.getSuccessAction() == null) { throw new ValidationException("Rollout group is missing success action"); } return group; }
java
public static RolloutGroup verifyRolloutGroupHasConditions(final RolloutGroup group) { if (group.getTargetPercentage() < 1F || group.getTargetPercentage() > 100F) { throw new ValidationException("Target percentage has to be between 1 and 100"); } if (group.getSuccessCondition() == null) { throw new ValidationException("Rollout group is missing success condition"); } if (group.getSuccessAction() == null) { throw new ValidationException("Rollout group is missing success action"); } return group; }
[ "public", "static", "RolloutGroup", "verifyRolloutGroupHasConditions", "(", "final", "RolloutGroup", "group", ")", "{", "if", "(", "group", ".", "getTargetPercentage", "(", ")", "<", "1F", "||", "group", ".", "getTargetPercentage", "(", ")", ">", "100F", ")", ...
Verifies that the group has the required success condition and action and a falid target percentage. @param group the input group @return the verified group
[ "Verifies", "that", "the", "group", "has", "the", "required", "success", "condition", "and", "action", "and", "a", "falid", "target", "percentage", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/repository/RolloutHelper.java#L55-L67
train
eclipse/hawkbit
hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/repository/RolloutHelper.java
RolloutHelper.verifyRolloutGroupParameter
public static void verifyRolloutGroupParameter(final int amountGroup, final QuotaManagement quotaManagement) { if (amountGroup <= 0) { throw new ValidationException("The amount of groups cannot be lower than zero"); } else if (amountGroup > quotaManagement.getMaxRolloutGroupsPerRollout()) { throw new QuotaExceededException( "The amount of groups cannot be greater than " + quotaManagement.getMaxRolloutGroupsPerRollout()); } }
java
public static void verifyRolloutGroupParameter(final int amountGroup, final QuotaManagement quotaManagement) { if (amountGroup <= 0) { throw new ValidationException("The amount of groups cannot be lower than zero"); } else if (amountGroup > quotaManagement.getMaxRolloutGroupsPerRollout()) { throw new QuotaExceededException( "The amount of groups cannot be greater than " + quotaManagement.getMaxRolloutGroupsPerRollout()); } }
[ "public", "static", "void", "verifyRolloutGroupParameter", "(", "final", "int", "amountGroup", ",", "final", "QuotaManagement", "quotaManagement", ")", "{", "if", "(", "amountGroup", "<=", "0", ")", "{", "throw", "new", "ValidationException", "(", "\"The amount of g...
Verify if the supplied amount of groups is in range @param amountGroup amount of groups @param quotaManagement to retrieve maximum number of groups allowed
[ "Verify", "if", "the", "supplied", "amount", "of", "groups", "is", "in", "range" ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/repository/RolloutHelper.java#L77-L85
train
eclipse/hawkbit
hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/repository/RolloutHelper.java
RolloutHelper.verifyRolloutInStatus
public static void verifyRolloutInStatus(final Rollout rollout, final Rollout.RolloutStatus status) { if (!rollout.getStatus().equals(status)) { throw new RolloutIllegalStateException("Rollout is not in status " + status.toString()); } }
java
public static void verifyRolloutInStatus(final Rollout rollout, final Rollout.RolloutStatus status) { if (!rollout.getStatus().equals(status)) { throw new RolloutIllegalStateException("Rollout is not in status " + status.toString()); } }
[ "public", "static", "void", "verifyRolloutInStatus", "(", "final", "Rollout", "rollout", ",", "final", "Rollout", ".", "RolloutStatus", "status", ")", "{", "if", "(", "!", "rollout", ".", "getStatus", "(", ")", ".", "equals", "(", "status", ")", ")", "{", ...
Verifies that the Rollout is in the required status. @param rollout the Rollout @param status the Status
[ "Verifies", "that", "the", "Rollout", "is", "in", "the", "required", "status", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/repository/RolloutHelper.java#L136-L140
train
eclipse/hawkbit
hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/repository/RolloutHelper.java
RolloutHelper.getGroupsByStatusIncludingGroup
public static List<Long> getGroupsByStatusIncludingGroup(final List<RolloutGroup> groups, final RolloutGroup.RolloutGroupStatus status, final RolloutGroup group) { return groups.stream().filter(innerGroup -> innerGroup.getStatus().equals(status) || innerGroup.equals(group)) .map(RolloutGroup::getId).collect(Collectors.toList()); }
java
public static List<Long> getGroupsByStatusIncludingGroup(final List<RolloutGroup> groups, final RolloutGroup.RolloutGroupStatus status, final RolloutGroup group) { return groups.stream().filter(innerGroup -> innerGroup.getStatus().equals(status) || innerGroup.equals(group)) .map(RolloutGroup::getId).collect(Collectors.toList()); }
[ "public", "static", "List", "<", "Long", ">", "getGroupsByStatusIncludingGroup", "(", "final", "List", "<", "RolloutGroup", ">", "groups", ",", "final", "RolloutGroup", ".", "RolloutGroupStatus", "status", ",", "final", "RolloutGroup", "group", ")", "{", "return",...
Filters the groups of a Rollout to match a specific status and adds a group to the result. @param rollout the rollout @param status the required status for the groups @param group the group to add @return list of groups
[ "Filters", "the", "groups", "of", "a", "Rollout", "to", "match", "a", "specific", "status", "and", "adds", "a", "group", "to", "the", "result", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/repository/RolloutHelper.java#L154-L158
train
eclipse/hawkbit
hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/repository/RolloutHelper.java
RolloutHelper.getAllGroupsTargetFilter
public static String getAllGroupsTargetFilter(final List<RolloutGroup> groups) { if (groups.stream().anyMatch(group -> StringUtils.isEmpty(group.getTargetFilterQuery()))) { return ""; } return "(" + groups.stream().map(RolloutGroup::getTargetFilterQuery).distinct().sorted() .collect(Collectors.joining("),(")) + ")"; }
java
public static String getAllGroupsTargetFilter(final List<RolloutGroup> groups) { if (groups.stream().anyMatch(group -> StringUtils.isEmpty(group.getTargetFilterQuery()))) { return ""; } return "(" + groups.stream().map(RolloutGroup::getTargetFilterQuery).distinct().sorted() .collect(Collectors.joining("),(")) + ")"; }
[ "public", "static", "String", "getAllGroupsTargetFilter", "(", "final", "List", "<", "RolloutGroup", ">", "groups", ")", "{", "if", "(", "groups", ".", "stream", "(", ")", ".", "anyMatch", "(", "group", "->", "StringUtils", ".", "isEmpty", "(", "group", "....
Creates an RSQL expression that matches all targets in the provided groups. Links all target filter queries with OR. @param groups the rollout groups @return RSQL string without base filter of the Rollout. Can be an empty string.
[ "Creates", "an", "RSQL", "expression", "that", "matches", "all", "targets", "in", "the", "provided", "groups", ".", "Links", "all", "target", "filter", "queries", "with", "OR", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/repository/RolloutHelper.java#L169-L176
train
eclipse/hawkbit
hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/repository/RolloutHelper.java
RolloutHelper.getOverlappingWithGroupsTargetFilter
public static String getOverlappingWithGroupsTargetFilter(final String baseFilter, final List<RolloutGroup> groups, final RolloutGroup group) { final String groupFilter = group.getTargetFilterQuery(); // when any previous group has the same filter as the target group the // overlap is 100% if (isTargetFilterInGroups(groupFilter, groups)) { return concatAndTargetFilters(baseFilter, groupFilter); } final String previousGroupFilters = getAllGroupsTargetFilter(groups); if (!StringUtils.isEmpty(previousGroupFilters)) { if (!StringUtils.isEmpty(groupFilter)) { return concatAndTargetFilters(baseFilter, groupFilter, previousGroupFilters); } else { return concatAndTargetFilters(baseFilter, previousGroupFilters); } } if (!StringUtils.isEmpty(groupFilter)) { return concatAndTargetFilters(baseFilter, groupFilter); } else { return baseFilter; } }
java
public static String getOverlappingWithGroupsTargetFilter(final String baseFilter, final List<RolloutGroup> groups, final RolloutGroup group) { final String groupFilter = group.getTargetFilterQuery(); // when any previous group has the same filter as the target group the // overlap is 100% if (isTargetFilterInGroups(groupFilter, groups)) { return concatAndTargetFilters(baseFilter, groupFilter); } final String previousGroupFilters = getAllGroupsTargetFilter(groups); if (!StringUtils.isEmpty(previousGroupFilters)) { if (!StringUtils.isEmpty(groupFilter)) { return concatAndTargetFilters(baseFilter, groupFilter, previousGroupFilters); } else { return concatAndTargetFilters(baseFilter, previousGroupFilters); } } if (!StringUtils.isEmpty(groupFilter)) { return concatAndTargetFilters(baseFilter, groupFilter); } else { return baseFilter; } }
[ "public", "static", "String", "getOverlappingWithGroupsTargetFilter", "(", "final", "String", "baseFilter", ",", "final", "List", "<", "RolloutGroup", ">", "groups", ",", "final", "RolloutGroup", "group", ")", "{", "final", "String", "groupFilter", "=", "group", "...
Creates an RSQL Filter that matches all targets that are in the provided group and in the provided groups. @param baseFilter the base filter from the rollout @param groups the rollout groups @param group the target group @return RSQL string without base filter of the Rollout. Can be an empty string.
[ "Creates", "an", "RSQL", "Filter", "that", "matches", "all", "targets", "that", "are", "in", "the", "provided", "group", "and", "in", "the", "provided", "groups", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/repository/RolloutHelper.java#L191-L212
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPTargetAttributesLayout.java
SPTargetAttributesLayout.decorate
private void decorate(final Map<String, String> controllerAttibs) { final VaadinMessageSource i18n = SpringContextHelper.getBean(VaadinMessageSource.class); final Label title = new Label(i18n.getMessage("label.target.controller.attrs"), ContentMode.HTML); title.addStyleName(SPUIDefinitions.TEXT_STYLE); targetAttributesLayout.addComponent(title); if (HawkbitCommonUtil.isNotNullOrEmpty(controllerAttibs)) { for (final Map.Entry<String, String> entry : controllerAttibs.entrySet()) { targetAttributesLayout.addComponent( SPUIComponentProvider.createNameValueLabel(entry.getKey() + ": ", entry.getValue())); } } }
java
private void decorate(final Map<String, String> controllerAttibs) { final VaadinMessageSource i18n = SpringContextHelper.getBean(VaadinMessageSource.class); final Label title = new Label(i18n.getMessage("label.target.controller.attrs"), ContentMode.HTML); title.addStyleName(SPUIDefinitions.TEXT_STYLE); targetAttributesLayout.addComponent(title); if (HawkbitCommonUtil.isNotNullOrEmpty(controllerAttibs)) { for (final Map.Entry<String, String> entry : controllerAttibs.entrySet()) { targetAttributesLayout.addComponent( SPUIComponentProvider.createNameValueLabel(entry.getKey() + ": ", entry.getValue())); } } }
[ "private", "void", "decorate", "(", "final", "Map", "<", "String", ",", "String", ">", "controllerAttibs", ")", "{", "final", "VaadinMessageSource", "i18n", "=", "SpringContextHelper", ".", "getBean", "(", "VaadinMessageSource", ".", "class", ")", ";", "final", ...
Custom Decorate. @param controllerAttibs
[ "Custom", "Decorate", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPTargetAttributesLayout.java#L47-L58
train
eclipse/hawkbit
hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/SystemSecurityContext.java
SystemSecurityContext.runAsSystemAsTenant
@SuppressWarnings({ "squid:S2221", "squid:S00112" }) public <T> T runAsSystemAsTenant(final Callable<T> callable, final String tenant) { final SecurityContext oldContext = SecurityContextHolder.getContext(); try { LOG.debug("entering system code execution"); return tenantAware.runAsTenant(tenant, () -> { try { setSystemContext(SecurityContextHolder.getContext()); return callable.call(); } catch (final RuntimeException e) { throw e; } catch (final Exception e) { throw new RuntimeException(e); } }); } finally { SecurityContextHolder.setContext(oldContext); LOG.debug("leaving system code execution"); } }
java
@SuppressWarnings({ "squid:S2221", "squid:S00112" }) public <T> T runAsSystemAsTenant(final Callable<T> callable, final String tenant) { final SecurityContext oldContext = SecurityContextHolder.getContext(); try { LOG.debug("entering system code execution"); return tenantAware.runAsTenant(tenant, () -> { try { setSystemContext(SecurityContextHolder.getContext()); return callable.call(); } catch (final RuntimeException e) { throw e; } catch (final Exception e) { throw new RuntimeException(e); } }); } finally { SecurityContextHolder.setContext(oldContext); LOG.debug("leaving system code execution"); } }
[ "@", "SuppressWarnings", "(", "{", "\"squid:S2221\"", ",", "\"squid:S00112\"", "}", ")", "public", "<", "T", ">", "T", "runAsSystemAsTenant", "(", "final", "Callable", "<", "T", ">", "callable", ",", "final", "String", "tenant", ")", "{", "final", "SecurityC...
The callable API throws a Exception and not a specific one
[ "The", "callable", "API", "throws", "a", "Exception", "and", "not", "a", "specific", "one" ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/SystemSecurityContext.java#L91-L112
train
eclipse/hawkbit
hawkbit-http-security/src/main/java/org/eclipse/hawkbit/security/AbstractHttpControllerAuthenticationFilter.java
AbstractHttpControllerAuthenticationFilter.createTenantSecruityTokenVariables
protected DmfTenantSecurityToken createTenantSecruityTokenVariables(final HttpServletRequest request) { final String requestURI = request.getRequestURI(); if (pathExtractor.match(request.getContextPath() + CONTROLLER_REQUEST_ANT_PATTERN, requestURI)) { LOG.debug("retrieving principal from URI request {}", requestURI); final Map<String, String> extractUriTemplateVariables = pathExtractor .extractUriTemplateVariables(request.getContextPath() + CONTROLLER_REQUEST_ANT_PATTERN, requestURI); final String controllerId = extractUriTemplateVariables.get(CONTROLLER_ID_PLACE_HOLDER); final String tenant = extractUriTemplateVariables.get(TENANT_PLACE_HOLDER); if (LOG.isTraceEnabled()) { LOG.trace("Parsed tenant {} and controllerId {} from path request {}", tenant, controllerId, requestURI); } return createTenantSecruityTokenVariables(request, tenant, controllerId); } else if (pathExtractor.match(request.getContextPath() + CONTROLLER_DL_REQUEST_ANT_PATTERN, requestURI)) { LOG.debug("retrieving path variables from URI request {}", requestURI); final Map<String, String> extractUriTemplateVariables = pathExtractor.extractUriTemplateVariables( request.getContextPath() + CONTROLLER_DL_REQUEST_ANT_PATTERN, requestURI); final String tenant = extractUriTemplateVariables.get(TENANT_PLACE_HOLDER); if (LOG.isTraceEnabled()) { LOG.trace("Parsed tenant {} from path request {}", tenant, requestURI); } return createTenantSecruityTokenVariables(request, tenant, "anonymous"); } else { if (LOG.isTraceEnabled()) { LOG.trace("request {} does not match the path pattern {}, request gets ignored", requestURI, CONTROLLER_REQUEST_ANT_PATTERN); } return null; } }
java
protected DmfTenantSecurityToken createTenantSecruityTokenVariables(final HttpServletRequest request) { final String requestURI = request.getRequestURI(); if (pathExtractor.match(request.getContextPath() + CONTROLLER_REQUEST_ANT_PATTERN, requestURI)) { LOG.debug("retrieving principal from URI request {}", requestURI); final Map<String, String> extractUriTemplateVariables = pathExtractor .extractUriTemplateVariables(request.getContextPath() + CONTROLLER_REQUEST_ANT_PATTERN, requestURI); final String controllerId = extractUriTemplateVariables.get(CONTROLLER_ID_PLACE_HOLDER); final String tenant = extractUriTemplateVariables.get(TENANT_PLACE_HOLDER); if (LOG.isTraceEnabled()) { LOG.trace("Parsed tenant {} and controllerId {} from path request {}", tenant, controllerId, requestURI); } return createTenantSecruityTokenVariables(request, tenant, controllerId); } else if (pathExtractor.match(request.getContextPath() + CONTROLLER_DL_REQUEST_ANT_PATTERN, requestURI)) { LOG.debug("retrieving path variables from URI request {}", requestURI); final Map<String, String> extractUriTemplateVariables = pathExtractor.extractUriTemplateVariables( request.getContextPath() + CONTROLLER_DL_REQUEST_ANT_PATTERN, requestURI); final String tenant = extractUriTemplateVariables.get(TENANT_PLACE_HOLDER); if (LOG.isTraceEnabled()) { LOG.trace("Parsed tenant {} from path request {}", tenant, requestURI); } return createTenantSecruityTokenVariables(request, tenant, "anonymous"); } else { if (LOG.isTraceEnabled()) { LOG.trace("request {} does not match the path pattern {}, request gets ignored", requestURI, CONTROLLER_REQUEST_ANT_PATTERN); } return null; } }
[ "protected", "DmfTenantSecurityToken", "createTenantSecruityTokenVariables", "(", "final", "HttpServletRequest", "request", ")", "{", "final", "String", "requestURI", "=", "request", ".", "getRequestURI", "(", ")", ";", "if", "(", "pathExtractor", ".", "match", "(", ...
Extracts tenant and controllerId from the request URI as path variables. @param request the Http request to extract the path variables. @return the extracted {@link PathVariables} or {@code null} if the request does not match the pattern and no variables could be extracted
[ "Extracts", "tenant", "and", "controllerId", "from", "the", "request", "URI", "as", "path", "variables", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-http-security/src/main/java/org/eclipse/hawkbit/security/AbstractHttpControllerAuthenticationFilter.java#L134-L164
train
eclipse/hawkbit
hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/BaseAmqpService.java
BaseAmqpService.convertMessage
@SuppressWarnings("unchecked") public <T> T convertMessage(@NotNull final Message message, final Class<T> clazz) { checkMessageBody(message); message.getMessageProperties().getHeaders().put(AbstractJavaTypeMapper.DEFAULT_CLASSID_FIELD_NAME, clazz.getName()); return (T) rabbitTemplate.getMessageConverter().fromMessage(message); }
java
@SuppressWarnings("unchecked") public <T> T convertMessage(@NotNull final Message message, final Class<T> clazz) { checkMessageBody(message); message.getMessageProperties().getHeaders().put(AbstractJavaTypeMapper.DEFAULT_CLASSID_FIELD_NAME, clazz.getName()); return (T) rabbitTemplate.getMessageConverter().fromMessage(message); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "T", "convertMessage", "(", "@", "NotNull", "final", "Message", "message", ",", "final", "Class", "<", "T", ">", "clazz", ")", "{", "checkMessageBody", "(", "message", ")", ";", ...
Is needed to convert a incoming message to is originally object type. @param message the message to convert. @param clazz the class of the originally object. @return the converted object
[ "Is", "needed", "to", "convert", "a", "incoming", "message", "to", "is", "originally", "object", "type", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/BaseAmqpService.java#L60-L66
train
eclipse/hawkbit
hawkbit-security-core/src/main/java/org/eclipse/hawkbit/im/authentication/PermissionUtils.java
PermissionUtils.createAllAuthorityList
public static List<GrantedAuthority> createAllAuthorityList() { return SpPermission.getAllAuthorities().stream().map(SimpleGrantedAuthority::new).collect(Collectors.toList()); }
java
public static List<GrantedAuthority> createAllAuthorityList() { return SpPermission.getAllAuthorities().stream().map(SimpleGrantedAuthority::new).collect(Collectors.toList()); }
[ "public", "static", "List", "<", "GrantedAuthority", ">", "createAllAuthorityList", "(", ")", "{", "return", "SpPermission", ".", "getAllAuthorities", "(", ")", ".", "stream", "(", ")", ".", "map", "(", "SimpleGrantedAuthority", "::", "new", ")", ".", "collect...
Returns all authorities. @return a list of {@link GrantedAuthority}
[ "Returns", "all", "authorities", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/im/authentication/PermissionUtils.java#L31-L33
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java
SPUIComponentProvider.getButton
public static Button getButton(final String id, final String buttonName, final String buttonDesc, final String style, final boolean setStyle, final Resource icon, final Class<? extends SPUIButtonDecorator> buttonDecoratorclassName) { Button button = null; SPUIButtonDecorator buttonDecorator = null; try { // Create instance buttonDecorator = buttonDecoratorclassName.newInstance(); // Decorate button button = buttonDecorator.decorate(new SPUIButton(id, buttonName, buttonDesc), style, setStyle, icon); } catch (final InstantiationException exception) { LOG.error("Error occured while creating Button decorator-" + buttonName, exception); } catch (final IllegalAccessException exception) { LOG.error("Error occured while acessing Button decorator-" + buttonName, exception); } return button; }
java
public static Button getButton(final String id, final String buttonName, final String buttonDesc, final String style, final boolean setStyle, final Resource icon, final Class<? extends SPUIButtonDecorator> buttonDecoratorclassName) { Button button = null; SPUIButtonDecorator buttonDecorator = null; try { // Create instance buttonDecorator = buttonDecoratorclassName.newInstance(); // Decorate button button = buttonDecorator.decorate(new SPUIButton(id, buttonName, buttonDesc), style, setStyle, icon); } catch (final InstantiationException exception) { LOG.error("Error occured while creating Button decorator-" + buttonName, exception); } catch (final IllegalAccessException exception) { LOG.error("Error occured while acessing Button decorator-" + buttonName, exception); } return button; }
[ "public", "static", "Button", "getButton", "(", "final", "String", "id", ",", "final", "String", "buttonName", ",", "final", "String", "buttonDesc", ",", "final", "String", "style", ",", "final", "boolean", "setStyle", ",", "final", "Resource", "icon", ",", ...
Get Button - Factory Approach for decoration. @param id as string @param buttonName as string @param buttonDesc as string @param style string as string @param setStyle string as boolean @param icon as image @param buttonDecoratorclassName as decorator @return Button as UI
[ "Get", "Button", "-", "Factory", "Approach", "for", "decoration", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java#L139-L155
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java
SPUIComponentProvider.getPinButtonStyle
public static String getPinButtonStyle() { final StringBuilder pinStyle = new StringBuilder(ValoTheme.BUTTON_BORDERLESS_COLORED); pinStyle.append(' '); pinStyle.append(ValoTheme.BUTTON_SMALL); pinStyle.append(' '); pinStyle.append(ValoTheme.BUTTON_ICON_ONLY); pinStyle.append(' '); pinStyle.append("pin-icon"); return pinStyle.toString(); }
java
public static String getPinButtonStyle() { final StringBuilder pinStyle = new StringBuilder(ValoTheme.BUTTON_BORDERLESS_COLORED); pinStyle.append(' '); pinStyle.append(ValoTheme.BUTTON_SMALL); pinStyle.append(' '); pinStyle.append(ValoTheme.BUTTON_ICON_ONLY); pinStyle.append(' '); pinStyle.append("pin-icon"); return pinStyle.toString(); }
[ "public", "static", "String", "getPinButtonStyle", "(", ")", "{", "final", "StringBuilder", "pinStyle", "=", "new", "StringBuilder", "(", "ValoTheme", ".", "BUTTON_BORDERLESS_COLORED", ")", ";", "pinStyle", ".", "append", "(", "'", "'", ")", ";", "pinStyle", "...
Get the style required. @return String
[ "Get", "the", "style", "required", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java#L162-L171
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java
SPUIComponentProvider.getDistributionSetInfo
public static Panel getDistributionSetInfo(final DistributionSet distributionSet, final String caption, final String style1, final String style2) { return new DistributionSetInfoPanel(distributionSet, caption, style1, style2); }
java
public static Panel getDistributionSetInfo(final DistributionSet distributionSet, final String caption, final String style1, final String style2) { return new DistributionSetInfoPanel(distributionSet, caption, style1, style2); }
[ "public", "static", "Panel", "getDistributionSetInfo", "(", "final", "DistributionSet", "distributionSet", ",", "final", "String", "caption", ",", "final", "String", "style1", ",", "final", "String", "style2", ")", "{", "return", "new", "DistributionSetInfoPanel", "...
Get DistributionSet Info Panel. @param distributionSet as DistributionSet @param caption as string @param style1 as string @param style2 as string @return Panel
[ "Get", "DistributionSet", "Info", "Panel", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java#L186-L189
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java
SPUIComponentProvider.createNameValueLabel
public static Label createNameValueLabel(final String label, final String... values) { final String valueStr = StringUtils.arrayToDelimitedString(values, " "); final Label nameValueLabel = new Label(getBoldHTMLText(label) + valueStr, ContentMode.HTML); nameValueLabel.setSizeFull(); nameValueLabel.addStyleName(SPUIDefinitions.TEXT_STYLE); nameValueLabel.addStyleName("label-style"); return nameValueLabel; }
java
public static Label createNameValueLabel(final String label, final String... values) { final String valueStr = StringUtils.arrayToDelimitedString(values, " "); final Label nameValueLabel = new Label(getBoldHTMLText(label) + valueStr, ContentMode.HTML); nameValueLabel.setSizeFull(); nameValueLabel.addStyleName(SPUIDefinitions.TEXT_STYLE); nameValueLabel.addStyleName("label-style"); return nameValueLabel; }
[ "public", "static", "Label", "createNameValueLabel", "(", "final", "String", "label", ",", "final", "String", "...", "values", ")", "{", "final", "String", "valueStr", "=", "StringUtils", ".", "arrayToDelimitedString", "(", "values", ",", "\" \"", ")", ";", "f...
Method to CreateName value labels. @param label as string @param values as string @return Label
[ "Method", "to", "CreateName", "value", "labels", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java#L200-L207
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java
SPUIComponentProvider.getDetailTabLayout
public static VerticalLayout getDetailTabLayout() { final VerticalLayout layout = new VerticalLayout(); layout.setSpacing(true); layout.setMargin(true); layout.setImmediate(true); return layout; }
java
public static VerticalLayout getDetailTabLayout() { final VerticalLayout layout = new VerticalLayout(); layout.setSpacing(true); layout.setMargin(true); layout.setImmediate(true); return layout; }
[ "public", "static", "VerticalLayout", "getDetailTabLayout", "(", ")", "{", "final", "VerticalLayout", "layout", "=", "new", "VerticalLayout", "(", ")", ";", "layout", ".", "setSpacing", "(", "true", ")", ";", "layout", ".", "setMargin", "(", "true", ")", ";"...
Layout of tabs in detail tabsheet. @return VerticalLayout
[ "Layout", "of", "tabs", "in", "detail", "tabsheet", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java#L289-L295
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java
SPUIComponentProvider.getLink
public static Link getLink(final String id, final String name, final String resource, final FontAwesome icon, final String targetOpen, final String style) { final Link link = new Link(name, new ExternalResource(resource)); link.setId(id); link.setIcon(icon); link.setDescription(name); link.setTargetName(targetOpen); if (style != null) { link.setStyleName(style); } return link; }
java
public static Link getLink(final String id, final String name, final String resource, final FontAwesome icon, final String targetOpen, final String style) { final Link link = new Link(name, new ExternalResource(resource)); link.setId(id); link.setIcon(icon); link.setDescription(name); link.setTargetName(targetOpen); if (style != null) { link.setStyleName(style); } return link; }
[ "public", "static", "Link", "getLink", "(", "final", "String", "id", ",", "final", "String", "name", ",", "final", "String", "resource", ",", "final", "FontAwesome", "icon", ",", "final", "String", "targetOpen", ",", "final", "String", "style", ")", "{", "...
Method to create a link. @param id of the link @param name of the link @param resource path of the link @param icon of the link @param targetOpen specify how the link should be open (f. e. new windows = _blank) @param style chosen style of the link. Might be {@code null} if no style should be used @return a link UI component
[ "Method", "to", "create", "a", "link", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java#L316-L331
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleAddUpdateWindow.java
SoftwareModuleAddUpdateWindow.createUpdateSoftwareModuleWindow
public CommonDialogWindow createUpdateSoftwareModuleWindow(final Long baseSwModuleId) { this.baseSwModuleId = baseSwModuleId; resetComponents(); populateTypeNameCombo(); populateValuesOfSwModule(); return createWindow(); }
java
public CommonDialogWindow createUpdateSoftwareModuleWindow(final Long baseSwModuleId) { this.baseSwModuleId = baseSwModuleId; resetComponents(); populateTypeNameCombo(); populateValuesOfSwModule(); return createWindow(); }
[ "public", "CommonDialogWindow", "createUpdateSoftwareModuleWindow", "(", "final", "Long", "baseSwModuleId", ")", "{", "this", ".", "baseSwModuleId", "=", "baseSwModuleId", ";", "resetComponents", "(", ")", ";", "populateTypeNameCombo", "(", ")", ";", "populateValuesOfSw...
Creates window for update software module. @param baseSwModuleId id of the software module to edit. @return reference of {@link com.vaadin.ui.Window} to update software module.
[ "Creates", "window", "for", "update", "software", "module", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleAddUpdateWindow.java#L208-L214
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleAddUpdateWindow.java
SoftwareModuleAddUpdateWindow.populateValuesOfSwModule
private void populateValuesOfSwModule() { if (baseSwModuleId == null) { return; } editSwModule = Boolean.TRUE; softwareModuleManagement.get(baseSwModuleId).ifPresent(swModule -> { nameTextField.setValue(swModule.getName()); versionTextField.setValue(swModule.getVersion()); vendorTextField.setValue(swModule.getVendor()); descTextArea.setValue(swModule.getDescription()); softwareModuleType = new LabelBuilder().name(swModule.getType().getName()) .caption(i18n.getMessage(UIMessageIdProvider.CAPTION_ARTIFACT_SOFTWARE_MODULE_TYPE)).buildLabel(); }); }
java
private void populateValuesOfSwModule() { if (baseSwModuleId == null) { return; } editSwModule = Boolean.TRUE; softwareModuleManagement.get(baseSwModuleId).ifPresent(swModule -> { nameTextField.setValue(swModule.getName()); versionTextField.setValue(swModule.getVersion()); vendorTextField.setValue(swModule.getVendor()); descTextArea.setValue(swModule.getDescription()); softwareModuleType = new LabelBuilder().name(swModule.getType().getName()) .caption(i18n.getMessage(UIMessageIdProvider.CAPTION_ARTIFACT_SOFTWARE_MODULE_TYPE)).buildLabel(); }); }
[ "private", "void", "populateValuesOfSwModule", "(", ")", "{", "if", "(", "baseSwModuleId", "==", "null", ")", "{", "return", ";", "}", "editSwModule", "=", "Boolean", ".", "TRUE", ";", "softwareModuleManagement", ".", "get", "(", "baseSwModuleId", ")", ".", ...
fill the data of a softwareModule in the content of the window
[ "fill", "the", "data", "of", "a", "softwareModule", "in", "the", "content", "of", "the", "window" ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleAddUpdateWindow.java#L299-L312
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/client/SuggestionsSelectList.java
SuggestionsSelectList.addItems
public void addItems(final List<SuggestTokenDto> suggestions, final VTextField textFieldWidget, final PopupPanel popupPanel, final TextFieldSuggestionBoxServerRpc suggestionServerRpc) { for (int index = 0; index < suggestions.size(); index++) { final SuggestTokenDto suggestToken = suggestions.get(index); final MenuItem mi = new MenuItem(suggestToken.getSuggestion(), true, new ScheduledCommand() { @Override public void execute() { final String tmpSuggestion = suggestToken.getSuggestion(); final TokenStartEnd tokenStartEnd = tokenMap.get(tmpSuggestion); final String text = textFieldWidget.getValue(); final StringBuilder builder = new StringBuilder(text); builder.replace(tokenStartEnd.getStart(), tokenStartEnd.getEnd() + 1, tmpSuggestion); textFieldWidget.setValue(builder.toString(), true); popupPanel.hide(); textFieldWidget.setFocus(true); suggestionServerRpc.suggest(builder.toString(), textFieldWidget.getCursorPos()); } }); tokenMap.put(suggestToken.getSuggestion(), new TokenStartEnd(suggestToken.getStart(), suggestToken.getEnd())); Roles.getListitemRole().set(mi.getElement()); WidgetUtil.sinkOnloadForImages(mi.getElement()); addItem(mi); } }
java
public void addItems(final List<SuggestTokenDto> suggestions, final VTextField textFieldWidget, final PopupPanel popupPanel, final TextFieldSuggestionBoxServerRpc suggestionServerRpc) { for (int index = 0; index < suggestions.size(); index++) { final SuggestTokenDto suggestToken = suggestions.get(index); final MenuItem mi = new MenuItem(suggestToken.getSuggestion(), true, new ScheduledCommand() { @Override public void execute() { final String tmpSuggestion = suggestToken.getSuggestion(); final TokenStartEnd tokenStartEnd = tokenMap.get(tmpSuggestion); final String text = textFieldWidget.getValue(); final StringBuilder builder = new StringBuilder(text); builder.replace(tokenStartEnd.getStart(), tokenStartEnd.getEnd() + 1, tmpSuggestion); textFieldWidget.setValue(builder.toString(), true); popupPanel.hide(); textFieldWidget.setFocus(true); suggestionServerRpc.suggest(builder.toString(), textFieldWidget.getCursorPos()); } }); tokenMap.put(suggestToken.getSuggestion(), new TokenStartEnd(suggestToken.getStart(), suggestToken.getEnd())); Roles.getListitemRole().set(mi.getElement()); WidgetUtil.sinkOnloadForImages(mi.getElement()); addItem(mi); } }
[ "public", "void", "addItems", "(", "final", "List", "<", "SuggestTokenDto", ">", "suggestions", ",", "final", "VTextField", "textFieldWidget", ",", "final", "PopupPanel", "popupPanel", ",", "final", "TextFieldSuggestionBoxServerRpc", "suggestionServerRpc", ")", "{", "...
Adds suggestions to the suggestion menu bar. @param suggestions the suggestions to be added @param textFieldWidget the text field which the suggestion is attached to to bring back the focus after selection @param popupPanel pop-up panel where the menu bar is shown to hide it after selection @param suggestionServerRpc server RPC to ask for new suggestion after a selection
[ "Adds", "suggestions", "to", "the", "suggestion", "menu", "bar", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/client/SuggestionsSelectList.java#L55-L79
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SpringContextHelper.java
SpringContextHelper.getBean
public static <T> T getBean(final String beanName, final Class<T> beanClazz) { return context.getBean(beanName, beanClazz); }
java
public static <T> T getBean(final String beanName, final Class<T> beanClazz) { return context.getBean(beanName, beanClazz); }
[ "public", "static", "<", "T", ">", "T", "getBean", "(", "final", "String", "beanName", ",", "final", "Class", "<", "T", ">", "beanClazz", ")", "{", "return", "context", ".", "getBean", "(", "beanName", ",", "beanClazz", ")", ";", "}" ]
method to return a certain bean by its class and name. @param beanName name of the beand which should be returned from the application context @param beanClazz class of the bean which should be returned from the application context @return the requested bean
[ "method", "to", "return", "a", "certain", "bean", "by", "its", "class", "and", "name", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SpringContextHelper.java#L69-L71
train
eclipse/hawkbit
hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaDistributionSetManagement.java
JpaDistributionSetManagement.getDsFilterNameAndVersionEntries
private static String[] getDsFilterNameAndVersionEntries(final String filterString) { final int semicolonIndex = filterString.indexOf(':'); final String dsFilterName = semicolonIndex != -1 ? filterString.substring(0, semicolonIndex) : (filterString + "%"); final String dsFilterVersion = semicolonIndex != -1 ? (filterString.substring(semicolonIndex + 1) + "%") : "%"; return new String[] { !StringUtils.isEmpty(dsFilterName) ? dsFilterName : "%", dsFilterVersion }; }
java
private static String[] getDsFilterNameAndVersionEntries(final String filterString) { final int semicolonIndex = filterString.indexOf(':'); final String dsFilterName = semicolonIndex != -1 ? filterString.substring(0, semicolonIndex) : (filterString + "%"); final String dsFilterVersion = semicolonIndex != -1 ? (filterString.substring(semicolonIndex + 1) + "%") : "%"; return new String[] { !StringUtils.isEmpty(dsFilterName) ? dsFilterName : "%", dsFilterVersion }; }
[ "private", "static", "String", "[", "]", "getDsFilterNameAndVersionEntries", "(", "final", "String", "filterString", ")", "{", "final", "int", "semicolonIndex", "=", "filterString", ".", "indexOf", "(", "'", "'", ")", ";", "final", "String", "dsFilterName", "=",...
field when the semicolon is present
[ "field", "when", "the", "semicolon", "is", "present" ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaDistributionSetManagement.java#L658-L666
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/filter/TargetTagFilterButtons.java
TargetTagFilterButtons.validate
private Boolean validate(final DragAndDropEvent event) { final Transferable transferable = event.getTransferable(); final Component compsource = transferable.getSourceComponent(); if (!(compsource instanceof AbstractTable)) { uiNotification.displayValidationError(getI18n().getMessage(getActionNotAllowedMessage())); return false; } final TableTransferable tabletransferable = (TableTransferable) transferable; final AbstractTable<?> source = (AbstractTable<?>) tabletransferable.getSourceComponent(); if (!validateIfSourceIsTargetTable(source) && !hasTargetUpdatePermission()) { return false; } final Set<Long> deletedEntityByTransferable = source.getSelectedEntitiesByTransferable(tabletransferable); if (deletedEntityByTransferable.isEmpty()) { final String actionDidNotWork = getI18n().getMessage("message.action.did.not.work"); uiNotification.displayValidationError(actionDidNotWork); return false; } return true; }
java
private Boolean validate(final DragAndDropEvent event) { final Transferable transferable = event.getTransferable(); final Component compsource = transferable.getSourceComponent(); if (!(compsource instanceof AbstractTable)) { uiNotification.displayValidationError(getI18n().getMessage(getActionNotAllowedMessage())); return false; } final TableTransferable tabletransferable = (TableTransferable) transferable; final AbstractTable<?> source = (AbstractTable<?>) tabletransferable.getSourceComponent(); if (!validateIfSourceIsTargetTable(source) && !hasTargetUpdatePermission()) { return false; } final Set<Long> deletedEntityByTransferable = source.getSelectedEntitiesByTransferable(tabletransferable); if (deletedEntityByTransferable.isEmpty()) { final String actionDidNotWork = getI18n().getMessage("message.action.did.not.work"); uiNotification.displayValidationError(actionDidNotWork); return false; } return true; }
[ "private", "Boolean", "validate", "(", "final", "DragAndDropEvent", "event", ")", "{", "final", "Transferable", "transferable", "=", "event", ".", "getTransferable", "(", ")", ";", "final", "Component", "compsource", "=", "transferable", ".", "getSourceComponent", ...
Validate the drop. @param event DragAndDropEvent reference @return Boolean
[ "Validate", "the", "drop", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/filter/TargetTagFilterButtons.java#L163-L187
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/filter/TargetTagFilterButtons.java
TargetTagFilterButtons.hasTargetUpdatePermission
private boolean hasTargetUpdatePermission() { if (!permChecker.hasUpdateTargetPermission()) { uiNotification.displayValidationError( getI18n().getMessage("message.permission.insufficient", SpPermission.UPDATE_TARGET)); return false; } return true; }
java
private boolean hasTargetUpdatePermission() { if (!permChecker.hasUpdateTargetPermission()) { uiNotification.displayValidationError( getI18n().getMessage("message.permission.insufficient", SpPermission.UPDATE_TARGET)); return false; } return true; }
[ "private", "boolean", "hasTargetUpdatePermission", "(", ")", "{", "if", "(", "!", "permChecker", ".", "hasUpdateTargetPermission", "(", ")", ")", "{", "uiNotification", ".", "displayValidationError", "(", "getI18n", "(", ")", ".", "getMessage", "(", "\"message.per...
validate the update permission. @return boolean
[ "validate", "the", "update", "permission", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/filter/TargetTagFilterButtons.java#L194-L202
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGrid.java
AbstractGrid.refreshContainer
@Override public void refreshContainer() { final Indexed container = getContainerDataSource(); if (hasGeneratedPropertySupport() && getGeneratedPropertySupport().getRawContainer() instanceof LazyQueryContainer) { ((LazyQueryContainer) getGeneratedPropertySupport().getRawContainer()).refresh(); return; } if (container instanceof LazyQueryContainer) { ((LazyQueryContainer) container).refresh(); } }
java
@Override public void refreshContainer() { final Indexed container = getContainerDataSource(); if (hasGeneratedPropertySupport() && getGeneratedPropertySupport().getRawContainer() instanceof LazyQueryContainer) { ((LazyQueryContainer) getGeneratedPropertySupport().getRawContainer()).refresh(); return; } if (container instanceof LazyQueryContainer) { ((LazyQueryContainer) container).refresh(); } }
[ "@", "Override", "public", "void", "refreshContainer", "(", ")", "{", "final", "Indexed", "container", "=", "getContainerDataSource", "(", ")", ";", "if", "(", "hasGeneratedPropertySupport", "(", ")", "&&", "getGeneratedPropertySupport", "(", ")", ".", "getRawCont...
Refresh the container.
[ "Refresh", "the", "container", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGrid.java#L100-L112
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGrid.java
AbstractGrid.resetHeaderDefaultRow
protected HeaderRow resetHeaderDefaultRow() { getHeader().removeRow(getHeader().getDefaultRow()); final HeaderRow newHeaderRow = getHeader().appendRow(); getHeader().setDefaultRow(newHeaderRow); return newHeaderRow; }
java
protected HeaderRow resetHeaderDefaultRow() { getHeader().removeRow(getHeader().getDefaultRow()); final HeaderRow newHeaderRow = getHeader().appendRow(); getHeader().setDefaultRow(newHeaderRow); return newHeaderRow; }
[ "protected", "HeaderRow", "resetHeaderDefaultRow", "(", ")", "{", "getHeader", "(", ")", ".", "removeRow", "(", "getHeader", "(", ")", ".", "getDefaultRow", "(", ")", ")", ";", "final", "HeaderRow", "newHeaderRow", "=", "getHeader", "(", ")", ".", "appendRow...
Resets the default row of the header. This means the current default row is removed and replaced with a newly created one. @return the new and clean header row.
[ "Resets", "the", "default", "row", "of", "the", "header", ".", "This", "means", "the", "current", "default", "row", "is", "removed", "and", "replaced", "with", "a", "newly", "created", "one", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGrid.java#L358-L363
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/ShortCutModifierUtils.java
ShortCutModifierUtils.getCtrlOrMetaModifier
public static int getCtrlOrMetaModifier() { final WebBrowser webBrowser = Page.getCurrent().getWebBrowser(); if (webBrowser.isMacOSX()) { return ShortcutAction.ModifierKey.META; } return ShortcutAction.ModifierKey.CTRL; }
java
public static int getCtrlOrMetaModifier() { final WebBrowser webBrowser = Page.getCurrent().getWebBrowser(); if (webBrowser.isMacOSX()) { return ShortcutAction.ModifierKey.META; } return ShortcutAction.ModifierKey.CTRL; }
[ "public", "static", "int", "getCtrlOrMetaModifier", "(", ")", "{", "final", "WebBrowser", "webBrowser", "=", "Page", ".", "getCurrent", "(", ")", ".", "getWebBrowser", "(", ")", ";", "if", "(", "webBrowser", ".", "isMacOSX", "(", ")", ")", "{", "return", ...
Returns the ctrl or meta modifier depending on the platform. @return on mac return {@link com.vaadin.event.ShortcutAction.ModifierKey#META} other platform return {@link com.vaadin.event.ShortcutAction.ModifierKey#CTRL}
[ "Returns", "the", "ctrl", "or", "meta", "modifier", "depending", "on", "the", "platform", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/ShortCutModifierUtils.java#L33-L40
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/AbstractTagLayout.java
AbstractTagLayout.getPreviewButtonColor
protected void getPreviewButtonColor(final String color) { Page.getCurrent().getJavaScript().execute(HawkbitCommonUtil.getPreviewButtonColorScript(color)); }
java
protected void getPreviewButtonColor(final String color) { Page.getCurrent().getJavaScript().execute(HawkbitCommonUtil.getPreviewButtonColorScript(color)); }
[ "protected", "void", "getPreviewButtonColor", "(", "final", "String", "color", ")", "{", "Page", ".", "getCurrent", "(", ")", ".", "getJavaScript", "(", ")", ".", "execute", "(", "HawkbitCommonUtil", ".", "getPreviewButtonColorScript", "(", "color", ")", ")", ...
Dynamic styles for window. @param top int value @param marginLeft int value
[ "Dynamic", "styles", "for", "window", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/AbstractTagLayout.java#L274-L276
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/AbstractTagLayout.java
AbstractTagLayout.createDynamicStyleForComponents
protected void createDynamicStyleForComponents(final TextField tagName, final TextArea tagDesc, final String taregtTagColor) { tagName.removeStyleName(SPUIDefinitions.TAG_NAME); tagDesc.removeStyleName(SPUIDefinitions.TAG_DESC); getTargetDynamicStyles(taregtTagColor); tagName.addStyleName(TAG_NAME_DYNAMIC_STYLE); tagDesc.addStyleName(TAG_DESC_DYNAMIC_STYLE); }
java
protected void createDynamicStyleForComponents(final TextField tagName, final TextArea tagDesc, final String taregtTagColor) { tagName.removeStyleName(SPUIDefinitions.TAG_NAME); tagDesc.removeStyleName(SPUIDefinitions.TAG_DESC); getTargetDynamicStyles(taregtTagColor); tagName.addStyleName(TAG_NAME_DYNAMIC_STYLE); tagDesc.addStyleName(TAG_DESC_DYNAMIC_STYLE); }
[ "protected", "void", "createDynamicStyleForComponents", "(", "final", "TextField", "tagName", ",", "final", "TextArea", "tagDesc", ",", "final", "String", "taregtTagColor", ")", "{", "tagName", ".", "removeStyleName", "(", "SPUIDefinitions", ".", "TAG_NAME", ")", ";...
Set tag name and desc field border color based on chosen color. @param tagName @param tagDesc @param taregtTagColor
[ "Set", "tag", "name", "and", "desc", "field", "border", "color", "based", "on", "chosen", "color", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/AbstractTagLayout.java#L285-L292
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/AbstractTagLayout.java
AbstractTagLayout.restoreComponentStyles
protected void restoreComponentStyles() { tagName.removeStyleName(TAG_NAME_DYNAMIC_STYLE); tagDesc.removeStyleName(TAG_DESC_DYNAMIC_STYLE); tagName.addStyleName(SPUIDefinitions.TAG_NAME); tagDesc.addStyleName(SPUIDefinitions.TAG_DESC); getPreviewButtonColor(ColorPickerConstants.DEFAULT_COLOR); }
java
protected void restoreComponentStyles() { tagName.removeStyleName(TAG_NAME_DYNAMIC_STYLE); tagDesc.removeStyleName(TAG_DESC_DYNAMIC_STYLE); tagName.addStyleName(SPUIDefinitions.TAG_NAME); tagDesc.addStyleName(SPUIDefinitions.TAG_DESC); getPreviewButtonColor(ColorPickerConstants.DEFAULT_COLOR); }
[ "protected", "void", "restoreComponentStyles", "(", ")", "{", "tagName", ".", "removeStyleName", "(", "TAG_NAME_DYNAMIC_STYLE", ")", ";", "tagDesc", ".", "removeStyleName", "(", "TAG_DESC_DYNAMIC_STYLE", ")", ";", "tagName", ".", "addStyleName", "(", "SPUIDefinitions"...
reset the tag name and tag description component border color.
[ "reset", "the", "tag", "name", "and", "tag", "description", "component", "border", "color", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/AbstractTagLayout.java#L297-L303
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/AbstractTagLayout.java
AbstractTagLayout.createWindow
public CommonDialogWindow createWindow() { window = new WindowBuilder(SPUIDefinitions.CREATE_UPDATE_WINDOW).caption(getWindowCaption()).content(this) .cancelButtonClickListener(event -> discard()).layout(mainLayout).i18n(i18n) .saveDialogCloseListener(new SaveOnDialogCloseListener()).buildCommonDialogWindow(); return window; }
java
public CommonDialogWindow createWindow() { window = new WindowBuilder(SPUIDefinitions.CREATE_UPDATE_WINDOW).caption(getWindowCaption()).content(this) .cancelButtonClickListener(event -> discard()).layout(mainLayout).i18n(i18n) .saveDialogCloseListener(new SaveOnDialogCloseListener()).buildCommonDialogWindow(); return window; }
[ "public", "CommonDialogWindow", "createWindow", "(", ")", "{", "window", "=", "new", "WindowBuilder", "(", "SPUIDefinitions", ".", "CREATE_UPDATE_WINDOW", ")", ".", "caption", "(", "getWindowCaption", "(", ")", ")", ".", "content", "(", "this", ")", ".", "canc...
Creates the window to create or update a tag or type @return the created window
[ "Creates", "the", "window", "to", "create", "or", "update", "a", "tag", "or", "type" ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/AbstractTagLayout.java#L362-L367
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/AbstractTagLayout.java
AbstractTagLayout.previewButtonClicked
private void previewButtonClicked() { if (!tagPreviewBtnClicked) { colorPickerLayout .setSelectedColor(ColorPickerHelper.rgbToColorConverter(ColorPickerConstants.DEFAULT_COLOR)); } tagPreviewBtnClicked = !tagPreviewBtnClicked; colorPickerLayout.setVisible(tagPreviewBtnClicked); }
java
private void previewButtonClicked() { if (!tagPreviewBtnClicked) { colorPickerLayout .setSelectedColor(ColorPickerHelper.rgbToColorConverter(ColorPickerConstants.DEFAULT_COLOR)); } tagPreviewBtnClicked = !tagPreviewBtnClicked; colorPickerLayout.setVisible(tagPreviewBtnClicked); }
[ "private", "void", "previewButtonClicked", "(", ")", "{", "if", "(", "!", "tagPreviewBtnClicked", ")", "{", "colorPickerLayout", ".", "setSelectedColor", "(", "ColorPickerHelper", ".", "rgbToColorConverter", "(", "ColorPickerConstants", ".", "DEFAULT_COLOR", ")", ")",...
Open color picker on click of preview button. Auto select the color based on target tag if already selected.
[ "Open", "color", "picker", "on", "click", "of", "preview", "button", ".", "Auto", "select", "the", "color", "based", "on", "target", "tag", "if", "already", "selected", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/AbstractTagLayout.java#L491-L499
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/AbstractTagLayout.java
AbstractTagLayout.getTargetDynamicStyles
private static void getTargetDynamicStyles(final String colorPickedPreview) { Page.getCurrent().getJavaScript() .execute(HawkbitCommonUtil.changeToNewSelectedPreviewColor(colorPickedPreview)); }
java
private static void getTargetDynamicStyles(final String colorPickedPreview) { Page.getCurrent().getJavaScript() .execute(HawkbitCommonUtil.changeToNewSelectedPreviewColor(colorPickedPreview)); }
[ "private", "static", "void", "getTargetDynamicStyles", "(", "final", "String", "colorPickedPreview", ")", "{", "Page", ".", "getCurrent", "(", ")", ".", "getJavaScript", "(", ")", ".", "execute", "(", "HawkbitCommonUtil", ".", "changeToNewSelectedPreviewColor", "(",...
Get target style - Dynamically as per the color picked, cannot be done from the static css. @param colorPickedPreview
[ "Get", "target", "style", "-", "Dynamically", "as", "per", "the", "color", "picked", "cannot", "be", "done", "from", "the", "static", "css", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/AbstractTagLayout.java#L507-L510
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/AbstractTagLayout.java
AbstractTagLayout.slidersValueChangeListeners
private void slidersValueChangeListeners() { colorPickerLayout.getRedSlider().addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(final ValueChangeEvent event) { final double red = (Double) event.getProperty().getValue(); final Color newColor = new Color((int) red, colorPickerLayout.getSelectedColor().getGreen(), colorPickerLayout.getSelectedColor().getBlue()); setColorToComponents(newColor); } }); colorPickerLayout.getGreenSlider().addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(final ValueChangeEvent event) { final double green = (Double) event.getProperty().getValue(); final Color newColor = new Color(colorPickerLayout.getSelectedColor().getRed(), (int) green, colorPickerLayout.getSelectedColor().getBlue()); setColorToComponents(newColor); } }); colorPickerLayout.getBlueSlider().addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(final ValueChangeEvent event) { final double blue = (Double) event.getProperty().getValue(); final Color newColor = new Color(colorPickerLayout.getSelectedColor().getRed(), colorPickerLayout.getSelectedColor().getGreen(), (int) blue); setColorToComponents(newColor); } }); }
java
private void slidersValueChangeListeners() { colorPickerLayout.getRedSlider().addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(final ValueChangeEvent event) { final double red = (Double) event.getProperty().getValue(); final Color newColor = new Color((int) red, colorPickerLayout.getSelectedColor().getGreen(), colorPickerLayout.getSelectedColor().getBlue()); setColorToComponents(newColor); } }); colorPickerLayout.getGreenSlider().addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(final ValueChangeEvent event) { final double green = (Double) event.getProperty().getValue(); final Color newColor = new Color(colorPickerLayout.getSelectedColor().getRed(), (int) green, colorPickerLayout.getSelectedColor().getBlue()); setColorToComponents(newColor); } }); colorPickerLayout.getBlueSlider().addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(final ValueChangeEvent event) { final double blue = (Double) event.getProperty().getValue(); final Color newColor = new Color(colorPickerLayout.getSelectedColor().getRed(), colorPickerLayout.getSelectedColor().getGreen(), (int) blue); setColorToComponents(newColor); } }); }
[ "private", "void", "slidersValueChangeListeners", "(", ")", "{", "colorPickerLayout", ".", "getRedSlider", "(", ")", ".", "addValueChangeListener", "(", "new", "ValueChangeListener", "(", ")", "{", "private", "static", "final", "long", "serialVersionUID", "=", "1L",...
Value change listeners implementations of sliders.
[ "Value", "change", "listeners", "implementations", "of", "sliders", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/layouts/AbstractTagLayout.java#L515-L549
train
eclipse/hawkbit
hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/ResponseExceptionHandler.java
ResponseExceptionHandler.handleSpServerRtExceptions
@ExceptionHandler(AbstractServerRtException.class) public ResponseEntity<ExceptionInfo> handleSpServerRtExceptions(final HttpServletRequest request, final Exception ex) { logRequest(request, ex); final ExceptionInfo response = createExceptionInfo(ex); final HttpStatus responseStatus; if (ex instanceof AbstractServerRtException) { responseStatus = getStatusOrDefault(((AbstractServerRtException) ex).getError()); } else { responseStatus = DEFAULT_RESPONSE_STATUS; } return new ResponseEntity<>(response, responseStatus); }
java
@ExceptionHandler(AbstractServerRtException.class) public ResponseEntity<ExceptionInfo> handleSpServerRtExceptions(final HttpServletRequest request, final Exception ex) { logRequest(request, ex); final ExceptionInfo response = createExceptionInfo(ex); final HttpStatus responseStatus; if (ex instanceof AbstractServerRtException) { responseStatus = getStatusOrDefault(((AbstractServerRtException) ex).getError()); } else { responseStatus = DEFAULT_RESPONSE_STATUS; } return new ResponseEntity<>(response, responseStatus); }
[ "@", "ExceptionHandler", "(", "AbstractServerRtException", ".", "class", ")", "public", "ResponseEntity", "<", "ExceptionInfo", ">", "handleSpServerRtExceptions", "(", "final", "HttpServletRequest", "request", ",", "final", "Exception", "ex", ")", "{", "logRequest", "...
method for handling exception of type AbstractServerRtException. Called by the Spring-Framework for exception handling. @param request the Http request @param ex the exception which occurred @return the entity to be responded containing the exception information as entity.
[ "method", "for", "handling", "exception", "of", "type", "AbstractServerRtException", ".", "Called", "by", "the", "Spring", "-", "Framework", "for", "exception", "handling", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/ResponseExceptionHandler.java#L99-L111
train
eclipse/hawkbit
hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/ResponseExceptionHandler.java
ResponseExceptionHandler.handleHttpMessageNotReadableException
@ExceptionHandler(HttpMessageNotReadableException.class) public ResponseEntity<ExceptionInfo> handleHttpMessageNotReadableException(final HttpServletRequest request, final Exception ex) { logRequest(request, ex); final ExceptionInfo response = createExceptionInfo(new MessageNotReadableException()); return new ResponseEntity<>(response, HttpStatus.BAD_REQUEST); }
java
@ExceptionHandler(HttpMessageNotReadableException.class) public ResponseEntity<ExceptionInfo> handleHttpMessageNotReadableException(final HttpServletRequest request, final Exception ex) { logRequest(request, ex); final ExceptionInfo response = createExceptionInfo(new MessageNotReadableException()); return new ResponseEntity<>(response, HttpStatus.BAD_REQUEST); }
[ "@", "ExceptionHandler", "(", "HttpMessageNotReadableException", ".", "class", ")", "public", "ResponseEntity", "<", "ExceptionInfo", ">", "handleHttpMessageNotReadableException", "(", "final", "HttpServletRequest", "request", ",", "final", "Exception", "ex", ")", "{", ...
Method for handling exception of type HttpMessageNotReadableException which is thrown in case the request body is not well formed and cannot be deserialized. Called by the Spring-Framework for exception handling. @param request the Http request @param ex the exception which occurred @return the entity to be responded containing the exception information as entity.
[ "Method", "for", "handling", "exception", "of", "type", "HttpMessageNotReadableException", "which", "is", "thrown", "in", "case", "the", "request", "body", "is", "not", "well", "formed", "and", "cannot", "be", "deserialized", ".", "Called", "by", "the", "Spring"...
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/ResponseExceptionHandler.java#L125-L131
train
eclipse/hawkbit
hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/ResponseExceptionHandler.java
ResponseExceptionHandler.handleConstraintViolationException
@ExceptionHandler(ConstraintViolationException.class) public ResponseEntity<ExceptionInfo> handleConstraintViolationException(final HttpServletRequest request, final ConstraintViolationException ex) { logRequest(request, ex); final ExceptionInfo response = new ExceptionInfo(); response.setMessage(ex.getConstraintViolations().stream().map( violation -> violation.getPropertyPath() + MESSAGE_FORMATTER_SEPARATOR + violation.getMessage() + ".") .collect(Collectors.joining(MESSAGE_FORMATTER_SEPARATOR))); response.setExceptionClass(ex.getClass().getName()); response.setErrorCode(SpServerError.SP_REPO_CONSTRAINT_VIOLATION.getKey()); return new ResponseEntity<>(response, HttpStatus.BAD_REQUEST); }
java
@ExceptionHandler(ConstraintViolationException.class) public ResponseEntity<ExceptionInfo> handleConstraintViolationException(final HttpServletRequest request, final ConstraintViolationException ex) { logRequest(request, ex); final ExceptionInfo response = new ExceptionInfo(); response.setMessage(ex.getConstraintViolations().stream().map( violation -> violation.getPropertyPath() + MESSAGE_FORMATTER_SEPARATOR + violation.getMessage() + ".") .collect(Collectors.joining(MESSAGE_FORMATTER_SEPARATOR))); response.setExceptionClass(ex.getClass().getName()); response.setErrorCode(SpServerError.SP_REPO_CONSTRAINT_VIOLATION.getKey()); return new ResponseEntity<>(response, HttpStatus.BAD_REQUEST); }
[ "@", "ExceptionHandler", "(", "ConstraintViolationException", ".", "class", ")", "public", "ResponseEntity", "<", "ExceptionInfo", ">", "handleConstraintViolationException", "(", "final", "HttpServletRequest", "request", ",", "final", "ConstraintViolationException", "ex", "...
Method for handling exception of type ConstraintViolationException which is thrown in case the request is rejected due to a constraint violation. Called by the Spring-Framework for exception handling. @param request the Http request @param ex the exception which occurred @return the entity to be responded containing the exception information as entity.
[ "Method", "for", "handling", "exception", "of", "type", "ConstraintViolationException", "which", "is", "thrown", "in", "case", "the", "request", "is", "rejected", "due", "to", "a", "constraint", "violation", ".", "Called", "by", "the", "Spring", "-", "Framework"...
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/ResponseExceptionHandler.java#L145-L158
train
eclipse/hawkbit
hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/ResponseExceptionHandler.java
ResponseExceptionHandler.handleValidationException
@ExceptionHandler(ValidationException.class) public ResponseEntity<ExceptionInfo> handleValidationException(final HttpServletRequest request, final ValidationException ex) { logRequest(request, ex); final ExceptionInfo response = new ExceptionInfo(); response.setMessage(ex.getMessage()); response.setExceptionClass(ex.getClass().getName()); response.setErrorCode(SpServerError.SP_REPO_CONSTRAINT_VIOLATION.getKey()); return new ResponseEntity<>(response, HttpStatus.BAD_REQUEST); }
java
@ExceptionHandler(ValidationException.class) public ResponseEntity<ExceptionInfo> handleValidationException(final HttpServletRequest request, final ValidationException ex) { logRequest(request, ex); final ExceptionInfo response = new ExceptionInfo(); response.setMessage(ex.getMessage()); response.setExceptionClass(ex.getClass().getName()); response.setErrorCode(SpServerError.SP_REPO_CONSTRAINT_VIOLATION.getKey()); return new ResponseEntity<>(response, HttpStatus.BAD_REQUEST); }
[ "@", "ExceptionHandler", "(", "ValidationException", ".", "class", ")", "public", "ResponseEntity", "<", "ExceptionInfo", ">", "handleValidationException", "(", "final", "HttpServletRequest", "request", ",", "final", "ValidationException", "ex", ")", "{", "logRequest", ...
Method for handling exception of type ValidationException which is thrown in case the request is rejected due to invalid requests. Called by the Spring-Framework for exception handling. @param request the Http request @param ex the exception which occurred @return the entity to be responded containing the exception information as entity.
[ "Method", "for", "handling", "exception", "of", "type", "ValidationException", "which", "is", "thrown", "in", "case", "the", "request", "is", "rejected", "due", "to", "invalid", "requests", ".", "Called", "by", "the", "Spring", "-", "Framework", "for", "except...
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-rest/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/ResponseExceptionHandler.java#L172-L183
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractTableDetailsLayout.java
AbstractTableDetailsLayout.onBaseEntityEvent
protected void onBaseEntityEvent(final BaseUIEntityEvent<T> baseEntityEvent) { final BaseEntityEventType eventType = baseEntityEvent.getEventType(); if (BaseEntityEventType.SELECTED_ENTITY == eventType || BaseEntityEventType.UPDATED_ENTITY == eventType || BaseEntityEventType.REMOVE_ENTITY == eventType) { UI.getCurrent().access(() -> populateData(baseEntityEvent.getEntity())); } else if (BaseEntityEventType.MINIMIZED == eventType) { UI.getCurrent().access(() -> setVisible(true)); } else if (BaseEntityEventType.MAXIMIZED == eventType) { UI.getCurrent().access(() -> setVisible(false)); } }
java
protected void onBaseEntityEvent(final BaseUIEntityEvent<T> baseEntityEvent) { final BaseEntityEventType eventType = baseEntityEvent.getEventType(); if (BaseEntityEventType.SELECTED_ENTITY == eventType || BaseEntityEventType.UPDATED_ENTITY == eventType || BaseEntityEventType.REMOVE_ENTITY == eventType) { UI.getCurrent().access(() -> populateData(baseEntityEvent.getEntity())); } else if (BaseEntityEventType.MINIMIZED == eventType) { UI.getCurrent().access(() -> setVisible(true)); } else if (BaseEntityEventType.MAXIMIZED == eventType) { UI.getCurrent().access(() -> setVisible(false)); } }
[ "protected", "void", "onBaseEntityEvent", "(", "final", "BaseUIEntityEvent", "<", "T", ">", "baseEntityEvent", ")", "{", "final", "BaseEntityEventType", "eventType", "=", "baseEntityEvent", ".", "getEventType", "(", ")", ";", "if", "(", "BaseEntityEventType", ".", ...
Default implementation to handle an entity event. @param baseEntityEvent the event
[ "Default", "implementation", "to", "handle", "an", "entity", "event", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractTableDetailsLayout.java#L129-L139
train
eclipse/hawkbit
hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpConfiguration.java
AmqpConfiguration.dmfReceiverQueue
@Bean public Queue dmfReceiverQueue() { return new Queue(amqpProperties.getReceiverQueue(), true, false, false, amqpDeadletterProperties.getDeadLetterExchangeArgs(amqpProperties.getDeadLetterExchange())); }
java
@Bean public Queue dmfReceiverQueue() { return new Queue(amqpProperties.getReceiverQueue(), true, false, false, amqpDeadletterProperties.getDeadLetterExchangeArgs(amqpProperties.getDeadLetterExchange())); }
[ "@", "Bean", "public", "Queue", "dmfReceiverQueue", "(", ")", "{", "return", "new", "Queue", "(", "amqpProperties", ".", "getReceiverQueue", "(", ")", ",", "true", ",", "false", ",", "false", ",", "amqpDeadletterProperties", ".", "getDeadLetterExchangeArgs", "("...
Create the DMF API receiver queue for retrieving DMF messages. @return the receiver queue
[ "Create", "the", "DMF", "API", "receiver", "queue", "for", "retrieving", "DMF", "messages", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpConfiguration.java#L135-L139
train
eclipse/hawkbit
hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpConfiguration.java
AmqpConfiguration.authenticationReceiverQueue
@Bean public Queue authenticationReceiverQueue() { return QueueBuilder.nonDurable(amqpProperties.getAuthenticationReceiverQueue()).autoDelete() .withArguments(getTTLMaxArgsAuthenticationQueue()).build(); }
java
@Bean public Queue authenticationReceiverQueue() { return QueueBuilder.nonDurable(amqpProperties.getAuthenticationReceiverQueue()).autoDelete() .withArguments(getTTLMaxArgsAuthenticationQueue()).build(); }
[ "@", "Bean", "public", "Queue", "authenticationReceiverQueue", "(", ")", "{", "return", "QueueBuilder", ".", "nonDurable", "(", "amqpProperties", ".", "getAuthenticationReceiverQueue", "(", ")", ")", ".", "autoDelete", "(", ")", ".", "withArguments", "(", "getTTLM...
Create the DMF API receiver queue for authentication requests called by 3rd party artifact storages for download authorization by devices. @return the receiver queue
[ "Create", "the", "DMF", "API", "receiver", "queue", "for", "authentication", "requests", "called", "by", "3rd", "party", "artifact", "storages", "for", "download", "authorization", "by", "devices", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpConfiguration.java#L147-L151
train
eclipse/hawkbit
hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpConfiguration.java
AmqpConfiguration.amqpMessageHandlerService
@Bean public AmqpMessageHandlerService amqpMessageHandlerService(final RabbitTemplate rabbitTemplate, final AmqpMessageDispatcherService amqpMessageDispatcherService, final ControllerManagement controllerManagement, final EntityFactory entityFactory) { return new AmqpMessageHandlerService(rabbitTemplate, amqpMessageDispatcherService, controllerManagement, entityFactory); }
java
@Bean public AmqpMessageHandlerService amqpMessageHandlerService(final RabbitTemplate rabbitTemplate, final AmqpMessageDispatcherService amqpMessageDispatcherService, final ControllerManagement controllerManagement, final EntityFactory entityFactory) { return new AmqpMessageHandlerService(rabbitTemplate, amqpMessageDispatcherService, controllerManagement, entityFactory); }
[ "@", "Bean", "public", "AmqpMessageHandlerService", "amqpMessageHandlerService", "(", "final", "RabbitTemplate", "rabbitTemplate", ",", "final", "AmqpMessageDispatcherService", "amqpMessageDispatcherService", ",", "final", "ControllerManagement", "controllerManagement", ",", "fin...
Create AMQP handler service bean. @param rabbitTemplate for converting messages @param amqpMessageDispatcherService to sending events to DMF client @param controllerManagement for target repo access @param entityFactory to create entities @return handler service bean
[ "Create", "AMQP", "handler", "service", "bean", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpConfiguration.java#L240-L246
train
eclipse/hawkbit
hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpConfiguration.java
AmqpConfiguration.listenerContainerFactory
@Bean @ConditionalOnMissingBean(name = "listenerContainerFactory") public RabbitListenerContainerFactory<SimpleMessageListenerContainer> listenerContainerFactory( final SimpleRabbitListenerContainerFactoryConfigurer configurer, final ErrorHandler errorHandler) { final ConfigurableRabbitListenerContainerFactory factory = new ConfigurableRabbitListenerContainerFactory( amqpProperties.isMissingQueuesFatal(), amqpProperties.getDeclarationRetries(), errorHandler); configurer.configure(factory, rabbitConnectionFactory); return factory; }
java
@Bean @ConditionalOnMissingBean(name = "listenerContainerFactory") public RabbitListenerContainerFactory<SimpleMessageListenerContainer> listenerContainerFactory( final SimpleRabbitListenerContainerFactoryConfigurer configurer, final ErrorHandler errorHandler) { final ConfigurableRabbitListenerContainerFactory factory = new ConfigurableRabbitListenerContainerFactory( amqpProperties.isMissingQueuesFatal(), amqpProperties.getDeclarationRetries(), errorHandler); configurer.configure(factory, rabbitConnectionFactory); return factory; }
[ "@", "Bean", "@", "ConditionalOnMissingBean", "(", "name", "=", "\"listenerContainerFactory\"", ")", "public", "RabbitListenerContainerFactory", "<", "SimpleMessageListenerContainer", ">", "listenerContainerFactory", "(", "final", "SimpleRabbitListenerContainerFactoryConfigurer", ...
Create RabbitListenerContainerFactory bean if no listenerContainerFactory bean found @return RabbitListenerContainerFactory bean
[ "Create", "RabbitListenerContainerFactory", "bean", "if", "no", "listenerContainerFactory", "bean", "found" ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpConfiguration.java#L279-L287
train
eclipse/hawkbit
hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpConfiguration.java
AmqpConfiguration.amqpControllerAuthentication
@Bean @ConditionalOnMissingBean(AmqpControllerAuthentication.class) public AmqpControllerAuthentication amqpControllerAuthentication(final SystemManagement systemManagement, final ControllerManagement controllerManagement, final TenantConfigurationManagement tenantConfigurationManagement, final TenantAware tenantAware, final DdiSecurityProperties ddiSecruityProperties, final SystemSecurityContext systemSecurityContext) { return new AmqpControllerAuthentication(systemManagement, controllerManagement, tenantConfigurationManagement, tenantAware, ddiSecruityProperties, systemSecurityContext); }
java
@Bean @ConditionalOnMissingBean(AmqpControllerAuthentication.class) public AmqpControllerAuthentication amqpControllerAuthentication(final SystemManagement systemManagement, final ControllerManagement controllerManagement, final TenantConfigurationManagement tenantConfigurationManagement, final TenantAware tenantAware, final DdiSecurityProperties ddiSecruityProperties, final SystemSecurityContext systemSecurityContext) { return new AmqpControllerAuthentication(systemManagement, controllerManagement, tenantConfigurationManagement, tenantAware, ddiSecruityProperties, systemSecurityContext); }
[ "@", "Bean", "@", "ConditionalOnMissingBean", "(", "AmqpControllerAuthentication", ".", "class", ")", "public", "AmqpControllerAuthentication", "amqpControllerAuthentication", "(", "final", "SystemManagement", "systemManagement", ",", "final", "ControllerManagement", "controlle...
create the authentication bean for controller over amqp. @param systemManagement the systemManagement @param controllerManagement the controllerManagement @param tenantConfigurationManagement the tenantConfigurationManagement @param tenantAware the tenantAware @param ddiSecruityProperties the ddiSecruityProperties @param systemSecurityContext the systemSecurityContext @return the bean
[ "create", "the", "authentication", "bean", "for", "controller", "over", "amqp", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpConfiguration.java#L306-L314
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/AbstractNotificationView.java
AbstractNotificationView.refreshView
public void refreshView(final Set<Class<?>> eventContainers) { eventContainers.stream().filter(this::supportNotificationEventContainer).forEach(this::refreshContainer); clear(); }
java
public void refreshView(final Set<Class<?>> eventContainers) { eventContainers.stream().filter(this::supportNotificationEventContainer).forEach(this::refreshContainer); clear(); }
[ "public", "void", "refreshView", "(", "final", "Set", "<", "Class", "<", "?", ">", ">", "eventContainers", ")", "{", "eventContainers", ".", "stream", "(", ")", ".", "filter", "(", "this", "::", "supportNotificationEventContainer", ")", ".", "forEach", "(", ...
Refresh the view by event container changes. @param eventContainers event container which container changed
[ "Refresh", "the", "view", "by", "event", "container", "changes", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/AbstractNotificationView.java#L122-L125
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/builder/TextFieldBuilder.java
TextFieldBuilder.createSearchField
public TextField createSearchField(final TextChangeListener textChangeListener) { final TextField textField = style("filter-box").styleName("text-style filter-box-hide").buildTextComponent(); textField.setWidth(100.0F, Unit.PERCENTAGE); textField.addTextChangeListener(textChangeListener); textField.setTextChangeEventMode(TextChangeEventMode.LAZY); // 1 seconds timeout. textField.setTextChangeTimeout(1000); return textField; }
java
public TextField createSearchField(final TextChangeListener textChangeListener) { final TextField textField = style("filter-box").styleName("text-style filter-box-hide").buildTextComponent(); textField.setWidth(100.0F, Unit.PERCENTAGE); textField.addTextChangeListener(textChangeListener); textField.setTextChangeEventMode(TextChangeEventMode.LAZY); // 1 seconds timeout. textField.setTextChangeTimeout(1000); return textField; }
[ "public", "TextField", "createSearchField", "(", "final", "TextChangeListener", "textChangeListener", ")", "{", "final", "TextField", "textField", "=", "style", "(", "\"filter-box\"", ")", ".", "styleName", "(", "\"text-style filter-box-hide\"", ")", ".", "buildTextComp...
Create a search text field. @param textChangeListener listener when text is changed. @return the textfield
[ "Create", "a", "search", "text", "field", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/builder/TextFieldBuilder.java#L41-L49
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/DistributionSetSelectWindow.java
DistributionSetSelectWindow.showForTargetFilter
public void showForTargetFilter(final Long tfqId) { this.tfqId = tfqId; final TargetFilterQuery tfq = targetFilterQueryManagement.get(tfqId) .orElseThrow(() -> new EntityNotFoundException(TargetFilterQuery.class, tfqId)); final VerticalLayout verticalLayout = initView(); final DistributionSet distributionSet = tfq.getAutoAssignDistributionSet(); final ActionType actionType = tfq.getAutoAssignActionType(); setInitialControlValues(distributionSet, actionType); // build window after values are set to view elements final CommonDialogWindow window = new WindowBuilder(SPUIDefinitions.CREATE_UPDATE_WINDOW) .caption(i18n.getMessage(UIMessageIdProvider.CAPTION_SELECT_AUTO_ASSIGN_DS)).content(verticalLayout) .layout(verticalLayout).i18n(i18n).saveDialogCloseListener(this).buildCommonDialogWindow(); window.setId(UIComponentIdProvider.DIST_SET_SELECT_WINDOW_ID); window.setWidth(40.0F, Sizeable.Unit.PERCENTAGE); UI.getCurrent().addWindow(window); window.setVisible(true); }
java
public void showForTargetFilter(final Long tfqId) { this.tfqId = tfqId; final TargetFilterQuery tfq = targetFilterQueryManagement.get(tfqId) .orElseThrow(() -> new EntityNotFoundException(TargetFilterQuery.class, tfqId)); final VerticalLayout verticalLayout = initView(); final DistributionSet distributionSet = tfq.getAutoAssignDistributionSet(); final ActionType actionType = tfq.getAutoAssignActionType(); setInitialControlValues(distributionSet, actionType); // build window after values are set to view elements final CommonDialogWindow window = new WindowBuilder(SPUIDefinitions.CREATE_UPDATE_WINDOW) .caption(i18n.getMessage(UIMessageIdProvider.CAPTION_SELECT_AUTO_ASSIGN_DS)).content(verticalLayout) .layout(verticalLayout).i18n(i18n).saveDialogCloseListener(this).buildCommonDialogWindow(); window.setId(UIComponentIdProvider.DIST_SET_SELECT_WINDOW_ID); window.setWidth(40.0F, Sizeable.Unit.PERCENTAGE); UI.getCurrent().addWindow(window); window.setVisible(true); }
[ "public", "void", "showForTargetFilter", "(", "final", "Long", "tfqId", ")", "{", "this", ".", "tfqId", "=", "tfqId", ";", "final", "TargetFilterQuery", "tfq", "=", "targetFilterQueryManagement", ".", "get", "(", "tfqId", ")", ".", "orElseThrow", "(", "(", "...
Shows a distribution set select window for the given target filter query @param tfqId target filter query id
[ "Shows", "a", "distribution", "set", "select", "window", "for", "the", "given", "target", "filter", "query" ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/DistributionSetSelectWindow.java#L100-L121
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/DistributionSetSelectWindow.java
DistributionSetSelectWindow.saveOrUpdate
@Override public void saveOrUpdate() { if (checkBox.getValue() && dsCombo.getValue() != null) { final ActionType autoAssignActionType = ((ActionTypeOption) actionTypeOptionGroupLayout .getActionTypeOptionGroup().getValue()).getActionType(); updateTargetFilterQueryDS(tfqId, (Long) dsCombo.getValue(), autoAssignActionType); } else if (!checkBox.getValue()) { updateTargetFilterQueryDS(tfqId, null, null); } }
java
@Override public void saveOrUpdate() { if (checkBox.getValue() && dsCombo.getValue() != null) { final ActionType autoAssignActionType = ((ActionTypeOption) actionTypeOptionGroupLayout .getActionTypeOptionGroup().getValue()).getActionType(); updateTargetFilterQueryDS(tfqId, (Long) dsCombo.getValue(), autoAssignActionType); } else if (!checkBox.getValue()) { updateTargetFilterQueryDS(tfqId, null, null); } }
[ "@", "Override", "public", "void", "saveOrUpdate", "(", ")", "{", "if", "(", "checkBox", ".", "getValue", "(", ")", "&&", "dsCombo", ".", "getValue", "(", ")", "!=", "null", ")", "{", "final", "ActionType", "autoAssignActionType", "=", "(", "(", "ActionT...
Is called when the new value should be saved after the save button has been clicked
[ "Is", "called", "when", "the", "new", "value", "should", "be", "saved", "after", "the", "save", "button", "has", "been", "clicked" ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/DistributionSetSelectWindow.java#L181-L190
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/dd/criteria/ManagementViewClientCriterion.java
ManagementViewClientCriterion.createViewComponentClientCriteria
static ServerViewComponentClientCriterion[] createViewComponentClientCriteria() { final ServerViewComponentClientCriterion[] criteria = new ServerViewComponentClientCriterion[4]; // Target table acceptable components. criteria[0] = ServerViewComponentClientCriterion.createBuilder() .dragSourceIdPrefix(UIComponentIdProvider.TARGET_TABLE_ID) .dropTargetIdPrefixes(SPUIDefinitions.TARGET_TAG_ID_PREFIXS, UIComponentIdProvider.DIST_TABLE_ID) .dropAreaIds(UIComponentIdProvider.TARGET_TAG_DROP_AREA_ID, UIComponentIdProvider.DIST_TABLE_ID) .build(); // Target Tag acceptable components. criteria[1] = ServerViewComponentClientCriterion.createBuilder() .dragSourceIdPrefix(SPUIDefinitions.TARGET_TAG_ID_PREFIXS) .dropTargetIdPrefixes(UIComponentIdProvider.TARGET_TABLE_ID, UIComponentIdProvider.DIST_TABLE_ID) .dropAreaIds(UIComponentIdProvider.TARGET_TABLE_ID, UIComponentIdProvider.DIST_TABLE_ID).build(); // Distribution table acceptable components. criteria[2] = ServerViewComponentClientCriterion.createBuilder() .dragSourceIdPrefix(UIComponentIdProvider.DIST_TABLE_ID) .dropTargetIdPrefixes(UIComponentIdProvider.TARGET_TABLE_ID, UIComponentIdProvider.TARGET_DROP_FILTER_ICON, SPUIDefinitions.DISTRIBUTION_TAG_ID_PREFIXS) .dropAreaIds(UIComponentIdProvider.TARGET_TABLE_ID, UIComponentIdProvider.TARGET_DROP_FILTER_ICON, UIComponentIdProvider.DISTRIBUTION_TAG_TABLE_ID) .build(); // Distribution tag acceptable components. criteria[3] = ServerViewComponentClientCriterion.createBuilder() .dragSourceIdPrefix(SPUIDefinitions.DISTRIBUTION_TAG_ID_PREFIXS) .dropTargetIdPrefixes(UIComponentIdProvider.DIST_TABLE_ID) .dropAreaIds(UIComponentIdProvider.DIST_TABLE_ID).build(); return criteria; }
java
static ServerViewComponentClientCriterion[] createViewComponentClientCriteria() { final ServerViewComponentClientCriterion[] criteria = new ServerViewComponentClientCriterion[4]; // Target table acceptable components. criteria[0] = ServerViewComponentClientCriterion.createBuilder() .dragSourceIdPrefix(UIComponentIdProvider.TARGET_TABLE_ID) .dropTargetIdPrefixes(SPUIDefinitions.TARGET_TAG_ID_PREFIXS, UIComponentIdProvider.DIST_TABLE_ID) .dropAreaIds(UIComponentIdProvider.TARGET_TAG_DROP_AREA_ID, UIComponentIdProvider.DIST_TABLE_ID) .build(); // Target Tag acceptable components. criteria[1] = ServerViewComponentClientCriterion.createBuilder() .dragSourceIdPrefix(SPUIDefinitions.TARGET_TAG_ID_PREFIXS) .dropTargetIdPrefixes(UIComponentIdProvider.TARGET_TABLE_ID, UIComponentIdProvider.DIST_TABLE_ID) .dropAreaIds(UIComponentIdProvider.TARGET_TABLE_ID, UIComponentIdProvider.DIST_TABLE_ID).build(); // Distribution table acceptable components. criteria[2] = ServerViewComponentClientCriterion.createBuilder() .dragSourceIdPrefix(UIComponentIdProvider.DIST_TABLE_ID) .dropTargetIdPrefixes(UIComponentIdProvider.TARGET_TABLE_ID, UIComponentIdProvider.TARGET_DROP_FILTER_ICON, SPUIDefinitions.DISTRIBUTION_TAG_ID_PREFIXS) .dropAreaIds(UIComponentIdProvider.TARGET_TABLE_ID, UIComponentIdProvider.TARGET_DROP_FILTER_ICON, UIComponentIdProvider.DISTRIBUTION_TAG_TABLE_ID) .build(); // Distribution tag acceptable components. criteria[3] = ServerViewComponentClientCriterion.createBuilder() .dragSourceIdPrefix(SPUIDefinitions.DISTRIBUTION_TAG_ID_PREFIXS) .dropTargetIdPrefixes(UIComponentIdProvider.DIST_TABLE_ID) .dropAreaIds(UIComponentIdProvider.DIST_TABLE_ID).build(); return criteria; }
[ "static", "ServerViewComponentClientCriterion", "[", "]", "createViewComponentClientCriteria", "(", ")", "{", "final", "ServerViewComponentClientCriterion", "[", "]", "criteria", "=", "new", "ServerViewComponentClientCriterion", "[", "4", "]", ";", "// Target table acceptable...
Configures the elements of the composite accept criterion for the Management View. @return accept criterion elements
[ "Configures", "the", "elements", "of", "the", "composite", "accept", "criterion", "for", "the", "Management", "View", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/dd/criteria/ManagementViewClientCriterion.java#L49-L78
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.trimAndNullIfEmpty
public static String trimAndNullIfEmpty(final String text) { if (text != null && !text.trim().isEmpty()) { return text.trim(); } return null; }
java
public static String trimAndNullIfEmpty(final String text) { if (text != null && !text.trim().isEmpty()) { return text.trim(); } return null; }
[ "public", "static", "String", "trimAndNullIfEmpty", "(", "final", "String", "text", ")", "{", "if", "(", "text", "!=", "null", "&&", "!", "text", ".", "trim", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "return", "text", ".", "trim", "(", ")", ";...
Trims the text and converts into null in case of an empty string. @param text text to be trimmed @return null if the text is null or if the text is blank, text.trim() if the text is not empty.
[ "Trims", "the", "text", "and", "converts", "into", "null", "in", "case", "of", "an", "empty", "string", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L90-L95
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.concatStrings
public static String concatStrings(final String delimiter, final String... texts) { final String delim = delimiter == null ? "" : delimiter; final StringBuilder conCatStrBldr = new StringBuilder(); if (null != texts) { for (final String text : texts) { conCatStrBldr.append(delim); conCatStrBldr.append(text); } } final String conCatedStr = conCatStrBldr.toString(); return delim.length() > 0 && conCatedStr.startsWith(delim) ? conCatedStr.substring(1) : conCatedStr; }
java
public static String concatStrings(final String delimiter, final String... texts) { final String delim = delimiter == null ? "" : delimiter; final StringBuilder conCatStrBldr = new StringBuilder(); if (null != texts) { for (final String text : texts) { conCatStrBldr.append(delim); conCatStrBldr.append(text); } } final String conCatedStr = conCatStrBldr.toString(); return delim.length() > 0 && conCatedStr.startsWith(delim) ? conCatedStr.substring(1) : conCatedStr; }
[ "public", "static", "String", "concatStrings", "(", "final", "String", "delimiter", ",", "final", "String", "...", "texts", ")", "{", "final", "String", "delim", "=", "delimiter", "==", "null", "?", "\"\"", ":", "delimiter", ";", "final", "StringBuilder", "c...
Concatenate the given text all the string arguments with the given delimiter. @param delimiter the delimiter text to be used while concatenation. @param texts all these string values will be concatenated with the given delimiter. @return null in case no text arguments to be compared. just concatenation of all texts arguments if "delimiter" is null or empty. concatenation of all texts arguments with "delimiter" if it not null.
[ "Concatenate", "the", "given", "text", "all", "the", "string", "arguments", "with", "the", "given", "delimiter", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L111-L122
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.getSoftwareModuleName
public static String getSoftwareModuleName(final String caption, final String name) { return new StringBuilder() .append(DIV_DESCRIPTION_START + caption + " : " + getBoldHTMLText(getFormattedName(name))) .append(DIV_DESCRIPTION_END).toString(); }
java
public static String getSoftwareModuleName(final String caption, final String name) { return new StringBuilder() .append(DIV_DESCRIPTION_START + caption + " : " + getBoldHTMLText(getFormattedName(name))) .append(DIV_DESCRIPTION_END).toString(); }
[ "public", "static", "String", "getSoftwareModuleName", "(", "final", "String", "caption", ",", "final", "String", "name", ")", "{", "return", "new", "StringBuilder", "(", ")", ".", "append", "(", "DIV_DESCRIPTION_START", "+", "caption", "+", "\" : \"", "+", "g...
Get Label for Artifact Details. @param caption as caption of the details @param name as name @return SoftwareModuleName
[ "Get", "Label", "for", "Artifact", "Details", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L152-L156
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.getPollStatusToolTip
public static String getPollStatusToolTip(final PollStatus pollStatus, final VaadinMessageSource i18N) { if (pollStatus != null && pollStatus.getLastPollDate() != null && pollStatus.isOverdue()) { final TimeZone tz = SPDateTimeUtil.getBrowserTimeZone(); return i18N.getMessage(UIMessageIdProvider.TOOLTIP_OVERDUE, SPDateTimeUtil.getDurationFormattedString( pollStatus.getOverdueDate().atZone(SPDateTimeUtil.getTimeZoneId(tz)).toInstant().toEpochMilli(), pollStatus.getCurrentDate().atZone(SPDateTimeUtil.getTimeZoneId(tz)).toInstant().toEpochMilli(), i18N)); } return null; }
java
public static String getPollStatusToolTip(final PollStatus pollStatus, final VaadinMessageSource i18N) { if (pollStatus != null && pollStatus.getLastPollDate() != null && pollStatus.isOverdue()) { final TimeZone tz = SPDateTimeUtil.getBrowserTimeZone(); return i18N.getMessage(UIMessageIdProvider.TOOLTIP_OVERDUE, SPDateTimeUtil.getDurationFormattedString( pollStatus.getOverdueDate().atZone(SPDateTimeUtil.getTimeZoneId(tz)).toInstant().toEpochMilli(), pollStatus.getCurrentDate().atZone(SPDateTimeUtil.getTimeZoneId(tz)).toInstant().toEpochMilli(), i18N)); } return null; }
[ "public", "static", "String", "getPollStatusToolTip", "(", "final", "PollStatus", "pollStatus", ",", "final", "VaadinMessageSource", "i18N", ")", "{", "if", "(", "pollStatus", "!=", "null", "&&", "pollStatus", ".", "getLastPollDate", "(", ")", "!=", "null", "&&"...
Get tool tip for Poll status. @param pollStatus @param i18N @return PollStatusToolTip
[ "Get", "tool", "tip", "for", "Poll", "status", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L165-L174
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.getFormattedName
public static String getFormattedName(final String orgText) { return trimAndNullIfEmpty(orgText) == null ? SPUIDefinitions.SPACE : orgText; }
java
public static String getFormattedName(final String orgText) { return trimAndNullIfEmpty(orgText) == null ? SPUIDefinitions.SPACE : orgText; }
[ "public", "static", "String", "getFormattedName", "(", "final", "String", "orgText", ")", "{", "return", "trimAndNullIfEmpty", "(", "orgText", ")", "==", "null", "?", "SPUIDefinitions", ".", "SPACE", ":", "orgText", ";", "}" ]
Null check for text. @param orgText text to be formatted @return String formatted text
[ "Null", "check", "for", "text", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L183-L185
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.getArtifactUploadPopupWidth
public static float getArtifactUploadPopupWidth(final float newBrowserWidth, final int minPopupWidth) { final float extraWidth = findRequiredSwModuleExtraWidth(newBrowserWidth); if (extraWidth + minPopupWidth > SPUIDefinitions.MAX_UPLOAD_CONFIRMATION_POPUP_WIDTH) { return SPUIDefinitions.MAX_UPLOAD_CONFIRMATION_POPUP_WIDTH; } return extraWidth + minPopupWidth; }
java
public static float getArtifactUploadPopupWidth(final float newBrowserWidth, final int minPopupWidth) { final float extraWidth = findRequiredSwModuleExtraWidth(newBrowserWidth); if (extraWidth + minPopupWidth > SPUIDefinitions.MAX_UPLOAD_CONFIRMATION_POPUP_WIDTH) { return SPUIDefinitions.MAX_UPLOAD_CONFIRMATION_POPUP_WIDTH; } return extraWidth + minPopupWidth; }
[ "public", "static", "float", "getArtifactUploadPopupWidth", "(", "final", "float", "newBrowserWidth", ",", "final", "int", "minPopupWidth", ")", "{", "final", "float", "extraWidth", "=", "findRequiredSwModuleExtraWidth", "(", "newBrowserWidth", ")", ";", "if", "(", ...
Get artifact upload pop up width. @param newBrowserWidth new browser width @param minPopupWidth minimum popup width @return float new pop up width
[ "Get", "artifact", "upload", "pop", "up", "width", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L202-L208
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.removePrefix
public static String removePrefix(final String text, final String prefix) { if (text != null) { return text.replaceFirst(prefix, ""); } return null; }
java
public static String removePrefix(final String text, final String prefix) { if (text != null) { return text.replaceFirst(prefix, ""); } return null; }
[ "public", "static", "String", "removePrefix", "(", "final", "String", "text", ",", "final", "String", "prefix", ")", "{", "if", "(", "text", "!=", "null", ")", "{", "return", "text", ".", "replaceFirst", "(", "prefix", ",", "\"\"", ")", ";", "}", "retu...
Remove the prefix from text. @param text name @param prefix text to be removed @return String name
[ "Remove", "the", "prefix", "from", "text", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L234-L239
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.getFormatedLabel
public static Label getFormatedLabel(final String labelContent) { final Label labelValue = new Label(labelContent, ContentMode.HTML); labelValue.setSizeFull(); labelValue.addStyleName(SPUIDefinitions.TEXT_STYLE); labelValue.addStyleName("label-style"); return labelValue; }
java
public static Label getFormatedLabel(final String labelContent) { final Label labelValue = new Label(labelContent, ContentMode.HTML); labelValue.setSizeFull(); labelValue.addStyleName(SPUIDefinitions.TEXT_STYLE); labelValue.addStyleName("label-style"); return labelValue; }
[ "public", "static", "Label", "getFormatedLabel", "(", "final", "String", "labelContent", ")", "{", "final", "Label", "labelValue", "=", "new", "Label", "(", "labelContent", ",", "ContentMode", ".", "HTML", ")", ";", "labelValue", ".", "setSizeFull", "(", ")", ...
Get formatted label.Appends ellipses if content does not fit the label. @param labelContent content @return Label
[ "Get", "formatted", "label", ".", "Appends", "ellipses", "if", "content", "does", "not", "fit", "the", "label", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L248-L254
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.createAssignmentMessage
public static String createAssignmentMessage(final String tagName, final AssignmentResult<? extends NamedEntity> result, final VaadinMessageSource i18n) { final StringBuilder formMsg = new StringBuilder(); final int assignedCount = result.getAssigned(); final int alreadyAssignedCount = result.getAlreadyAssigned(); final int unassignedCount = result.getUnassigned(); if (assignedCount == 1) { formMsg.append(i18n.getMessage("message.target.assigned.one", result.getAssignedEntity().get(0).getName(), tagName)).append("<br>"); } else if (assignedCount > 1) { formMsg.append(i18n.getMessage("message.target.assigned.many", assignedCount, tagName)).append("<br>"); if (alreadyAssignedCount > 0) { final String alreadyAssigned = i18n.getMessage("message.target.alreadyAssigned", alreadyAssignedCount); formMsg.append(alreadyAssigned).append("<br>"); } } if (unassignedCount == 1) { formMsg.append(i18n.getMessage("message.target.unassigned.one", result.getUnassignedEntity().get(0).getName(), tagName)).append("<br>"); } else if (unassignedCount > 1) { formMsg.append(i18n.getMessage("message.target.unassigned.many", unassignedCount, tagName)).append("<br>"); } return formMsg.toString(); }
java
public static String createAssignmentMessage(final String tagName, final AssignmentResult<? extends NamedEntity> result, final VaadinMessageSource i18n) { final StringBuilder formMsg = new StringBuilder(); final int assignedCount = result.getAssigned(); final int alreadyAssignedCount = result.getAlreadyAssigned(); final int unassignedCount = result.getUnassigned(); if (assignedCount == 1) { formMsg.append(i18n.getMessage("message.target.assigned.one", result.getAssignedEntity().get(0).getName(), tagName)).append("<br>"); } else if (assignedCount > 1) { formMsg.append(i18n.getMessage("message.target.assigned.many", assignedCount, tagName)).append("<br>"); if (alreadyAssignedCount > 0) { final String alreadyAssigned = i18n.getMessage("message.target.alreadyAssigned", alreadyAssignedCount); formMsg.append(alreadyAssigned).append("<br>"); } } if (unassignedCount == 1) { formMsg.append(i18n.getMessage("message.target.unassigned.one", result.getUnassignedEntity().get(0).getName(), tagName)).append("<br>"); } else if (unassignedCount > 1) { formMsg.append(i18n.getMessage("message.target.unassigned.many", unassignedCount, tagName)).append("<br>"); } return formMsg.toString(); }
[ "public", "static", "String", "createAssignmentMessage", "(", "final", "String", "tagName", ",", "final", "AssignmentResult", "<", "?", "extends", "NamedEntity", ">", "result", ",", "final", "VaadinMessageSource", "i18n", ")", "{", "final", "StringBuilder", "formMsg...
Display Target Tag action message. @param tagName as tag name @param result as TargetTagAssigmentResult @param i18n I18N @return message
[ "Display", "Target", "Tag", "action", "message", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L296-L320
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.createLazyQueryContainer
public static LazyQueryContainer createLazyQueryContainer( final BeanQueryFactory<? extends AbstractBeanQuery<?>> queryFactory) { queryFactory.setQueryConfiguration(Collections.emptyMap()); return new LazyQueryContainer(new LazyQueryDefinition(true, 20, SPUILabelDefinitions.VAR_NAME), queryFactory); }
java
public static LazyQueryContainer createLazyQueryContainer( final BeanQueryFactory<? extends AbstractBeanQuery<?>> queryFactory) { queryFactory.setQueryConfiguration(Collections.emptyMap()); return new LazyQueryContainer(new LazyQueryDefinition(true, 20, SPUILabelDefinitions.VAR_NAME), queryFactory); }
[ "public", "static", "LazyQueryContainer", "createLazyQueryContainer", "(", "final", "BeanQueryFactory", "<", "?", "extends", "AbstractBeanQuery", "<", "?", ">", ">", "queryFactory", ")", "{", "queryFactory", ".", "setQueryConfiguration", "(", "Collections", ".", "empt...
Create a lazy query container for the given query bean factory with empty configurations. @param queryFactory is reference of {@link BeanQueryFactory<? extends AbstractBeanQuery>} on which lazy container should create. @return instance of {@link LazyQueryContainer}.
[ "Create", "a", "lazy", "query", "container", "for", "the", "given", "query", "bean", "factory", "with", "empty", "configurations", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L331-L335
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.createDSLazyQueryContainer
public static LazyQueryContainer createDSLazyQueryContainer( final BeanQueryFactory<? extends AbstractBeanQuery<?>> queryFactory) { queryFactory.setQueryConfiguration(Collections.emptyMap()); return new LazyQueryContainer(new LazyQueryDefinition(true, 20, "tagIdName"), queryFactory); }
java
public static LazyQueryContainer createDSLazyQueryContainer( final BeanQueryFactory<? extends AbstractBeanQuery<?>> queryFactory) { queryFactory.setQueryConfiguration(Collections.emptyMap()); return new LazyQueryContainer(new LazyQueryDefinition(true, 20, "tagIdName"), queryFactory); }
[ "public", "static", "LazyQueryContainer", "createDSLazyQueryContainer", "(", "final", "BeanQueryFactory", "<", "?", "extends", "AbstractBeanQuery", "<", "?", ">", ">", "queryFactory", ")", "{", "queryFactory", ".", "setQueryConfiguration", "(", "Collections", ".", "em...
Create lazy query container for DS type. @param queryFactory @return LazyQueryContainer
[ "Create", "lazy", "query", "container", "for", "DS", "type", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L343-L347
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.getDsTableColumnProperties
public static void getDsTableColumnProperties(final Container container) { final LazyQueryContainer lqc = (LazyQueryContainer) container; lqc.addContainerProperty(SPUILabelDefinitions.VAR_ID, Long.class, null, false, false); lqc.addContainerProperty(SPUILabelDefinitions.VAR_DESC, String.class, "", false, true); lqc.addContainerProperty(SPUILabelDefinitions.VAR_VERSION, String.class, null, false, false); lqc.addContainerProperty(SPUILabelDefinitions.VAR_NAME, String.class, null, false, true); lqc.addContainerProperty(SPUILabelDefinitions.VAR_CREATED_BY, String.class, null, false, true); lqc.addContainerProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, String.class, null, false, true); lqc.addContainerProperty(SPUILabelDefinitions.VAR_CREATED_DATE, String.class, null, false, true); lqc.addContainerProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, String.class, null, false, true); }
java
public static void getDsTableColumnProperties(final Container container) { final LazyQueryContainer lqc = (LazyQueryContainer) container; lqc.addContainerProperty(SPUILabelDefinitions.VAR_ID, Long.class, null, false, false); lqc.addContainerProperty(SPUILabelDefinitions.VAR_DESC, String.class, "", false, true); lqc.addContainerProperty(SPUILabelDefinitions.VAR_VERSION, String.class, null, false, false); lqc.addContainerProperty(SPUILabelDefinitions.VAR_NAME, String.class, null, false, true); lqc.addContainerProperty(SPUILabelDefinitions.VAR_CREATED_BY, String.class, null, false, true); lqc.addContainerProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, String.class, null, false, true); lqc.addContainerProperty(SPUILabelDefinitions.VAR_CREATED_DATE, String.class, null, false, true); lqc.addContainerProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, String.class, null, false, true); }
[ "public", "static", "void", "getDsTableColumnProperties", "(", "final", "Container", "container", ")", "{", "final", "LazyQueryContainer", "lqc", "=", "(", "LazyQueryContainer", ")", "container", ";", "lqc", ".", "addContainerProperty", "(", "SPUILabelDefinitions", "....
Set distribution table column properties. @param container table container
[ "Set", "distribution", "table", "column", "properties", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L355-L365
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.getScriptSMHighlightWithColor
public static String getScriptSMHighlightWithColor(final String colorCSS) { return new StringBuilder().append(SM_HIGHLIGHT_SCRIPT_CURRENT) .append("smHighlightStyle = smHighlightStyle + \"").append(colorCSS).append("\";") .append(SM_HIGHLIGHT_SCRIPT_APPEND).toString(); }
java
public static String getScriptSMHighlightWithColor(final String colorCSS) { return new StringBuilder().append(SM_HIGHLIGHT_SCRIPT_CURRENT) .append("smHighlightStyle = smHighlightStyle + \"").append(colorCSS).append("\";") .append(SM_HIGHLIGHT_SCRIPT_APPEND).toString(); }
[ "public", "static", "String", "getScriptSMHighlightWithColor", "(", "final", "String", "colorCSS", ")", "{", "return", "new", "StringBuilder", "(", ")", ".", "append", "(", "SM_HIGHLIGHT_SCRIPT_CURRENT", ")", ".", "append", "(", "\"smHighlightStyle = smHighlightStyle + ...
Highlight software module rows with the color of sw-type. @param colorCSS color to generate the css script. @return javascript to append software module table rows with highlighted color.
[ "Highlight", "software", "module", "rows", "with", "the", "color", "of", "sw", "-", "type", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L384-L388
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.changeToNewSelectedPreviewColor
public static String changeToNewSelectedPreviewColor(final String colorPickedPreview) { return new StringBuilder().append(NEW_PREVIEW_COLOR_REMOVE_SCRIPT).append(NEW_PREVIEW_COLOR_CREATE_SCRIPT) .append("var newColorPreviewStyle = \".v-app .new-tag-name{ border: solid 3px ") .append(colorPickedPreview) .append(" !important; width:138px; margin-left:2px !important; box-shadow:none !important; } \"; ") .append("newColorPreviewStyle = newColorPreviewStyle + \".v-app .new-tag-desc{ border: solid 3px ") .append(colorPickedPreview) .append(" !important; width:138px; height:75px !important; margin-top:4px !important; margin-left:2px !important;;box-shadow:none !important;} \"; ") .append(NEW_PREVIEW_COLOR_SET_STYLE_SCRIPT).toString(); }
java
public static String changeToNewSelectedPreviewColor(final String colorPickedPreview) { return new StringBuilder().append(NEW_PREVIEW_COLOR_REMOVE_SCRIPT).append(NEW_PREVIEW_COLOR_CREATE_SCRIPT) .append("var newColorPreviewStyle = \".v-app .new-tag-name{ border: solid 3px ") .append(colorPickedPreview) .append(" !important; width:138px; margin-left:2px !important; box-shadow:none !important; } \"; ") .append("newColorPreviewStyle = newColorPreviewStyle + \".v-app .new-tag-desc{ border: solid 3px ") .append(colorPickedPreview) .append(" !important; width:138px; height:75px !important; margin-top:4px !important; margin-left:2px !important;;box-shadow:none !important;} \"; ") .append(NEW_PREVIEW_COLOR_SET_STYLE_SCRIPT).toString(); }
[ "public", "static", "String", "changeToNewSelectedPreviewColor", "(", "final", "String", "colorPickedPreview", ")", "{", "return", "new", "StringBuilder", "(", ")", ".", "append", "(", "NEW_PREVIEW_COLOR_REMOVE_SCRIPT", ")", ".", "append", "(", "NEW_PREVIEW_COLOR_CREATE...
Get javascript to reflect new color selection in color picker preview for name and description fields . @param colorPickedPreview changed color @return javascript for the selected color.
[ "Get", "javascript", "to", "reflect", "new", "color", "selection", "in", "color", "picker", "preview", "for", "name", "and", "description", "fields", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L398-L407
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.getPreviewButtonColorScript
public static String getPreviewButtonColorScript(final String color) { return new StringBuilder().append(PREVIEW_BUTTON_COLOR_REMOVE_SCRIPT).append(PREVIEW_BUTTON_COLOR_CREATE_SCRIPT) .append("var tagColorPreviewStyle = \".v-app .tag-color-preview{ height: 15px !important; padding: 0 10px !important; border: 0px !important; margin-left:12px !important; margin-top: 4px !important; border-width: 0 !important; background: ") .append(color) .append(" } .v-app .tag-color-preview:after{ border-color: none !important; box-shadow:none !important;} \"; ") .append(PREVIEW_BUTTON_COLOR_SET_STYLE_SCRIPT).toString(); }
java
public static String getPreviewButtonColorScript(final String color) { return new StringBuilder().append(PREVIEW_BUTTON_COLOR_REMOVE_SCRIPT).append(PREVIEW_BUTTON_COLOR_CREATE_SCRIPT) .append("var tagColorPreviewStyle = \".v-app .tag-color-preview{ height: 15px !important; padding: 0 10px !important; border: 0px !important; margin-left:12px !important; margin-top: 4px !important; border-width: 0 !important; background: ") .append(color) .append(" } .v-app .tag-color-preview:after{ border-color: none !important; box-shadow:none !important;} \"; ") .append(PREVIEW_BUTTON_COLOR_SET_STYLE_SCRIPT).toString(); }
[ "public", "static", "String", "getPreviewButtonColorScript", "(", "final", "String", "color", ")", "{", "return", "new", "StringBuilder", "(", ")", ".", "append", "(", "PREVIEW_BUTTON_COLOR_REMOVE_SCRIPT", ")", ".", "append", "(", "PREVIEW_BUTTON_COLOR_CREATE_SCRIPT", ...
Get javascript to reflect new color selection for preview button. @param color changed color @return javascript for the selected color.
[ "Get", "javascript", "to", "reflect", "new", "color", "selection", "for", "preview", "button", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L416-L422
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.applyStatusLblStyle
public static void applyStatusLblStyle(final Table targetTable, final Button pinBtn, final Object itemId) { final Item item = targetTable.getItem(itemId); if (item != null) { final TargetUpdateStatus updateStatus = (TargetUpdateStatus) item .getItemProperty(SPUILabelDefinitions.VAR_TARGET_STATUS).getValue(); pinBtn.removeStyleName("statusIconRed statusIconBlue statusIconGreen statusIconYellow statusIconLightBlue"); if (updateStatus == TargetUpdateStatus.ERROR) { pinBtn.addStyleName(SPUIStyleDefinitions.STATUS_ICON_RED); } else if (updateStatus == TargetUpdateStatus.UNKNOWN) { pinBtn.addStyleName(SPUIStyleDefinitions.STATUS_ICON_BLUE); } else if (updateStatus == TargetUpdateStatus.IN_SYNC) { pinBtn.addStyleName(SPUIStyleDefinitions.STATUS_ICON_GREEN); } else if (updateStatus == TargetUpdateStatus.PENDING) { pinBtn.addStyleName(SPUIStyleDefinitions.STATUS_ICON_YELLOW); } else if (updateStatus == TargetUpdateStatus.REGISTERED) { pinBtn.addStyleName(SPUIStyleDefinitions.STATUS_ICON_LIGHT_BLUE); } } }
java
public static void applyStatusLblStyle(final Table targetTable, final Button pinBtn, final Object itemId) { final Item item = targetTable.getItem(itemId); if (item != null) { final TargetUpdateStatus updateStatus = (TargetUpdateStatus) item .getItemProperty(SPUILabelDefinitions.VAR_TARGET_STATUS).getValue(); pinBtn.removeStyleName("statusIconRed statusIconBlue statusIconGreen statusIconYellow statusIconLightBlue"); if (updateStatus == TargetUpdateStatus.ERROR) { pinBtn.addStyleName(SPUIStyleDefinitions.STATUS_ICON_RED); } else if (updateStatus == TargetUpdateStatus.UNKNOWN) { pinBtn.addStyleName(SPUIStyleDefinitions.STATUS_ICON_BLUE); } else if (updateStatus == TargetUpdateStatus.IN_SYNC) { pinBtn.addStyleName(SPUIStyleDefinitions.STATUS_ICON_GREEN); } else if (updateStatus == TargetUpdateStatus.PENDING) { pinBtn.addStyleName(SPUIStyleDefinitions.STATUS_ICON_YELLOW); } else if (updateStatus == TargetUpdateStatus.REGISTERED) { pinBtn.addStyleName(SPUIStyleDefinitions.STATUS_ICON_LIGHT_BLUE); } } }
[ "public", "static", "void", "applyStatusLblStyle", "(", "final", "Table", "targetTable", ",", "final", "Button", "pinBtn", ",", "final", "Object", "itemId", ")", "{", "final", "Item", "item", "=", "targetTable", ".", "getItem", "(", "itemId", ")", ";", "if",...
Apply style for status label in target table. @param targetTable target table @param pinBtn pin button used for status display and pin on mouse over @param itemId id of the tabel row
[ "Apply", "style", "for", "status", "label", "in", "target", "table", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L434-L452
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.formattingFinishedPercentage
public static String formattingFinishedPercentage(final RolloutGroup rolloutGroup, final float finishedPercentage) { float tmpFinishedPercentage = 0; switch (rolloutGroup.getStatus()) { case READY: case SCHEDULED: case ERROR: tmpFinishedPercentage = 0.0F; break; case FINISHED: tmpFinishedPercentage = 100.0F; break; case RUNNING: tmpFinishedPercentage = finishedPercentage; break; default: break; } return String.format("%.1f", tmpFinishedPercentage); }
java
public static String formattingFinishedPercentage(final RolloutGroup rolloutGroup, final float finishedPercentage) { float tmpFinishedPercentage = 0; switch (rolloutGroup.getStatus()) { case READY: case SCHEDULED: case ERROR: tmpFinishedPercentage = 0.0F; break; case FINISHED: tmpFinishedPercentage = 100.0F; break; case RUNNING: tmpFinishedPercentage = finishedPercentage; break; default: break; } return String.format("%.1f", tmpFinishedPercentage); }
[ "public", "static", "String", "formattingFinishedPercentage", "(", "final", "RolloutGroup", "rolloutGroup", ",", "final", "float", "finishedPercentage", ")", "{", "float", "tmpFinishedPercentage", "=", "0", ";", "switch", "(", "rolloutGroup", ".", "getStatus", "(", ...
Formats the finished percentage of a rollout group into a string with one digit after comma. @param rolloutGroup the rollout group @param finishedPercentage the calculated finished percentage of the rolloutgroup @return formatted String value
[ "Formats", "the", "finished", "percentage", "of", "a", "rollout", "group", "into", "a", "string", "with", "one", "digit", "after", "comma", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L464-L482
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.getStatusLabelDetailsInString
public static String getStatusLabelDetailsInString(final String value, final String style, final String id) { final StringBuilder val = new StringBuilder(); if (!StringUtils.isEmpty(value)) { val.append("value:").append(value).append(","); } if (!StringUtils.isEmpty(style)) { val.append("style:").append(style).append(","); } return val.append("id:").append(id).toString(); }
java
public static String getStatusLabelDetailsInString(final String value, final String style, final String id) { final StringBuilder val = new StringBuilder(); if (!StringUtils.isEmpty(value)) { val.append("value:").append(value).append(","); } if (!StringUtils.isEmpty(style)) { val.append("style:").append(style).append(","); } return val.append("id:").append(id).toString(); }
[ "public", "static", "String", "getStatusLabelDetailsInString", "(", "final", "String", "value", ",", "final", "String", "style", ",", "final", "String", "id", ")", "{", "final", "StringBuilder", "val", "=", "new", "StringBuilder", "(", ")", ";", "if", "(", "...
Returns a formatted string as needed by label custom render .This string holds the properties of a status label. @param value label value @param style label style @param id label id @return formatted string
[ "Returns", "a", "formatted", "string", "as", "needed", "by", "label", "custom", "render", ".", "This", "string", "holds", "the", "properties", "of", "a", "status", "label", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L496-L505
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.getCodePoint
public static String getCodePoint(final StatusFontIcon statusFontIcon) { if (statusFontIcon == null) { return null; } return statusFontIcon.getFontIcon() != null ? Integer.toString(statusFontIcon.getFontIcon().getCodepoint()) : null; }
java
public static String getCodePoint(final StatusFontIcon statusFontIcon) { if (statusFontIcon == null) { return null; } return statusFontIcon.getFontIcon() != null ? Integer.toString(statusFontIcon.getFontIcon().getCodepoint()) : null; }
[ "public", "static", "String", "getCodePoint", "(", "final", "StatusFontIcon", "statusFontIcon", ")", "{", "if", "(", "statusFontIcon", "==", "null", ")", "{", "return", "null", ";", "}", "return", "statusFontIcon", ".", "getFontIcon", "(", ")", "!=", "null", ...
Receive the code point of a given StatusFontIcon. @param statusFontIcon the status font icon @return the code point of the StatusFontIcon
[ "Receive", "the", "code", "point", "of", "a", "given", "StatusFontIcon", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L514-L520
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.getCurrentLocale
public static Locale getCurrentLocale() { final UI currentUI = UI.getCurrent(); return currentUI == null ? Locale.getDefault() : currentUI.getLocale(); }
java
public static Locale getCurrentLocale() { final UI currentUI = UI.getCurrent(); return currentUI == null ? Locale.getDefault() : currentUI.getLocale(); }
[ "public", "static", "Locale", "getCurrentLocale", "(", ")", "{", "final", "UI", "currentUI", "=", "UI", ".", "getCurrent", "(", ")", ";", "return", "currentUI", "==", "null", "?", "Locale", ".", "getDefault", "(", ")", ":", "currentUI", ".", "getLocale", ...
Gets the locale of the current Vaadin UI. If the locale can not be determined, the default locale is returned instead. @return the current locale, never {@code null}. @see com.vaadin.ui.UI#getLocale() @see java.util.Locale#getDefault()
[ "Gets", "the", "locale", "of", "the", "current", "Vaadin", "UI", ".", "If", "the", "locale", "can", "not", "be", "determined", "the", "default", "locale", "is", "returned", "instead", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L530-L533
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.getArtifactoryDetailsLabelId
public static String getArtifactoryDetailsLabelId(final String name, final VaadinMessageSource i18n) { String caption; if (StringUtils.hasText(name)) { caption = i18n.getMessage(UIMessageIdProvider.CAPTION_ARTIFACT_DETAILS_OF, HawkbitCommonUtil.getBoldHTMLText(name)); } else { caption = i18n.getMessage(UIMessageIdProvider.CAPTION_ARTIFACT_DETAILS); } return getCaptionText(caption); }
java
public static String getArtifactoryDetailsLabelId(final String name, final VaadinMessageSource i18n) { String caption; if (StringUtils.hasText(name)) { caption = i18n.getMessage(UIMessageIdProvider.CAPTION_ARTIFACT_DETAILS_OF, HawkbitCommonUtil.getBoldHTMLText(name)); } else { caption = i18n.getMessage(UIMessageIdProvider.CAPTION_ARTIFACT_DETAILS); } return getCaptionText(caption); }
[ "public", "static", "String", "getArtifactoryDetailsLabelId", "(", "final", "String", "name", ",", "final", "VaadinMessageSource", "i18n", ")", "{", "String", "caption", ";", "if", "(", "StringUtils", ".", "hasText", "(", "name", ")", ")", "{", "caption", "=",...
Creates the caption of the Artifact Details table @param name name of the software module, if one is selected @param i18n VaadinMessageSource @return complete caption text of the table
[ "Creates", "the", "caption", "of", "the", "Artifact", "Details", "table" ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L554-L563
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.getLocaleToBeUsed
public static Locale getLocaleToBeUsed(final UiProperties.Localization localizationProperties, final Locale desiredLocale) { final List<String> availableLocals = localizationProperties.getAvailableLocals(); // ckeck if language code of UI locale matches an available local. // Country, region and variant are ignored. "availableLocals" must only // contain language codes without country or other extensions. if (availableLocals.contains(desiredLocale.getLanguage())) { return desiredLocale; } return new Locale(localizationProperties.getDefaultLocal()); }
java
public static Locale getLocaleToBeUsed(final UiProperties.Localization localizationProperties, final Locale desiredLocale) { final List<String> availableLocals = localizationProperties.getAvailableLocals(); // ckeck if language code of UI locale matches an available local. // Country, region and variant are ignored. "availableLocals" must only // contain language codes without country or other extensions. if (availableLocals.contains(desiredLocale.getLanguage())) { return desiredLocale; } return new Locale(localizationProperties.getDefaultLocal()); }
[ "public", "static", "Locale", "getLocaleToBeUsed", "(", "final", "UiProperties", ".", "Localization", "localizationProperties", ",", "final", "Locale", "desiredLocale", ")", "{", "final", "List", "<", "String", ">", "availableLocals", "=", "localizationProperties", "....
Determine the language that should be used considering localization properties and a desired Locale @param localizationProperties UI Localization settings @param desiredLocale desired Locale @return Locale to be used according to UI and properties
[ "Determine", "the", "language", "that", "should", "be", "used", "considering", "localization", "properties", "and", "a", "desired", "Locale" ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L575-L585
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java
HawkbitCommonUtil.initLocalization
public static void initLocalization(final UI ui, final Localization localizationProperties, final VaadinMessageSource i18n) { ui.setLocale(HawkbitCommonUtil.getLocaleToBeUsed(localizationProperties, ui.getSession().getLocale())); ui.getReconnectDialogConfiguration() .setDialogText(i18n.getMessage(UIMessageIdProvider.VAADIN_SYSTEM_TRYINGRECONNECT)); }
java
public static void initLocalization(final UI ui, final Localization localizationProperties, final VaadinMessageSource i18n) { ui.setLocale(HawkbitCommonUtil.getLocaleToBeUsed(localizationProperties, ui.getSession().getLocale())); ui.getReconnectDialogConfiguration() .setDialogText(i18n.getMessage(UIMessageIdProvider.VAADIN_SYSTEM_TRYINGRECONNECT)); }
[ "public", "static", "void", "initLocalization", "(", "final", "UI", "ui", ",", "final", "Localization", "localizationProperties", ",", "final", "VaadinMessageSource", "i18n", ")", "{", "ui", ".", "setLocale", "(", "HawkbitCommonUtil", ".", "getLocaleToBeUsed", "(", ...
Set localization considering properties and UI settings. @param ui UI to setup @param localizationProperties UI localization settings @param i18n Localization message source
[ "Set", "localization", "considering", "properties", "and", "UI", "settings", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java#L597-L602
train
eclipse/hawkbit
hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/DistributionSetMetadataDetailsLayout.java
DistributionSetMetadataDetailsLayout.populateDSMetadata
public void populateDSMetadata(final DistributionSet distributionSet) { removeAllItems(); if (null == distributionSet) { return; } selectedDistSetId = distributionSet.getId(); final List<DistributionSetMetadata> dsMetadataList = distributionSetManagement .findMetaDataByDistributionSetId(PageRequest.of(0, MAX_METADATA_QUERY), selectedDistSetId).getContent(); if (null != dsMetadataList && !dsMetadataList.isEmpty()) { dsMetadataList.forEach(this::setMetadataProperties); } }
java
public void populateDSMetadata(final DistributionSet distributionSet) { removeAllItems(); if (null == distributionSet) { return; } selectedDistSetId = distributionSet.getId(); final List<DistributionSetMetadata> dsMetadataList = distributionSetManagement .findMetaDataByDistributionSetId(PageRequest.of(0, MAX_METADATA_QUERY), selectedDistSetId).getContent(); if (null != dsMetadataList && !dsMetadataList.isEmpty()) { dsMetadataList.forEach(this::setMetadataProperties); } }
[ "public", "void", "populateDSMetadata", "(", "final", "DistributionSet", "distributionSet", ")", "{", "removeAllItems", "(", ")", ";", "if", "(", "null", "==", "distributionSet", ")", "{", "return", ";", "}", "selectedDistSetId", "=", "distributionSet", ".", "ge...
Populate distribution set metadata. @param distributionSet
[ "Populate", "distribution", "set", "metadata", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/DistributionSetMetadataDetailsLayout.java#L61-L72
train
eclipse/hawkbit
hawkbit-dmf/hawkbit-dmf-api/src/main/java/org/eclipse/hawkbit/dmf/json/model/DmfDownloadAndUpdateRequest.java
DmfDownloadAndUpdateRequest.addSoftwareModule
public void addSoftwareModule(final DmfSoftwareModule createSoftwareModule) { if (softwareModules == null) { softwareModules = new ArrayList<>(); } softwareModules.add(createSoftwareModule); }
java
public void addSoftwareModule(final DmfSoftwareModule createSoftwareModule) { if (softwareModules == null) { softwareModules = new ArrayList<>(); } softwareModules.add(createSoftwareModule); }
[ "public", "void", "addSoftwareModule", "(", "final", "DmfSoftwareModule", "createSoftwareModule", ")", "{", "if", "(", "softwareModules", "==", "null", ")", "{", "softwareModules", "=", "new", "ArrayList", "<>", "(", ")", ";", "}", "softwareModules", ".", "add",...
Add a Software module. @param createSoftwareModule the module
[ "Add", "a", "Software", "module", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-dmf/hawkbit-dmf-api/src/main/java/org/eclipse/hawkbit/dmf/json/model/DmfDownloadAndUpdateRequest.java#L56-L63
train
eclipse/hawkbit
hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaTenantConfigurationManagement.java
JpaTenantConfigurationManagement.validateTenantConfigurationDataType
static <T> void validateTenantConfigurationDataType(final TenantConfigurationKey configurationKey, final Class<T> propertyType) { if (!configurationKey.getDataType().isAssignableFrom(propertyType)) { throw new TenantConfigurationValidatorException( String.format("Cannot parse the database value of type %s into the type %s.", configurationKey.getDataType(), propertyType)); } }
java
static <T> void validateTenantConfigurationDataType(final TenantConfigurationKey configurationKey, final Class<T> propertyType) { if (!configurationKey.getDataType().isAssignableFrom(propertyType)) { throw new TenantConfigurationValidatorException( String.format("Cannot parse the database value of type %s into the type %s.", configurationKey.getDataType(), propertyType)); } }
[ "static", "<", "T", ">", "void", "validateTenantConfigurationDataType", "(", "final", "TenantConfigurationKey", "configurationKey", ",", "final", "Class", "<", "T", ">", "propertyType", ")", "{", "if", "(", "!", "configurationKey", ".", "getDataType", "(", ")", ...
Validates the data type of the tenant configuration. If it is possible to cast to the given data type. @param configurationKey the key @param propertyType the class
[ "Validates", "the", "data", "type", "of", "the", "tenant", "configuration", ".", "If", "it", "is", "possible", "to", "cast", "to", "the", "given", "data", "type", "." ]
9884452ad42f3b4827461606d8a9215c8625a7fe
https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaTenantConfigurationManagement.java#L75-L83
train