Alona Kaplan has uploaded a new change for review. Change subject: webadmin: modify StatusCompositeCellWithElementId to support any cell ......................................................................
webadmin: modify StatusCompositeCellWithElementId to support any cell Due to generic restriction StatusCompositeCellWithElementId supported only cell with VM data type. Since there is no specific use for VM data type, the generic was modified to support any data type. Change-Id: Ia5c619dc1086c417ef25100fa538f9581a046ad1 Signed-off-by: Alona Kaplan <[email protected]> --- M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/cell/StatusCompositeCellWithElementId.java 1 file changed, 9 insertions(+), 10 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/01/38301/1 diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/cell/StatusCompositeCellWithElementId.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/cell/StatusCompositeCellWithElementId.java index 692170d..37a1f66 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/cell/StatusCompositeCellWithElementId.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/cell/StatusCompositeCellWithElementId.java @@ -2,7 +2,6 @@ import java.util.List; -import org.ovirt.engine.core.common.businessentities.VM; import org.ovirt.engine.ui.common.utils.ElementIdUtils; import org.ovirt.engine.ui.common.widget.table.HasStyleClass; @@ -16,7 +15,7 @@ import com.google.gwt.safehtml.shared.SafeHtml; import com.google.gwt.safehtml.shared.SafeHtmlBuilder; -public class StatusCompositeCellWithElementId extends CompositeCellWithElementId<VM> implements CellWithElementId<VM> { +public class StatusCompositeCellWithElementId<C> extends CompositeCellWithElementId<C> implements CellWithElementId<C> { public interface StatusCompositeCellResources extends ClientBundle { @ClientBundle.Source("org/ovirt/engine/ui/common/css/StatusCompositeCell.css") StatusCompositeCellCss statusCompositeCellCss(); @@ -33,11 +32,11 @@ private static final StatusCompositeCellResources RESOURCES = GWT.create(StatusCompositeCellResources.class); private final StatusCompositeCellCss style; - private final List<HasCell<VM, ?>> hasCells; + private final List<HasCell<C, ?>> hasCells; private ContentTemplate template; - public StatusCompositeCellWithElementId(List<HasCell<VM, ?>> hasCells) { + public StatusCompositeCellWithElementId(List<HasCell<C, ?>> hasCells) { super(hasCells); this.hasCells = hasCells; style = RESOURCES.statusCompositeCellCss(); @@ -52,11 +51,11 @@ } @Override - public void render(Cell.Context context, VM value, SafeHtmlBuilder sb) { + public void render(Cell.Context context, C value, SafeHtmlBuilder sb) { sb.append(getTemplate().id(ElementIdUtils.createTableCellElementId( getElementIdPrefix(), getColumnId(), context))); - for (HasCell<VM, ?> hasCell : hasCells) { + for (HasCell<C, ?> hasCell : hasCells) { render(context, value, sb, hasCell); } @@ -64,8 +63,8 @@ } @Override - protected <T> void render(Cell.Context context, VM value, - SafeHtmlBuilder sb, HasCell<VM, T> hasCell) { + protected <T> void render(Cell.Context context, C value, + SafeHtmlBuilder sb, HasCell<C, T> hasCell) { Cell<T> cell = hasCell.getCell(); if (cell instanceof HasStyleClass) { ((HasStyleClass) cell).setStyleClass(style.divInlineBlock()); @@ -74,12 +73,12 @@ } @Override - public boolean isEditing(Context context, Element parent, VM value) { + public boolean isEditing(Context context, Element parent, C value) { return false; } @Override - public boolean resetFocus(Context context, Element parent, VM value) { + public boolean resetFocus(Context context, Element parent, C value) { return false; } } -- To view, visit https://gerrit.ovirt.org/38301 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia5c619dc1086c417ef25100fa538f9581a046ad1 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alona Kaplan <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
