Examples of Listener


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

Examples of org.eclipse.swt.widgets.Listener

          }
        }
      }
    });
   
    drawCanvas.addListener(SWT.Resize, new Listener() {
      public void handleEvent(Event event) {
        drawChart(true);
      }
    });
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.Listener

        };
       
        // Reuse the same label as defined for Azureus UI reset buttons.
        reset_button_holder[0] = new ButtonParameter(area, "ConfigView.section.style.colorOverrides.reset");
        reset_button_holder[0].getControl().setEnabled(color_param.isOverridden());
        reset_button_holder[0].getControl().addListener(SWT.Selection, new Listener(){
          public void handleEvent(Event event) {
            reset_button_holder[0].getControl().setEnabled(false);
            color_param.resetToDefault();
            color_param.reloadParamDataFromConfig(false);
          }
View Full Code Here

Examples of org.eclipse.swt.widgets.Listener

     
      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

Examples of org.eclipse.swt.widgets.Listener

    sParamName = name;

    inputField = new Text(composite, SWT.BORDER);
    float value = COConfigurationManager.getFloatParameter(name);
    inputField.setText(String.valueOf(value));
    inputField.addListener(SWT.Verify, new Listener() {
      public void handleEvent(Event e) {
        String text = e.text;
        char[] chars = new char[text.length()];
        text.getChars(0, chars.length, chars, 0);
        for (int i = 0; i < chars.length; i++) {
          if ( !((chars[i] >= '0' && chars[i] <= '9') || chars[i] == '.') ) {
            e.doit = false;
            return;
          }
        }
      }
    });

    inputField.addListener(SWT.Modify, new Listener() {
      public void handleEvent(Event event) {
        try {
          float val = Float.parseFloat(inputField.getText());
          if (val < fMinValue) {
            if (!(allowZero && val == 0)) {
              val = fMinValue;
            }
          }
          if (val > fMaxValue) {
            if (fMaxValue > -1) {
              val = fMaxValue;
            }
          }
          COConfigurationManager.setParameter(name, val);
        }
        catch (Exception e) {}
      }
    });

    inputField.addListener(SWT.FocusOut, new Listener() {
      public void handleEvent(Event event) {
        try {
          float val = Float.parseFloat(inputField.getText());
          if (val < fMinValue) {
            if (!(allowZero && val == 0)) {
View Full Code Here

Examples of org.eclipse.swt.widgets.Listener

    b = COConfigurationManager.getIntParameter(name+".blue",_b);
    updateButtonColor(composite.getDisplay(), r, g, b);

    COConfigurationManager.addParameterListener(sParamName, this);
   
    colorChooser.addListener(SWT.Dispose, new Listener() {
      public void handleEvent(Event e) {
        COConfigurationManager.removeParameterListener(sParamName, ColorParameter.this);
        if(img != null && ! img.isDisposed()) {
          img.dispose();         
        }
      }
    });

    colorChooser.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
        ColorDialog cd = new ColorDialog(composite.getShell());
        cd.setRGB(new RGB(r,g,b));
        RGB newColor = cd.open();
        if (newColor == null)
View Full Code Here

Examples of org.eclipse.swt.widgets.Listener

    }
    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)
          COConfigurationManager.setParameter(sConfigName, iButtonValue);
View Full Code Here

Examples of org.eclipse.swt.widgets.Listener

    // Start All
    MenuItem start_all = new MenuItem(menu, SWT.PUSH);
    Messages.setLanguageText(start_all, "MainWindow.menu.transfers.startalltransfers");
    Utils.setMenuItemImage(start_all, "start");
    start_all.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
        ManagerUtils.asyncStartAll();
      }
    });
    start_all.setEnabled(true);

    // Stop All
    MenuItem stop_all = new MenuItem(menu, SWT.PUSH);
    Messages.setLanguageText(stop_all, "MainWindow.menu.transfers.stopalltransfers");
    Utils.setMenuItemImage(stop_all, "stop");
    stop_all.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
        ManagerUtils.asyncStopAll();
      }
    });
    stop_all.setEnabled(true);
   
    // Pause All
    MenuItem pause_all = new MenuItem(menu, SWT.PUSH);
    Messages.setLanguageText(pause_all, "MainWindow.menu.transfers.pausetransfers");
    Utils.setMenuItemImage(pause_all, "pause");
    pause_all.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
        ManagerUtils.asyncPause();
      }
    });
    pause_all.setEnabled(g_manager.canPauseDownloads());
   
    // Resume All
    MenuItem resume_all = new MenuItem(menu, SWT.PUSH);
    Messages.setLanguageText(resume_all, "MainWindow.menu.transfers.resumetransfers");
    Utils.setMenuItemImage(resume_all, "resume");
    resume_all.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
        ManagerUtils.asyncResume();
      }
    });
    resume_all.setEnabled(g_manager.canResumeDownloads());
View Full Code Here

Examples of org.eclipse.swt.widgets.Listener

    this.needs_update = true;
    this_mon.exit();
  }

  public void created(final MainStatusBar.CLabelPadding label) {
    final Listener click_listener = new Listener() {
      public void handleEvent(Event e) {
        onClick();
      }
    };
View Full Code Here

Examples of org.eclipse.swt.widgets.Listener

    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()) {
          shell.dispose();
        }
      }
    });
   
    mainLayout = new StackLayout();
    mainComposite.setLayout(mainLayout);
   
    loadingPanel = new Composite(mainComposite,SWT.NONE);
    loadingPanel.setLayout(new FormLayout());
   
    listPanel = new Composite(mainComposite,SWT.NONE);
    listPanel.setLayout(new FillLayout());
   
    subscriptionsList = new Table(listPanel,SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION | SWT.VIRTUAL);
    subscriptionsList.setHeaderVisible(true);
   
    TableColumn name = new TableColumn(subscriptionsList,SWT.NONE);
    name.setText(MessageText.getString("subscriptions.listwindow.name"));
    name.setWidth(310);
    name.setResizable(false);
   
    TableColumn popularity = new TableColumn(subscriptionsList,SWT.NONE);
    popularity.setText(MessageText.getString("subscriptions.listwindow.popularity"));
    popularity.setWidth(70);
    popularity.setResizable(false);
   
    subscriptionsList.addListener(SWT.SetData, new Listener() {
      public void handleEvent(Event e) {
        TableItem item = (TableItem) e.item;
        int index = subscriptionsList.indexOf(item);
        if(index >= 0 && index < subscriptionItems.length) {
          SubscriptionItemModel subscriptionItem = subscriptionItems[index];
          item.setText(0,subscriptionItem.name);
          item.setText(1,subscriptionItem.popularityDisplay);
        }
      }
    });
   
    subscriptionsList.setSortColumn(popularity);
    subscriptionsList.setSortDirection(SWT.DOWN);
   
    subscriptionsList.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event arg0) {
        action.setEnabled(subscriptionsList.getSelectionIndex() != -1);
      }
    });
   
    Listener sortListener = new Listener() {
      public void handleEvent(Event e) {
        // determine new sort column and direction
        TableColumn sortColumn = subscriptionsList.getSortColumn();
        TableColumn currentColumn = (TableColumn) e.widget;
        int dir = subscriptionsList.getSortDirection();
        if (sortColumn == currentColumn) {
          dir = dir == SWT.UP ? SWT.DOWN : SWT.UP;
        } else {
          subscriptionsList.setSortColumn(currentColumn);
          dir = SWT.DOWN;
        }
        subscriptionsList.setSortDirection(dir);
        sortAndRefresh();
      }
    };
    name.addListener(SWT.Selection, sortListener);
    popularity.addListener(SWT.Selection, sortListener);
   
    animatedImage = new AnimatedImage(loadingPanel);
    loadingText = new Label(loadingPanel,SWT.WRAP | SWT.CENTER);
    loadingProgress = new ProgressBar(loadingPanel,SWT.HORIZONTAL);
   
    animatedImage.setImageFromName("spinner_big");
    String contentName = "Dummy";
    if(download != null) {
      contentName = download.getDisplayName();
    }
    loadingText.setText(MessageText.getString("subscriptions.listwindow.loadingtext", new String[] {contentName}));
   
    loadingProgress.setMinimum(0);
    loadingProgress.setMaximum(300);
    loadingProgress.setSelection(0);
   
    data = new FormData();
    data.left = new FormAttachment(1,2,-16);
    data.top = new FormAttachment(1,2,-32);
    data.width = 32;
    data.height = 32;
    animatedImage.setLayoutData(data);
   
    data = new FormData();
    data.left = new FormAttachment(0,5);
    data.right = new FormAttachment(100,-5);
    data.top = new FormAttachment(animatedImage.getControl(),10);
    data.height = 50;
    loadingText.setLayoutData(data);
   
    data = new FormData();
    data.left = new FormAttachment(0,5);
    data.right = new FormAttachment(100,-5);
    data.top = new FormAttachment(loadingText,5);
    loadingProgress.setLayoutData(data);
   
    boolean autoCheck = COConfigurationManager.getBooleanParameter("subscriptions.autocheck");
   
    if(autoCheck) {
      startChecking();
    } else {
      action.setText(MessageText.getString("Button.yes"));
      Composite acceptPanel = new Composite(mainComposite,SWT.NONE);
      acceptPanel.setLayout(new FormLayout());
     
      Label acceptLabel = new Label(acceptPanel,SWT.WRAP | SWT.CENTER);
     
      acceptLabel.setText(MessageText.getString("subscriptions.listwindow.autochecktext"));
     
      data = new FormData();
      data.left = new FormAttachment(0,5);
      data.right = new FormAttachment(100,-5);
      data.top = new FormAttachment(1,3,0);
      acceptLabel.setLayoutData(data);
     
      action.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event event) {
          action.removeListener(SWT.Selection,this);
          COConfigurationManager.setParameter("subscriptions.autocheck",true);
          startChecking();
          mainComposite.layout()
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.