Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.KeyListener


      }
    });

    // Hook up the return key in the location bar.
    //
    location.addKeyListener(new KeyListener() {
      public void keyPressed(KeyEvent e) {
        if (e.character == '\r') {
          go(location.getText());
        }
      }
View Full Code Here


    makeActions();
    hookContextMenu();
    hookViewerEvents();
   
    fViewer.getControl().addKeyListener(new KeyListener() {
      public void keyPressed(KeyEvent event) {
        if ((event.stateMask & SWT.CTRL) != 0) {
                switch (event.keyCode) {
                  case '+' :
                    if(expandAction.isEnabled()) {
View Full Code Here

    private boolean mIsActive;

    private AnnotationFS mCandidate;

    FeatureStructureDragListener(final StyledText textWidget) {
      textWidget.addKeyListener(new KeyListener() {
        public void keyPressed(KeyEvent e) {
          if (e.keyCode == SWT.ALT) {
            mIsActive = true;

            textWidget.setCursor(Display.getCurrent().getSystemCursor(SWT.CURSOR_HAND));
View Full Code Here

    //
    // Until this can be used we improvise by registering a couple of listeners which
    // compute a caret offset change based on events which could change it,
    // that are key and mouse listeners.
   
    getSourceViewer().getTextWidget().addKeyListener(new KeyListener() {
      public void keyPressed(KeyEvent e) {
        int newCaretOffset = getSourceViewer().getTextWidget().getCaretOffset();

        if (newCaretOffset != mCursorPosition) {
          mCursorPosition = newCaretOffset;
View Full Code Here

    // especially on a Mac
    FontData [] fontData = cc.getFont().getFontData();
    ((GridData) cc.getLayoutData()).heightHint = 2 * fontData[0].getHeight();
    cc.addListener(SWT.Selection, this);
    cc.setToolTipText(tip);
    cc.addKeyListener(new KeyListener() {
      private final StringBuffer b = new StringBuffer();

      public void keyPressed(KeyEvent e) {
      }

View Full Code Here

        if (validator != null)
          validator.validate(newEditor.getText());
        evt.doit = true;
      }
    });
    newEditor.addKeyListener(new KeyListener() {
      public void keyPressed(KeyEvent arg0) {
        // nothing to do
      }

      public void keyReleased(KeyEvent evt) {
View Full Code Here

        if (validator != null)
          validator.validate(newEditor.getText());
        evt.doit = true;
      }
    });
    newEditor.addKeyListener(new KeyListener() {
      public void keyPressed(KeyEvent arg0) {
        // nothing to do
      }

      public void keyReleased(KeyEvent evt) {
View Full Code Here

        if (validator != null)
          validator.validate(newEditor.getText());
        evt.doit = true;
      }
    });
    newEditor.addKeyListener(new KeyListener() {
      public void keyPressed(KeyEvent arg0) {
        // nothing to do
      }

      public void keyReleased(KeyEvent evt) {
View Full Code Here

        if (validator != null)
          validator.validate(newEditor.getText());
        evt.doit = true;
      }
    });
    newEditor.addKeyListener(new KeyListener() {
      public void keyPressed(KeyEvent arg0) {
        // nothing to do
      }

      public void keyReleased(KeyEvent evt) {
View Full Code Here

    gd = new GridData(SWT.FILL, SWT.TOP, true, false);
    gd.horizontalIndent = 5;
    pathField.setLayoutData(gd);

    prefixField.addKeyListener(new KeyListener(){

      public void keyPressed(KeyEvent e) {
        markDirty();
      }
View Full Code Here

TOP

Related Classes of org.eclipse.swt.events.KeyListener

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.