RadioParameterpublic class RadioParameter extends Parameter
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.Control | getControl()
return radioButton;
| public boolean | isSelected()
return( radioButton.getSelection());
| public void | setAdditionalActionPerformer(IAdditionalActionPerformer actionPerformer)
performers.add(actionPerformer);
boolean selected = radioButton.getSelection();
actionPerformer.setSelected(selected);
actionPerformer.performAction();
| public void | setLayoutData(java.lang.Object layoutData)
radioButton.setLayoutData(layoutData);
| public void | setValue(java.lang.Object value)
System.err.println("NOT IMPLEMENTED");
|
|