Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Listener


    cancel_button.setText( "Cancel" );
   
    cancel_button.addListener(
        SWT.Selection,
        new Listener()
        {
          public void
          handleEvent(
            Event arg0 )
          {
View Full Code Here


    textPath.setLayoutData(gridData);
    textPath.setText(((ExportTorrentWizard)wizard).getExportFile());
 
    Button browse = new Button(panel,SWT.PUSH);
    Messages.setLanguageText(browse, "exportTorrentWizard.exportfile.browse");
    browse.addListener(SWT.Selection,new Listener() {
     
      public void handleEvent(Event arg0){
       
      FileDialog fd = new FileDialog(wizard.getWizardWindow(), SWT.SAVE );
     
      fd.setFileName(textPath.getText());
     
      fd.setFilterExtensions(new String[]{"*.xml", Constants.FILE_WILDCARD});
     
      String path = fd.open();
     
      if(path != null) {
       
        textPath.setText(path);
      }    
      }
    });
 
    textPath.addListener(SWT.Modify, new Listener(){
     
      public void handleEvent(Event event) {
      String path = textPath.getText();
     
      pathSet( path );
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) {               
        updateTrackers();
        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) {
        List group = new ArrayList();
        List tracker = new ArrayList();
        tracker.add(((NewTorrentWizard)wizard).trackerURL);
        group.add(tracker);
        new MultiTrackerEditor(null,group,MultiTrackerPanel.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 multiTrackers = TrackersUtil.getInstance().getMultiTrackers();
        new MultiTrackerEditor(selected,(List)multiTrackers.get(selected),MultiTrackerPanel.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().removeMultiTracker(selected);
        refreshList("");
View Full Code Here

    Composite  comp )
  {
    styled_text = new StyledText(comp,SWT.BORDER | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL);   
    styled_text.setWordWrap(true);

    styled_text.addListener(SWT.MouseUp, new Listener() {
      public void handleEvent(Event event) {
        if (links.size() == 0) {
          return;
        }
        try {
          int ofs = styled_text.getOffsetAtLocation(new Point(event.x, event.y));
          for (int i = 0; i < links.size(); i++) {
            linkInfo linkInfo = (linkInfo)links.get(i);
            if (ofs >= linkInfo.ofsStart && ofs <= linkInfo.ofsEnd) {
              Utils.launch(linkInfo.url);
              break;
            }
          }
        } catch (Exception e) {

        }
      }
    });

    final Cursor handCursor = new Cursor(comp.getDisplay(), SWT.CURSOR_HAND);
    styled_text.addListener(SWT.MouseMove, new Listener() {
      Cursor curCursor = null;

      public void handleEvent(Event event) {
        if (links.size() == 0) {
          return;
        }
        boolean onLink = false;
        try {
          int ofs = styled_text.getOffsetAtLocation(new Point(event.x, event.y));
          for (int i = 0; i < links.size(); i++) {
            linkInfo linkInfo = (linkInfo)links.get(i);
            if (ofs >= linkInfo.ofsStart && ofs <= linkInfo.ofsEnd) {
              onLink = true;
              break;
            }
          }
        } catch (Exception e) {

        }

        try {
          Cursor cursor = onLink ? handCursor : null;
          if (curCursor != cursor) {
            styled_text.setCursor(cursor);
            curCursor = cursor;
          }
        } catch (Exception e) {

        }
      }
    });

    styled_text.addListener(SWT.Dispose, new Listener() {
      public void handleEvent(Event event) {
        styled_text.setCursor(null);
        handCursor.dispose();
      }
    });
View Full Code Here

    textPath.setLayoutData(gridData);
    textPath.setText("");
 
    Button browse = new Button(panel,SWT.PUSH);
    Messages.setLanguageText(browse, "exportTorrentWizard.torrentfile.browse");
    browse.addListener(SWT.Selection,new Listener() {
      public void handleEvent(Event arg0) {
       
      FileDialog fd = new FileDialog(wizard.getWizardWindow());
     
      fd.setFileName(textPath.getText());
     
      fd.setFilterExtensions(new String[]{"*.torrent", "*.tor", Constants.FILE_WILDCARD});
     
      String path = fd.open();
     
      if(path != null) {
       
        textPath.setText(path);     
      }    
      }
    });
 
    textPath.addListener(SWT.Modify, new Listener(){
     
      public void handleEvent(Event event) {
       
      String path = textPath.getText();
     
View Full Code Here

      String version = plugin.getPluginVersion();
      if(version == null) version = MessageText.getString("installPluginsWizard.list.nullversion");
      item.setText(1,version);
    }
 
  pluginList.addListener(SWT.Selection,new Listener() {
    public void handleEvent(Event e) {
      updateList();   
    }
  });
  }
View Full Code Here

      Utils.linkShellMetricsToConfig(shell, "options");

      /*
       * Auto-save when the shell closes
       */
      shell.addListener(SWT.Close, new Listener() {
        public void handleEvent(Event event) {
          configView.save();
          event.doit = true;
        }
      });
View Full Code Here

      Button reset_button = new Button(networkGroup, SWT.PUSH);

      Messages.setLanguageText(reset_button, CFG_PREFIX + "reset.button" );

      reset_button.addListener(SWT.Selection,
        new Listener()
      {
            public void
        handleEvent(Event event)
            {
              sm.reset();
View Full Code Here

    ok.setText(MessageText.getString("Button.ok"));
    gridData = new GridData();
    gridData.widthHint = 70;
    ok.setLayoutData(gridData);
    shell.setDefaultButton(ok);
    ok.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        try {
          shell.dispose();
        }
        catch (Exception e) {
          Debug.printStackTrace( e );
        }
      }
    });

  shell.addListener(SWT.Traverse, new Listener() { 
    public void handleEvent(Event e) {
      if ( e.character == SWT.ESC){
        shell.dispose();
      }
    }
View Full Code Here

        Button reset_button = new Button(cSection, SWT.PUSH);

        Messages.setLanguageText(reset_button, CFG_PREFIX + "reset.button" );

        reset_button.addListener(SWT.Selection,
            new Listener()
          {
                public void
            handleEvent(Event event)
                {
                  max_increase.resetToDefault();
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.