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

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

Introduction

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

Prototype

public void addSelectionListener(SelectionListener listener) 

Source Link

Document

Adds an SelectionListener to the collection of selectionEventListeners

Usage

From source file:org.neuro4j.studio.debug.ui.views.StructuredViewer.java

License:Apache License

protected void hookControl(Control control) {
    super.hookControl(control);
    OpenStrategy handler = new OpenStrategy(control);
    handler.addSelectionListener(new SelectionListener() {
        public void widgetSelected(SelectionEvent e) {
            // On Windows, selection events may happen during a refresh.
            // Ignore these events if we are currently in preservingSelection().
            // See bug 184441.
            if (!inChange) {
                handleSelect(e);/* w  w  w  .j ava  2s . c  o  m*/
            }
        }

        public void widgetDefaultSelected(SelectionEvent e) {
            handleDoubleSelect(e);
        }
    });
    handler.addPostSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            handlePostSelect(e);
        }
    });
    handler.addOpenListener(new IOpenEventListener() {
        public void handleOpen(SelectionEvent e) {
            StructuredViewer.this.handleOpen(e);
        }
    });
}