Example usage for org.eclipse.jface.util OpenStrategy getPostSelectionDelay

List of usage examples for org.eclipse.jface.util OpenStrategy getPostSelectionDelay

Introduction

In this page you can find the example usage for org.eclipse.jface.util OpenStrategy getPostSelectionDelay.

Prototype

public static final int getPostSelectionDelay() 

Source Link

Document

Returns the delay for post selection events.

Usage

From source file:org.eclipse.jpt.common.ui.internal.swt.widgets.DisplayTools.java

License:Open Source License

/**
 * Use the standard delay./*from ww  w  .  ja  v  a2s  .c o m*/
 * <p>
 * <strong>NB:</strong> The runnable will not be executed if the workbench
 * is not running (i.e. the runnable is treated as ephemeral, and not
 * executing it, probably during workbench shutdown, is not a problem because
 * it is UI-related and the UI is gone).
 * @see OpenStrategy#getPostSelectionDelay()
 * @see #timerExec(int, Runnable)
 */
public static void delayedExec(Runnable runnable) {
    timerExec(OpenStrategy.getPostSelectionDelay(), runnable);
}

From source file:org.xmind.ui.viewers.MListViewer.java

License:Open Source License

private void handleItemSelect(final Event event) {
    handleSelect(new SelectionEvent(event));

    if (event.detail == SWT.ARROW_DOWN || event.detail == SWT.ARROW_UP || event.detail == SWT.ARROW_LEFT
            || event.detail == SWT.ARROW_RIGHT) {
        keyDownSelectionEventId++;//w ww  .ja  v a2s .c  o  m
        final int id = keyDownSelectionEventId;
        Display.getCurrent().timerExec(OpenStrategy.getPostSelectionDelay(), new Runnable() {
            public void run() {
                if (id != keyDownSelectionEventId)
                    return;

                handlePostSelect(new SelectionEvent(event));
            }
        });
    } else {
        Display.getCurrent().asyncExec(new Runnable() {
            public void run() {
                handlePostSelect(new SelectionEvent(event));
            }
        });
    }
}