FileDocCategorySizeDatePackage
RadioParameter.javaAPI DocAzureus 3.0.3.43261Mon Jan 15 22:37:24 GMT 2007org.gudy.azureus2.ui.swt.config

RadioParameter

public class RadioParameter extends Parameter
author
TuxPaper

Fields Summary
org.eclipse.swt.widgets.Button
radioButton
List
performers
Constructors Summary
public RadioParameter(org.eclipse.swt.widgets.Composite composite, String sConfigName, int iButtonValue)


         
    this(composite, sConfigName, iButtonValue, null);
  
public RadioParameter(org.eclipse.swt.widgets.Composite composite, String sConfigName, int iButtonValue, IAdditionalActionPerformer actionPerformer)

  	super(sConfigName);
    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)
          COConfigurationManager.setParameter(sConfigName, iButtonValue);

        if (performers.size() > 0 ) {
          for (int i = 0;i < performers.size(); i++) {
            IAdditionalActionPerformer  performer = (IAdditionalActionPerformer)performers.get(i);

            performer.setSelected(selected);
            performer.performAction();
          }
        }
      }
    });
  
Methods Summary
public org.eclipse.swt.widgets.ControlgetControl()

    return radioButton;
  
public booleanisSelected()

    return( radioButton.getSelection());
  
public voidsetAdditionalActionPerformer(IAdditionalActionPerformer actionPerformer)

    performers.add(actionPerformer);
    boolean selected  = radioButton.getSelection();
    actionPerformer.setSelected(selected);
    actionPerformer.performAction();
  
public voidsetLayoutData(java.lang.Object layoutData)

    radioButton.setLayoutData(layoutData);
  
public voidsetValue(java.lang.Object value)

  	System.err.println("NOT IMPLEMENTED");