Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.SelectionAdapter


   
    _tabLibraries = new Table(container, SWT.CHECK|SWT.READ_ONLY);
    GridData tabLayout = new GridData(GridData.FILL_BOTH);
    _tabLibraries.setLayoutData(tabLayout);
   
    _tabLibraries.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        boolean itemsChecked = false;
        TableItem[] items = _tabLibraries.getItems();
View Full Code Here


    GridData optionStyle = new GridData();
    optionStyle.horizontalSpan = 3;
    _optionDownload = new Button(group, SWT.RADIO);
    _optionDownload.setText("Download latest WGA release from \n'" + WGADesignerPlugin.getDefault().getWGADownloadURL().toString() + "'.");
    _optionDownload.setLayoutData(GridDataFactory.copyData(optionStyle));
    _optionDownload.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        dialogchanged();
      }
     
    });
       
   
    _optionLocalFile = new Button(group, SWT.RADIO);
    _optionLocalFile.setText("Use local WGA war file ...");
    _optionLocalFile.setLayoutData(GridDataFactory.copyData(optionStyle));
   
    _optionLocalFile.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        dialogchanged();
      }
     
    });
   
    _lblFileLocation = new Label(group, SWT.None);
        _lblFileLocation.setText("File:");
        _txtFileLocation = new Text(group, SWT.BORDER);
        _txtFileLocation.setLayoutData(GridDataFactory.copyData(txtStyle));
        _txtFileLocation.addModifyListener(this);
       
        if (_deployment != null) {
            _txtFileLocation.setFocus();
        }
       
        _btnBrowse = new Button(group, SWT.PUSH);
        _btnBrowse.setText("...");
        _btnBrowse.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
                handleBrowse();
            }  
        });
   

      _optionCustomURL  = new Button(group, SWT.RADIO);
        _optionCustomURL.setText("Download from ...");
        _optionCustomURL.setLayoutData(GridDataFactory.copyData(optionStyle));
        _optionCustomURL.addSelectionListener(new SelectionAdapter() {
           
            @Override
            public void widgetSelected(SelectionEvent e) {
                dialogchanged();
            }
View Full Code Here

    GridData listLayout = new GridData(GridData.FILL_HORIZONTAL);
    listLayout.horizontalSpan = 2;
    _lstDefaultPlugins.setLayoutData(listLayout);
   
    _lstDefaultPlugins.getButton(DynamicListControl.BUTTON_ADD).addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        handleAddDefaultPlugin();
      }       
    });
   
    _lstDefaultPlugins.getButton(DynamicListControl.BUTTON_REMOVE).addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        handleRemoveDefaultPlugin();
      }       
    });
View Full Code Here

      _btnStartRuntime = new Button(buttonGroup, SWT.PUSH);
      _btnStartRuntime.setData(SWTBotIDs.WIDGET_KEY, ResourceIDs.SWTBOT_WGARUNTIME_EDITOR_BUTTON_START);
      _btnStartRuntime.setText("Start");

      _btnStartRuntime.setImage(WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_WGA_SERVER_START));
      _btnStartRuntime.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        try {
          StartWGARuntime.call(_model.getWgaRuntime());
          //_btnStartRuntime.setEnabled(false);
        } catch (Exception ex) {         
        }
      }
       
      });

     
      _btnStopRuntime = new Button(buttonGroup, SWT.PUSH);
      _btnStopRuntime.setText("Stop");
      _btnStopRuntime.setData(SWTBotIDs.WIDGET_KEY, ResourceIDs.SWTBOT_WGARUNTIME_EDITOR_BUTTON_STOP);
      _btnStopRuntime.setImage(WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_WGA_SERVER_STOP));
      _btnStopRuntime.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        try {
          StopWGARuntime.call();
          //_btnStopRuntime.setEnabled(false);
        } catch (Exception ex) {         
        }
      }
       
      });
     
     
      _btnRestartRuntime = new Button(buttonGroup, SWT.PUSH);
      _btnRestartRuntime.setText("Restart");

      _btnRestartRuntime.setImage(WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_WGA_SERVER_RESTART));
      _btnRestartRuntime.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        try {
          RestartWGARuntime.call();
View Full Code Here

    Label label = new Label(container, SWT.NONE);
    label.setText("Available runtimes:");
   
    _lstRuntimes = new org.eclipse.swt.widgets.List(container, SWT.BORDER|SWT.SINGLE);
    _lstRuntimes.setLayoutData(new GridData(GridData.FILL_BOTH));
    _lstRuntimes.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetDefaultSelected(SelectionEvent e) {
        performValidation();
      }
View Full Code Here

        //Label padding = new Label(configSection,SWT.NULL);
        //gridData = new GridData(GridData.FILL_HORIZONTAL);
        //padding.setLayoutData(gridData);
      Button btnConfig = new Button(configSection, SWT.PUSH);
      Messages.setLanguageText(btnConfig, "plugins.basicview.config");
      btnConfig.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
          UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
         if (uiFunctions != null) {
           uiFunctions.openView(UIFunctions.VIEW_CONFIG,
                model.getConfigSectionID());
         }
        }
      });
      btnConfig.setLayoutData(new GridData());
    }
   
    if(model.getLogArea().getVisible()) {
      Label logTitle = new Label(topSection,SWT.NULL);
      Messages.setLanguageText(logTitle,"plugins.basicview.log");
      //  gridData = new GridData(GridData.FILL_HORIZONTAL);
      //  gridData.horizontalSpan = 1;
      //  logTitle.setLayoutData(gridData);

      Button button = new Button( topSection, SWT.PUSH );
      Messages.setLanguageText(button,"plugins.basicview.clear");

      button.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event event)
        {
          model.getLogArea().setText("");
        }});

      log = new StyledText(panel,SWT.READ_ONLY | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
      gridData = new GridData(GridData.FILL_BOTH);
      gridData.horizontalSpan = 2;
      log.setLayoutData(gridData);
      //String  text = model.getLogArea().getText().trim();
      //log.setText( text);
      //log.setTopIndex(log.getLineCount());
      model.getLogArea().addPropertyChangeListener(this);

      Composite bottomSection = new Composite(panel, SWT.NONE);
        gridLayout = new GridLayout();
        gridLayout.numColumns = 3;
        gridLayout.marginHeight = 0;
        gridLayout.marginWidth = 0;
        bottomSection.setLayout(gridLayout);
      gridData = new GridData(GridData.FILL_HORIZONTAL);
       gridData.horizontalSpan = 2;
       bottomSection.setLayoutData(gridData);

         // include
      
      Label label = new Label(bottomSection, SWT.NONE);
      label.setLayoutData(new GridData());
      Messages.setLanguageText(label, "LoggerView.includeOnly");

      final Text inclText = new Text(bottomSection, SWT.BORDER);
      gridData = new GridData();
      gridData.widthHint = 200;
      inclText.setLayoutData(gridData);
      inclText.addModifyListener(new ModifyListener()
      {
        public void modifyText(ModifyEvent e) {
          String newExpression = inclText.getText();
          if (newExpression.length() == 0)
            inclusionFilter = null;
          else
          {
            try
            {
              inclusionFilter = Pattern.compile(newExpression, Pattern.CASE_INSENSITIVE);
              inclText.setBackground(null);
            } catch (PatternSyntaxException e1)
            {
              inclText.setBackground(Colors.colorErrorBG);
            }
          }
        }
      });

      label = new Label(bottomSection, SWT.NONE);
     
        // exclude
     
      label = new Label(bottomSection, SWT.NONE);
      label.setLayoutData(new GridData());
      Messages.setLanguageText(label, "LoggerView.excludeAll");

      final Text exclText = new Text(bottomSection, SWT.BORDER);
      gridData = new GridData();
      gridData.widthHint = 200;
      exclText.setLayoutData(gridData);
      exclText.addModifyListener(new ModifyListener()
      {
        public void modifyText(ModifyEvent e) {
          String newExpression = exclText.getText();
          if (newExpression.length() == 0)
            exclusionFilter = null;
          else
          {
            try
            {
              exclusionFilter = Pattern.compile(newExpression, Pattern.CASE_INSENSITIVE);
              exclText.setBackground(null);
            } catch (PatternSyntaxException e1)
            {
              exclText.setBackground(Colors.colorErrorBG);
            }
          }
        }
      });
     
         label = new Label(bottomSection, SWT.NONE);
       
        // pause
     
    Button buttonPause = new Button(bottomSection, SWT.CHECK);
    Messages.setLanguageText(buttonPause, "LoggerView.pause");
    gridData = new GridData();
    buttonPause.setLayoutData(gridData);
    buttonPause.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        if (e.widget == null || !(e.widget instanceof Button))
          return;
        Button btn = (Button) e.widget;
        paused = btn.getSelection();
View Full Code Here

      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()
         {
           public void
           widgetSelected(
             SelectionEvent e )
           {
View Full Code Here

    }
   
    button.setSelection( selected );
   
     button.addSelectionListener(
         new SelectionAdapter()
         {
           public void
           widgetSelected(
             SelectionEvent e )
           {
View Full Code Here

    final Button speed_test = new Button( gRadio, SWT.NULL );
   
    Messages.setLanguageText( speed_test, "configureWizard.transfer2.test" );
           
    final SelectionAdapter speed_test_listener =
      new SelectionAdapter()
      {
        public void
        widgetSelected(
          SelectionEvent arg0 )
        {
          speed_test.setEnabled( false );
         
          test_in_progress = true;
         
          updateNextEnabled();

        rootPanel.getShell().setEnabled( false );
       
          UIFunctionsManager.getUIFunctions().installPlugin(
            "mlab",
            "dlg.install.mlab",
            new UIFunctions.actionListener()
            {
              public void
              actionComplete(
                Object result )
              {
                if ( result instanceof Boolean ){
                 
                  PluginInterface pi = AzureusCoreFactory.getSingleton().getPluginManager().getPluginInterfaceByID( "mlab" );

                  IPCInterface callback =
                    new IPCInterface()
                    {
                      public Object
                      invoke(
                        String     methodName,
                        Object[]  params )
                      {
                        try{
                          if ( methodName.equals( "results" )){
                                                    
                            Map<String,Object>   results = (Map<String,Object>)params[0];
                           
                            Long  up_rate = (Long)results.get( "up" );
                           
                            if ( up_rate != null ){
                             
                              final int u = up_rate.intValue();
                             
                              if ( u > 0 ){
                               
                                Utils.execSWTThread(
                                  new Runnable()
                                  {
                                    public void
                                    run()
                                    {
                                      updateUp( u, false );
                                    }               
                                  });
                              }
                            }
                          }
                         
                          return( null );
                         
                        }finally{
                         
                          enableTest();
                        }
                      }
                   
                      public boolean
                      canInvoke(
                        String methodName,
                        Object[] params )
                      {
                        return( true );
                      }
                    };
                 
                  try{
                    pi.getIPC().invoke(
                      "runTest",
                      new Object[]{ new HashMap<String,Object>(), callback, false });
                   
                  }catch( Throwable e ){
                   
                    Debug.out( e );
                   
                    enableTest();
                  }
                }else{
               
                  try{
                    Throwable error = (Throwable)result;
                 
                    Debug.out( error );
                   
                  }finally{
                   
                    enableTest();
                  }
                }
              }
             
              protected void
              enableTest()
              {
              Utils.execSWTThread(
                  new Runnable()
                  {
                    public void
                    run()
                    {
                      speed_test.setEnabled( true );
                     
                      test_in_progress = false;
                     
                      updateNextEnabled();
                     
                      rootPanel.getShell().setEnabled( true );
                    };
                  });
              }
            })
        }
      };
   
   speed_test.addSelectionListener( speed_test_listener );
   
      // manual
   
    final Button manual_button = new Button( gRadio, SWT.RADIO );
    Messages.setLanguageText(manual_button, "manual.mode");

    new Label( gRadio, SWT.NULL );
   
      // drop down speed selector
       
    final Label manual_label = new Label( gRadio, SWT.NULL );
    Messages.setLanguageText(manual_label, "configureWizard.transfer2.mselect");

    String connection_labels[] = new String[connection_rates.length];

    connection_labels[0] = MessageText.getString( "configureWizard.transfer2.current" );
    String dial_up = MessageText.getString( "dial.up" );
   
    for (int i = 1; i < connection_rates.length; i++) {
     
      connection_labels[i] = (i<3?(dial_up+ " "):"xxx/") + DisplayFormatters.formatByteCountToBitsPerSec( connection_rates[i]/8);
    }
   
    final Combo connection_speed = new Combo(gRadio, SWT.SINGLE | SWT.READ_ONLY);
   
    for ( int i=0; i<connection_rates.length; i++ ){
     
      connection_speed.add(connection_labels[i]);
    }
   
    connection_speed.select(0);
   
    connection_speed.addListener(
      SWT.Selection,
      new Listener()
      {
        public void
        handleEvent(
          Event arg0 )
        {
          int index = connection_speed.getSelectionIndex();
                   
          updateUp( connection_rates[index]/8, true );
         }
      });
   
    final Label manual2_label = new Label( gRadio, SWT.WRAP );
    Messages.setLanguageText(manual2_label, "configureWizard.transfer2.mselect.info");
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan = 2;
    manual2_label.setLayoutData( gridData );

    Listener listener =
      new Listener()
    {
      public void
      handleEvent(
        Event arg0 )
      {
        boolean is_manual = manual_button.getSelection();
         
        speed_test.setEnabled( !is_manual );
       
        connection_speed.setEnabled( is_manual );
        manual_label.setEnabled( is_manual );
        manual2_label.setEnabled( is_manual );
       
        manual_mode = is_manual;
       
        updateNextEnabled();
      }
    };
    manual_button.addListener( SWT.Selection, listener );
    listener.handleEvent( null );
   
    uprate_label = new Label( panel, SWT.WRAP );
    gridData = new GridData(GridData.FILL_BOTH);
    gridData.verticalIndent=10;
    uprate_label.setLayoutData( gridData );
    updateUp( 0, true );
   
    manual_mode = false;
   
    updateNextEnabled();
   
    if ( wizard.getWizardMode() == ConfigureWizard.WIZARD_MODE_SPEED_TEST_AUTO ){
     
      Utils.execSWTThreadLater(
        0,
        new Runnable()
        {
          public void
          run()
          {
            speed_test_listener.widgetSelected( null );
          }
        });
    }
  }
View Full Code Here

      Button show_folder_button = new Button( control, SWT.PUSH );
       
       Messages.setLanguageText( show_folder_button, "MyTorrentsView.menu.explore");
      
       show_folder_button.addSelectionListener(
         new SelectionAdapter()
         {
           public void
           widgetSelected(
             SelectionEvent e )
           {
            
             ManagerUtils.open( device.getWorkingDirectory());
           }
         });
      
       new Label( control, SWT.NONE );
      
       if ( device.canFilterFilesView()){
        
        final Button show_xcode_button = new Button( control, SWT.CHECK );
       
         Messages.setLanguageText( show_xcode_button, "devices.xcode.only.show");
        
         show_xcode_button.setSelection( device.getFilterFilesView());
        
         show_xcode_button.addSelectionListener(
           new SelectionAdapter()
           {
             public void
             widgetSelected(
               SelectionEvent e )
             {            
View Full Code Here

TOP

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

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.