Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Button


     
      controls[0] = sp.getControl();
      GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
      controls[0].setLayoutData(gridData);
     
      Button browse = new Button(pluginGroup, SWT.PUSH);
      ImageLoader.getInstance().setButtonImage(browse, getBrowseImageResource());
      browse.setToolTipText(MessageText.getString("ConfigView.button.browse"));

      browse.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event event) {
          String path = DirectoryParameter.this.openDialog(pluginGroup.getShell(), sp.getValue());
          if (path != null) {
            sp.setValue(path);
          }
View Full Code Here


  public ColorParameter(final Composite composite,
                        final String name,
                        int _r, int _g, int _b) {
    super(name);
    sParamName = name;
    colorChooser = new Button(composite,SWT.PUSH);
    r = COConfigurationManager.getIntParameter(name+".red",_r);
    g = COConfigurationManager.getIntParameter(name+".green",_g);
    b = COConfigurationManager.getIntParameter(name+".blue",_b);
    updateButtonColor(composite.getDisplay(), r, g, b);
View Full Code Here

    if ( actionPerformer != null ){
      performers.add( actionPerformer );
    }
    int iDefaultValue = COConfigurationManager.getIntParameter(sConfigName);

    radioButton = new Button(composite, SWT.RADIO);
    radioButton.setSelection(iDefaultValue == iButtonValue);
    radioButton.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        boolean selected = radioButton.getSelection();
        if (selected)
View Full Code Here

   
    shell.setLayout(new FormLayout());
   
    mainComposite = new Composite(shell,SWT.NONE);
    Label separator = new Label(shell,SWT.SEPARATOR | SWT.HORIZONTAL);
    Button cancel = new Button(shell,SWT.PUSH);
    action = new Button(shell,SWT.PUSH);
    cancel.setText(MessageText.getString("Button.cancel"));
   
    FormData data;
   
    data = new FormData();
    data.left = new FormAttachment(0,0);
    data.right = new FormAttachment(100,0);
    data.top = new FormAttachment(0,0);
    data.bottom = new FormAttachment(separator,0);
    mainComposite.setLayoutData(data);
   
    data = new FormData();
    data.left = new FormAttachment(0,0);
    data.right = new FormAttachment(100,0);
    data.bottom = new FormAttachment(cancel,-2);
    separator.setLayoutData(data);
   
    data = new FormData();
    data.right = new FormAttachment(action);
    data.width = 100;
    data.bottom = new FormAttachment(100,-5);
    cancel.setLayoutData(data);
   
    data = new FormData();
    data.right = new FormAttachment(100,-5);
    data.width = 100;
    data.bottom = new FormAttachment(100,-5);
    action.setLayoutData(data);
   
    cancel.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event arg0) {
        if(lookup != null) {
          lookup.cancel();
        }
        if(!shell.isDisposed()) {
View Full Code Here

    final Text textPath = new Text(panel,SWT.BORDER);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    textPath.setLayoutData(gridData);
    textPath.setText(((ImportTorrentWizard)wizard).getTorrentFile());
 
    Button browse = new Button(panel,SWT.PUSH);
    Messages.setLanguageText(browse, "importTorrentWizard.torrentfile.browse");
    browse.addListener(SWT.Selection,new Listener() {
     
      public void handleEvent(Event arg0){
       
      FileDialog fd = new FileDialog(wizard.getWizardWindow(), SWT.SAVE);
     
View Full Code Here

    final Text textPath = new Text(panel,SWT.BORDER);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    textPath.setLayoutData(gridData);
    textPath.setText("");
 
    Button browse = new Button(panel,SWT.PUSH);
    Messages.setLanguageText(browse, "importTorrentWizard.importfile.browse");
    browse.addListener(SWT.Selection,new Listener() {
      public void handleEvent(Event arg0) {
       
      FileDialog fd = new FileDialog(wizard.getWizardWindow());
     
      fd.setFileName(textPath.getText());
View Full Code Here

        gridData = new GridData(GridData.FILL_BOTH);
        gridData.horizontalSpan = 1;
        label.setLayoutData(gridData);
          Messages.setLanguageText(label, msg_text);
 
          final Button checkBox = new Button(shell, SWT.CHECK);
          checkBox.setSelection(false);
        gridData = new GridData(GridData.FILL_BOTH);
        gridData.horizontalSpan = 2;
        checkBox.setLayoutData(gridData);
       
        checkboxes[i= checkBox;
       
        for ( int j=0;j<tracker_networks.length;j++ ){
         
          if ( tracker_networks[j] == network ){
           
            checkBox.setSelection( true );
          }
        }
      }
     
        // line
     
      labelSeparator = new Label(shell,SWT.SEPARATOR | SWT.HORIZONTAL);
      gridData = new GridData(GridData.FILL_HORIZONTAL);
      gridData.horizontalSpan = 3;
      labelSeparator.setLayoutData(gridData);

        // buttons
       
      new Label(shell,SWT.NULL);

      Button bOk = new Button(shell,SWT.PUSH);
       bOk.setText(MessageText.getString("Button.ok"));
       gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_END | GridData.HORIZONTAL_ALIGN_FILL);
       gridData.grabExcessHorizontalSpace = true;
       gridData.widthHint = 70;
       bOk.setLayoutData(gridData);
       bOk.addListener(SWT.Selection,new Listener() {
          public void handleEvent(Event e) {
           close(true);
           }
       });
     
       Button bCancel = new Button(shell,SWT.PUSH);
       bCancel.setText(MessageText.getString("Button.cancel"));
       gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
       gridData.grabExcessHorizontalSpace = false;
       gridData.widthHint = 70;
       bCancel.setLayoutData(gridData);   
       bCancel.addListener(SWT.Selection,new Listener() {
         public void handleEvent(Event e) {
           close(false);
           }
       });
     
View Full Code Here

    grid_data.horizontalSpan = 1;
    control.setLayoutData(grid_data);

        // start
   
      start_button = new Button( control, SWT.PUSH );
       
       Messages.setLanguageText( start_button, "ConfigView.section.start");
      
       start_button.addSelectionListener(
         new SelectionAdapter()
         {
           public void
           widgetSelected(
             SelectionEvent e )
           {
             start_button.setEnabled( false );
            
             cancel_button.setEnabled( true );
            
             startTest();
           }
         });
      
         // cancel
      
       cancel_button = new Button( control, SWT.PUSH );
      
       Messages.setLanguageText( cancel_button, "UpdateWindow.cancel");
      
       cancel_button.addSelectionListener(
         new SelectionAdapter()
View Full Code Here

   
    // WinXP Classic Theme will not bring though parent's background image
    // without FORCEing the background mode
    createOn.setBackgroundMode(SWT.INHERIT_FORCE);

    button = new Button(createOn, SWT.CHECK);
    checked = false;

    button.addSelectionListener(new SelectionListener() {
      public void widgetSelected(SelectionEvent e) {
        checked = button.getSelection();
View Full Code Here

      Debug.out("AbstractWizardPage:: a button with this same ID already exists ID:"
          + buttonID);
      return (Button) buttons.get(buttonID);
    }

    Button button = new Button(toolbarPanel, SWT.PUSH);
    GridData gData = new GridData(SWT.END, SWT.BOTTOM, false, false);
    gData.widthHint = button.computeSize(SWT.DEFAULT, SWT.DEFAULT).y
        + buttonExtraMargin;
    button.setLayoutData(gData);

    /*
     * Add listener if given; for default buttons this is used in place of the default listener
     */
    if (null != listener) {
      button.addSelectionListener(listener);
    }

    button.setText(buttonText);
    button.setData("button.id", buttonID);

    buttons.put(buttonID, button);

    adjustToolbar();

View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.Button

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.