Greg Sheremeta has uploaded a new change for review. Change subject: webadmin: extract static classes ......................................................................
webadmin: extract static classes (Patch 4u of 12) Exracted EnabledDisabledCheckboxCell and EnabledDisabledRadioCell from being static classes inside AbstractCheckboxColumn. No logic changes. Just a move. Change-Id: I6fe2b1d51655be5e3f07c837ed403d66e381dd78 Signed-off-by: Greg Sheremeta <gsher...@redhat.com> --- M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/AbstractCheckboxColumn.java A frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/EnabledDisabledCheckboxCell.java A frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/EnabledDisabledRadioCell.java 3 files changed, 45 insertions(+), 30 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/33/38633/1 diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/AbstractCheckboxColumn.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/AbstractCheckboxColumn.java index ea54999..9b6c160 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/AbstractCheckboxColumn.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/AbstractCheckboxColumn.java @@ -2,12 +2,9 @@ import java.util.Comparator; -import org.ovirt.engine.ui.common.widget.table.cell.EventHandlingCell; -import org.ovirt.engine.ui.common.widget.table.cell.RadioboxCell; import org.ovirt.engine.ui.uicommonweb.models.EntityModel; import com.google.gwt.cell.client.Cell.Context; -import com.google.gwt.cell.client.CheckboxCell; import com.google.gwt.cell.client.FieldUpdater; import com.google.gwt.dom.client.BrowserEvents; import com.google.gwt.dom.client.Element; @@ -22,33 +19,7 @@ private boolean centered = false; private boolean multipleSelectionAllowed = true; - static class EnabledDisabledCheckboxCell extends CheckboxCell implements EventHandlingCell { - - public EnabledDisabledCheckboxCell() { - super(true, false); - } - - @Override - public boolean handlesEvent(CellPreviewEvent<EntityModel> event) { - return AbstractCheckboxColumn.handlesEvent(event); - } - - } - - static class EnabledDisabledRadioCell extends RadioboxCell implements EventHandlingCell { - - public EnabledDisabledRadioCell() { - super(true, false); - } - - @Override - public boolean handlesEvent(CellPreviewEvent<EntityModel> event) { - return AbstractCheckboxColumn.handlesEvent(event); - } - - } - - private static boolean handlesEvent(CellPreviewEvent<EntityModel> event) { + static boolean handlesEvent(CellPreviewEvent<EntityModel> event) { NativeEvent nativeEvent = event.getNativeEvent(); if (!BrowserEvents.CLICK.equals(nativeEvent.getType())) { return false; diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/EnabledDisabledCheckboxCell.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/EnabledDisabledCheckboxCell.java new file mode 100644 index 0000000..5b0d30f --- /dev/null +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/EnabledDisabledCheckboxCell.java @@ -0,0 +1,23 @@ +package org.ovirt.engine.ui.common.widget.table.column; + +import org.ovirt.engine.ui.common.widget.table.cell.EventHandlingCell; +import org.ovirt.engine.ui.uicommonweb.models.EntityModel; + +import com.google.gwt.cell.client.CheckboxCell; +import com.google.gwt.view.client.CellPreviewEvent; + +/** + * A Cell that renders a checkbox. + */ +public class EnabledDisabledCheckboxCell extends CheckboxCell implements EventHandlingCell { + + public EnabledDisabledCheckboxCell() { + super(true, false); + } + + @Override + public boolean handlesEvent(CellPreviewEvent<EntityModel> event) { + return AbstractCheckboxColumn.handlesEvent(event); + } + +} diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/EnabledDisabledRadioCell.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/EnabledDisabledRadioCell.java new file mode 100644 index 0000000..157b633 --- /dev/null +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/column/EnabledDisabledRadioCell.java @@ -0,0 +1,21 @@ +package org.ovirt.engine.ui.common.widget.table.column; + +import org.ovirt.engine.ui.common.widget.table.cell.EventHandlingCell; +import org.ovirt.engine.ui.common.widget.table.cell.RadioboxCell; +import org.ovirt.engine.ui.uicommonweb.models.EntityModel; + +import com.google.gwt.view.client.CellPreviewEvent; + +public class EnabledDisabledRadioCell extends RadioboxCell implements EventHandlingCell { + + public EnabledDisabledRadioCell() { + super(true, false); + } + + @Override + public boolean handlesEvent(CellPreviewEvent<EntityModel> event) { + return AbstractCheckboxColumn.handlesEvent(event); + } + +} + -- To view, visit https://gerrit.ovirt.org/38633 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6fe2b1d51655be5e3f07c837ed403d66e381dd78 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Greg Sheremeta <gsher...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches