Ext.define('WD40.view.legend.Utils', {
singleton: true,
createTreeColumsSpec: function(renderFunction) {
return [{
xtype: 'treecolumn',
flex: 1,
text: 'text',
dataIndex: 'text',
renderer: renderFunction
}];
},
createTools: function(prefix) {
return [{
type: 'plus',
id: prefix + 'plustool',
tooltip: "Show selected document highlights"
}, {
type: 'minus',
id: prefix + 'minustool',
tooltip: "Hide selected document highlights"
}];
}
});
Ext.define('WD40.view.Legend', {
extend: 'Ext.panel.Panel',
alias: 'widget.wd40legend',
requires: ['WD40.view.legend.Utils'],
autoScroll: true,
layout: {type: 'vbox', align: 'stretch'},
items: [
{
xtype: 'treepanel',
title: 'Base Linguistics',
border: 0,
rootVisible: false,
itemId: 'bltree',
id: 'bltree',
useArrows: true,
collapsible: true,
collapseFirst: false,
collapsed: false,
hideHeaders: true,
root: {
text: 'Root',
expanded: true,
children: [{
text: 'hello1',
expanded: true,
children: [
{
text: 'child 1',
leaf: true},
{
text: 'child 2',
leaf: true},
{
text: 'child 3',
leaf: true},
{
text: 'child 4',
leaf: true},
{
text: 'child 5',
leaf: true},
{
text: 'child 6',
leaf: true},
{
text: 'child 7',
leaf: true},
{
text: 'child 8',
leaf: true},
{
text: 'child 9',
leaf: true},
{
text: 'child 10',
leaf: true},
{
text: 'child 11',
leaf: true},
{
text: 'child 12',
leaf: true},
{
text: 'child 13',
leaf: true},
{
text: 'child 14',
leaf: true},
{
text: 'child 15',
leaf: true},
{
text: 'child 16',
leaf: true},
{
text: 'child 17',
leaf: true},
{
text: 'child 18',
leaf: true}
]}]
},
columns: WD40.view.legend.Utils.createTreeColumsSpec(
function(value, metaData, record, row, col, store, gridView) {
return '<span class="treenode">' + value + '</span>';
}),
tools: WD40.view.legend.Utils.createTools('bl')},
{
xtype: 'treepanel',
title: 'Entity Extraction',
border: 0,
rootVisible: false,
itemId: 'netree',
id: 'netree',
useArrows: true,
collapsible: true,
collapseFirst: false,
hideHeaders: true,
root: {
text: 'Root',
expanded: true,
children: [{
text: 'hello1',
expanded: true,
children: [
{
text: 'child 1',
leaf: true},
{
text: 'child 2',
leaf: true},
{
text: 'child 3',
leaf: true},
{
text: 'child 4',
leaf: true},
{
text: 'child 5',
leaf: true},
{
text: 'child 6',
leaf: true},
{
text: 'child 7',
leaf: true},
{
text: 'child 8',
leaf: true},
{
text: 'child 9',
leaf: true},
{
text: 'child 10',
leaf: true},
{
text: 'child 11',
leaf: true},
{
text: 'child 12',
leaf: true},
{
text: 'child 13',
leaf: true},
{
text: 'child 14',
leaf: true},
{
text: 'child 15',
leaf: true},
{
text: 'child 16',
leaf: true},
{
text: 'child 17',
leaf: true},
{
text: 'child 18',
leaf: true}
]}]
},
columns: WD40.view.legend.Utils.createTreeColumsSpec(
function(value, metaData, record, row, col, store, gridView) {
return '<span class="ne-type-node">' + value + '</span>';
}),
tools: WD40.view.legend.Utils.createTools('ne')}]
});
Ext.application({
name: 'WD40',
controllers: [],
launch: function() {
Ext.create('Ext.container.Viewport', {
renderTo: Ext.getBody(),
title: 'wd40',
layout: 'border',
items: [{
xtype: 'toolbar',
region: 'north',
split: false,
border: false},
{
xtype: 'panel',
region: 'center',
layout: 'border',
border: false,
defaults: {
split: true
},
items: [{
xtype: 'tabpanel',
region: 'center',
height: 250,
id: 'docTabs'}
]},
{
xtype: 'wd40legend',
id: 'legendView',
region: 'west',
split: true,
width: 275}
]
});
}
});
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.