Vojtech Szocs has posted comments on this change.
Change subject: webadmin,userportal: Support generic TextBoxLabel widget
......................................................................
Patch Set 5:
Update: there are some widgets which rely on "? super T" constructor variant
inherited from GWT ValueLabel, for example:
class DetailsLabel<T extends ArrayList<ValueLabel<V>>, V> extends
ValueLabel<T> {
public DetailsLabel(String... delimiters) {
super(new DetailsRenderer<V>(delimiters)); // using V instead of T
}
}
class DetailsRenderer<V> extends AbstractRenderer<ArrayList<ValueLabel<V>>> {
...
@Override
public String render(ArrayList<ValueLabel<V>> widgets) ...
...
}
Because TextBoxLabelBase can only delegate to available constructors of parent
class (GWT ValueBoxBase), there's only "T" constructor variant available in
TextBoxLabelBase for use by its subclasses.
For widgets such as DetailsLabel, this means the generic type signature of
widget and renderer must match. For example:
class DetailsTextBoxLabel<T extends ArrayList<ValueLabel<V>>, V> extends
TextBoxLabelBase<T> {
public DetailsTextBoxLabel(String... delimiters) {
super(new DetailsRenderer<T, V>(delimiters)); // generic type
signature must match
}
}
class DetailsRenderer<T extends ArrayList<ValueLabel<V>>, V> extends
AbstractRenderer<T> {
...
@Override
public String render(T widgets) ...
...
}
--
To view, visit http://gerrit.ovirt.org/21289
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I728f7d6fdc74523ac397225c1c5833cb84f6eef9
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Vojtech Szocs <[email protected]>
Gerrit-Reviewer: Alexander Wels <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Einav Cohen <[email protected]>
Gerrit-Reviewer: Tomas Jelinek <[email protected]>
Gerrit-Reviewer: Vojtech Szocs <[email protected]>
Gerrit-Reviewer: anmolbabu <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches