Skip to content

Commit 2c2ce57

Browse files
committed
runtime fixes for ListRenderers, alert for thread.wait(),
adds dnd DropTargetAdapter preliminary work on editable combobox
1 parent 57ffbde commit 2c2ce57

File tree

5 files changed

+16
-24
lines changed

5 files changed

+16
-24
lines changed
-963 Bytes
Binary file not shown.

sources/net.sf.j2s.java.core/src/swingjs/jquery/test.htm

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,15 @@
3737
</head>
3838
<body>
3939
<div class="select-editable">
40-
<select id=selector onchange="this.nextElementSibling.value=this.value">
41-
<option style="height:1px" value=""></option>
42-
<option value="115x175 mm">115x175 mm</option>
43-
<option value="120x160 mm">120x160 mm</option>
44-
<option value="120x287 mm">120x287 mm</option>
40+
<select id=selector onchange="this.nextElementSibling.value=this.value" onmousemove="document.getElementById('info').innerHTML=event.x + this">
41+
<option style="height:1px" value="" onmousemove="document.getElementById('info').innerHTML=event.x + this"></option>
42+
<option value="115x175 mm" onmouseEnter="alert(1)" onmousemove="document.getElementById('info').innerHTML=event.x + this">115x175 mm</option>
43+
<option value="120x160 mm" onmousemove="document.getElementById('info').innerHTML=event.x + this">120x160 mm</option>
44+
<option value="120x287 mm" onmousemove="document.getElementById('info').innerHTML=event.x + this">120x287 mm</option>
4545
</select>
46-
<input type="text" name="format" value="" />
46+
<input type="text" name="format" value="" onkeyup="this.previousElementSibling.options[0].value=this.previousElementSibling.options[0].innerHTML=this.value"/>
4747
</div>
48-
49-
<br>
50-
<h3> Using HTML5 </h3>
51-
<input list="browsers" name="browser">
52-
<datalist id="browsers">
53-
<option value="Internet Explorer">
54-
<option value="Firefox">
55-
<option value="Chrome">
56-
<option value="Opera">
57-
</datalist>
48+
<div id=info style="position:absolute;left:300px;top:0px"></div>
5849

5950
</body>
6051
</html>

sources/net.sf.j2s.java.core/src/swingjs/plaf/JSComponentUI.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,20 +1343,20 @@ public Dimension getPreferredSize() {
13431343
return getPreferredSize(jc);
13441344
}
13451345

1346+
// the following are likely to be called in the original BasicXXXUI classes
13461347

1347-
1348-
public Dimension getMinimumSize(JComponent jc) {
1348+
Dimension getMinimumSize(JComponent jc) {
13491349
return getPreferredSize(jc);
13501350
}
13511351

1352-
public Dimension getPreferredSize(JComponent jc) {
1352+
Dimension getPreferredSize(JComponent jc) {
13531353
Dimension d = getHTMLSize();
13541354
if (debugging)
13551355
System.out.println("CUI >> getPrefSize >> " + d + " for " + this.id);
13561356
return d;
13571357
}
13581358

1359-
public Dimension getMaximumSize(JComponent jc) {
1359+
Dimension getMaximumSize(JComponent jc) {
13601360
if (isToolbarFixed) {
13611361
Container parent = jc.getParent();
13621362
String parentClass = (parent == null ? null : parent.getUIClassID());
@@ -1825,8 +1825,9 @@ private void undisposeUI(DOMNode node) {
18251825
if (ui.containerNode != null)
18261826
ui.containerNode.appendChild(node);
18271827
}
1828-
if (outerNode != null && domNode != outerNode) // menu separators have
1829-
// domNode == outerNode
1828+
// menu separators have domNode == outerNode
1829+
// cell renderers will set their domNode to null;
1830+
if (outerNode != null && domNode != null && domNode != outerNode)
18301831
outerNode.appendChild(domNode);
18311832
isDisposed = false;
18321833
}

sources/net.sf.j2s.java.core/srcjs/js/j2sClazz.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,7 @@ var minimalObjNames = [ "equals", "equals$O", "hashCode" /*"toString",*/ ];
11361136
addProto(proto, "finalize", function () {});
11371137
addProto(proto, "notify", function () {});
11381138
addProto(proto, "notifyAll", function () {});
1139-
addProto(proto, "wait", function () {});
1139+
addProto(proto, "wait", function () {alert("Object.wait was called!" + arguments.callee.caller.toString())});
11401140
addProto(proto, "to$tring", Object.prototype.toString);
11411141
addProto(proto, "toString", function () { return (this.__CLASS_NAME__ ? "[" + this.__CLASS_NAME__ + " object]" : this.to$tring.apply(this, arguments)); });
11421142

sources/net.sf.j2s.java.core/srcjs/swingjs2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14221,7 +14221,7 @@ var minimalObjNames = [ "equals", "equals$O", "hashCode" /*"toString",*/ ];
1422114221
addProto(proto, "finalize", function () {});
1422214222
addProto(proto, "notify", function () {});
1422314223
addProto(proto, "notifyAll", function () {});
14224-
addProto(proto, "wait", function () {});
14224+
addProto(proto, "wait", function () {alert("Object.wait was called!" + arguments.callee.caller.toString()});
1422514225
addProto(proto, "to$tring", Object.prototype.toString);
1422614226
addProto(proto, "toString", function () { return (this.__CLASS_NAME__ ? "[" + this.__CLASS_NAME__ + " object]" : this.to$tring.apply(this, arguments)); });
1422714227

0 commit comments

Comments
 (0)