Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.FocusListener


        nameText.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent event) {
                logger.trace("got modify event: " + event);
            }
        });
        nameText.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent event) {
            }

            public void focusLost(FocusEvent event) {
                logger.debug("got focus lost event: " + event);

                participant.setName(nameText.getText());
                ParticipantEditor.this.setPartName(getTitle());

                doSave(null);
            }
        });
        // TODO

        // contact info
        label = new Label(comp, SWT.RIGHT);
        label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
        label.setText(Messages.getString("participant.editor.contact_info.label"));
        label.setToolTipText(Messages.getString("participant.editor.contact_info.tooltip"));

        contactInfoText = new Text(comp, SWT.SINGLE | SWT.BORDER);
        contactInfoText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
        contactInfoText.setToolTipText(Messages.getString("participant.editor.contact_info.tooltip"));
        contactInfoText.setText(participant.getContactInfo());
        contactInfoText.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent event) {
                logger.trace("got modify event: " + event);
            }
        });
        contactInfoText.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent event) {
            }

            public void focusLost(FocusEvent event) {
                logger.debug("got focus lost event: " + event);

                participant.setContactInfo(contactInfoText.getText());

                doSave(null);
            }
        });
        // TODO

        // image
        Group imageGroup = new Group(comp, SWT.BORDER);
        imageGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 2));
        imageGroup.setText(Messages.getString("participant.editor.image.label"));

        imageLabel = new Label(imageGroup, SWT.CENTER);
        imageLabel.setText("TODO");
        // TODO: image
        // TODO: drop target

        // address
        label = new Label(comp, SWT.RIGHT);
        label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
        label.setText(Messages.getString("participant.editor.address.label"));
        label.setToolTipText(Messages.getString("participant.editor.address.tooltip"));

        addressText = new Text(comp, SWT.MULTI | SWT.BORDER);
        addressText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
        addressText.setToolTipText(Messages.getString("participant.editor.address.tooltip"));
        addressText.setText(participant.getAddress());
        addressText.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent event) {
                logger.trace("got modify event: " + event);
            }
        });
        addressText.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent event) {
            }

            public void focusLost(FocusEvent event) {
                logger.debug("got focus lost event: " + event);

                participant.setAddress(addressText.getText());

                doSave(null);
            }
        });
        // TODO

        // notes
        label = new Label(comp, SWT.RIGHT);
        label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
        label.setText(Messages.getString("participant.editor.notes.label"));
        label.setToolTipText(Messages.getString("participant.editor.notes.tooltip"));

        notesText = new Text(comp, SWT.SINGLE | SWT.BORDER);
        notesText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1));
        notesText.setToolTipText(Messages.getString("participant.editor.notes.tooltip"));
        notesText.setText(participant.getNotes());
        notesText.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent event) {
                logger.trace("got modify event: " + event);
            }
        });
        notesText.addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent event) {
            }

            public void focusLost(FocusEvent event) {
                logger.debug("got focus lost event: " + event);
View Full Code Here


                CategoriesComposite.POLICIES, dram);
        section.setClient(categoriesComposite);

        // Set up a focus listener for maintaining global actions.
        categoriesComposite.getTreeViewer().getControl().
                addFocusListener(new FocusListener() {
                    public void focusGained(FocusEvent event) {
                        IActionBars actionBars = DeviceDefinitionPoliciesSection.this.
                                context.getActionBars();
                        origDelete = actionBars.
                                getGlobalActionHandler(IWorkbenchActionConstants.DELETE);
View Full Code Here

         * but because of a bug in Linux SWT 2.1.x (where comboboxes do not fire
         * these events) we handle both these events so that the occurrence of the
         * bug can be minimized. This is feasible because demarcation is a very
         * cheap operation.
         */
         this.focusDrivenUndoRedoDemarcator = new FocusListener() {
             public void focusGained(FocusEvent event) {
                 undoRedoManager.demarcateUOW();
             }

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

        actionMap.put(ActionFactory.CUT, actions.getCut());
        actionMap.put(ActionFactory.DELETE, actions.getDelete());
        actionMap.put(ActionFactory.PASTE, actions.getPaste());
        actionMap.put(ActionFactory.SELECT_ALL, actions.getSelectAll());

        viewer.getControl().addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent event) {
                setupActions();
            }

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

        // ensure that the tree has a white background
        tree.setBackground(getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
        tree.setLayoutData(new GridData(GridData.FILL_BOTH));
        // add a focus listener to the tree that updates the active editors
        // global actions
        tree.addFocusListener(new FocusListener() {
            // javadoc inherited
            public void focusGained(FocusEvent event) {
                setupGlobalActions();
            }
View Full Code Here

        initializeBackgroundAndBorder();

        // Initialize the layout for this FormatComposite
        initializeLayout();

        addFocusListener(new FocusListener() {
            public void focusGained(FocusEvent event) {
                FormatComposite.this.root.setFocus(true);
            }

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

    valueText = new Text(bodyComposite,  SWT.BORDER);
    addDefaultVertifyListener(valueText, property);
    String valueStr = constraint.getValue();
    valueText.setText(valueStr != null? valueStr : "");
    valueText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
    valueText.addFocusListener( new FocusListener() {
     
      @Override
      public void focusLost(FocusEvent e) {
        new SetConstraintValueCommand(constraint, getValue()).runAsJob();
      }
View Full Code Here

     possibileValuesCombo.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
    
     addDefaultVertifyListener(possibileValuesCombo, property);
     String valueStr = constraint.getValue();
     possibileValuesCombo.setText(valueStr != null? valueStr : "");
     possibileValuesCombo.addFocusListener(new FocusListener() {
     
      @Override
      public void focusLost(FocusEvent e) {
        new SetConstraintValueCommand(constraint, getValue() ).runAsJob();
      }
View Full Code Here

     
     addDefaultVertifyListener(possibileValuesCombo, property);
     String valueStr = constraint.getValue();
     possibileValuesCombo.setText(valueStr != null? valueStr : "");
     possibileValuesCombo.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
     possibileValuesCombo.addFocusListener(new FocusListener() {
     
      @Override
      public void focusLost(FocusEvent e) {
        new SetConstraintValueCommand(constraint, getValue() ).runAsJob();
      }
View Full Code Here

   *            the factor
   * @return the created FocusListener
   */
  protected FocusListener createFactorCaptionFocusListener(
      final FactorPart part, final Factor factor) {
    return new FocusListener() {

      @Override
      public void focusGained(FocusEvent e) {
      }

View Full Code Here

TOP

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

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.