Examples of FocusAdapter


Examples of java.awt.event.FocusAdapter

                if (treetable.getTable().isEditing()) {
                    treetable.getTable().editingStopped(new ChangeEvent(treetable.getTreeTable()));
                }
      }
        });
        treetable.getTree().addFocusListener(new FocusAdapter() {
      public void focusGained(FocusEvent e) {
        super.focusGained(e);
        mySelectionManager.setUserInputConsumer(this);
      }
        });
View Full Code Here

Examples of java.awt.event.FocusAdapter

  }
  public Component getTableCellEditorComponent(JTable arg0, Object arg1, boolean arg2, int arg3, int arg4) {
    final Component result = myProxiedEditor.getTableCellEditorComponent(arg0, arg1,arg2, arg3, arg4);
    if (result instanceof JTextComponent) {
      ((JTextComponent)result).selectAll();
      result.addFocusListener(new FocusAdapter() {
        public void focusGained(FocusEvent arg0) {
          super.focusGained(arg0);
          ((JTextComponent)result).selectAll();
          result.removeFocusListener(this);
        }
View Full Code Here

Examples of java.awt.event.FocusAdapter

    for (final InputColumn<?> column : _columns) {
      if (column instanceof MutableInputColumn<?>) {
        final JXTextField textField = WidgetFactory.createTextField("Column name");
        textField.setText(column.getName());
        final MutableInputColumn<?> mutableInputColumn = (MutableInputColumn<?>) column;
        textField.addFocusListener(new FocusAdapter() {
          @Override
          public void focusLost(FocusEvent e) {
            if (!mutableInputColumn.getName().equals(textField.getText())) {
              mutableInputColumn.setName(textField.getText());
View Full Code Here

Examples of java.awt.event.FocusAdapter

  /**
   * Adds AWT focus listener to this component that calls back <code>controller</code>
   * escape method on focus lost event. 
   */
  private void addFocusListener(final PlanController controller) {
    addFocusListener(new FocusAdapter() {
      @Override
      public void focusLost(FocusEvent ev) {
        controller.escape();
      }
    });
View Full Code Here

Examples of org.eclipse.swt.events.FocusAdapter

            newControlDeco.hideHover();
          }
        }
      });

      fNewState.addFocusListener(new FocusAdapter() {
        @Override
        public void focusLost(FocusEvent e) {
          newControlDeco.hide();
          newControlDeco.hideHover();
        }
      });

      fUnreadState.addFocusListener(new FocusAdapter() {
        @Override
        public void focusLost(FocusEvent e) {
          unreadControlDeco.hide();
          unreadControlDeco.hideHover();
        }
      });
    }

    /* Use Balloon Tooltip on Windows and Linux */
    else {

      /* Use a Tooltip to help the user understand the State Semantic */
      final ToolTip newStateToolTip = new ToolTip(getShell(), SWT.BALLOON);
      newStateToolTip.setMessage(Messages.StateConditionControl_NEW_HINT);
      newStateToolTip.setAutoHide(false);

      final ToolTip unreadStateToolTip = new ToolTip(getShell(), SWT.BALLOON);
      unreadStateToolTip.setMessage(Messages.StateConditionControl_UNREAD_HINT);
      unreadStateToolTip.setAutoHide(false);

      fNewState.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
          if (fNewState.getSelection() && !fUnreadState.getSelection()) {
            Point toolTipLocation = toDisplay(fUnreadState.getLocation());
            toolTipLocation.y += fUnreadState.getSize().y;
            if (Application.IS_WINDOWS)
              toolTipLocation.x += 5;
            else if (Application.IS_LINUX)
              toolTipLocation.x += 12;

            unreadStateToolTip.setLocation(toolTipLocation);
            unreadStateToolTip.setVisible(true);
          } else {
            unreadStateToolTip.setVisible(false);
          }
        }
      });

      fUnreadState.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
          if (fUnreadState.getSelection() && !fNewState.getSelection()) {
            Point toolTipLocation = toDisplay(fNewState.getLocation());
            toolTipLocation.y += fNewState.getSize().y;
            if (Application.IS_WINDOWS)
              toolTipLocation.x += 5;
            else if (Application.IS_LINUX)
              toolTipLocation.x += 12;

            newStateToolTip.setLocation(toolTipLocation);
            newStateToolTip.setVisible(true);
          } else {
            newStateToolTip.setVisible(false);
          }
        }
      });

      fNewState.addFocusListener(new FocusAdapter() {
        @Override
        public void focusGained(FocusEvent e) {
          newStateToolTip.setVisible(false);
        }

        @Override
        public void focusLost(FocusEvent e) {
          unreadStateToolTip.setVisible(false);
        }
      });

      fUnreadState.addFocusListener(new FocusAdapter() {
        @Override
        public void focusGained(FocusEvent e) {
          unreadStateToolTip.setVisible(false);
        }

View Full Code Here

Examples of org.eclipse.swt.events.FocusAdapter

          e.result = filterTextString;
      }
    });

    /* Select All on Focus if input matches Initial Text */
    fFilterText.addFocusListener(new FocusAdapter() {
      @Override
      public void focusGained(FocusEvent e) {
        JobRunner.runInUIThread(fFilterText, new Runnable() {
          public void run() {
            if (fInitialText.equals(fFilterText.getText().trim()))
View Full Code Here

Examples of org.eclipse.swt.events.FocusAdapter

          e.result = filterTextString;
      }
    });

    /* Select All on Focus if input matches Initial Text */
    fFilterText.addFocusListener(new FocusAdapter() {
      @Override
      public void focusGained(FocusEvent e) {
        JobRunner.runInUIThread(0, true, fFilterText, new Runnable() {
          public void run() {
            if (fInitialText.equals(fFilterText.getText().trim()))
View Full Code Here

Examples of org.eclipse.swt.events.FocusAdapter

     gWebService.setLayout(gridLayout1);
     gWebService.setLayoutData(gridData);
     label = new Label(gWebService, SWT.NONE);
     label.setText("Name:");
     tName = new Text(gWebService, SWT.BORDER);
     tName.addFocusListener(new FocusAdapter() {
       public void focusGained(final FocusEvent e) {
         tName.selectAll();
       }
     });
     tName.setLayoutData(gridData9);
     tName.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
       public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
        
         getShell().setDefaultButton(null);
        
         boolean valid = listener.isValid(tName.getText());
         if (valid)
           tName.setBackground(null);
         else
           tName.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_YELLOW));        
        
         valid = (valid && !tName.getText().equals("") && !tURL.getText().equals(""));
         if (valid) {
           getShell().setDefaultButton(bApply);
         }
         bApply.setEnabled(valid);
       
         // gWebService.setText(GROUP_WEB_SERVICE + ": " + tName.getText());
        
       }
     });
     label1 = new Label(gWebService, SWT.NONE);
     label1.setText("URL:");
     tURL = new Text(gWebService, SWT.BORDER);
     tURL.addFocusListener(new FocusAdapter() {
       public void focusGained(final FocusEvent e) {
         tURL.selectAll();
       }
     });
     tURL.addSelectionListener(new SelectionAdapter() {
       public void widgetDefaultSelected(final SelectionEvent e) {
       }


       public void widgetSelected(final SelectionEvent e) {
       }
     });
     tURL.setLayoutData(gridData10);
     tURL.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
       public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
         if ((tURL.getText().length() > 0) && (tURL.getText().charAt(0) != '/')) {
           tURL.setText("/" + tURL.getText());
           tURL.setSelection(2);
         }
         boolean valid = (!tName.getText().equals("") && !tURL.getText().equals(""));
         if (valid) {
           getShell().setDefaultButton(bApply);
         }
         bApply.setEnabled(valid);
       }
     });
     label2 = new Label(gWebService, SWT.NONE);
     label2.setText("Job Chain:");
     cChain = new CCombo(gWebService, SWT.BORDER);
     cChain.addSelectionListener(new SelectionAdapter() {
       public void widgetSelected(final SelectionEvent e) {
       }
     });
     cChain.setEditable(true);
     cChain.setLayoutData(gridData12);
     cChain.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
       public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
         setEnabledComponent();
         /*boolean valid = (!tName.getText().equals(""));
         bApply.setEnabled(valid);
         if (valid) {
           getShell().setDefaultButton(bApply);
         }
         sTimeout.setEnabled(!cChain.getText().equals(""));
         tRequest.setEnabled(!sTimeout.getEnabled());
         tResponse.setEnabled(!sTimeout.getEnabled());
         tForward.setEnabled(!sTimeout.getEnabled());
         */
       }
     });
     label3 = new Label(gWebService, SWT.NONE);
     label3.setText("Timeout:");
     sTimeout = new Text(gWebService, SWT.BORDER);
     sTimeout.addFocusListener(new FocusAdapter() {
       public void focusGained(final FocusEvent e) {
         sTimeout.selectAll();
       }
     });
     sTimeout.addVerifyListener(new VerifyListener() {
       public void verifyText(final VerifyEvent e) {
         e.doit = Utils.isOnlyDigits(e.text);
       }
     });
     sTimeout.setLayoutData(gridData11);
     sTimeout.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
       public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
         boolean valid = (!tName.getText().equals("")) ;
         if (valid) {
           getShell().setDefaultButton(bApply);
         }
         bApply.setEnabled(valid);
       }
     });
     label5 = new Label(gWebService, SWT.NONE);
     label5.setText("Debug:");
     bDebug = new Button(gWebService, SWT.CHECK);
     bDebug.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
       public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
         boolean valid = (!tName.getText().equals("")) ;
         if (valid) {
           getShell().setDefaultButton(bApply);
         }
         bApply.setEnabled(valid);
       }
     });
     label7 = new Label(gWebService, SWT.NONE);
     label7.setText("Request XSLT:");
     tRequest = new Text(gWebService, SWT.BORDER);
     tRequest.addFocusListener(new FocusAdapter() {
       public void focusGained(final FocusEvent e) {
         tRequest.selectAll();
       }
     });
     tRequest.setLayoutData(gridData8);
     tRequest.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
       public void modifyText(org.eclipse.swt.events.ModifyEvent e) { 
         setEnabledComponent();
         /*boolean valid = (!tName.getText().equals(""));
         if (valid) {
           getShell().setDefaultButton(bApply);
         }
         bApply.setEnabled(valid);
         cChain.setEnabled(tRequest.getText().equals(""));
         */
       }
     });
     label19 = new Label(gWebService, SWT.NONE);
     label19.setText("Response XSLT:");
     tResponse = new Text(gWebService, SWT.BORDER);
     tResponse.addFocusListener(new FocusAdapter() {
       public void focusGained(final FocusEvent e) {
         tResponse.selectAll();
       }
     });
     tResponse.setLayoutData(gridData6);
     tResponse.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
       public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
         setEnabledComponent();
         /*boolean valid = (!tName.getText().equals(""));
         if (valid) {
           getShell().setDefaultButton(bApply);
         }
         bApply.setEnabled(valid);
         cChain.setEnabled(tResponse.getText().equals(""));
         */
       }
     });
     label13 = new Label(gWebService, SWT.NONE);
     label13.setLayoutData(new GridData());
     label13.setText("Forward XSLT:");
     GridData gridData7 = new org.eclipse.swt.layout.GridData(GridData.FILL, GridData.CENTER, true, false, 5, 1);
     tForward = new Text(gWebService, SWT.BORDER);
     tForward.addFocusListener(new FocusAdapter() {
       public void focusGained(final FocusEvent e) {
         tForward.selectAll();   
       }
     });
     tForward.setLayoutData(gridData7);
