Greg Sheremeta has uploaded a new change for review.

Change subject: userportal, webadmin: added optional underlining to column 
headers
......................................................................

userportal, webadmin: added optional underlining to column headers

Some column headers require underlining when they have a tooltip set
(to indicate that the user can hover over them for a tooltip). Added
functionality to SafeHtmlHeader to achieve this.

Change-Id: I2d1e2094410dae6a33897401aa83a2212ef645fd
Signed-off-by: Greg Sheremeta <gsher...@redhat.com>
---
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/header/SafeHtmlHeader.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterManageNetworkPopupView.java
M packaging/branding/ovirt.brand/ovirt.css
3 files changed, 31 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/26/40626/1

diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/header/SafeHtmlHeader.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/header/SafeHtmlHeader.java
index 2ccbfe2..dd28a12 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/header/SafeHtmlHeader.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/table/header/SafeHtmlHeader.java
@@ -6,12 +6,17 @@
 import org.ovirt.engine.ui.common.widget.table.cell.SafeHtmlCell;
 import org.ovirt.engine.ui.common.widget.table.column.ColumnWithElementId;
 
+import com.google.gwt.core.client.GWT;
 import com.google.gwt.dom.client.BrowserEvents;
+import com.google.gwt.safehtml.client.SafeHtmlTemplates;
 import com.google.gwt.safehtml.shared.SafeHtml;
 import com.google.gwt.safehtml.shared.SafeHtmlUtils;
 
 /**
  * A Header that renders SafeHtml. Supports tooltips. Supports element-id 
framework.
+ *
+ * If you want to show an underline on the header to indicate the presence of 
a tooltip, use the
+ * constructor with showUnderline and set it to true.
  *
  * @param <H> Cell data type.
  */
@@ -19,8 +24,16 @@
 
     private SafeHtml headerText;
     private SafeHtml tooltipText;
+    boolean showUnderline = false;
 
     public static final SafeHtmlHeader BLANK_HEADER = new 
SafeHtmlHeader(SafeHtmlUtils.fromSafeConstant("")); //$NON-NLS-1$
+
+    interface CellTemplate extends SafeHtmlTemplates {
+        @Template("<span class=\"underlinedHeader\">{0}</span>")
+        SafeHtml underlinedHeader(SafeHtml html);
+    }
+
+    private static final CellTemplate templates = 
GWT.create(CellTemplate.class);
 
     public SafeHtmlHeader(SafeHtmlCell cell) {
         super(cell);
@@ -37,6 +50,11 @@
 
     public SafeHtmlHeader(SafeHtml headerText, SafeHtml tooltipText) {
         this(headerText, tooltipText, createSafeHtmlCell());
+    }
+
+    public SafeHtmlHeader(SafeHtml headerText, SafeHtml tooltipText, boolean 
showUnderline) {
+        this(headerText, tooltipText);
+        this.showUnderline = showUnderline;
     }
 
     public SafeHtmlHeader(SafeHtml headerText, SafeHtml tooltipText, 
SafeHtmlCell safeHtmlCell) {
@@ -71,6 +89,9 @@
 
     @Override
     public SafeHtml getValue() {
+        if (showUnderline) {
+            return templates.underlinedHeader(headerText);
+        }
         return headerText;
     }
 
@@ -81,7 +102,5 @@
     protected void setTooltip(SafeHtml tooltipText) {
         this.tooltipText = tooltipText;
     }
-
-
 
 }
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterManageNetworkPopupView.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterManageNetworkPopupView.java
index 181e85a..9f7e6d9 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterManageNetworkPopupView.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/cluster/ClusterManageNetworkPopupView.java
@@ -97,7 +97,7 @@
                 new DisplayNetworkIndicatorCheckboxColumn(multiCluster,
                         new DisplayNetworkIndicatorFieldUpdater()),
                 new 
SafeHtmlHeader(SafeHtmlUtils.fromSafeConstant(constants.displayNetwork()),
-                        
SafeHtmlUtils.fromSafeConstant(constants.changeDisplayNetworkWarning())),
+                        
SafeHtmlUtils.fromSafeConstant(constants.changeDisplayNetworkWarning()), true),
                 "100px"); //$NON-NLS-1$
 
         networks.addColumn(
diff --git a/packaging/branding/ovirt.brand/ovirt.css 
b/packaging/branding/ovirt.brand/ovirt.css
index 3383d5c..e7fed80 100644
--- a/packaging/branding/ovirt.brand/ovirt.css
+++ b/packaging/branding/ovirt.brand/ovirt.css
@@ -47,3 +47,12 @@
 .tooltip-w620 .tooltip-inner {
     max-width: 620px !important;
 }
+
+/***************************************
+Widgets -- cells and columns
+TODO: use SASS, break into columns.scss
+****************************************/
+
+.underlinedHeader {
+    border-bottom: 1px dotted #000;
+}


-- 
To view, visit https://gerrit.ovirt.org/40626
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d1e2094410dae6a33897401aa83a2212ef645fd
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

Reply via email to