01: package net.sourceforge.squirrel_sql.plugins.hibernate.mapping;
02:
03: public class MappedClassInfoTreeWrapper extends Object implements
04: Comparable {
05: private MappedClassInfo _mappedClassInfo;
06: private boolean _expanded;
07: private String _toString;
08:
09: public MappedClassInfoTreeWrapper(MappedClassInfo mappedClassInfo,
10: boolean showQualified) {
11: _mappedClassInfo = mappedClassInfo;
12: initToString(showQualified);
13: }
14:
15: public String toString() {
16: return _toString;
17: }
18:
19: private void initToString(boolean showQualified) {
20: if (showQualified) {
21: _toString = _mappedClassInfo.getClassName() + " ->"
22: + _mappedClassInfo.getTableName();
23: } else {
24: _toString = _mappedClassInfo.getSimpleClassName() + " ->"
25: + _mappedClassInfo.getTableName();
26: }
27: }
28:
29: public boolean isExpanded() {
30: return _expanded;
31: }
32:
33: public void setExpanded(boolean expanded) {
34: _expanded = expanded;
35: }
36:
37: public MappedClassInfo getMappedClassInfo() {
38: return _mappedClassInfo;
39: }
40:
41: public void setQualified(boolean b) {
42: initToString(b);
43: }
44:
45: public int compareTo(Object o) {
46: MappedClassInfoTreeWrapper other = (MappedClassInfoTreeWrapper) o;
47:
48: return _toString.compareTo(other.toString());
49: }
50: }
|