View Full Code Here

Examples of org.eclipse.swt.events.FocusAdapter

      final Label nameLabel = new Label(scheduleGroup, SWT.NONE);
      nameLabel.setText("Name");

      txtName = new Text(scheduleGroup, SWT.BORDER);
      txtName.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtName.selectAll();
        }
      });
      txtName.addVerifyListener(new VerifyListener() {
        public void verifyText(final VerifyEvent e) {
          if(!init)//w�hrend der initialiserung sollen keine �berpr�fungen stattfinden
            e.doit = Utils.checkElement(txtName.getText(), dom, sos.scheduler.editor.app.Editor.SCHEDULE, null);
        }
      });
      txtName.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          if(!init && !existScheduleName())
            listener.setName(txtName.getText());
        }
      });
      txtName.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));


      final Label titleLabel = new Label(scheduleGroup, SWT.NONE);
      titleLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, false, false));
      titleLabel.setText("Title");

      txtTitle = new Text(scheduleGroup, SWT.BORDER);
      txtTitle.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtTitle.selectAll();
        }
      });
      txtTitle.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          if(!init)
            listener.setTitle(txtTitle.getText());
        }
      });
      txtTitle.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));

      final Label substitueLabel = new Label(scheduleGroup, SWT.NONE);
      substitueLabel.setText("Substitute");

      cboCombo = new Combo(scheduleGroup, SWT.NONE);
      cboCombo.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          if(!init)
            listener.setSubstitut(cboCombo.getText());
        }
      });
      cboCombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 2, 1));

      Label validFromLabel = new Label(scheduleGroup, SWT.NONE);
      validFromLabel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
      validFromLabel.setText("Valid From");


      validFrom = new DatePicker(scheduleGroup, SWT.BORDER);
      validFrom.setEditable(true);



      validFrom.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setValidDateFrom();         
        }



      });
      final GridData gridData = new GridData();
      gridData.grabExcessHorizontalSpace = true;
      gridData.horizontalAlignment = SWT.FILL;
      validFrom.setLayoutData(gridData);

      final Composite composite_1_1 = new Composite(scheduleGroup, SWT.NONE);
      composite_1_1.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
      final GridLayout gridLayout_1 = new GridLayout();
      gridLayout_1.numColumns = 6;
      composite_1_1.setLayout(gridLayout_1);

      txtHourFrom = new Text(composite_1_1, SWT.CENTER | SWT.BORDER);
      txtHourFrom.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtHourFrom.selectAll();
        }
      });
      txtHourFrom.setTextLimit(2);
      txtHourFrom.addVerifyListener(new VerifyListener() {
        public void verifyText(final VerifyEvent e) {
          e.doit = Utils.isOnlyDigits(e.text);
        }
      });
      txtHourFrom.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setValidDateFrom();
        }
      });
      txtHourFrom.setEnabled(false);
      final GridData gridData_1_1_1 = new GridData(GridData.FILL, GridData.FILL, false, false);
      gridData_1_1_1.minimumWidth = 30;
      gridData_1_1_1.widthHint = 30;
      txtHourFrom.setLayoutData(gridData_1_1_1);

      final Label label_2_1 = new Label(composite_1_1, SWT.NONE);
      label_2_1.setText(":");

      txtMinuteFrom = new Text(composite_1_1, SWT.CENTER | SWT.BORDER);
      txtMinuteFrom.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtMinuteFrom.selectAll();
        }
      });
      txtMinuteFrom.setTextLimit(2);
      txtMinuteFrom.addVerifyListener(new VerifyListener() {
        public void verifyText(final VerifyEvent e) {
          e.doit = Utils.isOnlyDigits(e.text);
        }
      });
      txtMinuteFrom.setEnabled(false);
      txtMinuteFrom.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setValidDateFrom();
        }
      });
      final GridData gridData_2_1_1 = new GridData(GridData.FILL, GridData.CENTER, false, false);
      gridData_2_1_1.minimumWidth = 30;
      gridData_2_1_1.widthHint = 30;
      txtMinuteFrom.setLayoutData(gridData_2_1_1);

      final Label label_1_1_1 = new Label(composite_1_1, SWT.NONE);
      label_1_1_1.setText(":");

      txtSecondFrom = new Text(composite_1_1, SWT.CENTER | SWT.BORDER);
      txtSecondFrom.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtSecondFrom.selectAll();
        }
      });
      txtSecondFrom.setTextLimit(2);
      txtSecondFrom.addVerifyListener(new VerifyListener() {
        public void verifyText(final VerifyEvent e) {
          e.doit = Utils.isOnlyDigits(e.text);
        }
      });
      txtSecondFrom.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setValidDateFrom();
        }
      });
      txtSecondFrom.setEnabled(false);
      txtSecondFrom.setLayoutData(new GridData(30, SWT.DEFAULT));

      final Label hhmmssLabel_1_1 = new Label(composite_1_1, SWT.NONE);
      hhmmssLabel_1_1.setText("hh:mm:ss");

      final Label validToLabel = new Label(scheduleGroup, SWT.NONE);
      validToLabel.setText("Valid To");

      validTo = new DatePicker(scheduleGroup, SWT.BORDER);
      validTo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
      validTo.setEditable(true);
      validTo.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setValidDateTo();         
        }
      });

      final Composite composite_1 = new Composite(scheduleGroup, SWT.NONE);
      composite_1.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
      final GridLayout gridLayout_2 = new GridLayout();
      gridLayout_2.numColumns = 6;
      composite_1.setLayout(gridLayout_2);

      txtHourTo = new Text(composite_1, SWT.CENTER | SWT.BORDER);
      txtHourTo.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtHourTo.selectAll();
        }
      });
      txtHourTo.setTextLimit(2);
      txtHourTo.addVerifyListener(new VerifyListener() {
        public void verifyText(final VerifyEvent e) {
          e.doit = Utils.isOnlyDigits(e.text);
        }
      });
      txtHourTo.setEnabled(false);
      txtHourTo.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setValidDateTo();
        }
      });
      final GridData gridData_1_1 = new GridData(GridData.FILL, GridData.FILL, false, false);
      gridData_1_1.minimumWidth = 30;
      gridData_1_1.widthHint = 30;
      txtHourTo.setLayoutData(gridData_1_1);

      final Label label_2 = new Label(composite_1, SWT.NONE);
      label_2.setText(":");

      txtMinuteTo = new Text(composite_1, SWT.CENTER | SWT.BORDER);
      txtMinuteTo.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtMinuteTo.selectAll();
        }
      });
      txtMinuteTo.setTextLimit(2);
      txtMinuteTo.addVerifyListener(new VerifyListener() {
        public void verifyText(final VerifyEvent e) {
          e.doit = Utils.isOnlyDigits(e.text);
        }
      });
      txtMinuteTo.setEnabled(false);
      txtMinuteTo.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          setValidDateTo();
        }
      });
      final GridData gridData_2_1 = new GridData(GridData.FILL, GridData.CENTER, false, false);
      gridData_2_1.minimumWidth = 30;
      gridData_2_1.widthHint = 30;
      txtMinuteTo.setLayoutData(gridData_2_1);

      final Label label_1_1 = new Label(composite_1, SWT.NONE);
      label_1_1.setText(":");

      txtSecondTo = new Text(composite_1, SWT.CENTER | SWT.BORDER);
      txtSecondTo.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtSecondTo.selectAll();
        }
      });
      txtSecondTo.setTextLimit(2);
