Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.KeyAdapter


        dropAdapter.setExpandEnabled(false);
        viewer.addDropSupport(DND.DROP_COPY | DND.DROP_MOVE, new Transfer[] {
                LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance(), ResourceTransfer.getInstance(), URLTransfer.getInstance()
        }, dropAdapter);

        table.addKeyListener(new KeyAdapter() {
            @Override
            public void keyReleased(KeyEvent e) {
                if (e.character == SWT.DEL) {
                    doRemove();
                } else if (e.character == '+') {
View Full Code Here


            public void selectionChanged(SelectionChangedEvent event) {
                boolean enable = !viewer.getSelection().isEmpty();
                removeItem.setEnabled(enable);
            }
        });
        table.addKeyListener(new KeyAdapter() {
            @Override
            public void keyReleased(KeyEvent e) {
                if (e.character == SWT.DEL) {
                    doRemove();
                } else if (e.character == '+') {
View Full Code Here

            @Override
            public void widgetSelected(SelectionEvent e) {
                doRemove();
            }
        });
        table.addKeyListener(new KeyAdapter() {
            @Override
            public void keyReleased(KeyEvent e) {
                if (e.character == SWT.DEL) {
                    doRemove();
                } else if (e.character == '+') {
View Full Code Here

                boolean enable = !viewer.getSelection().isEmpty();
                removeItemTool.setEnabled(enable);
                editItemTool.setEnabled(enable);
            }
        });
        table.addKeyListener(new KeyAdapter() {
            @Override
            public void keyReleased(KeyEvent e) {
                if (e.character == SWT.DEL) {
                    doRemove();
                } else if (e.character == '+') {
View Full Code Here

            @Override
            protected int indexOf(Object object) {
                return 0;
            }
        });
        table.addKeyListener(new KeyAdapter() {
            @Override
            public void keyReleased(KeyEvent e) {
                if (e.character == SWT.DEL) {
                    doRemovePackages();
                } else if (e.character == '+') {
View Full Code Here

            public boolean canModify(Object element, String property) {
                return true;
            }
        });
        tableViewer.getTable().addKeyListener(new KeyAdapter() {
            @Override
            public void keyPressed(KeyEvent event) {
                if (event.keyCode == SWT.F2 && event.stateMask == 0) {
                    ISelection selection = tableViewer.getSelection();
                    if (!(selection instanceof IStructuredSelection))
View Full Code Here

    if (spinner == null) {
      spinner = new Spinner(parent, SWT.SINGLE | SWT.BORDER);
      spinner.setFont(parent.getFont());
      switch (validateStrategy) {
      case VALIDATE_ON_KEY_STROKE:
        spinner.addKeyListener(new KeyAdapter() {

          /*
           * (non-Javadoc)
           * @see org.eclipse.swt.events.KeyAdapter#keyReleased(org.eclipse.swt.events.KeyEvent)
           */
          public void keyReleased(KeyEvent e) {
            valueChanged();
          }
        });
        spinner.addFocusListener(new FocusAdapter() {
          // Ensure that the value is checked on focus loss in case we
          // missed a keyRelease or user hasn't released key.
          // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=214716
          public void focusLost(FocusEvent e) {
            valueChanged();
          }
        });

        break;
      case VALIDATE_ON_FOCUS_LOST:
        spinner.addKeyListener(new KeyAdapter() {
          public void keyPressed(KeyEvent e) {
            clearErrorMessage();
          }
        });
        spinner.addFocusListener(new FocusAdapter() {
View Full Code Here

        data.heightHint = 400;
        resourceNameTable.setLayoutData(data);

        viewer = new TableViewer(resourceNameTable);

        txtFilter.addKeyListener(new KeyAdapter()
        {
            @Override
            public void keyReleased(KeyEvent e)
            {
                switch (e.keyCode)
View Full Code Here

    protected void createCustom(Composite body)
    {
        Label l = new Label(body, SWT.NONE);
        l.setText("Version:");
        versionText = new Text(body, SWT.BORDER);
        versionText.addKeyListener(new KeyAdapter()
        {
            @Override
            public void keyReleased(KeyEvent e)
            {
                try
View Full Code Here

        });

        new Label(body, SWT.NONE).setText("Version:");

        specificText = new Text(body, SWT.BORDER);
        specificText.addKeyListener(new KeyAdapter()
        {
            @Override
            public void keyReleased(KeyEvent e)
            {
                setVersions();
            }
        });

        rangeButton = new Button(body, SWT.RADIO);
        rangeButton.setText("Range:");

        new Label(body, SWT.NONE).setText("Minimum:");

        minimumText = new Text(body, SWT.BORDER);
        minimumText.addKeyListener(new KeyAdapter()
        {
            @Override
            public void keyReleased(KeyEvent e)
            {
                setVersions();
            }
        });

        minInclusiveButton = new Button(body, SWT.CHECK);
        minInclusiveButton.setText("inclusive");
        minInclusiveButton.setSelection(true);
        minInclusiveButton.addSelectionListener(new SelectionAdapter()
        {
            @Override
            public void widgetSelected(SelectionEvent e)
            {
                setVersions();
            }
        });

        new Label(body, SWT.NONE).setText("Maximum:");
        maximumText = new Text(body, SWT.BORDER);
        maximumText.addKeyListener(new KeyAdapter()
        {
            @Override
            public void keyReleased(KeyEvent e)
            {
                setVersions();
View Full Code Here

TOP

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

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.