Package org.eclipse.swt.custom

Examples of org.eclipse.swt.custom.VerifyKeyListener


        } else {
            isDefined = false;
        }

        if (forceCreation || !isDefined) {
            return new VerifyKeyListener() {

                public void verifyKey(VerifyEvent event) {
                    if (event.doit) {
                        boolean isHome;
                        if (isDefined) {
View Full Code Here


                        site = activePart.getSite();
                    }
                }
            }
        }
        VerifyKeyListener createVerifyKeyListener = FirstCharAction.createVerifyKeyListener(viewer, site, true);
        if (createVerifyKeyListener != null) {
            viewer.appendVerifyKeyListener(createVerifyKeyListener);
        }
        return viewer;
    }
View Full Code Here

        //content assist handling (we don't want to execute the event because the content assist handling
        //will be done here).

        //verify if it was a content assist
        styledText.addVerifyKeyListener(new VerifyKeyListener() {
            public void verifyKey(VerifyEvent event) {
                if (KeyBindingHelper.matchesContentAssistKeybinding(event)
                        || KeyBindingHelper.matchesQuickAssistKeybinding(event)) {
                    event.doit = false;
                    return;
View Full Code Here

    /**
     * Creates a handler that will properly treat backspaces considering python code.
     */
    public static VerifyKeyListener createVerifyKeyListener(final TextViewer viewer, final PyEdit edit) {
        return new VerifyKeyListener() {

            public void verifyKey(VerifyEvent event) {
                if ((event.doit && event.character == SWT.BS && event.stateMask == 0 && viewer != null && viewer
                        .isEditable())) { //isBackspace
                    boolean blockSelection = false;
View Full Code Here

                : "Ctrl");
      }
    }

    private void installAutoEvalExpressionOnEnter() {
        viewerWidget.addVerifyKeyListener(new VerifyKeyListener() {
          private boolean enterAlonePressed(VerifyEvent e) {
            return (e.keyCode == SWT.LF || e.keyCode == SWT.CR)
            && e.stateMask == SWT.NONE;
          }
          private boolean noSelection() {
View Full Code Here

    commitMessageComponent = new CommitMessageComponent(listener);
    commitMessageComponent.attachControls(commitMessageText, authorText,
        committerText);

    // allow to commit with ctrl-enter
    commitMessageText.getTextWidget().addVerifyKeyListener(new VerifyKeyListener() {
      public void verifyKey(VerifyEvent event) {
        if (UIUtils.isSubmitKeyEvent(event)) {
          event.doit = false;
          commit(false);
        }
View Full Code Here

    if (fViewer instanceof ITextViewerExtension) {
      final ITextViewerExtension textViewerExtension= (ITextViewerExtension)fViewer;
      final StyledText textWidget= fViewer.getTextWidget();

      final VerifyKeyListener verifyListener= new VerifyKeyListener() {
        public void verifyKey(VerifyEvent event) {
          if (isActive() && event.keyCode == 13 && event.character == '\r' && event.widget == textWidget) {
            event.doit= false;
            insertSelectedContext();
            hideContextSelector();
View Full Code Here

      try {
        fReentranceCount++;
        Iterator iterator= fListeners.iterator();
        while (iterator.hasNext() && event.doit) {
          VerifyKeyListener listener= (VerifyKeyListener) iterator.next();
          listener.verifyKey(event); // we might trigger reentrant calls on GTK
        }
      } finally {
        fReentranceCount--;
      }
      if (fReentranceCount == 0)
View Full Code Here

TOP

Related Classes of org.eclipse.swt.custom.VerifyKeyListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.