eclipsesource / eclipsesource/tabris

When selecting multiple checkboxes at the same time (multi-touch) and those become disabled, not all selection listeners are notified

Open
#450 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
56
Forks
18
PR merge metrics
No merged PRs in 30d

Description

Platforms: iOs and Android
Version: Tabris 1.5.0 / RAP 2.3.2

Snippet to reproduce:

```java
package app;

import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;

import com.eclipsesource.tabris.ui.AbstractPage;
import com.eclipsesource.tabris.ui.PageData;

@SuppressWarnings("serial")
public class TopLevelPage extends AbstractPage implements SelectionListener {

private Button button1, button2, button3, button4;

// To reproduce:
// - touch several checkboxes (two or more) at the same time
// - the widgetSelected code is only run once
// - the widgetSelected code is NOT run for the buttons that have been disabled during run-1
//
// This is caused by the following code in RAP:
// EventUtil.java:
// private static boolean isAccessible( Control control ) {
// return control.getEnabled() && control.getVisible() && isShellAccessible( control.getShell());
// }

@Override
public void createContent(final Composite parent, PageData data) {
GridLayoutFactory.swtDefaults().margins(44, 44).spacing(44, 44).numColumns(1).applyTo(parent);

button1 = new Button(parent, SWT.CHECK);
button1.setText("Checkbox 1");
button1.addSelectionListener(this);

button2 = new Button(parent, SWT.CHECK);
button2.setText("Checkbox 2");
button2.addSelectionListener(this);

button3 = new Button(parent, SWT.CHECK);
button3.setText("Checkbox 3");
button3.addSelectionListener(this);

button4 = new Button(parent, SWT.CHECK);
button4.setText("Checkbox 4");
button4.addSelectionListener(this);
}

@Override
public void widgetSelected(SelectionEvent e) {
System.out.println("** Widget selected: " + ((Button)e.widget).getText());
button1.setEnabled(false);
button2.setEnabled(false);
button3.setEnabled(false);
button4.setEnabled(false);
}

@Override
public void widgetDefaultSelected(SelectionEvent e) {
// unused
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.