@qooxdoo/framework 7.0.0 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -3
- package/Manifest.json +1 -1
- package/README.md +2 -4
- package/lib/compiler/compile-info.json +65 -63
- package/lib/compiler/index.js +1846 -1569
- package/lib/resource/qx/tool/cli/templates/skeleton/mobile/source/theme/custom/css/custom.css.map +1 -1
- package/npm-shrinkwrap.json +933 -32
- package/package.json +2 -1
- package/source/class/qx/tool/cli/api/AbstractApi.js +4 -1
- package/source/class/qx/tool/cli/commands/Compile.js +1 -0
- package/source/class/qx/tool/cli/commands/Lint.js +15 -5
- package/source/class/qx/tool/compiler/ClassFile.js +70 -0
- package/source/class/qx/tool/compiler/TargetError.js +27 -0
- package/source/class/qx/tool/compiler/targets/Target.js +6 -0
- package/source/class/qx/tool/compiler/targets/meta/AbstractJavascriptMeta.js +1 -1
- package/source/class/qx/tool/compiler/targets/meta/Browserify.js +143 -0
- package/source/class/qx/ui/form/AbstractSelectBox.js +4 -1
- package/source/class/qx/ui/form/DateField.js +4 -1
- package/source/class/qx/ui/progressive/renderer/table/Row.js +2 -1
- package/source/class/qx/ui/progressive/renderer/table/cell/Boolean.js +24 -26
- package/source/class/qx/ui/progressive/renderer/table/cell/Icon.js +9 -7
- package/source/class/qx/ui/progressive/renderer/table/cell/Image.js +16 -13
- package/source/class/qx/ui/table/Table.js +0 -1
- package/source/class/qx/ui/table/model/Abstract.js +31 -1
- package/source/class/qx/ui/table/model/Remote.js +1 -0
- package/source/class/qx/ui/table/model/Simple.js +3 -0
- package/source/class/qx/ui/treevirtual/MNode.js +60 -5
- package/source/class/qx/ui/treevirtual/SimpleTreeDataModel.js +11 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qooxdoo/framework",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "The JS Framework for Coders",
|
|
5
5
|
"author": "The qooxdoo project",
|
|
6
6
|
"keywords": [
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
"app-module-path": "^2.2.0",
|
|
75
75
|
"async": "^2.6.3",
|
|
76
76
|
"better-ajv-errors": "^1.1.1",
|
|
77
|
+
"browserify": "^17.0.0",
|
|
77
78
|
"chokidar": "^3.5.1",
|
|
78
79
|
"cldr": "^7.1.1",
|
|
79
80
|
"columnify": "^1.5.4",
|
|
@@ -86,7 +86,10 @@ qx.Class.define("qx.tool.cli.api.AbstractApi", {
|
|
|
86
86
|
*/
|
|
87
87
|
loadNpmModule(module) {
|
|
88
88
|
const { execSync } = require("child_process");
|
|
89
|
-
|
|
89
|
+
// since npm 7 --no-save deletes the node_modules folder
|
|
90
|
+
// see https://github.com/npm/cli/pull/3907
|
|
91
|
+
// let s = `npm install --no-save --no-package-lock ${module}`;
|
|
92
|
+
let s = `npm install --no-package-lock ${module}`;
|
|
90
93
|
qx.tool.compiler.Console.info(s);
|
|
91
94
|
execSync(s, {
|
|
92
95
|
stdio: "inherit"
|
|
@@ -157,13 +157,23 @@ qx.Class.define("qx.tool.cli.commands.Lint", {
|
|
|
157
157
|
}
|
|
158
158
|
if (report.errorCount > 0 || report.warningCount > 0) {
|
|
159
159
|
let outputFormat = this.argv.format || "codeframe";
|
|
160
|
-
|
|
161
|
-
// If there are too many errors, the pretty formatter is appallingly slow
|
|
162
|
-
if (report.errorCount + report.warningCount > 150) {
|
|
163
|
-
outputFormat = "compact";
|
|
164
|
-
}
|
|
165
160
|
const formatter = await linter.loadFormatter(outputFormat);
|
|
166
161
|
const s = formatter.format(report);
|
|
162
|
+
// If there are too many errors, the pretty formatter is appallingly slow so if the
|
|
163
|
+
// user has not specified a format, change to compact mode
|
|
164
|
+
const maxDefaultFormatErrorCount = 150;
|
|
165
|
+
if (report.errorCount + report.warningCount > maxDefaultFormatErrorCount) {
|
|
166
|
+
if (!this.argv.format) {
|
|
167
|
+
qx.tool.compiler.Console.info(
|
|
168
|
+
`Total errors and warnings exceed ${maxDefaultFormatErrorCount}, switching to "compact" style report`
|
|
169
|
+
);
|
|
170
|
+
outputFormat = "compact";
|
|
171
|
+
} else {
|
|
172
|
+
qx.tool.compiler.Console.info(
|
|
173
|
+
`Total errors and warnings exceed ${maxDefaultFormatErrorCount}, the report may take some time to generate.`
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
167
177
|
if (this.argv.outputFile) {
|
|
168
178
|
if (this.argv.verbose) {
|
|
169
179
|
qx.tool.compiler.Console.info(
|
|
@@ -223,6 +223,7 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
|
|
|
223
223
|
};
|
|
224
224
|
|
|
225
225
|
this.__externals = [];
|
|
226
|
+
this.__commonjsModules = {};
|
|
226
227
|
|
|
227
228
|
this.__taskQueueDrains = [];
|
|
228
229
|
this.__taskQueue = async.queue(function (task, cb) {
|
|
@@ -281,6 +282,7 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
|
|
|
281
282
|
__privates: null,
|
|
282
283
|
__blockedPrivates: null,
|
|
283
284
|
__externals: null,
|
|
285
|
+
__commonjsModules: null,
|
|
284
286
|
|
|
285
287
|
_onTaskQueueDrain() {
|
|
286
288
|
var cbs = this.__taskQueueDrain;
|
|
@@ -496,6 +498,7 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
|
|
|
496
498
|
delete dbClassInfo.translations;
|
|
497
499
|
delete dbClassInfo.markers;
|
|
498
500
|
delete dbClassInfo.fatalCompileError;
|
|
501
|
+
delete dbClassInfo.commonjsModules;
|
|
499
502
|
for (var key in this.__dbClassInfo) {
|
|
500
503
|
dbClassInfo[key] = this.__dbClassInfo[key];
|
|
501
504
|
}
|
|
@@ -667,6 +670,14 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
|
|
|
667
670
|
dbClassInfo.fatalCompileError = true;
|
|
668
671
|
}
|
|
669
672
|
|
|
673
|
+
// CommonJS modules
|
|
674
|
+
if (Object.keys(this.__commonjsModules).length > 0) {
|
|
675
|
+
dbClassInfo.commonjsModules = {};
|
|
676
|
+
for (let moduleName in this.__commonjsModules) {
|
|
677
|
+
dbClassInfo.commonjsModules[moduleName] = [ ...this.__commonjsModules[moduleName] ];
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
|
|
670
681
|
return dbClassInfo;
|
|
671
682
|
},
|
|
672
683
|
|
|
@@ -1648,6 +1659,52 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
|
|
|
1648
1659
|
}
|
|
1649
1660
|
}
|
|
1650
1661
|
|
|
1662
|
+
// Are we looking at the Identifier `require`, and is it a
|
|
1663
|
+
// function call (identified by having
|
|
1664
|
+
// `path.node.arguments`? If so, we'll add the discovered
|
|
1665
|
+
// module to the list of modules that must be browserified
|
|
1666
|
+
// if the application is destined for the browser.
|
|
1667
|
+
let scope;
|
|
1668
|
+
let applicationTypes = t.__analyser.getApplicationTypes();
|
|
1669
|
+
|
|
1670
|
+
if (path.node.callee.type == "Identifier" &&
|
|
1671
|
+
path.node?.callee?.name == "require" &&
|
|
1672
|
+
path.node.arguments?.length == 1 &&
|
|
1673
|
+
applicationTypes.includes("browser")) {
|
|
1674
|
+
|
|
1675
|
+
// See if this is a reference to global `require` or
|
|
1676
|
+
// something in the scope chain
|
|
1677
|
+
for (scope = t.__scope; scope; scope = scope.parent) {
|
|
1678
|
+
if (scope.vars["require"]) {
|
|
1679
|
+
// It's in the scope chain. Ignore it.
|
|
1680
|
+
break;
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
// Did we reach top level without finding it in a local scope?
|
|
1684
|
+
if (! scope) {
|
|
1685
|
+
// Yup. It's the global one we're looking for. Ensure the argument is valid.
|
|
1686
|
+
let arg = path.node.arguments[0];
|
|
1687
|
+
if (types.isLiteral(arg)) {
|
|
1688
|
+
if (typeof arg.value != "string") {
|
|
1689
|
+
log.error(
|
|
1690
|
+
`${t.__className}: ` +
|
|
1691
|
+
"Only literal string arguments to require() are supported: " +
|
|
1692
|
+
arg.value
|
|
1693
|
+
);
|
|
1694
|
+
} else {
|
|
1695
|
+
qx.tool.compiler.Console.log(
|
|
1696
|
+
`${t.__className}:${path.node.loc.start.line}:` +
|
|
1697
|
+
` automatically detected \'require(${arg.value})\``);
|
|
1698
|
+
t.addCommonjsModule(arg.value, t.__className, path.node.loc.start.line);
|
|
1699
|
+
|
|
1700
|
+
// Don't show "unresolved" error for `require` since the
|
|
1701
|
+
// browserified code defines it as a global
|
|
1702
|
+
t.addIgnore("require");
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1651
1708
|
if (
|
|
1652
1709
|
types.isMemberExpression(path.node.callee) ||
|
|
1653
1710
|
(es6ClassDeclarations == 0 &&
|
|
@@ -2506,6 +2563,19 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
|
|
|
2506
2563
|
}
|
|
2507
2564
|
},
|
|
2508
2565
|
|
|
2566
|
+
/**
|
|
2567
|
+
* Adds a CommonJS module to be browserified
|
|
2568
|
+
*
|
|
2569
|
+
* @param name {String} name of the module
|
|
2570
|
+
*/
|
|
2571
|
+
addCommonjsModule(moduleName, className, linenum) {
|
|
2572
|
+
if (! this.__commonjsModules[moduleName]) {
|
|
2573
|
+
this.__commonjsModules[moduleName] = new Set();
|
|
2574
|
+
}
|
|
2575
|
+
|
|
2576
|
+
this.__commonjsModules[moduleName].add(`${className}:${linenum}`);
|
|
2577
|
+
},
|
|
2578
|
+
|
|
2509
2579
|
/**
|
|
2510
2580
|
* Adds an ignored symbol
|
|
2511
2581
|
* @param name {String} name of the symbol
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* ************************************************************************
|
|
2
|
+
*
|
|
3
|
+
* qooxdoo-compiler - node.js based replacement for the Qooxdoo python
|
|
4
|
+
* toolchain
|
|
5
|
+
*
|
|
6
|
+
* https://github.com/qooxdoo/qooxdoo-compiler
|
|
7
|
+
*
|
|
8
|
+
* Copyright:
|
|
9
|
+
* 3033 Derrell Lipman
|
|
10
|
+
*
|
|
11
|
+
* License:
|
|
12
|
+
* MIT: https://opensource.org/licenses/MIT
|
|
13
|
+
*
|
|
14
|
+
* This software is provided under the same licensing terms as Qooxdoo,
|
|
15
|
+
* please see the LICENSE file in the Qooxdoo project's top-level directory
|
|
16
|
+
* for details.
|
|
17
|
+
*
|
|
18
|
+
* Authors:
|
|
19
|
+
* * Derrell Lipman (@derrell)
|
|
20
|
+
*
|
|
21
|
+
* ************************************************************************/
|
|
22
|
+
|
|
23
|
+
qx.Class.define("qx.tool.compiler.TargetError",
|
|
24
|
+
{
|
|
25
|
+
// extend : qx.type.BaseError
|
|
26
|
+
extend : Error
|
|
27
|
+
});
|
|
@@ -432,6 +432,12 @@ qx.Class.define("qx.tool.compiler.targets.Target", {
|
|
|
432
432
|
new qx.tool.compiler.targets.meta.PolyfillJs(appMeta)
|
|
433
433
|
);
|
|
434
434
|
|
|
435
|
+
// Add browserified CommonJS modules, if any
|
|
436
|
+
if (appMeta.getEnvironmentValue("qx.compiler.applicationType") == "browser") {
|
|
437
|
+
bootPackage.addJavascriptMeta(
|
|
438
|
+
new qx.tool.compiler.targets.meta.Browserify(appMeta));
|
|
439
|
+
}
|
|
440
|
+
|
|
435
441
|
/*
|
|
436
442
|
* Assemble the Parts
|
|
437
443
|
*/
|
|
@@ -26,7 +26,7 @@ const sourceMap = require("source-map");
|
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* An AbstractJavascriptMeta provides an abstraction of some source code, and might be
|
|
29
|
-
*
|
|
29
|
+
* comprised of a number of input files which are merged together as required.
|
|
30
30
|
*
|
|
31
31
|
* This object could represent a file which already exists on disk (eg a transpiled
|
|
32
32
|
* source file), or something that is generated on the fly (such as a index.js), or
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/* ************************************************************************
|
|
2
|
+
*
|
|
3
|
+
* qooxdoo-compiler - node.js based replacement for the Qooxdoo python
|
|
4
|
+
* toolchain
|
|
5
|
+
*
|
|
6
|
+
* https://github.com/qooxdoo/qooxdoo-compiler
|
|
7
|
+
*
|
|
8
|
+
* Copyright:
|
|
9
|
+
* 2022 Derrell Lipman
|
|
10
|
+
*
|
|
11
|
+
* License:
|
|
12
|
+
* MIT: https://opensource.org/licenses/MIT
|
|
13
|
+
*
|
|
14
|
+
* This software is provided under the same licensing terms as Qooxdoo,
|
|
15
|
+
* please see the LICENSE file in the Qooxdoo project's top-level directory
|
|
16
|
+
* for details.
|
|
17
|
+
*
|
|
18
|
+
* Authors:
|
|
19
|
+
* * Derrell Lipman (@derrell)
|
|
20
|
+
*
|
|
21
|
+
* ************************************************************************/
|
|
22
|
+
|
|
23
|
+
const fs = qx.tool.utils.Promisify.fs;
|
|
24
|
+
const path = require("upath");
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
qx.Class.define("qx.tool.compiler.targets.meta.Browserify", {
|
|
30
|
+
extend: qx.tool.compiler.targets.meta.AbstractJavascriptMeta,
|
|
31
|
+
|
|
32
|
+
construct(appMeta) {
|
|
33
|
+
super(appMeta, `${appMeta.getApplicationRoot()}commonjs-browserify.js`);
|
|
34
|
+
this.__appMeta = appMeta;
|
|
35
|
+
this.setNeedsWriteToDisk(true);
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
members: {
|
|
39
|
+
__appMeta : null,
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @Override
|
|
43
|
+
*/
|
|
44
|
+
async writeSourceCodeToStream(ws) {
|
|
45
|
+
let hasCommonjsModules = false;
|
|
46
|
+
let commonjsModules = new Set();
|
|
47
|
+
let references = {};
|
|
48
|
+
const db = this.__appMeta.getAnalyser().getDatabase();
|
|
49
|
+
|
|
50
|
+
// Get a Set of unique `require`d CommonJS module names from all classes
|
|
51
|
+
for (let className in db.classInfo) {
|
|
52
|
+
let classInfo = db.classInfo[className];
|
|
53
|
+
if (classInfo.commonjsModules) {
|
|
54
|
+
Object.keys(classInfo.commonjsModules).forEach(
|
|
55
|
+
moduleName =>
|
|
56
|
+
{
|
|
57
|
+
// Add this module name to the set of module names
|
|
58
|
+
commonjsModules.add(moduleName);
|
|
59
|
+
|
|
60
|
+
// Add the list of references from which this module was require()d
|
|
61
|
+
if (! references[moduleName]) {
|
|
62
|
+
references[moduleName] = new Set();
|
|
63
|
+
}
|
|
64
|
+
references[moduleName].add([ ...classInfo.commonjsModules[moduleName] ]);
|
|
65
|
+
|
|
66
|
+
// There is at least one module
|
|
67
|
+
hasCommonjsModules = true;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// If there are any CommonJS modules required, browserify them
|
|
73
|
+
if (hasCommonjsModules) {
|
|
74
|
+
await this.__browserify(
|
|
75
|
+
commonjsModules,
|
|
76
|
+
references,
|
|
77
|
+
ws
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
await new Promise(resolve => {
|
|
82
|
+
ws.write("\n", resolve);
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
async __browserify(commonjsModules, references, ws) {
|
|
87
|
+
let b;
|
|
88
|
+
const browserify = require("browserify");
|
|
89
|
+
const builtins = require("browserify/lib/builtins.js");
|
|
90
|
+
|
|
91
|
+
// For some reason, `process` is not require()able, but `_process` is.
|
|
92
|
+
// Make them equivalent.
|
|
93
|
+
builtins.process = builtins._process;
|
|
94
|
+
|
|
95
|
+
// Convert the Set of CommonJS module names to an array
|
|
96
|
+
commonjsModules = [...commonjsModules];
|
|
97
|
+
|
|
98
|
+
return new Promise(resolve =>
|
|
99
|
+
{
|
|
100
|
+
b = browserify(
|
|
101
|
+
[],
|
|
102
|
+
{
|
|
103
|
+
builtins : builtins,
|
|
104
|
+
ignoreMissing : true,
|
|
105
|
+
insertGlobals : true,
|
|
106
|
+
detectGlobals : true
|
|
107
|
+
});
|
|
108
|
+
b._mdeps.on("missing", (id, parent) => {
|
|
109
|
+
let message = [];
|
|
110
|
+
|
|
111
|
+
message.push(`ERROR: could not locate require()d module: "${id}"`);
|
|
112
|
+
message.push(" required from:");
|
|
113
|
+
[ ...references[id] ].forEach(refs => {
|
|
114
|
+
refs.forEach(ref =>
|
|
115
|
+
{
|
|
116
|
+
message.push(` ${ref}`);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
qx.tool.compiler.Console.error(message.join("\n"));
|
|
121
|
+
});
|
|
122
|
+
b.require(commonjsModules);
|
|
123
|
+
b.bundle((e, output) => {
|
|
124
|
+
if (e) {
|
|
125
|
+
// We've already handled the case of missing module. This is something else.
|
|
126
|
+
qx.tool.compiler.Console.error(`Failed: ${e}`);
|
|
127
|
+
throw(e);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
ws.write(output);
|
|
131
|
+
resolve(null);
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @Override
|
|
138
|
+
*/
|
|
139
|
+
async getSourceMap() {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
});
|
|
@@ -210,7 +210,10 @@ qx.Class.define("qx.ui.form.AbstractSelectBox", {
|
|
|
210
210
|
* Hides the list popup.
|
|
211
211
|
*/
|
|
212
212
|
close() {
|
|
213
|
-
this.getChildControl("popup")
|
|
213
|
+
var popup = this.getChildControl("popup", true);
|
|
214
|
+
if (popup && popup.isVisible()) {
|
|
215
|
+
popup.hide();
|
|
216
|
+
}
|
|
214
217
|
},
|
|
215
218
|
|
|
216
219
|
/**
|
|
@@ -312,7 +312,10 @@ qx.Class.define("qx.ui.form.DateField", {
|
|
|
312
312
|
* Hides the date chooser popup.
|
|
313
313
|
*/
|
|
314
314
|
close() {
|
|
315
|
-
this.getChildControl("popup")
|
|
315
|
+
var popup = this.getChildControl("popup", true);
|
|
316
|
+
if (popup && popup.isVisible()) {
|
|
317
|
+
popup.hide();
|
|
318
|
+
}
|
|
316
319
|
},
|
|
317
320
|
|
|
318
321
|
/**
|
|
@@ -284,7 +284,8 @@ qx.Class.define("qx.ui.progressive.renderer.table.Row", {
|
|
|
284
284
|
element: element,
|
|
285
285
|
dataIndex: i,
|
|
286
286
|
cellData: data[i],
|
|
287
|
-
height: height
|
|
287
|
+
height: height,
|
|
288
|
+
rowRenderer: this // useful, e.g., for getting default row height
|
|
288
289
|
};
|
|
289
290
|
|
|
290
291
|
// Render this cell
|
|
@@ -28,13 +28,13 @@ qx.Class.define("qx.ui.progressive.renderer.table.cell.Boolean", {
|
|
|
28
28
|
construct() {
|
|
29
29
|
super();
|
|
30
30
|
|
|
31
|
-
this.
|
|
31
|
+
this._resolveImages();
|
|
32
32
|
|
|
33
33
|
// dynamic theme switch
|
|
34
34
|
if (qx.core.Environment.get("qx.dyntheme")) {
|
|
35
35
|
qx.theme.manager.Meta.getInstance().addListener(
|
|
36
36
|
"changeTheme",
|
|
37
|
-
this.
|
|
37
|
+
this._resolveImages,
|
|
38
38
|
this
|
|
39
39
|
);
|
|
40
40
|
}
|
|
@@ -53,19 +53,13 @@ qx.Class.define("qx.ui.progressive.renderer.table.cell.Boolean", {
|
|
|
53
53
|
},
|
|
54
54
|
|
|
55
55
|
members: {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
__numericAllowed: null,
|
|
59
|
-
__conditions: null,
|
|
60
|
-
__defaultTextAlign: null,
|
|
61
|
-
__defaultColor: null,
|
|
62
|
-
__defaultFontStyle: null,
|
|
63
|
-
__defaultFontWeight: null,
|
|
56
|
+
_iconUrlTrue: null,
|
|
57
|
+
_iconUrlFalse: null,
|
|
64
58
|
|
|
65
59
|
/**
|
|
66
60
|
* Resolve the boolean images using the alias and resource manager.
|
|
67
61
|
*/
|
|
68
|
-
|
|
62
|
+
_resolveImages() {
|
|
69
63
|
var aliasManager = qx.util.AliasManager.getInstance();
|
|
70
64
|
var resourceManager = qx.util.ResourceManager.getInstance();
|
|
71
65
|
var boolTrueImg = aliasManager.resolve(
|
|
@@ -76,25 +70,29 @@ qx.Class.define("qx.ui.progressive.renderer.table.cell.Boolean", {
|
|
|
76
70
|
"decoration/table/boolean-false.png"
|
|
77
71
|
);
|
|
78
72
|
|
|
79
|
-
this.
|
|
80
|
-
this.
|
|
73
|
+
this._iconUrlTrue = resourceManager.toUri(boolTrueImg);
|
|
74
|
+
this._iconUrlFalse = resourceManager.toUri(boolFalseImg);
|
|
81
75
|
},
|
|
82
76
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
var imageData = {
|
|
77
|
+
_getDefaultImageData(cellInfo) {
|
|
78
|
+
return {
|
|
86
79
|
imageWidth: 11,
|
|
87
80
|
imageHeight: 11
|
|
88
81
|
};
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
// overridden
|
|
85
|
+
_identifyImage(cellInfo) {
|
|
86
|
+
var imageData = this._getDefaultImageData(cellInfo);
|
|
89
87
|
|
|
90
88
|
switch (cellInfo.cellData) {
|
|
91
89
|
case true:
|
|
92
|
-
imageData.url = this.
|
|
90
|
+
imageData.url = this._iconUrlTrue;
|
|
93
91
|
imageData.extras = "celldata='1' ";
|
|
94
92
|
break;
|
|
95
93
|
|
|
96
94
|
case false:
|
|
97
|
-
imageData.url = this.
|
|
95
|
+
imageData.url = this._iconUrlFalse;
|
|
98
96
|
imageData.extras = "celldata='0' ";
|
|
99
97
|
break;
|
|
100
98
|
|
|
@@ -115,7 +113,7 @@ qx.Class.define("qx.ui.progressive.renderer.table.cell.Boolean", {
|
|
|
115
113
|
|
|
116
114
|
if (
|
|
117
115
|
qx.core.Environment.get("css.alphaimageloaderneeded") &&
|
|
118
|
-
/\.png$/i.test(this.
|
|
116
|
+
/\.png$/i.test(this._iconUrlTrue)
|
|
119
117
|
) {
|
|
120
118
|
imageData.extras +=
|
|
121
119
|
" this.src='" +
|
|
@@ -124,18 +122,18 @@ qx.Class.define("qx.ui.progressive.renderer.table.cell.Boolean", {
|
|
|
124
122
|
" var loader = 'DXImageTransform.Microsoft.AlphaImageLoader'; " +
|
|
125
123
|
" var filters = this.filters.item(loader); " +
|
|
126
124
|
" filters.src='" +
|
|
127
|
-
this.
|
|
125
|
+
this._iconUrlTrue +
|
|
128
126
|
"'; " +
|
|
129
127
|
" filters.sizingMethod = 'scale'; ";
|
|
130
128
|
} else {
|
|
131
|
-
imageData.extras += " this.src='" + this.
|
|
129
|
+
imageData.extras += " this.src='" + this._iconUrlTrue + "'; ";
|
|
132
130
|
}
|
|
133
131
|
|
|
134
132
|
imageData.extras += " node.nodeValue='1'; " + "} " + "else " + "{";
|
|
135
133
|
|
|
136
134
|
if (
|
|
137
135
|
qx.core.Environment.get("css.alphaimageloaderneeded") &&
|
|
138
|
-
/\.png$/i.test(this.
|
|
136
|
+
/\.png$/i.test(this._iconUrlFalse)
|
|
139
137
|
) {
|
|
140
138
|
imageData.extras +=
|
|
141
139
|
" this.src='" +
|
|
@@ -144,11 +142,11 @@ qx.Class.define("qx.ui.progressive.renderer.table.cell.Boolean", {
|
|
|
144
142
|
" var loader = 'DXImageTransform.Microsoft.AlphaImageLoader'; " +
|
|
145
143
|
" var filters = this.filters.item(loader); " +
|
|
146
144
|
" filters.src='" +
|
|
147
|
-
this.
|
|
145
|
+
this._iconUrlFalse +
|
|
148
146
|
"'; " +
|
|
149
147
|
" filters.sizingMethod = 'scale'; ";
|
|
150
148
|
} else {
|
|
151
|
-
imageData.extras += " this.src='" + this.
|
|
149
|
+
imageData.extras += " this.src='" + this._iconUrlFalse + "'; ";
|
|
152
150
|
}
|
|
153
151
|
|
|
154
152
|
imageData.extras += " node.nodeValue='0'; " + "}";
|
|
@@ -176,13 +174,13 @@ qx.Class.define("qx.ui.progressive.renderer.table.cell.Boolean", {
|
|
|
176
174
|
},
|
|
177
175
|
|
|
178
176
|
destruct() {
|
|
179
|
-
this.
|
|
177
|
+
this._iconUrlTrue = this._iconUrlFalse = null;
|
|
180
178
|
|
|
181
179
|
// remove dynamic theme listener
|
|
182
180
|
if (qx.core.Environment.get("qx.dyntheme")) {
|
|
183
181
|
qx.theme.manager.Meta.getInstance().removeListener(
|
|
184
182
|
"changeTheme",
|
|
185
|
-
this.
|
|
183
|
+
this._resolveImages,
|
|
186
184
|
this
|
|
187
185
|
);
|
|
188
186
|
}
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Abstract Icon cell renderer.
|
|
24
|
+
*
|
|
25
|
+
* @asset(qx/static/blank.gif)
|
|
24
26
|
*/
|
|
25
27
|
qx.Class.define("qx.ui.progressive.renderer.table.cell.Icon", {
|
|
26
28
|
type: "abstract",
|
|
@@ -34,14 +36,14 @@ qx.Class.define("qx.ui.progressive.renderer.table.cell.Icon", {
|
|
|
34
36
|
var resourceManager = qx.util.ResourceManager.getInstance();
|
|
35
37
|
var blankImg = aliasManager.resolve("qx/static/blank.gif");
|
|
36
38
|
|
|
37
|
-
this.
|
|
39
|
+
this._imageBlank = resourceManager.toUri(blankImg);
|
|
38
40
|
},
|
|
39
41
|
|
|
40
42
|
members: {
|
|
41
43
|
/**
|
|
42
44
|
* A blank image for use as a spacer in place of another image
|
|
43
45
|
*/
|
|
44
|
-
|
|
46
|
+
_imageBlank: null,
|
|
45
47
|
|
|
46
48
|
/**
|
|
47
49
|
* Retrieve the URI for a blank image
|
|
@@ -50,7 +52,7 @@ qx.Class.define("qx.ui.progressive.renderer.table.cell.Icon", {
|
|
|
50
52
|
* The URI of the blank image.
|
|
51
53
|
*/
|
|
52
54
|
getBlankImage() {
|
|
53
|
-
return this.
|
|
55
|
+
return this._imageBlank;
|
|
54
56
|
},
|
|
55
57
|
|
|
56
58
|
/**
|
|
@@ -118,7 +120,7 @@ qx.Class.define("qx.ui.progressive.renderer.table.cell.Icon", {
|
|
|
118
120
|
// overridden
|
|
119
121
|
_getContentHtml(cellInfo) {
|
|
120
122
|
var html = [];
|
|
121
|
-
var imageData = this.
|
|
123
|
+
var imageData = this._getImageData(cellInfo);
|
|
122
124
|
|
|
123
125
|
// Start the image tag
|
|
124
126
|
html.push("<img ");
|
|
@@ -130,7 +132,7 @@ qx.Class.define("qx.ui.progressive.renderer.table.cell.Icon", {
|
|
|
130
132
|
) {
|
|
131
133
|
html.push(
|
|
132
134
|
'src="',
|
|
133
|
-
this.
|
|
135
|
+
this._imageBlank,
|
|
134
136
|
'" style="filter:',
|
|
135
137
|
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='",
|
|
136
138
|
imageData.url,
|
|
@@ -192,7 +194,7 @@ qx.Class.define("qx.ui.progressive.renderer.table.cell.Icon", {
|
|
|
192
194
|
* @return {Map}
|
|
193
195
|
* See {@link #_identifyImage}
|
|
194
196
|
*/
|
|
195
|
-
|
|
197
|
+
_getImageData(cellInfo) {
|
|
196
198
|
// Query the subclass about image and tooltip
|
|
197
199
|
var imageData = this._identifyImage(cellInfo);
|
|
198
200
|
|
|
@@ -206,7 +208,7 @@ qx.Class.define("qx.ui.progressive.renderer.table.cell.Icon", {
|
|
|
206
208
|
|
|
207
209
|
// If subclass gave null as url, replace with url to empty image
|
|
208
210
|
if (imageData.url == null) {
|
|
209
|
-
imageData.url = this.
|
|
211
|
+
imageData.url = this._imageBlank;
|
|
210
212
|
}
|
|
211
213
|
|
|
212
214
|
return imageData;
|
|
@@ -34,31 +34,34 @@ qx.Class.define("qx.ui.progressive.renderer.table.cell.Image", {
|
|
|
34
34
|
construct(width, height) {
|
|
35
35
|
super();
|
|
36
36
|
|
|
37
|
-
if (width
|
|
38
|
-
this.
|
|
37
|
+
if (width !== undefined) {
|
|
38
|
+
this._imageWidth = width;
|
|
39
39
|
} else {
|
|
40
|
-
this.
|
|
40
|
+
this._imageWidth = 16;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
if (height
|
|
44
|
-
this.
|
|
43
|
+
if (height !== undefined) {
|
|
44
|
+
this._imageHeight = height;
|
|
45
45
|
} else {
|
|
46
|
-
this.
|
|
46
|
+
this._imageHeight = 16;
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
|
|
50
50
|
members: {
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
_imageWidth: null,
|
|
52
|
+
_imageHeight: null,
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
imageHeight: this.__imageHeight
|
|
54
|
+
_getDefaultImageData(cellInfo) {
|
|
55
|
+
return {
|
|
56
|
+
imageWidth: this._imageWidth,
|
|
57
|
+
imageHeight: this._imageHeight
|
|
59
58
|
};
|
|
59
|
+
},
|
|
60
60
|
|
|
61
|
+
// overridden
|
|
62
|
+
_identifyImage(cellInfo) {
|
|
61
63
|
var height;
|
|
64
|
+
var imageData = this._getDefaultImageData(cellInfo);
|
|
62
65
|
|
|
63
66
|
// String data is the unresolved url for the image.
|
|
64
67
|
// Object data is a map containing the url, tooltip, and a height
|