Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.FocusAdapter


    final Label urlPathLabel = new Label(group_1, SWT.NONE);
    urlPathLabel.setText("Url Path");

    tUrlPath = new Text(group_1, SWT.BORDER);
    tUrlPath.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        tUrlPath.selectAll();
      }
    });
    tUrlPath.addKeyListener(new KeyAdapter() {
      public void keyPressed(final KeyEvent e) {    
        if ((tUrlPath.getText().length() > 0) && (tUrlPath.getText().charAt(0) != '/')) {
          tUrlPath.setText("/" + tUrlPath.getText());
          tUrlPath.setSelection(2);
        }
        if (e.keyCode == SWT.CR && !tUrlPath.getText().equals(""))
          applyHttpDirectory();
      }
    });
    tUrlPath.addModifyListener(new ModifyListener() {
      public void modifyText(final ModifyEvent e) {
        bApplyHttpDirectory.setEnabled(!tUrlPath.getText().equals(""));

      }
    });
    tUrlPath.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

    final Label pathLabel = new Label(group_1, SWT.NONE);
    pathLabel.setText("Path");

    tPath = new Text(group_1, SWT.BORDER);
    tPath.addFocusListener(new FocusAdapter() {
      public void focusGained(final FocusEvent e) {
        tPath.selectAll();
      }
    });
    tPath.addKeyListener(new KeyAdapter() {
View Full Code Here


                SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL, this);
        variablesViewer.setContentProvider(createContentProvider());
        variablesViewer.setLabelProvider(new VariablesViewLabelProvider(
                getModelPresentation()));
        variablesViewer.setUseHashlookup(true);
        variablesViewer.getControl().addFocusListener(new FocusAdapter() {
            public void focusGained(FocusEvent e) {
                getVariablesViewSelectionProvider()
                        .setUnderlyingSelectionProvider(variablesViewer);
                setAction(SELECT_ALL_ACTION,
                        getAction(VARIABLES_SELECT_ALL_ACTION));
                setAction(COPY_ACTION, getAction(VARIABLES_COPY_ACTION));
                getViewSite().getActionBars().updateActionBars();
                setFocusViewer(getVariablesViewer());
            }
        });
        variablesViewer
                .addSelectionChangedListener(getTreeSelectionChangedListener());
        getVariablesViewSelectionProvider().setUnderlyingSelectionProvider(
                variablesViewer);
        getSite().setSelectionProvider(getVariablesViewSelectionProvider());

        SourceViewer detailsViewer = new SourceViewer(getSashForm(), null,
                SWT.V_SCROLL | SWT.H_SCROLL);
        setDetailViewer(detailsViewer);
        detailsViewer.setDocument(getDetailDocument());
        detailsViewer.getTextWidget().setFont(
                JFaceResources
                        .getFont(IInternalDebugUIConstants.DETAIL_PANE_FONT));
        getDetailDocument().addDocumentListener(getDetailDocumentListener());
        detailsViewer.setEditable(false);
        getSashForm().setMaximizedControl(variablesViewer.getControl());

        detailsViewer.getSelectionProvider().addSelectionChangedListener(
                getDetailSelectionChangedListener());

        detailsViewer.getControl().addFocusListener(new FocusAdapter() {
            public void focusGained(FocusEvent e) {
                getVariablesViewSelectionProvider()
                        .setUnderlyingSelectionProvider(
                                getDetailViewer().getSelectionProvider());
                setAction(SELECT_ALL_ACTION,
View Full Code Here

        group.setText("Applications"); // Generated
        group.setLayout(gridLayout); // Generated
        label = new Label(group, SWT.NONE);
        label.setText("Name:"); // Generated
        tName = new Text(group, SWT.BORDER);
        tName.addFocusListener(new FocusAdapter() {
          public void focusGained(final FocusEvent e) {
            tName.selectAll();
          }
        });
        tName.setLayoutData(gridData); // Generated
        tName.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
            public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
                setApplyStatus();
            }
        });
        bApply = new Button(group, SWT.NONE);
        bApply.setText("Apply Application"); // Generated
        bApply.setLayoutData(gridData2); // Generated
        bApply.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
            public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
                applyApp();
            }
        });
        label1 = new Label(group, SWT.NONE);
        label1.setText("ID:"); // Generated
        tID = new Text(group, SWT.BORDER);
        tID.addFocusListener(new FocusAdapter() {
          public void focusGained(final FocusEvent e) {
          }
        });
        tID.setLayoutData(gridData4); // Generated
        tID.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
View Full Code Here

        btnMoveDown.setText("Down");
        btnMoveDown.setImage(imgDown);
        btnMoveDown.setEnabled(false);

        // Listeners
        table.addFocusListener(new FocusAdapter() {
            @Override
            public void focusGained(FocusEvent e) {
                ISelection selection = viewer.getSelection();
                if (!selection.isEmpty())
                    managedForm.fireSelectionChanged(PkgPatternsListPart.this, selection);
View Full Code Here

        btnMoveDown.setText("Down");
        btnMoveDown.setImage(imgDown);
        btnMoveDown.setEnabled(false);

        // Listeners
        table.addFocusListener(new FocusAdapter() {
            @Override
            public void focusGained(FocusEvent e) {
                ISelection selection = viewer.getSelection();
                if (!selection.isEmpty())
                    managedForm.fireSelectionChanged(PkgPatternsListPart.this, selection);
View Full Code Here

           */
          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() {
          public void focusGained(FocusEvent e) {
            refreshValidState();
          }

          public void focusLost(FocusEvent e) {
View Full Code Here

      public void keyReleased(KeyEvent e) {
        updateEditingPosition();
      }
    });
    wScript.addFocusListener(new FocusAdapter() {
      public void focusGained(FocusEvent e) {
        updateEditingPosition();
      }

      public void focusLost(FocusEvent e) {
View Full Code Here

                            break;
                    }
                }
            }
        });
        txt.addFocusListener(new FocusAdapter()
        {
            @Override
            public void focusLost(FocusEvent e)
            {
                handleValueChanged();
View Full Code Here

                     */
                    public void keyReleased(KeyEvent e) {
                        valueChanged();
                    }
                });
                textField.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:
                textField.addKeyListener(new KeyAdapter() {
                    public void keyPressed(KeyEvent e) {
                        clearErrorMessage();
                    }
                });
                textField.addFocusListener(new FocusAdapter() {
                    public void focusGained(FocusEvent e) {
                        refreshValidState();
                    }

                    public void focusLost(FocusEvent e) {
View Full Code Here

                checkSelection();
                checkDeleteable();
                checkSelectable();
            }
        });
        text.addFocusListener(new FocusAdapter() {
            public void focusLost(FocusEvent e) {
                TextCellEditor.this.focusLost();
            }
        });
        text.setFont(parent.getFont());
View Full Code Here

TOP

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

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.