Change in ovirt-engine[master]: webadmin, userportal: Resizable table columns

vszocs at redhat.com vszocs at redhat.com
Wed Oct 3 17:15:00 UTC 2012


Vojtech Szocs has submitted this change and it was merged.

Change subject: webadmin,userportal: Resizable table columns
......................................................................


webadmin,userportal: Resizable table columns

This patch introduces resizable table columns feature into gwt-common
module through the action table widget.

Table columns can now be resized (have their widths changed) by dragging
their right-hand border using mouse. Each resizable column has a 'resize
bar area' on the right-hand side of its header. Whenever mouse hovers
over this area, mouse cursor changes shape to indicate that column resize
operation can begin.

This implementation is suitable for HTML tables with 'table-layout:fixed'
and 'width:100%' CSS attributes. An empty, no-width column at the end of
the table is used to avoid actual columns being proportionally stretched
(or shrinked) by the browser's table layout engine. As a result, resizing
one column will have no impact on other columns, given that all columns
(except the empty one) have their widths defined in pixel (PX) units.

Furthermore, this implementation adds following features:

1. support horizontal scroll bar when total column width exceeds table
   display width

2. support minimum column width

3. visually highlight column header during column resize operation

Each column SHOULD have an explicit width defined in pixel (PX) units.
Any columns without explicit width will be proportionally resized by
the browser's table layout engine.

This feature is turned off by default. Following code shows how to turn
it on.

void initTable() {
  getTable().enableColumnResizing(); // must be called first
  getTable().addColumn(columnOne, "Foo", "50px"); // explicit PX width
  getTable().addColumn(columnTwo, "Bar", "200px"); // explicit PX width
  ...
}

Tested on FireFox 10 and Internet Explorer 8.

Change-Id: Idbb8c32e1858a6e7810d1af9a82166e3790803f8
Signed-off-by: Vojtech Szocs <vszocs at redhat.com>
---
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/presenter/AbstractSubTabPresenter.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/AbstractSubTabFormView.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/AbstractSubTabTableWidgetView.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/view/AbstractSubTabTreeWidgetView.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/AbstractActionTable.java
M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/SimpleActionTable.ui.xml
A frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/resize/ColumnResizeHandler.java
A frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/resize/HasResizableColumns.java
A frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/resize/ResizableHeader.java
A frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/resize/ResizableHeaderCell.java
M frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/ui/common/css/PopupCellTable.css
M frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/ui/common/css/PopupSimpleCellTable.css
M frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/ui/common/css/SanStorageListLunTable.css
M frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/ui/common/css/SanStorageListTargetTable.css
M frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/ui/common/css/TabCellTable.css
M frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/ui/common/css/TabCellTableHeaderless.css
M frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/presenter/AbstractSideTabWithDetailsPresenter.java
M frontend/webadmin/modules/userportal-gwtp/src/main/java/org/ovirt/engine/ui/userportal/section/main/view/AbstractSideTabWithDetailsView.java
M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/AbstractMainTabWithDetailsPresenter.java
M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/AbstractMainTabWithDetailsTableView.java
M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/AbstractSubTabTableView.java
M frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/webadmin/css/FooterHeaderlessTable.css
M frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/webadmin/css/IVdcQueryableCellTable.css
23 files changed, 501 insertions(+), 99 deletions(-)

Approvals:
  Vojtech Szocs: Verified; Looks good to me, approved


--
To view, visit http://gerrit.ovirt.org/5243
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Idbb8c32e1858a6e7810d1af9a82166e3790803f8
Gerrit-PatchSet: 13
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Vojtech Szocs <vszocs at redhat.com>
Gerrit-Reviewer: Daniel Erez <derez at redhat.com>
Gerrit-Reviewer: Einav Cohen <ecohen at redhat.com>
Gerrit-Reviewer: Vojtech Szocs <vszocs at redhat.com>



More information about the Engine-commits mailing list