Skip to content

Commit 4797dc2

Browse files
hansonrhansonr
authored andcommitted
j2sDoPropagate option for button and text UI
to propagate the jQuery effect (button press, text entry) while still effecting a Java consume
1 parent 973b5aa commit 4797dc2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

sources/net.sf.j2s.java.core/src/java/awt/event/InputEvent.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,8 @@ public int getModifiersEx() {
355355
@Override
356356
public void consume() {
357357
JSComponentUI ui = (JSComponentUI) ((JComponent) source).getUI();
358-
if (bdata != null && ui != null && ui.buttonListener == null && !ui.j2sDoPropagate) {
358+
if (bdata != null && ui != null && ui.buttonListener == null
359+
&& ((/** @j2sNative !this.bdata.doPropagate || */false))) {
359360
JSToolkit.consumeEvent(this);
360361
}
361362
consumed = true;

sources/net.sf.j2s.java.core/src/swingjs/JSMouse.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,12 @@ private void mouseAction(int id, long time, int x, int y, int xcount,
313313
* @j2sNative
314314
*
315315
* bdata.jqevent = jqevent;
316-
*
317-
* c = jqevent.target["data-component"];
316+
* bdata.source = c = jqevent.target["data-component"];
317+
* bdata.doPropagate = c && c.ui.j2sDoPropagate;
318318
*/
319319

320+
// bdata.doPropagate will be tested in InputEvent.doConsume.
321+
320322
// the key here is that if we have a data-component, go directly to its
321323
// container and dispatch the event; if we go through the event queue, any e.consume()
322324
// that occurs is too late to consume the event.

0 commit comments

Comments
 (0)