File tree Expand file tree Collapse file tree 2 files changed +21
-7
lines changed
sources/net.sf.j2s.java.core/src/swingjs Expand file tree Collapse file tree 2 files changed +21
-7
lines changed Original file line number Diff line number Diff line change 22
33import javax .swing .JPopupMenu ;
44
5+ /**
6+ * An abstract class to cover the JavaScript calls made to j2sMenu
7+ * @author hansonr
8+ *
9+ */
510public abstract class JSSwingMenu {
611
712 public class Options {
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ public DOMNode updateDOMNode() {
3636 return domNode ;
3737 }
3838
39+
3940 @ Override
4041 public boolean handleJSEvent (Object target , int eventType , Object jQueryEvent ) {
4142 // we use == here because this will be JavaScript
@@ -59,19 +60,27 @@ public void installUI(JComponent jc) {
5960 super .installUI (jc );
6061 }
6162
63+
6264 @ Override
6365 public void propertyChange (PropertyChangeEvent e ) {
64- super .propertyChange (e );
6566 String prop = e .getPropertyName ();
66- if (jc .isVisible ()) {
67- if (prop == "ancestor" ) {
68- if (jc .getParent () != null ) {
69- jc .getParent ().秘getUI ().setHTMLElement ();
70- }
67+ if (!jc .isVisible () && prop != "ancestor" && jc .getParent () == null )
68+ return ;
69+ switch (prop ) {
70+ case "focusPainted" :
71+ case "focusable" :
72+ case "borderPainted" :
73+ case "opaque" :
74+ return ;
75+ }
76+ super .propertyChange (e );
77+ if (prop == "ancestor" ) {
78+ if (jc .getParent () != null ) {
79+ jc .getParent ().秘getUI ().setHTMLElement ();
7180 }
7281 }
7382 }
74-
83+
7584 @ Override
7685 protected String getPropertyPrefix () {
7786 return "MenuItem" ;
You can’t perform that action at this time.
0 commit comments