Yaniv Bronhaim has uploaded a new change for review. 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 <[email protected]> --- 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, 37 insertions(+), 30 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/26/17426/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..2f1530e 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 @@ -1,8 +1,8 @@ package org.ovirt.engine.ui.common.widget.editor; +import com.google.gwt.dom.client.Style; 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 +12,23 @@ * 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().getStyle().setBorderWidth(1, Style.Unit.PX); + getElement().getStyle().setBorderColor("black"); //$NON-NLS-1$ + 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 fab797b..a91ad7b 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..91ed839 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,10 @@ .pkStyle { resize: none; + background-color: gray; + border-width: 1px; + border-style: solid; + border-color: black; } .radioButton { @@ -63,7 +67,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 368669e..7cd63ce 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 @@ -129,7 +129,6 @@ @WithElementId("fetchResult") Label fetchResult; - @UiField @Path(value = "comment.entity") @WithElementId("comment") EntityModelTextBoxEditor commentEditor; @@ -465,11 +464,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 +521,6 @@ } }); - publicKeyEditor = new EntityModelTextAreaLabelEditor(true, true); - // Check boxes pmEnabledEditor = new EntityModelCheckBoxEditor(Align.RIGHT); externalHostProviderEnabledEditor = new EntityModelCheckBoxEditor(Align.RIGHT); @@ -555,6 +554,7 @@ externalHostProviderEnabledEditor.setLabel(constants.hostPopupEnableExternalHostProvider()); externalHostNameEditor.setLabel(constants.hostPopupExternalHostName()); providerSearchFilterLabel.setLabel(constants.hostPopupProviderSearchFilter()); + publicKeyEditor.setTitle(constants.publicKeyUsage()); // Power Management tab powerManagementTab.setLabel(constants.hostPopupPowerManagementTabLabel()); @@ -946,7 +946,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 b467cf2..e62d3c8 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,15 @@ .pkStyle { resize: none; + background-color: gray; + border-width: 1px; + border-style: solid; + border-color: black; } </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> @@ -265,7 +264,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/17426 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6fab16684a9b1bb57587e672ff1ba7fbf7eae40b Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yaniv Bronhaim <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
