Alona Kaplan has uploaded a new change for review. Change subject: webadmin: Limiting vnic name label width on vm dialog ......................................................................
webadmin: Limiting vnic name label width on vm dialog LabelWithTooltip is used to limit the width of the vnic name label. In case the name width is bigger than the limited width (in pixels), the name is trimmed and '...' are add to it. The tooltip displays the whole name. Change-Id: I32d30aa8d1824b127030a533fcde57aaa75983b3 Bug-Url: https://bugzilla.redhat.com/1029973 Signed-off-by: Alona Kaplan <[email protected]> --- M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/profile/ProfileInstanceTypeEditor.java M frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/profile/ProfileInstanceTypeEditor.ui.xml 2 files changed, 16 insertions(+), 5 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/26/29126/1 diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/profile/ProfileInstanceTypeEditor.java b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/profile/ProfileInstanceTypeEditor.java index c319ef6..ff8252f 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/profile/ProfileInstanceTypeEditor.java +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/profile/ProfileInstanceTypeEditor.java @@ -4,6 +4,7 @@ import org.ovirt.engine.core.common.businessentities.network.VnicProfileView; import org.ovirt.engine.ui.common.idhandler.HasElementId; import org.ovirt.engine.ui.common.utils.ElementIdUtils; +import org.ovirt.engine.ui.common.widget.label.LabelWithToolTip; import org.ovirt.engine.ui.common.widget.uicommon.popup.AbstractModelBoundPopupWidget; import org.ovirt.engine.ui.uicommonweb.models.vms.VnicInstanceType; import org.ovirt.engine.ui.uicompat.Event; @@ -33,9 +34,14 @@ } interface Style extends CssResource { - String labelStyle(); String contentStyle(); + + String noDisplay(); } + + @UiField + @Path(value = "networkInterface.name") + LabelWithToolTip vnicLabel; @UiField @Path(value = "selectedItem") @@ -68,8 +74,7 @@ final VmNetworkInterface vnic = model.getNetworkInterface(); String vnicName = vnic.getName(); - profileEditor.setLabel(vnicName); - profileEditor.addLabelStyleName(style.labelStyle()); + profileEditor.addLabelStyleName(style.noDisplay()); profileEditor.addContentWidgetStyleName(style.contentStyle()); profileEditor.setElementId(ElementIdUtils.createElementId(elementId, vnicName)); model.getSelectedItemChangedEvent().addListener(new IEventListener() { diff --git a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/profile/ProfileInstanceTypeEditor.ui.xml b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/profile/ProfileInstanceTypeEditor.ui.xml index c7738e029..399295d 100644 --- a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/profile/ProfileInstanceTypeEditor.ui.xml +++ b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/profile/ProfileInstanceTypeEditor.ui.xml @@ -3,12 +3,17 @@ <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:e="urn:import:org.ovirt.engine.ui.common.widget.editor" - xmlns:p="urn:import:org.ovirt.engine.ui.common.widget.profile"> + xmlns:p="urn:import:org.ovirt.engine.ui.common.widget.profile" + xmlns:l="urn:import:org.ovirt.engine.ui.common.widget.label"> <ui:style type="org.ovirt.engine.ui.common.widget.profile.ProfileInstanceTypeEditor.Style"> .labelStyle { float: left; - width: 50px; + width: 70px; + } + + .noDisplay { + display: none; } .contentStyle { @@ -22,6 +27,7 @@ </ui:style> <g:FlowPanel> + <l:LabelWithToolTip ui:field="vnicLabel" addStyleNames="{style.labelStyle}" /> <p:ProfileEditor ui:field="profileEditor" addStyleNames="{style.containerStyle}" /> </g:FlowPanel> -- To view, visit http://gerrit.ovirt.org/29126 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I32d30aa8d1824b127030a533fcde57aaa75983b3 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alona Kaplan <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
