import eu.etaxonomy.taxeditor.preference.Resources;
/**
+ * <p>CheckboxElement class.</p>
+ *
* @author n.hoffmann
* @created Nov 5, 2009
* @version 1.0
private Label label;
/**
- *
- * @param parent
- * @param label
- * @param initialState
- * @param listener
- * @param style
+ * <p>Constructor for CheckboxElement.</p>
+ *
+ * @param initialState a boolean.
+ * @param style a int.
+ * @param formFactory a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory} object.
+ * @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object.
+ * @param labelString a {@link java.lang.String} object.
*/
protected CheckboxElement(CdmFormFactory formFactory, ICdmFormElement parentElement, String labelString, boolean initialState,
int style) {
addControl(checkbox);
}
+ /**
+ * <p>setSelection</p>
+ *
+ * @param selected a boolean.
+ */
public void setSelection(boolean selected){
checkbox.removeSelectionListener(this);
checkbox.setSelection(selected);
checkbox.addSelectionListener(this);
}
+ /**
+ * <p>getSelection</p>
+ *
+ * @return a boolean.
+ */
public boolean getSelection(){
return checkbox.getSelection();
}
/* (non-Javadoc)
* @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*/
+ /** {@inheritDoc} */
public void widgetSelected(SelectionEvent e) {
firePropertyChangeEvent(new CdmPropertyChangeEvent(this, e));
}
+ /** {@inheritDoc} */
public void widgetDefaultSelected(SelectionEvent e) {}
+ /** {@inheritDoc} */
public void setSelected(boolean selected) {
checkbox.setBackground(getColor(selected));
}
+ /** {@inheritDoc} */
public void setEnabled(boolean enabled) {
checkbox.setEnabled(enabled);
}
+ /** {@inheritDoc} */
public void setIrrelevant(boolean irrelevant) {
String colorId = irrelevant ? Resources.COLOR_COMPOSITE_IRRELEVANT : Resources.COLOR_COMPOSITE_BACKGROUND;
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.forms.AbstractCdmFormElement#setBackground(org.eclipse.swt.graphics.Color)
*/
+ /** {@inheritDoc} */
@Override
public void setBackground(Color color) {
checkbox.setBackground(color);