View Full Code Here

Examples of org.eclipse.swt.events.FocusAdapter

      nameLabel.setText("Name");



      txtName = new Text(eventgroup, SWT.BORDER);
      txtName.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtName.selectAll();
        }
      });
      txtName.setBackground(SWTResourceManager.getColor(255, 255, 217));
      txtName.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          refresh();
        }
      });
      txtName.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));

      final Label jobketteLabel = new Label(eventgroup, SWT.NONE);
      jobketteLabel.setLayoutData(new GridData());
      jobketteLabel.setText("Jobchain");

      txtJobChain = new Text(eventgroup, SWT.BORDER);
      txtJobChain.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtJobChain.selectAll();   
        }
      });
      txtJobChain.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          refresh();
        }
      });
      txtJobChain.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));

      final Label jobLabel = new Label(eventgroup, SWT.NONE);
      jobLabel.setLayoutData(new GridData());
      jobLabel.setText("Job");



      txtJob = new Text(eventgroup, SWT.BORDER);
      txtJob.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtJob.selectAll();
        }
      });
      txtJob.addModifyListener(new ModifyListener() {
        public void modifyText(final ModifyEvent e) {
          refresh();
        }
      });
      txtJob.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));



      final Label eventClassLabel = new Label(eventgroup, SWT.NONE);
      eventClassLabel.setLayoutData(new GridData());
      eventClassLabel.setText("Event Class");


      txtEventClass = new Text(eventgroup, SWT.BORDER);
      txtEventClass.addFocusListener(new FocusAdapter() {
        public void focusGained(final FocusEvent e) {
          txtEventClass.selectAll();
        }
      });
      txtEventClass.addModifyListener(new ModifyListener() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.