Lior Vernia has uploaded a new change for review. Change subject: webadmin: Remove redundant header splitter ......................................................................
webadmin: Remove redundant header splitter The styling of ResizableHeader added a right border, which is redundant in the case of an EntityModelCellTable because there's always the left border of the next column header (as opposed to ActionCellTable whose styling works differently). Change-Id: Ied14df6f093514e26bbeb3dc60e509d58d056dae Bug-Url: https://bugzilla.redhat.com/1125192 Signed-off-by: Lior Vernia <[email protected]> (cherry picked from commit 034ea2168126a63c2fd4cf629581ef3a438fbbc0) --- M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/EntityModelCellTable.java M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/resize/ColumnResizeCellTable.java M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/resize/ResizableHeader.java 3 files changed, 27 insertions(+), 6 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/60/31860/1 diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/EntityModelCellTable.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/EntityModelCellTable.java index 027e775..c33e0ad 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/EntityModelCellTable.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/EntityModelCellTable.java @@ -186,6 +186,7 @@ boolean showSelectAllCheckbox) { super(DEFAULT_PAGESIZE, resources); + dontApplyResizableHeaderStyle(); style = cellTableResources.cellTableValidation(); style.ensureInjected(); diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/resize/ColumnResizeCellTable.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/resize/ColumnResizeCellTable.java index 1330369..37216d9 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/resize/ColumnResizeCellTable.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/resize/ColumnResizeCellTable.java @@ -51,6 +51,7 @@ private boolean columnResizingEnabled = false; private boolean columnResizePersistenceEnabled = false; + private boolean applyResizableHeaderStyle = true; // used to store column width preferences private ClientStorage clientStorage; @@ -184,7 +185,7 @@ } Header<?> createHeader(Column<T, ?> column, SafeHtml headerHtml) { - return columnResizingEnabled ? new ResizableHeader<T>(headerHtml, column, this) + return columnResizingEnabled ? new ResizableHeader<T>(headerHtml, column, this, applyResizableHeaderStyle) : createSafeHtmlHeader(headerHtml); } @@ -374,4 +375,8 @@ return null; } + protected void dontApplyResizableHeaderStyle() { + applyResizableHeaderStyle = false; + } + } diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/resize/ResizableHeader.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/resize/ResizableHeader.java index 50b7706..50614fc 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/resize/ResizableHeader.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/resize/ResizableHeader.java @@ -98,18 +98,19 @@ */ private final ResizableHeaderCss style; + private final boolean applyStyle; + /** * Constructor. * @param text The contents of the header. * @param column The column associated with the header. * @param table The table containing the header/column. */ - public ResizableHeader(SafeHtml text, Column<T, ?> column, HasResizableColumns<T> table) { - this(text, column, table, new SafeHtmlCellWithTooltip( - BrowserEvents.CLICK, + public ResizableHeader(SafeHtml text, Column<T, ?> column, HasResizableColumns<T> table, boolean applyStyle) { + this(text, column, table, new SafeHtmlCellWithTooltip(BrowserEvents.CLICK, BrowserEvents.MOUSEDOWN, BrowserEvents.MOUSEMOVE, - BrowserEvents.MOUSEOVER)); + BrowserEvents.MOUSEOVER), applyStyle); } /** @@ -121,17 +122,31 @@ */ public ResizableHeader(SafeHtml text, Column<T, ?> column, HasResizableColumns<T> table, Cell<SafeHtml> cell) { + this(text, column, table, cell, true); + } + + /** + * Constructor. + * @param text The contents of the header. + * @param column The column associated with the header. + * @param table The table containing the header/column. + * @param cell The cell that defines the header cell. + * @param applyStyle Whether to apply default styling. + */ + public ResizableHeader(SafeHtml text, Column<T, ?> column, HasResizableColumns<T> table, + Cell<SafeHtml> cell, boolean applyStyle) { super(cell); style = RESOURCES.resizableHeaderCss(); style.ensureInjected(); this.text = text; this.column = column; this.table = table; + this.applyStyle = applyStyle; } @Override public SafeHtml getValue() { - return TEMPLATE.templatedContent(style.cellTableHeaderContent(), text); + return applyStyle ? TEMPLATE.templatedContent(style.cellTableHeaderContent(), text) : text; } @Override -- To view, visit http://gerrit.ovirt.org/31860 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ied14df6f093514e26bbeb3dc60e509d58d056dae Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.5 Gerrit-Owner: Lior Vernia <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
