Vojtech Szocs has submitted this change and it was merged.
Change subject: webadmin,userportal: Improve TextBoxLabelBase
......................................................................
webadmin,userportal: Improve TextBoxLabelBase
This patch modifies constructor:
public TextBoxLabelBase(Renderer<T> renderer) ...
to become:
public TextBoxLabelBase(Renderer<? super T> renderer) ...
in order to support broader range of renderers, i.e.
renderer for T or any supertype of T, up to Object.
Assuming GWT compiler discards generic type information,
in the worst case, things will blow up on bad method
signature. However, TextBoxLabelBase extends ValueBoxBase
which uses provided renderer like so:
public void setValue(T value, boolean fireEvents) {
...
setText(renderer.render(value));
...
}
and the above renderer usage should be safe even when
using Renderer<? super T> instead of just Renderer<T>
at runtime.
(Makes me wonder why GWT ValueBoxBase doesn't work
with Renderer<? super T> just like GWT ValueLabel.)
Change-Id: Ie691685ec6e9e1830da1457a0747901ba833be5d
Signed-off-by: Vojtech Szocs <vszocs(a)redhat.com>
---
M
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/label/TextBoxLabelBase.java
M
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/label/DetailsTextBoxLabel.java
M
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/label/NullableNumberTextBoxLabel.java
M
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/renderer/DetailsRenderer.java
4 files changed, 18 insertions(+), 13 deletions(-)
Approvals:
Vojtech Szocs: Verified; Looks good to me, approved
--
To view, visit
http://gerrit.ovirt.org/22236
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie691685ec6e9e1830da1457a0747901ba833be5d
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Vojtech Szocs <vszocs(a)redhat.com>
Gerrit-Reviewer: Alexander Wels <awels(a)redhat.com>
Gerrit-Reviewer: Daniel Erez <derez(a)redhat.com>
Gerrit-Reviewer: Einav Cohen <ecohen(a)redhat.com>
Gerrit-Reviewer: Kanagaraj M <kmayilsa(a)redhat.com>
Gerrit-Reviewer: Vojtech Szocs <vszocs(a)redhat.com>
Gerrit-Reviewer: anmolbabu <anbabu(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server