Tomas Jelinek has uploaded a new change for review.

Change subject: ui: disabled label colors different
......................................................................

ui: disabled label colors different

WIP

Change-Id: Ia754a6f1e81f8fafc1092a8f2e760579e8cca34e
Bug-Url: https://bugzilla.redhat.com/??????
Signed-off-by: Tomas Jelinek <[email protected]>
---
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/EntityModelDetachableWidgetWithInfo.java
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/EntityModelWidgetWithInfo.java
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/EntityModelWidgetWithInfo.ui.xml
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/generic/StringEntityModelLabel.java
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/pool/PoolNewPopupWidget.java
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/SerialNumberPolicyWidget.java
9 files changed, 120 insertions(+), 97 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/85/31885/1

diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java
index 1c46e07..e8dd77c 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java
@@ -1880,4 +1880,7 @@
 
     @DefaultStringValue("Authorization provider")
     String authz();
+
+    @DefaultStringValue("Custom Migration Downtime")
+    String customMigrationDowntime();
 }
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/EntityModelDetachableWidgetWithInfo.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/EntityModelDetachableWidgetWithInfo.java
index 18038da..4c20d39 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/EntityModelDetachableWidgetWithInfo.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/EntityModelDetachableWidgetWithInfo.java
@@ -1,10 +1,9 @@
 package org.ovirt.engine.ui.common.widget;
 
-import com.google.gwt.user.client.ui.HasEnabled;
 import org.ovirt.engine.ui.common.widget.editor.generic.EntityModelLabel;
 import 
org.ovirt.engine.ui.common.widget.editor.generic.EntityModelDetachableWidget;
 
-public class EntityModelDetachableWidgetWithInfo<T> extends 
EntityModelWidgetWithInfo implements HasDetachable, HasEnabled {
+public class EntityModelDetachableWidgetWithInfo<T> extends 
EntityModelWidgetWithInfo implements HasDetachable {
 
     public EntityModelDetachableWidgetWithInfo(EntityModelLabel<T> label, 
AbstractValidatedWidgetWithLabel contentWidget) {
         super(label, new EntityModelDetachableWidget(contentWidget));
@@ -18,16 +17,6 @@
     @Override
     public void setAttached(boolean attached) {
         ((HasDetachable) contentWidget).setAttached(attached);
-    }
-
-    @Override
-    public void setEnabled(boolean enabled) {
-        ((HasEnabled) contentWidget).setEnabled(enabled);
-    }
-
-    @Override
-    public boolean isEnabled() {
-        return ((HasEnabled) contentWidget).isEnabled();
     }
 
     public EntityModelDetachableWidget getContentWidget() {
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/EntityModelWidgetWithInfo.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/EntityModelWidgetWithInfo.java
index 78350d4..288a5b3 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/EntityModelWidgetWithInfo.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/EntityModelWidgetWithInfo.java
@@ -1,5 +1,7 @@
 package org.ovirt.engine.ui.common.widget;
 
+import com.google.gwt.resources.client.CssResource;
+import com.google.gwt.user.client.ui.HasEnabled;
 import org.ovirt.engine.ui.common.CommonApplicationResources;
 import org.ovirt.engine.ui.common.widget.dialog.InfoIcon;
 import org.ovirt.engine.ui.common.widget.editor.generic.EntityModelLabel;
@@ -15,10 +17,16 @@
 
 import java.util.List;
 
-public class EntityModelWidgetWithInfo<T> extends Composite implements 
HasValidation {
+public class EntityModelWidgetWithInfo<T> extends Composite implements 
HasValidation, HasEnabled {
 
     interface WidgetUiBinder extends UiBinder<Widget, 
EntityModelWidgetWithInfo> {
         WidgetUiBinder uiBinder = GWT.create(WidgetUiBinder.class);
+    }
+
+    interface Style extends CssResource {
+        String enabledLabel();
+
+        String disabledLabel();
     }
 
     private static CommonApplicationResources resources = 
GWT.create(CommonApplicationResources.class);
@@ -31,6 +39,9 @@
 
     @UiField(provided = true)
     Composite contentWidget;
+
+    @UiField
+    Style style;
 
     @Inject
     public EntityModelWidgetWithInfo(EntityModelLabel<T> label, Composite 
contentWidget) {
@@ -67,4 +78,29 @@
 
         return true;
     }
+
+    @Override
+    public void setEnabled(boolean enabled) {
+        if (contentWidget instanceof HasEnabled) {
+            ((HasEnabled) contentWidget).setEnabled(enabled);
+            if (enabled) {
+                label.getElement().replaceClassName(style.disabledLabel(), 
style.enabledLabel());
+            } else {
+                label.getElement().replaceClassName(style.enabledLabel(), 
style.disabledLabel());
+            }
+        }
+    }
+
+    @Override
+    public boolean isEnabled() {
+        if (contentWidget instanceof HasEnabled) {
+            return ((HasEnabled) contentWidget).isEnabled();
+        }
+
+        return true;
+    }
+
+    public void setInfoIconVisible(boolean visible) {
+        infoIcon.setVisible(visible);
+    }
 }
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/EntityModelWidgetWithInfo.ui.xml
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/EntityModelWidgetWithInfo.ui.xml
index 7ab595b..758157a 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/EntityModelWidgetWithInfo.ui.xml
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/EntityModelWidgetWithInfo.ui.xml
@@ -3,11 +3,20 @@
     xmlns:g="urn:import:com.google.gwt.user.client.ui" 
xmlns:ge="urn:import:org.ovirt.engine.ui.common.widget.editor.generic"
     xmlns:w="urn:import:org.ovirt.engine.ui.common.widget" 
xmlns:d="urn:import:org.ovirt.engine.ui.common.widget.dialog">
 
-    <ui:style>
+    <ui:style 
type="org.ovirt.engine.ui.common.widget.EntityModelWidgetWithInfo.Style">
         .labelStyle {
             width: 100%;
             padding: 0 5px;
         }
+
+        .enabledLabel {
+            color: #333333;
+        }
+
+        .disabledLabel {
+            color: gray;
+        }
+
     </ui:style>
 
     <g:HorizontalPanel width="100%" addStyleNames="emwwi_outerPanel_pfly_fix">
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/generic/StringEntityModelLabel.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/generic/StringEntityModelLabel.java
index cfdff98..70cfad0 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/generic/StringEntityModelLabel.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/generic/StringEntityModelLabel.java
@@ -7,4 +7,9 @@
     public StringEntityModelLabel() {
         super(new ToStringEntityModelRenderer<String>(), new 
ToStringEntityModelParser());
     }
+
+    public StringEntityModelLabel(String text) {
+        this();
+        setText(text);
+    }
 }
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java
index 99bbd19..bf3bba0 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java
@@ -163,23 +163,18 @@
     @WithElementId("quota")
     public ListModelTypeAheadListBoxEditor<Quota> quotaEditor;
 
-    @UiField
-    @Ignore
-    public Label nameLabel;
-
-    @UiField(provided = true)
     @Path(value = "name.entity")
     @WithElementId("name")
     public StringEntityModelTextBoxOnlyEditor nameEditor;
 
     @UiField(provided = true)
+    @Ignore
+    public EntityModelWidgetWithInfo nameEditorWithInfo;
+
+    @UiField(provided = true)
     @Path(value = "templateVersionName.entity")
     @WithElementId("templateVersionName")
     public StringEntityModelTextBoxEditor templateVersionNameEditor;
-
-    @UiField(provided = true)
-    @Ignore
-    public InfoIcon poolNameIcon;
 
     @UiField(provided = true)
     @Path(value = "description.entity")
@@ -317,41 +312,27 @@
 
     @UiField(provided = true)
     @Ignore
-    public InfoIcon newPoolPrestartedVmsIcon;
-
-    @UiField(provided = true)
-    @Ignore
     public InfoIcon editPoolPrestartedVmsIcon;
-
-    @UiField(provided = true)
-    @Ignore
-    public InfoIcon newPoolMaxAssignedVmsPerUserIcon;
 
     @UiField(provided = true)
     @Ignore
     public InfoIcon editPoolMaxAssignedVmsPerUserIcon;
 
-    @UiField(provided = true)
     @Path(value = "prestartedVms.entity")
     @WithElementId("prestartedVms")
     public IntegerEntityModelTextBoxOnlyEditor prestartedVmsEditor;
 
-    @UiField(provided = true)
     @Path("maxAssignedVmsPerUser.entity")
     @WithElementId("maxAssignedVmsPerUser")
     public IntegerEntityModelTextBoxOnlyEditor maxAssignedVmsPerUserEditor;
 
-    @UiField
+    @UiField(provided = true)
     @Ignore
-    public FlowPanel newPoolEditVmsPanel;
+    EntityModelWidgetWithInfo newPoolPrestartedVmsWithIcon;
 
-    @UiField
+    @UiField(provided = true)
     @Ignore
-    public FlowPanel newPoolEditMaxAssignedVmsPerUserPanel;
-
-    @UiField
-    @Ignore
-    public Label prestartedLabel;
+    EntityModelWidgetWithInfo newPoolEditMaxAssignedVmsPerUserWithInfo;
 
     @UiField(provided = true)
     @Path("numOfDesktops.entity")
@@ -569,15 +550,12 @@
     public EntityModelCheckBoxOnlyEditor overrideMigrationDowntimeEditor;
 
     @UiField(provided = true)
-    public EntityModelDetachableWidget 
overrideMigrationDowntimeEditorWithDetachable;
-
-    @UiField(provided = true)
-    public InfoIcon migrationDowntimeInfoIcon;
+    public EntityModelDetachableWidgetWithInfo 
overrideMigrationDowntimeEditorWithDetachable;
 
     @UiField(provided = true)
     @Path(value = "migrationDowntime.entity")
     @WithElementId("migrationDowntime")
-    public IntegerEntityModelTextBoxOnlyEditor migrationDowntimeEditor;
+    public IntegerEntityModelTextBoxEditor migrationDowntimeEditor;
 
     @UiField(provided = true)
     @Ignore
@@ -871,8 +849,7 @@
         nonEditableWhileVmNotDownInfo =
                 new 
InfoIcon(applicationTemplates.italicText(constants.nonEditableMigrationFieldsWhileVmNotDownInfo()),
                         resources);
-        final Integer defaultMaximumMigrationDowntime = (Integer) 
AsyncDataProvider.getInstance().getConfigValuePreConverted(ConfigurationValues.DefaultMaximumMigrationDowntime);
-        migrationDowntimeInfoIcon = new 
InfoIcon(applicationTemplates.italicText(messages.migrationDowntimeInfo(defaultMaximumMigrationDowntime)),
 resources);
+
         priorityEditor = new EntityModelCellTable<ListModel>(
                 (Resources) GWT.create(ButtonCellTableResources.class));
         disksAllocationView = new DisksAllocationView(constants);
@@ -880,11 +857,12 @@
         spiceFileTransferEnabledEditor = new 
EntityModelCheckBoxEditor(Align.RIGHT, new ModeSwitchingVisibilityRenderer());
         spiceCopyPasteEnabledEditor = new 
EntityModelCheckBoxEditor(Align.RIGHT, new ModeSwitchingVisibilityRenderer());
 
-        initPoolSpecificWidgets(resources, messages);
         initTextBoxEditors();
+        initPoolSpecificWidgets(resources, messages);
         initSpiceProxy();
         initTotalVcpus();
         initDetachableFields();
+        initNameEditor();
 
         initWidget(ViewUiBinder.uiBinder.createAndBindUi(this));
 
@@ -912,14 +890,22 @@
         initialize();
     }
 
+    private void initNameEditor() {
+        nameEditorWithInfo = new EntityModelWidgetWithInfo(new 
StringEntityModelLabel(constants.nameVmPopup()), nameEditor);
+        
nameEditorWithInfo.setExplanation(applicationTemplates.italicText(messages.poolNameHelp()));
+        nameEditorWithInfo.setInfoIconVisible(false);
+    }
+
     private void initDetachableFields() {
         detachableMemSizeEditor = new 
EntityModelDetachableWidgetWithLabel(memSizeEditor);
         isSmartcardEnabledEditorWithDetachable = new 
EntityModelDetachableWidget(isSmartcardEnabledEditor, Align.RIGHT);
         isSoundcardEnabledEditorWithDetachable = new 
EntityModelDetachableWidget(isSoundcardEnabledEditor, Align.RIGHT);
         isConsoleDeviceEnabledEditorWithDetachable = new 
EntityModelDetachableWidget(isConsoleDeviceEnabledEditor, Align.RIGHT);
         isHighlyAvailableEditorWithDetachable = new 
EntityModelDetachableWidget(isHighlyAvailableEditor, Align.RIGHT);
-        overrideMigrationDowntimeEditorWithDetachable = new 
EntityModelDetachableWidget(overrideMigrationDowntimeEditor, Align.RIGHT);
-        
overrideMigrationDowntimeEditor.getContentWidgetContainer().getElement().getStyle().setWidth(20,
 Unit.PX);
+        overrideMigrationDowntimeEditorWithDetachable = new 
EntityModelDetachableWidgetWithInfo(new 
StringEntityModelLabel(constants.overrideMigrationDowntimeLabel()), 
overrideMigrationDowntimeEditor);
+        final Integer defaultMaximumMigrationDowntime = (Integer) 
AsyncDataProvider.getInstance().getConfigValuePreConverted(ConfigurationValues.DefaultMaximumMigrationDowntime);
+        
overrideMigrationDowntimeEditorWithDetachable.setExplanation(applicationTemplates.italicText(messages.migrationDowntimeInfo(defaultMaximumMigrationDowntime)));
+
         isVirtioScsiEnabledWithDetachable = new 
EntityModelDetachableWidget(isVirtioScsiEnabled, Align.RIGHT);
         migrationModeEditorWithDetachable = new 
EntityModelDetachableWidget(migrationModeEditor, Align.RIGHT);
 
@@ -964,10 +950,10 @@
         initrd_pathEditor = new StringEntityModelTextBoxEditor(new 
ModeSwitchingVisibilityRenderer());
         kernel_parametersEditor = new StringEntityModelTextBoxEditor(new 
ModeSwitchingVisibilityRenderer());
         nameEditor = new StringEntityModelTextBoxOnlyEditor(new 
ModeSwitchingVisibilityRenderer());
-        prestartedVmsEditor = new IntegerEntityModelTextBoxOnlyEditor(new 
ModeSwitchingVisibilityRenderer());
         editPrestartedVmsEditor = new IntegerEntityModelTextBoxOnlyEditor(new 
ModeSwitchingVisibilityRenderer());
         maxAssignedVmsPerUserEditor = new 
IntegerEntityModelTextBoxOnlyEditor(new ModeSwitchingVisibilityRenderer());
         editMaxAssignedVmsPerUserEditor = new 
IntegerEntityModelTextBoxOnlyEditor(new ModeSwitchingVisibilityRenderer());
+        prestartedVmsEditor = new IntegerEntityModelTextBoxOnlyEditor(new 
ModeSwitchingVisibilityRenderer());
     }
 
     protected void initPoolSpecificWidgets(CommonApplicationResources 
resources,
@@ -977,17 +963,8 @@
         incraseNumOfVmsEditor.setKeepTitleOnSetEnabled(true);
         numOfVmsEditor.setKeepTitleOnSetEnabled(true);
 
-        newPoolPrestartedVmsIcon =
-                new 
InfoIcon(applicationTemplates.italicText(messages.prestartedHelp()), resources);
-
         editPoolPrestartedVmsIcon =
                 new 
InfoIcon(applicationTemplates.italicText(messages.prestartedHelp()), resources);
-
-        poolNameIcon =
-                new 
InfoIcon(applicationTemplates.italicText(messages.poolNameHelp()), resources);
-
-        newPoolMaxAssignedVmsPerUserIcon =
-                new 
InfoIcon(applicationTemplates.italicText(messages.maxAssignedVmsPerUserHelp()), 
resources);
 
         editPoolMaxAssignedVmsPerUserIcon =
                 new 
InfoIcon(applicationTemplates.italicText(messages.maxAssignedVmsPerUserHelp()), 
resources);
@@ -1001,6 +978,11 @@
 
         });
 
+        newPoolPrestartedVmsWithIcon = new EntityModelWidgetWithInfo(new 
StringEntityModelLabel(constants.prestartedPoolPopup()), prestartedVmsEditor);
+        
newPoolPrestartedVmsWithIcon.setExplanation(applicationTemplates.italicText(messages.prestartedHelp()));
+
+        newPoolEditMaxAssignedVmsPerUserWithInfo = new 
EntityModelWidgetWithInfo(new 
StringEntityModelLabel(constants.maxAssignedVmsPerUser()), 
maxAssignedVmsPerUserEditor);
+        
newPoolEditMaxAssignedVmsPerUserWithInfo.setExplanation(applicationTemplates.italicText(messages.maxAssignedVmsPerUserHelp()));
     }
 
     /**
@@ -1202,7 +1184,7 @@
                 new ListModelListBoxEditor<MigrationSupport>(new 
EnumRenderer(), new ModeSwitchingVisibilityRenderer());
 
         overrideMigrationDowntimeEditor = new 
EntityModelCheckBoxOnlyEditor(new ModeSwitchingVisibilityRenderer(), false);
-        migrationDowntimeEditor = new IntegerEntityModelTextBoxOnlyEditor(new 
ModeSwitchingVisibilityRenderer());
+        migrationDowntimeEditor = new IntegerEntityModelTextBoxEditor(new 
ModeSwitchingVisibilityRenderer());
 
         // Resource Allocation
         provisioningThinEditor =
@@ -1255,7 +1237,6 @@
         generalTab.setLabel(constants.GeneralVmPopup());
         dataCenterWithClusterEditor.setLabel(constants.hostClusterVmPopup());
         quotaEditor.setLabel(constants.quotaVmPopup());
-        nameLabel.setText(constants.nameVmPopup());
         templateVersionNameEditor.setLabel(constants.templateVersionName());
         descriptionEditor.setLabel(constants.descriptionVmPopup());
         commentEditor.setLabel(constants.commentLabel());
@@ -1289,7 +1270,6 @@
         poolTypeEditor.setLabel(constants.poolTypeVmPopup());
         editPrestartedVmsLabel.setText(constants.prestartedVms());
 
-        prestartedLabel.setText(constants.prestartedPoolPopup());
         numOfVmsEditor.setLabel(constants.numOfVmsPoolPopup());
         
maxAssignedVmsPerUserEditor.setLabel(constants.maxAssignedVmsPerUser());
         
editMaxAssignedVmsPerUserEditor.setLabel(constants.maxAssignedVmsPerUser());
@@ -1320,6 +1300,8 @@
         // specificHostEditor.setLabel("Specific");
         hostCpuEditor.setLabel(constants.useHostCpu());
         cpuPinning.setLabel(constants.cpuPinningLabel());
+//        
migrationDowntimeEditor.setLabel(constants.customMigrationDowntime());
+        migrationDowntimeEditor.setLabel("Custom Migration Downtime");
 
         // High Availability Tab
         isHighlyAvailableEditor.setLabel(constants.highlyAvailableVmPopup());
@@ -1922,13 +1904,12 @@
 
     protected List<Widget> poolSpecificFields() {
         return Arrays.<Widget> asList(numOfVmsEditor,
-                newPoolEditVmsPanel,
+                newPoolPrestartedVmsWithIcon,
                 editPoolEditVmsPanel,
                 editPoolIncraseNumOfVmsPanel,
                 poolTab,
                 prestartedVmsEditor,
-                poolNameIcon,
-                newPoolEditMaxAssignedVmsPerUserPanel,
+                newPoolEditMaxAssignedVmsPerUserWithInfo,
                 editPoolEditMaxAssignedVmsPerUserPanel,
                 spiceProxyEditor,
                 spiceProxyEnabledCheckboxWithInfoIcon,
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml
index ead8f12..d25ed85 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml
@@ -424,34 +424,18 @@
                 <t:content>
                     <g:FlowPanel>
                         <g:FlowPanel addStyleNames="{style.sectionPanel}">
-                            <g:FlowPanel addStyleNames="{style.name}">
-                                <g:FlowPanel 
addStyleNames="{style.prestartedLabelWithHelp}">
-                                    <g:Label ui:field="nameLabel" 
addStyleNames="{style.nameLabel}" />
-                                    <d:InfoIcon ui:field="poolNameIcon" 
addStyleNames="{style.poolNameIcon} avmpw_infoIcon_pfly_fix" />
-                                </g:FlowPanel>
-                                <ge:EntityModelTextBoxOnlyEditor 
ui:field="nameEditor" addStyleNames="{style.nameEditor} 
avmpw_nameEditor_pfly_fix" contentWidgetStyleName="{style.nameEditorContent}"/>
-                            </g:FlowPanel>
+
+                            <w:EntityModelWidgetWithInfo 
ui:field="nameEditorWithInfo" />
                             <ge:StringEntityModelTextBoxEditor 
ui:field="templateVersionNameEditor" />
                             <ge:StringEntityModelTextBoxEditor 
ui:field="descriptionEditor" />
                             <ge:StringEntityModelTextBoxEditor 
ui:field="commentEditor" />
 
                             <!-- New VM Pool -->
                             <ge:EntityModelTextBoxEditor 
ui:field="numOfVmsEditor" />
-                            <g:FlowPanel ui:field="newPoolEditVmsPanel" 
addStyleNames="{style.poolEditVms} avmpw_poolEditVms_pfly_fix">
-                                <g:FlowPanel 
addStyleNames="{style.prestartedLabelWithHelp}">
-                                    <g:Label ui:field="prestartedLabel" 
addStyleNames="{style.prestartedLabel}" />
-                                    <d:InfoIcon 
ui:field="newPoolPrestartedVmsIcon" addStyleNames="{style.prestartedVmsIcon} 
avmpw_infoIcon_pfly_fix" />
-                                </g:FlowPanel>
-                                <ge:IntegerEntityModelTextBoxOnlyEditor 
ui:field="prestartedVmsEditor" addStyleNames="{style.prestartedVmsEditor}" 
contentWidgetStyleName="{style.prestartedVmsEditorContent} 
avmpw_prestartedVmsEditorContent_pfly_fix" />
-                            </g:FlowPanel>
 
-                            <g:FlowPanel 
ui:field="newPoolEditMaxAssignedVmsPerUserPanel" 
addStyleNames="{style.poolEditVms} avmpw_poolEditVms_pfly_fix">
-                                <g:FlowPanel 
addStyleNames="{style.maxAssignedVmsPerUserLabel}">
-                                    <g:Label 
text="{constants.maxAssignedVmsPerUser}" 
addStyleNames="{style.maxAssignedVmsPerUserLabel}" />
-                                    <d:InfoIcon 
ui:field="newPoolMaxAssignedVmsPerUserIcon" 
addStyleNames="{style.maxAssignedVmsPerUserIcon} avmpw_infoIcon_pfly_fix" />
-                                </g:FlowPanel>
-                                <ge:EntityModelTextBoxOnlyEditor 
ui:field="maxAssignedVmsPerUserEditor" 
addStyleNames="{style.maxAssignedVmsPerUserEditor}" 
contentWidgetStyleName="{style.maxAssignedVmsPerUserEditorContent} 
avmpw_maxAssignedVmsPerUserEditorContent_pfly_fix" />
-                            </g:FlowPanel>
+                            <w:EntityModelWidgetWithInfo 
ui:field="newPoolPrestartedVmsWithIcon" />
+
+                            <w:EntityModelWidgetWithInfo 
ui:field="newPoolEditMaxAssignedVmsPerUserWithInfo" />
 
                             <!-- Edit VM Pool -->
                             <g:FlowPanel addStyleNames="{style.poolEditVms} 
avmpw_poolEditVms_pfly_fix" ui:field="editPoolEditVmsPanel">
@@ -598,14 +582,12 @@
                     </g:FlowPanel>
                         <g:Label addStyleNames="{style.sectionLabel}" 
text="{constants.runMigrationOptionsVmPopup}" />
                         <g:VerticalPanel width="100%" 
addStyleNames="{style.hostRunMigrationOptions}">
-                             <ge:EntityModelDetachableWidget 
ui:field="migrationModeEditorWithDetachable" 
addStyleNames="{style.migrationSelect}"/>
-                             <g:FlowPanel 
addStyleNames="{style.migrationDowntimePanel}">
-                               <ge:EntityModelDetachableWidget 
ui:field="overrideMigrationDowntimeEditorWithDetachable" 
addStyleNames="{style.overrideMigrationDowntime} 
avmpw_overrideMigrationDowntime_pfly_fix" />
-                               <g:Label 
text="{constants.overrideMigrationDowntimeLabel}" 
addStyleNames="{style.migrationDowntimeLabel} 
avmpw_migrationDowntimeLabel_pfly_fix" />
-                               <d:InfoIcon 
ui:field="migrationDowntimeInfoIcon" 
addStyleNames="{style.migrationDowntimeInfoIcon} avmpw_infoIcon_pfly_fix" />
-                               <ge:IntegerEntityModelTextBoxOnlyEditor 
ui:field="migrationDowntimeEditor" addStyleNames="{style.migrationDowntime}" />
-                             </g:FlowPanel>
-                             <ge:EntityModelCheckBoxEditor 
ui:field="hostCpuEditor" addStyleNames="{style.checkbox}"/>
+                            <ge:EntityModelDetachableWidget 
ui:field="migrationModeEditorWithDetachable" 
addStyleNames="{style.migrationSelect}"/>
+
+                            <w:EntityModelDetachableWidgetWithInfo 
ui:field="overrideMigrationDowntimeEditorWithDetachable" />
+                            <ge:IntegerEntityModelTextBoxEditor 
ui:field="migrationDowntimeEditor" />
+
+                            <ge:EntityModelCheckBoxEditor 
ui:field="hostCpuEditor" addStyleNames="{style.checkbox}"/>
                         </g:VerticalPanel>
                     </g:FlowPanel>
                 </t:content>
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/pool/PoolNewPopupWidget.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/pool/PoolNewPopupWidget.java
index 5c42755..56fa658 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/pool/PoolNewPopupWidget.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/pool/PoolNewPopupWidget.java
@@ -50,6 +50,8 @@
             object.getNumOfDesktops().setEntity(1);
             prestartedVmsEditor.setEnabled(false);
         }
+
+        nameEditorWithInfo.setInfoIconVisible(true);
     }
 
     @Override
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/SerialNumberPolicyWidget.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/SerialNumberPolicyWidget.java
index 6087dd9..c43d1a7 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/SerialNumberPolicyWidget.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/SerialNumberPolicyWidget.java
@@ -7,6 +7,7 @@
 import com.google.gwt.uibinder.client.UiBinder;
 import com.google.gwt.uibinder.client.UiField;
 import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.HasEnabled;
 import org.ovirt.engine.core.common.businessentities.SerialNumberPolicy;
 import org.ovirt.engine.ui.common.CommonApplicationMessages;
 import org.ovirt.engine.ui.common.CommonApplicationResources;
@@ -21,7 +22,9 @@
 import 
org.ovirt.engine.ui.common.widget.uicommon.popup.AbstractModelBoundPopupWidget;
 import org.ovirt.engine.ui.uicommonweb.models.vms.SerialNumberPolicyModel;
 
-public class SerialNumberPolicyWidget extends 
AbstractModelBoundPopupWidget<SerialNumberPolicyModel> {
+public class SerialNumberPolicyWidget extends 
AbstractModelBoundPopupWidget<SerialNumberPolicyModel> implements HasEnabled {
+
+    private boolean enabled;
 
     interface Driver extends SimpleBeanEditorDriver<SerialNumberPolicyModel, 
SerialNumberPolicyWidget> {
     }
@@ -87,4 +90,17 @@
     public void setCheckboxStyle(String checkboxStyle) {
         overrideSerialNumberPolicy.addStyleName(checkboxStyle);
     }
+
+    @Override
+    public boolean isEnabled() {
+        return enabled;
+    }
+
+    @Override
+    public void setEnabled(boolean enabled) {
+        this.enabled = enabled;
+        overrideSerialNumberPolicy.setEnabled(enabled);
+        serialNumberPolicy.setEnabled(enabled);
+        customSerialNumber.setEnabled(enabled);
+    }
 }


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia754a6f1e81f8fafc1092a8f2e760579e8cca34e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tomas Jelinek <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to