Search in sources :

Example 31 with TraverseEvent

use of org.eclipse.swt.events.TraverseEvent in project eclipse.platform.text by eclipse.

the class ContentAssistant method install.

protected void install() {
    fLayoutManager = new LayoutManager();
    fInternalListener = new InternalListener();
    AdditionalInfoController controller = null;
    if (fInformationControlCreator != null)
        controller = new AdditionalInfoController(fInformationControlCreator, OpenStrategy.getPostSelectionDelay());
    fContextInfoPopup = fContentAssistSubjectControlAdapter.createContextInfoPopup(this);
    fProposalPopup = fContentAssistSubjectControlAdapter.createCompletionProposalPopup(this, controller, fAsynchronous);
    fProposalPopup.setSorter(fSorter);
    registerHandler(SELECT_NEXT_PROPOSAL_COMMAND_ID, fProposalPopup.createProposalSelectionHandler(CompletionProposalPopup.ProposalSelectionHandler.SELECT_NEXT));
    registerHandler(SELECT_PREVIOUS_PROPOSAL_COMMAND_ID, fProposalPopup.createProposalSelectionHandler(CompletionProposalPopup.ProposalSelectionHandler.SELECT_PREVIOUS));
    if (Helper.okToUse(fContentAssistSubjectControlAdapter.getControl())) {
        fContentAssistSubjectControlShell = fContentAssistSubjectControlAdapter.getControl().getShell();
        fCASCSTraverseListener = new TraverseListener() {

            @Override
            public void keyTraversed(TraverseEvent e) {
                if (e.detail == SWT.TRAVERSE_ESCAPE && isProposalPopupActive())
                    e.doit = false;
            }
        };
        fContentAssistSubjectControlShell.addTraverseListener(fCASCSTraverseListener);
    }
    manageAutoActivation(fIsAutoActivated);
}
Also used : TraverseEvent(org.eclipse.swt.events.TraverseEvent) TraverseListener(org.eclipse.swt.events.TraverseListener)

Aggregations

TraverseEvent (org.eclipse.swt.events.TraverseEvent)31 TraverseListener (org.eclipse.swt.events.TraverseListener)30 SelectionEvent (org.eclipse.swt.events.SelectionEvent)11 FocusEvent (org.eclipse.swt.events.FocusEvent)10 FocusAdapter (org.eclipse.swt.events.FocusAdapter)9 ModifyEvent (org.eclipse.swt.events.ModifyEvent)8 MouseEvent (org.eclipse.swt.events.MouseEvent)8 Point (org.eclipse.swt.graphics.Point)8 KeyEvent (org.eclipse.swt.events.KeyEvent)7 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)7 Button (org.eclipse.swt.widgets.Button)7 Text (org.eclipse.swt.widgets.Text)7 StyledText (org.eclipse.swt.custom.StyledText)6 ModifyListener (org.eclipse.swt.events.ModifyListener)6 Composite (org.eclipse.swt.widgets.Composite)6 MouseAdapter (org.eclipse.swt.events.MouseAdapter)5 Listener (org.eclipse.swt.widgets.Listener)5 GridData (org.eclipse.swt.layout.GridData)4 Label (org.eclipse.swt.widgets.Label)4 ComboWithEnableFix (edu.cmu.cs.hcii.cogtool.util.ComboWithEnableFix)3