-
Notifications
You must be signed in to change notification settings - Fork 43
/
ResultsTree.js
63 lines (58 loc) · 2.24 KB
/
ResultsTree.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* ************************************************************************
Copyright:
2012 Tomek Kuprowski
License:
GPLv2: http://www.gnu.org/licences/gpl.html
Authors:
Tomek Kuprowski (tomekkuprowski at gmail dot com)
************************************************************************ */
qx.Class.define("helenos.ui.treevirtual.ResultsTree",
{
extend : qx.ui.treevirtual.TreeVirtual,
include : [helenos.ui.table.MZeroClipboardCtxHandler],
construct : function()
{
this.base(arguments, ["Name", "Value", "Clock", "TTL"]);
this.set({
alwaysShowOpenCloseSymbol : true,
useTreeLines : true,
statusBarVisible : false
});
var resizeBehavior = this.getTableColumnModel().getBehavior();
resizeBehavior.set(1, {
width:"1*",
minWidth:200
});
resizeBehavior.setWidth(2, 140);
resizeBehavior.setWidth(3, 60);
this.setContextMenuHandler(0, this.contextMenuHandler);
this.setContextMenuHandler(1, this.contextMenuHandler);
this.setContextMenuHandler(2, this.contextMenuHandler);
this.setContextMenuHandler(3, this.contextMenuHandler);
},
members : {
setData : function(data) {
if (data == null) {
return
}
var dataModel = this.getDataModel();
dataModel.clearData();
var i;
for(i = 0; i < data.length; i++) {
var row = data[i];
var branch = dataModel.addBranch(null, row.key, true, false, 'helenos/key.png');
var j;
for (j = 0; j < row.columns.length; j++) {
var col = row.columns[j];
if (col.name != 'KEY') {
var leaf = dataModel.addLeaf(branch, col.name, 'helenos/isctf.png');
dataModel.setColumnData(leaf, 1, col.value);
dataModel.setColumnData(leaf, 2, col.clock);
dataModel.setColumnData(leaf, 3, col.ttl);
}
}
}
dataModel.setData();
}
}
});