[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[riena-dev] TreeTableRidget - quick feedback on bind styles
|
Hi,
quick question: which bind method do you like best, #1 or #2 ?
Thanks,
Elias.
#1:
Object[] roots;
String[] valueAccessors = new String[] {
"word", upperCase, "ACount"
};
String[] columnHeaders = new String[] {
"Word", "Uppercase", "A Count"
};
tree.bindToModel(roots, WordNode.class, "children", "parent",
valueAccessors, columnHeaders);
#2:
tree.bindToModel(roots, WordNode.class, new WordNodeTreeAdvisor());
with
private final class WordNodeTreeAdvisor extends TreeAdvisor {
public String getChildrenAccessor() {
return "children";
}
public String[] getColumnHeaders() {
return new String[] { "Word", "Uppercase", "A Count" };
}
public String getParentAccessor() {
return "parent";
}
public String[] getValueAccessors() {
return new String[] { "word", "upperCase", "ACount" };
}
}
---
Elias Volanakis
Technical Lead
Innoopract, Inc.
351 NW 12th Avenue
Portland, Oregon 97209
Tel: +1-503-552-1457
Fax: +1-503-715-4915
Mobile: +1-503-929-5537
evolanakis@xxxxxxxxxxxxxx
http://rapblog.innoopract.com