Hello Yaniv Bronhaim,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/18630

to review the following change.

Change subject: webadmin: Adding tooltip and style to PublicKey field
......................................................................

webadmin: Adding tooltip and style to PublicKey field

Change-Id: I6fab16684a9b1bb57587e672ff1ba7fbf7eae40b
Signed-off-by: Yaniv Bronhaim <ybron...@redhat.com>
---
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/EntityModelTextAreaLabelEditor.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInstallPopupView.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInstallPopupView.ui.xml
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostPopupView.java
M 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostPopupView.ui.xml
6 files changed, 28 insertions(+), 29 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/30/18630/1

diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/EntityModelTextAreaLabelEditor.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/EntityModelTextAreaLabelEditor.java
index de2dc38..20323ec 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/EntityModelTextAreaLabelEditor.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/EntityModelTextAreaLabelEditor.java
@@ -2,7 +2,6 @@
 
 import org.ovirt.engine.ui.common.widget.renderer.EmptyValueRenderer;
 
-import com.google.gwt.dom.client.Style.Unit;
 import com.google.gwt.text.shared.Parser;
 import com.google.gwt.text.shared.Renderer;
 
@@ -12,26 +11,21 @@
      * A ValueBoxWithLabelEditor that has a Label as the widget
      */
     public EntityModelTextAreaLabelEditor() {
-        super(new EntityModelTextAreaLabel());
+        super(new EntityModelTextAreaLabel() {
+            @Override
+            public void setText(String text) {
+                super.setText(new EmptyValueRenderer<String>().render(text));
+            }
+        });
     }
 
     public EntityModelTextAreaLabelEditor(Renderer<Object> renderer, 
Parser<Object> parser) {
         super(new EntityModelTextAreaLabel(renderer, parser));
     }
 
-    public EntityModelTextAreaLabelEditor(final boolean showBorder, final 
boolean disableResizing) {
-        super(new EntityModelTextAreaLabel() {
-            @Override
-            public void setText(String text) {
-                super.setText(new EmptyValueRenderer<String>().render(text));
-
-                if (showBorder) {
-                    getElement().getStyle().setBorderWidth(1, Unit.PX);
-                }
-                if (disableResizing) {
-                    getElement().getStyle().setProperty("resize", "none"); 
//$NON-NLS-1$ //$NON-NLS-2$
-                }
-            }
-        });
+    public void setCustomStyle(final String customStyle) {
+        if (customStyle != null) {
+            
getElement().getElementsByTagName("textarea").getItem(0).addClassName(customStyle);
 //$NON-NLS-1$
+        }
     }
 }
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
index 6d09492..5ac6da2 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java
@@ -3053,4 +3053,7 @@
 
     @DefaultStringValue("Action Items")
     String actionItems();
+
+    @DefaultStringValue("For allowing PK authentication, copy the following PK 
to host under .ssh/authorized_keys")
+    String publicKeyUsage();
 }
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInstallPopupView.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInstallPopupView.java
index a556695..7c97fb5 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInstallPopupView.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInstallPopupView.java
@@ -121,7 +121,7 @@
 
         rbPassword = new RadioButton("1"); //$NON-NLS-1$
         rbPublicKey = new RadioButton("1"); //$NON-NLS-1$
-        publicKeyEditor = new EntityModelTextAreaLabelEditor(true, true);
+        publicKeyEditor = new EntityModelTextAreaLabelEditor();
     }
 
     void localize(ApplicationConstants constants) {
@@ -130,6 +130,7 @@
         
overrideIpTablesEditor.setLabel(constants.hostInstallOverrideIpTablesLabel());
         authLabel.setText(constants.hostPopupAuthLabel());
         userNameEditor.setLabel(constants.hostPopupUsernameLabel());
+        publicKeyEditor.setTitle(constants.publicKeyUsage());
     }
 
     @Override
@@ -187,9 +188,12 @@
 
     interface Style extends CssResource {
         String overrideIpStyle();
+
+        String pkStyle();
     }
 
     private void addStyles() {
         
overrideIpTablesEditor.addContentWidgetStyleName(style.overrideIpStyle());
+        publicKeyEditor.setCustomStyle(style.pkStyle());
     }
 }
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInstallPopupView.ui.xml
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInstallPopupView.ui.xml
index fb3ed54..7ede687 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInstallPopupView.ui.xml
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostInstallPopupView.ui.xml
@@ -28,6 +28,7 @@
 
         .pkStyle {
             resize: none;
+            background-color: gray;
         }
 
         .radioButton {
@@ -63,7 +64,7 @@
                 <g:HorizontalPanel width="100%" verticalAlignment="middle">
                     <g:RadioButton ui:field="rbPublicKey" 
addStyleNames="{style.radioButton}" />
                     <g:Label text="{constants.hostPublicKeyLable}" />
-                    <e:EntityModelTextAreaLabelEditor 
ui:field="publicKeyEditor" addStyleNames="{style.pkStyle}" />
+                    <e:EntityModelTextAreaLabelEditor 
ui:field="publicKeyEditor" />
                 </g:HorizontalPanel>
                 <e:EntityModelCheckBoxEditor 
ui:field="overrideIpTablesEditor"/>
                 <e:EntityModelLabelEditor ui:field="hostVersionEditor"/>
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostPopupView.java
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostPopupView.java
index ceb1166..e2ef174 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostPopupView.java
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostPopupView.java
@@ -465,11 +465,13 @@
         
providerSearchFilterLabel.addContentWidgetStyleName(style.emptyEditor());
         providerSearchFilterLabel.setStyleName(style.searchFilterLabel());
         
fetchSshFingerprint.addContentWidgetStyleName(style.fingerprintEditor());
-        publicKeyEditor.addContentWidgetStyleName(style.pkEditor());
         expanderContent.setStyleName(style.expanderContent());
+        publicKeyEditor.setCustomStyle(style.pkStyle());
     }
 
     private void initEditors() {
+        publicKeyEditor = new EntityModelTextAreaLabelEditor();
+
         // List boxes
         dataCenterEditor = new ListModelListBoxEditor<Object>(new 
NullSafeRenderer<Object>() {
             @Override
@@ -520,8 +522,6 @@
             }
         });
 
-        publicKeyEditor = new EntityModelTextAreaLabelEditor(true, true);
-
         // Check boxes
         pmEnabledEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
         externalHostProviderEnabledEditor = new 
EntityModelCheckBoxEditor(Align.RIGHT);
@@ -555,6 +555,7 @@
         
externalHostProviderEnabledEditor.setLabel(constants.hostPopupEnableExternalHostProvider());
         externalHostNameEditor.setLabel(constants.hostPopupExternalHostName());
         
providerSearchFilterLabel.setLabel(constants.hostPopupProviderSearchFilter());
+        publicKeyEditor.setTitle(constants.publicKeyUsage());
 
         // Power Management tab
         
powerManagementTab.setLabel(constants.hostPopupPowerManagementTabLabel());
@@ -955,7 +956,7 @@
 
         String expanderContent();
 
-        String pkEditor();
+        String pkStyle();
     }
 
     public void setPkPasswordSectionVisiblity(boolean visible) {
diff --git 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostPopupView.ui.xml
 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostPopupView.ui.xml
index 5b704ab..fe40e8e 100644
--- 
a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostPopupView.ui.xml
+++ 
b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/popup/host/HostPopupView.ui.xml
@@ -202,11 +202,6 @@
             display: none;
         }
 
-        .pkEditor {
-            border-width: 1px;
-            border-color: black;
-        }
-
         .fetchLink {
             margin: 3px;
             font-size: 10pt;
@@ -215,11 +210,12 @@
 
         .pkStyle {
             resize: none;
+            background-color: gray;
         }
 
     </ui:style>
 
-    <d:SimpleDialogPanel width="700px" height="685px">
+    <d:SimpleDialogPanel width="700px" height="715px">
         <d:content>
             <t:DialogTabPanel ui:field="tabPanel" height="100%">
                 <t:tab>
@@ -263,7 +259,7 @@
                                         <g:HorizontalPanel 
ui:field="pkSection" width="100%" verticalAlignment="middle">
                                             <g:RadioButton 
ui:field="rbPublicKey" addStyleNames="{style.radioButton}" />
                                             <g:Label 
text="{constants.hostPublicKeyLable}" />
-                                            <e:EntityModelTextAreaLabelEditor 
ui:field="publicKeyEditor" addStyleNames="{style.pkStyle}" />
+                                            <e:EntityModelTextAreaLabelEditor 
ui:field="publicKeyEditor" />
                                         </g:HorizontalPanel>
                                         <d:AdvancedParametersExpander 
ui:field="expander"/>
                                         <g:FlowPanel 
ui:field="expanderContent">


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6fab16684a9b1bb57587e672ff1ba7fbf7eae40b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybron...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to