Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
evolanakis opened this issue Jan 9, 2017 · 0 comments

Comments

@evolanakis
Copy link
Member

evolanakis commented Jan 9, 2017

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

Snippet to reproduce:

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
    }
}
@evolanakis evolanakis changed the title When selecting multiple checkboxes at the same time (multi-touch), selection listener only run once When selecting multiple checkboxes at the same time (multi-touch), there is a case, where the selection listener only run once Jan 9, 2017
@evolanakis evolanakis changed the title When selecting multiple checkboxes at the same time (multi-touch), there is a case, where the selection listener only run once When selecting multiple checkboxes at the same time (multi-touch) and those become disabled, not all selection listeners are notified Jan 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant