Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Listener


    final Label label = new Label(cMode, SWT.WRAP);
    gridData.horizontalSpan = 4;
    label.setLayoutData(gridData);
  text[0] = MessageText.getString("ConfigView.section.mode." + initsMode);
  label.setText(text[0]);
  label.addListener (SWT.Selection, new Listener () {
    public void handleEvent(Event event) {
      Utils.launch(event.text);
    }
  });
 
  Group gWiki = new Group(cMode, SWT.WRAP);
    gridData = new GridData();
    gridData.widthHint = 350;
    gWiki.setLayoutData(gridData);
    layout = new GridLayout();
    layout.numColumns = 1;
    layout.marginHeight = 1;
    gWiki.setLayout(layout);
   
    gWiki.setText(MessageText.getString("Utils.link.visit"));

      final Label linkLabel = new Label(gWiki, SWT.NULL);
      linkLabel.setText( MessageText.getString( messTexts[userMode] ) );
      linkLabel.setData( links[userMode] );
      linkLabel.setCursor(linkLabel.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
      linkLabel.setForeground(Colors.blue);
      gridData = new GridData(GridData.FILL_HORIZONTAL);
      gridData.horizontalIndent = 10;
      linkLabel.setLayoutData( gridData );
      linkLabel.addMouseListener(new MouseAdapter() {
        public void mouseDoubleClick(MouseEvent arg0) {
          Utils.launch((String) ((Label) arg0.widget).getData());
        }
        public void mouseUp(MouseEvent arg0) {
          Utils.launch((String) ((Label) arg0.widget).getData());
        }
      });
     
      final Label linkLabel1 = new Label(gWiki, SWT.NULL);
      linkLabel1.setText( (userMode == 1)?MessageText.getString(messTexts[3]):"");
      linkLabel1.setData( links[3] );
      linkLabel1.setCursor(linkLabel1.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
      linkLabel1.setForeground(Colors.blue);
      gridData = new GridData(GridData.FILL_HORIZONTAL);
      gridData.horizontalIndent = 10;
      linkLabel1.setLayoutData( gridData );
      linkLabel1.addMouseListener(new MouseAdapter() {
        public void mouseDoubleClick(MouseEvent arg0) {
          Utils.launch((String) ((Label) arg0.widget).getData());
        }
        public void mouseUp(MouseEvent arg0) {
          Utils.launch((String) ((Label) arg0.widget).getData());
        }
      });

   
    Listener radioGroup = new Listener () {
      public void handleEvent (Event event) {
       
        Control [] children = gRadio.getChildren ();
       
        for (int j=0; j<children.length; j++) {
           Control child = children [j];
           if (child instanceof Button) {
             Button button = (Button) child;
             if ((button.getStyle () & SWT.RADIO) != 0) button.setSelection (false);
           }
        }

        Button button = (Button) event.widget;
        button.setSelection (true);
        int mode = Integer.parseInt((String)button.getData("iMode"));
        text[0] = MessageText.getString("ConfigView.section.mode." + (String)button.getData("sMode"));
        label.setText(text[0]);
        linkLabel.setText( MessageText.getString(messTexts[mode]) );
        linkLabel.setData( links[mode] );
        if(mode == 1){
          linkLabel1.setText( MessageText.getString(messTexts[3]) );
          linkLabel1.setData( links[3] );
        } else{
          linkLabel1.setText( "" );
          linkLabel1.setData( "" );
        }
        COConfigurationManager.setParameter("User Mode", Integer.parseInt((String)button.getData("iMode")));
        }
    };
   
    button0.addListener (SWT.Selection, radioGroup);
    button1.addListener (SWT.Selection, radioGroup);
    button2.addListener (SWT.Selection, radioGroup);

    Label padding = new Label(cMode, SWT.NULL );
    gridData = new GridData();
    gridData.horizontalSpan = 3;
    padding.setLayoutData( gridData );
   
      // reset to defaults
   
  Composite gReset = new Composite(cMode, SWT.WRAP);
    gridData = new GridData();
    gridData.horizontalSpan = 4;
    gReset.setLayoutData(gridData);
    layout = new GridLayout();
    layout.numColumns = 3;
    gReset.setLayout(layout);

    Label reset_label = new Label(gReset, SWT.NULL );
    Messages.setLanguageText(reset_label, "ConfigView.section.mode.resetdefaults" );
   
    Button reset_button = new Button(gReset, SWT.PUSH);

    Messages.setLanguageText(reset_button, "Button.reset" );

    reset_button.addListener(SWT.Selection,
    new Listener()
    {
          public void
      handleEvent(Event event)
          {
            MessageBoxShell mb = new MessageBoxShell(
View Full Code Here


   
    configList = new Combo(panel,SWT.READ_ONLY);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan = 3;
    configList.setLayoutData(gridData);
    configList.addListener(SWT.Selection,new Listener() {
      public void handleEvent(Event e) {               
        updateWebSeeds();
        refreshDetails();
      }
    });
          
    btnNew = new Button(panel, SWT.PUSH);  
    Messages.setLanguageText(btnNew, "wizard.multitracker.new");
    gridData = new GridData();
    gridData.widthHint = 100;
    btnNew.setLayoutData(gridData);
    btnNew.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
      Map webseeds = new HashMap();
         webseeds.put( "getright", new ArrayList());
         webseeds.put( "webseed", new ArrayList());
        new WebSeedsEditor(null,webseeds,WebSeedPanel.this);
      }
    });
   
    btnEdit = new Button(panel, SWT.PUSH);  
    Messages.setLanguageText(btnEdit, "wizard.multitracker.edit");
    gridData = new GridData();
    gridData.widthHint = 100;
    btnEdit.setLayoutData(gridData);
    btnEdit.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
        int selection = configList.getSelectionIndex();
        String selected = configList.getItem(selection);
        Map webseeds = TrackersUtil.getInstance().getWebSeeds();
        new WebSeedsEditor(selected,(Map)webseeds.get(selected),WebSeedPanel.this);
      }
    });
   
    btnDelete = new Button(panel, SWT.PUSH);  
    Messages.setLanguageText(btnDelete, "wizard.multitracker.delete");
    gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
    gridData.widthHint = 100;   
    btnDelete.setLayoutData(gridData);
    btnDelete.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
        int selection = configList.getSelectionIndex();
        String selected = configList.getItem(selection);
        TrackersUtil.getInstance().removeWebSeed(selected);
        refreshList("");
View Full Code Here

    file.setText(((NewTorrentWizard) wizard).singlePath);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    file.setLayoutData(gridData);
   
    Button browse = new Button(panel, SWT.PUSH);
    browse.addListener(SWT.Selection, new Listener() {
      /*
       * (non-Javadoc)
       *
       * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
       */
 
View Full Code Here

        list.add(labels[i]);
      }
     
      setIndex(index);
     
      list.addListener(SWT.Selection, new Listener() {
           public void handleEvent(Event e) {
             setIndex(list.getSelectionIndex());
           }
         });
     
View Full Code Here

          }
          menuItem.setSelection(selection_value.booleanValue());
        }
      }
     
      final Listener main_listener = controller.makeSelectionListener(az_menuitem);
      menuItem.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event e) {
          if (az_menuitem.getStyle() == MenuItem.STYLE_CHECK
              || az_menuitem.getStyle() == MenuItem.STYLE_RADIO) {
            if (!menuItem.isDisposed()) {
              az_menuitem.setData(new Boolean(menuItem.getSelection()));
            }
          }
          main_listener.handleEvent(e);
        }
      });
     
      if (is_container) {
        Menu this_menu = new Menu(composite.getShell(), SWT.DROP_DOWN);
View Full Code Here

      this.objects = o;
    }

    public Listener makeSelectionListener(MenuItem menu_item) {
      final MenuItemImpl mii = (MenuItemImpl) menu_item;
      return new Listener() {
        public void handleEvent(Event e) {
          mii.invokeListenersMulti(objects);
        }
      };
    }
View Full Code Here

    label = new Label(shell,SWT.WRAP);
   
    combo = new Combo(shell,SWT.READ_ONLY);
   
    Button ok = new Button(shell,SWT.PUSH);
    ok.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event arg0) {
       result = combo.getText();
       shell.dispose();      
      }
    });
    ok.setText(MessageText.getString("Button.ok"));
   
    Button cancel = new Button(shell,SWT.PUSH);
    cancel.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event arg0) {
       
        result = null;
      
       shell.dispose();      
      }
    });
    cancel.setText(MessageText.getString("Button.cancel"));
   
   
    shell.addListener(SWT.Dispose,new Listener() {
      public void handleEvent(Event arg0) {
      }
    });
   
    data = new GridData(GridData.FILL_HORIZONTAL);
View Full Code Here

    });

    /*
     * On closing remove all reporters that was handled by this instance of the window from the registry
     */
    shell.addListener(SWT.Close, new Listener() {
      public void handleEvent(Event event) {

        /*
         * Remove this class as a listener to the disposal event for the panels or else
         * as the shell is closing the panels would be disposed one-by-one and each one would
View Full Code Here

    });
    file.setText(((NewTorrentWizard) wizard).directoryPath);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    file.setLayoutData(gridData);
    Button browse = new Button(panel, SWT.PUSH);
    browse.addListener(SWT.Selection, new Listener() {
      /*
       * (non-Javadoc)
       *
       * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
       */
 
View Full Code Here

  Button bFileMode = new Button(panel,SWT.RADIO);
  Messages.setLanguageText(bFileMode,"installPluginsWizard.mode.file");
  bFileMode.setData("mode",new Integer(MODE_FROM_FILE));
  if(((InstallPluginWizard)wizard).mode == MODE_FROM_FILE) bFileMode.setSelection(true);
 
  Listener modeListener = new Listener() {
    public void handleEvent(Event e) {
      mode = ((Integer) e.widget.getData("mode")).intValue();
      ((InstallPluginWizard)wizard).mode = mode;
    }
  };
View Full Code Here

TOP

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

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.