From b9c389d8dbb93449b1a1a63e52f1b94ab175cbf9 Mon Sep 17 00:00:00 2001 From: venu1278 Date: Fri, 15 Apr 2016 15:22:16 +0530 Subject: [PATCH] Rollout management issues Signed-off-by: venu1278 --- .../renderers/CustomObjectRenederer.java | 5 + .../renderers/CustomObjectRenderer.java | 20 +- .../ui/rollout/rollout/ProxyRollout.java | 2 +- .../ui/rollout/rollout/RolloutListGrid.java | 11 +- .../rolloutgroup/ProxyRolloutGroup.java | 316 +++++++++--------- 5 files changed, 187 insertions(+), 167 deletions(-) diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/CustomObjectRenederer.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/CustomObjectRenederer.java index 7931e9f84..262648178 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/CustomObjectRenederer.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/CustomObjectRenederer.java @@ -13,6 +13,11 @@ import com.vaadin.client.renderers.ClickableRenderer; import com.vaadin.client.ui.VButton; import com.vaadin.client.widget.grid.RendererCellReference; +/** + * Renders button with provided CustomObject. + * Used to display button with link. + * + */ public class CustomObjectRenederer extends ClickableRenderer { @Override diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/CustomObjectRenderer.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/CustomObjectRenderer.java index ae555f897..02eca1bf9 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/CustomObjectRenderer.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/CustomObjectRenderer.java @@ -15,26 +15,36 @@ import com.vaadin.ui.renderers.ClickableRenderer; import elemental.json.JsonValue; +/** + * Renders button with provided CustomObject. + * Used to display button with link. + * + */ + public class CustomObjectRenderer extends ClickableRenderer { - /** - * - */ private static final long serialVersionUID = -8754180585906263554L; /** - * Creates a new image renderer. + * Creates a new custom object renderer. */ public CustomObjectRenderer() { super(CustomObject.class, null); } + + /** + * Initialize custom object renderer with {@link Class} + * + * @param presentationType + * Class + */ public CustomObjectRenderer(Class presentationType) { super(presentationType); } /** - * Creates a new image renderer and adds the given click listener to it. + * Creates a new custom object renderer and adds the given click listener to it. * * @param listener * the click listener to register diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/ProxyRollout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/ProxyRollout.java index 36cb7ddee..6649d7dcb 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/ProxyRollout.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/ProxyRollout.java @@ -14,7 +14,7 @@ import org.eclipse.hawkbit.ui.customrenderers.client.renderers.CustomObject; import com.vaadin.server.FontAwesome; /** - * Proxy rollout with suctome properties. + * Proxy rollout with custom properties. * */ public class ProxyRollout extends Rollout { diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java index f8da4b269..65f94aee6 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java @@ -97,6 +97,10 @@ public class RolloutListGrid extends AbstractGrid { private transient Map statusIconMap = new EnumMap<>(RolloutStatus.class); + /** + * Handles the RolloutEvent to refresh Grid. + * + */ @EventBusListenerMethod(scope = EventScope.SESSION) void onEvent(final RolloutEvent event) { switch (event) { @@ -419,6 +423,9 @@ public class RolloutListGrid extends AbstractGrid { ((LazyQueryContainer) getContainerDataSource()).refresh(); } + /** + * Generator to generate fontIcon by String. + */ public final class FontIconGenerator extends PropertyValueGenerator { private static final long serialVersionUID = 2544026030795375748L; @@ -585,11 +592,9 @@ public class RolloutListGrid extends AbstractGrid { } /** - * - * Converter to convert 0 to empty , if total target groups is zero. + * Converter to convert 0 to empty, if total target groups is zero. * */ - class TotalTargetGroupsConverter implements Converter { private static final long serialVersionUID = 6589305227035220369L; diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/ProxyRolloutGroup.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/ProxyRolloutGroup.java index 3033ff02c..71fe2aa8e 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/ProxyRolloutGroup.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/ProxyRolloutGroup.java @@ -12,36 +12,36 @@ import org.eclipse.hawkbit.repository.model.RolloutGroup; import org.eclipse.hawkbit.ui.customrenderers.client.renderers.CustomObject; /** - * Proxy rollout group with suctome properties. + * Proxy rollout group with custom properties. * */ public class ProxyRolloutGroup extends RolloutGroup { - private static final long serialVersionUID = -2745056813306692356L; + private static final long serialVersionUID = -2745056813306692356L; - private String createdDate; + private String createdDate; - private String modifiedDate; + private String modifiedDate; - private String finishedPercentage; + private String finishedPercentage; - private Long runningTargetsCount; + private Long runningTargetsCount; - private Long scheduledTargetsCount; + private Long scheduledTargetsCount; - private Long cancelledTargetsCount; + private Long cancelledTargetsCount; - private Long errorTargetsCount; + private Long errorTargetsCount; - private Long finishedTargetsCount; + private Long finishedTargetsCount; - private Long notStartedTargetsCount; + private Long notStartedTargetsCount; - private Boolean isActionRecieved = Boolean.FALSE; + private Boolean isActionRecieved = Boolean.FALSE; - private String totalTargetsCount; - - private CustomObject customObject; + private String totalTargetsCount; + + private CustomObject customObject; public CustomObject getCustomObject() { return customObject; @@ -51,169 +51,169 @@ public class ProxyRolloutGroup extends RolloutGroup { this.customObject = customObject; } - /** - * @return the createdDate - */ - public String getCreatedDate() { - return createdDate; - } + /** + * @return the createdDate + */ + public String getCreatedDate() { + return createdDate; + } - /** - * @param createdDate - * the createdDate to set - */ - public void setCreatedDate(final String createdDate) { - this.createdDate = createdDate; - } + /** + * @param createdDate + * the createdDate to set + */ + public void setCreatedDate(final String createdDate) { + this.createdDate = createdDate; + } - /** - * @return the modifiedDate - */ - public String getModifiedDate() { - return modifiedDate; - } + /** + * @return the modifiedDate + */ + public String getModifiedDate() { + return modifiedDate; + } - /** - * @param modifiedDate - * the modifiedDate to set - */ - public void setModifiedDate(final String modifiedDate) { - this.modifiedDate = modifiedDate; - } + /** + * @param modifiedDate + * the modifiedDate to set + */ + public void setModifiedDate(final String modifiedDate) { + this.modifiedDate = modifiedDate; + } - /** - * @return the finishedPercentage - */ - public String getFinishedPercentage() { - return finishedPercentage; - } + /** + * @return the finishedPercentage + */ + public String getFinishedPercentage() { + return finishedPercentage; + } - /** - * @param finishedPercentage - * the finishedPercentage to set - */ - public void setFinishedPercentage(final String finishedPercentage) { - this.finishedPercentage = finishedPercentage; - } + /** + * @param finishedPercentage + * the finishedPercentage to set + */ + public void setFinishedPercentage(final String finishedPercentage) { + this.finishedPercentage = finishedPercentage; + } - /** - * @return the runningTargetsCount - */ - public Long getRunningTargetsCount() { - return runningTargetsCount; - } + /** + * @return the runningTargetsCount + */ + public Long getRunningTargetsCount() { + return runningTargetsCount; + } - /** - * @param runningTargetsCount - * the runningTargetsCount to set - */ - public void setRunningTargetsCount(final Long runningTargetsCount) { - this.runningTargetsCount = runningTargetsCount; - } + /** + * @param runningTargetsCount + * the runningTargetsCount to set + */ + public void setRunningTargetsCount(final Long runningTargetsCount) { + this.runningTargetsCount = runningTargetsCount; + } - /** - * @return the scheduledTargetsCount - */ - public Long getScheduledTargetsCount() { - return scheduledTargetsCount; - } + /** + * @return the scheduledTargetsCount + */ + public Long getScheduledTargetsCount() { + return scheduledTargetsCount; + } - /** - * @param scheduledTargetsCount - * the scheduledTargetsCount to set - */ - public void setScheduledTargetsCount(final Long scheduledTargetsCount) { - this.scheduledTargetsCount = scheduledTargetsCount; - } + /** + * @param scheduledTargetsCount + * the scheduledTargetsCount to set + */ + public void setScheduledTargetsCount(final Long scheduledTargetsCount) { + this.scheduledTargetsCount = scheduledTargetsCount; + } - /** - * @return the cancelledTargetsCount - */ - public Long getCancelledTargetsCount() { - return cancelledTargetsCount; - } + /** + * @return the cancelledTargetsCount + */ + public Long getCancelledTargetsCount() { + return cancelledTargetsCount; + } - /** - * @param cancelledTargetsCount - * the cancelledTargetsCount to set - */ - public void setCancelledTargetsCount(final Long cancelledTargetsCount) { - this.cancelledTargetsCount = cancelledTargetsCount; - } + /** + * @param cancelledTargetsCount + * the cancelledTargetsCount to set + */ + public void setCancelledTargetsCount(final Long cancelledTargetsCount) { + this.cancelledTargetsCount = cancelledTargetsCount; + } - /** - * @return the errorTargetsCount - */ - public Long getErrorTargetsCount() { - return errorTargetsCount; - } + /** + * @return the errorTargetsCount + */ + public Long getErrorTargetsCount() { + return errorTargetsCount; + } - /** - * @param errorTargetsCount - * the errorTargetsCount to set - */ - public void setErrorTargetsCount(final Long errorTargetsCount) { - this.errorTargetsCount = errorTargetsCount; - } + /** + * @param errorTargetsCount + * the errorTargetsCount to set + */ + public void setErrorTargetsCount(final Long errorTargetsCount) { + this.errorTargetsCount = errorTargetsCount; + } - /** - * @return the finishedTargetsCount - */ - public Long getFinishedTargetsCount() { - return finishedTargetsCount; - } + /** + * @return the finishedTargetsCount + */ + public Long getFinishedTargetsCount() { + return finishedTargetsCount; + } - /** - * @param finishedTargetsCount - * the finishedTargetsCount to set - */ - public void setFinishedTargetsCount(final Long finishedTargetsCount) { - this.finishedTargetsCount = finishedTargetsCount; - } + /** + * @param finishedTargetsCount + * the finishedTargetsCount to set + */ + public void setFinishedTargetsCount(final Long finishedTargetsCount) { + this.finishedTargetsCount = finishedTargetsCount; + } - /** - * @return the notStartedTargetsCount - */ - public Long getNotStartedTargetsCount() { - return notStartedTargetsCount; - } + /** + * @return the notStartedTargetsCount + */ + public Long getNotStartedTargetsCount() { + return notStartedTargetsCount; + } - /** - * @param notStartedTargetsCount - * the notStartedTargetsCount to set - */ - public void setNotStartedTargetsCount(final Long notStartedTargetsCount) { - this.notStartedTargetsCount = notStartedTargetsCount; - } + /** + * @param notStartedTargetsCount + * the notStartedTargetsCount to set + */ + public void setNotStartedTargetsCount(final Long notStartedTargetsCount) { + this.notStartedTargetsCount = notStartedTargetsCount; + } - /** - * @return the isActionRecieved - */ - public Boolean getIsActionRecieved() { - return isActionRecieved; - } + /** + * @return the isActionRecieved + */ + public Boolean getIsActionRecieved() { + return isActionRecieved; + } - /** - * @param isActionRecieved - * the isActionRecieved to set - */ - public void setIsActionRecieved(final Boolean isActionRecieved) { - this.isActionRecieved = isActionRecieved; - } + /** + * @param isActionRecieved + * the isActionRecieved to set + */ + public void setIsActionRecieved(final Boolean isActionRecieved) { + this.isActionRecieved = isActionRecieved; + } - /** - * @return the totalTargetsCount - */ - public String getTotalTargetsCount() { - return totalTargetsCount; - } + /** + * @return the totalTargetsCount + */ + public String getTotalTargetsCount() { + return totalTargetsCount; + } - /** - * @param totalTargetsCount - * the totalTargetsCount to set - */ - public void setTotalTargetsCount(final String totalTargetsCount) { - this.totalTargetsCount = totalTargetsCount; - } + /** + * @param totalTargetsCount + * the totalTargetsCount to set + */ + public void setTotalTargetsCount(final String totalTargetsCount) { + this.totalTargetsCount = totalTargetsCount; + } }