Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Button.addListener()


        }
      });

      Button browse = new Button(pathGroup, SWT.PUSH);
      browse.setText("    Browse...    ");
      browse.addListener(SWT.Selection, new Listener() {
        @Override public void handleEvent(Event event) {
          DirectoryDialog dialog = new DirectoryDialog(getShell());
          dialog.setMessage("Select a folder for storing data collected by Rabbit.");

          String path = dialog.open();
View Full Code Here


      Button button1 = new Button(comp, SWT.PUSH);
      button1.setText("...");
      GridDataFactory.swtDefaults()
          .align(SWT.END, SWT.CENTER)
          .applyTo(button1);
      button1.addListener(SWT.Selection,
          new Listener() {

            @Override
            public void handleEvent(Event event) {
              DirectoryDialog fdialog = new DirectoryDialog(
View Full Code Here

   */
  private static Button createButton(Composite parent, String text, Listener selectionListener) {
    Button button = new Button(parent, SWT.NONE);
    GridDataFactory.create(button).grabH().fillH();
    button.setText(text);
    button.addListener(SWT.Selection, selectionListener);
    return button;
  }

  /**
   * Creates separator between buttons on vertical buttons bar.
View Full Code Here

    Button browse = new Button(composite, SWT.NONE);
    browse.setText(browseButtonLabel);
    GridData data3 = new GridData(GridData.FILL_HORIZONTAL);
    browse.setLayoutData(data3);
    browse.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        IType baseType;
        try {
          baseType = getPackageFragmentRoot().getJavaProject().findType(
              baseClassName);
View Full Code Here

    span3.horizontalSpan = 3;
    label4.setLayoutData(span3);

    final Button validate = new Button(panel, SWT.NONE);
    validate.setText("&Validate location");
    validate.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
        testLocation();
      }

      public void widgetDefaultSelected(SelectionEvent e) {
View Full Code Here

                propSupport.firePropertyChange(PROP_CREATE_IN_ECLIPSE_WORKSPACE, oldCreateIn, createInEclipseWorkspace);
                propSupport.firePropertyChange(PROP_EXTERNAL_LOCATION, oldExtLoc, externalLocation);
            }
        };
        btnCreateExternal.addListener(SWT.Selection, locationListener);
        btnCreateInEclipseWorkspace.addListener(SWT.Selection, locationListener);
        txtExternalLocation.addListener(SWT.Modify, locationListener);

        btnBrowseExternalLocation.addSelectionListener(new SelectionAdapter() {
            @Override
View Full Code Here

  }

  protected Button newButton(Composite parent, int style, String name, String tip) {
    Button b = new Button(parent, style);
    setTextAndTip(b, name, tip);
    b.addListener(SWT.Selection, this);
    return b;
  }

  protected Text newText(Composite parent, int style, String tip) {
    Text t = new Text(parent, style | SWT.BORDER);
View Full Code Here

  // **************************************************
  public Button newRadioButton(Composite parent, String label, String toolTip, boolean selected) {
    Button button = toolkit.createButton(parent, label, SWT.RADIO);
    button.setToolTipText(toolTip);
    button.setSelection(selected);
    button.addListener(SWT.Selection, this);
    return button;
  }

  /**
   * add pushbutton to container, set enabled, add listener for it
View Full Code Here

    GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
    button.setLayoutData(gd);
    button.pack(false);
    button.setToolTipText(tip);
    button.setEnabled(enabled);
    button.addListener(SWT.Selection, this);
    Point buttonSize = button.getSize();
    gd.heightHint = buttonSize.y - 2;
    gd.widthHint = buttonSize.x - 2;
    return button;
  }
View Full Code Here

    Button button = toolkit.createButton(parent, label, SWT.CHECK);
    button.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING
            | GridData.HORIZONTAL_ALIGN_FILL));
    button.pack();
    button.setToolTipText(tip);
    button.addListener(SWT.Selection, this);
    return button;
  }

  public static void spacer(Composite container) {
    Label label = new Label(container, SWT.NONE);
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.