Map<String, String> runtimeLabels;
public String getValueString(int column) {
- if (column == 0)
+ if (labels == null)
initData();
if (labeler != null) {
String key = explorerContext.getGe().getColumns()[column].getKey();
- String s = null;
- if (runtimeLabels != null)
- s = runtimeLabels.get(key);
- if (s == null)
- s = labels.get(key);
- if (labelDecorators != null && !labelDecorators.isEmpty()) {
- int index = 0;
- for (LabelDecorator ld : labelDecorators) {
- String ds = ld.decorateLabel(s, key, index);
- if (ds != null)
- s = ds;
- }
+ return getValue(key);
+ }
+ return null;
+ }
+
+ private String getValue(String key) {
+ String s = null;
+ if (runtimeLabels != null)
+ s = runtimeLabels.get(key);
+ if (s == null)
+ s = labels.get(key);
+ if (labelDecorators != null && !labelDecorators.isEmpty()) {
+ int index = 0;
+ for (LabelDecorator ld : labelDecorators) {
+ String ds = ld.decorateLabel(s, key, index);
+ if (ds != null)
+ s = ds;
}
- return s;
+ }
+ return s;
+ }
+
+ public String getValueString(String key) {
+ if (labels == null)
+ initData();
+ if (labeler != null) {
+ return getValue(key);
}
return null;
}
manager = null;
}
+ /**
+ * Fast dispose is used to wipe the whole tree.
+ *
+ * ContextToNodeMap is cleared with one command, so we do not need to remove nodes one by one from the map.
+ */
+ public void fastDispose() {
+ if (DEBUG) System.out.println("dispose " + this);
+ parent = null;
+ for (TreeNode n : children) {
+ n.fastDispose();
+ }
+ clearCache();
+ children.clear();
+ context = null;
+ explorerContext = null;
+ manager.dispose();
+ manager = null;
+ }
+
private void clearCache() {
if (explorerContext != null) {
GECache2 cache = explorerContext.cache;