import eu.etaxonomy.taxeditor.preference.Resources;
/**
- * @author n.hoffmann
+ * <p>TextWithLabelElement class.</p>
*
+ * @author n.hoffmann
+ * @version $Id: $
*/
public class TextWithLabelElement extends AbstractCdmFormElement implements ModifyListener, IEnableableFormElement{
protected StyledText text;
private Label label;
+ /** Constant <code>MAX_HEIGHT=0</code> */
public static final int MAX_HEIGHT = 0;
+ /** Constant <code>SINGLE=-1</code> */
public static final int SINGLE = -1;
/**
- *
- * @param formFactory
- * @param parentElement
- * @param labelString
- * @param initialText
- * @param textHeight
- * @param style
+ * <p>Constructor for TextWithLabelElement.</p>
+ *
+ * @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.
+ * @param initialText a {@link java.lang.String} object.
+ * @param textHeight a {@link java.lang.Integer} object.
+ * @param style a int.
*/
protected TextWithLabelElement(CdmFormFactory formFactory, ICdmFormElement parentElement, String labelString, String initialText, Integer textHeight, int style)
{
/**
* Get the text of this composites text composite
- *
- * @return
+ *
+ * @return a {@link java.lang.String} object.
*/
public String getText() {
return text.getText();
/**
* Set the text of this composites text composite
- *
- * @param string
+ *
+ * @param string a {@link java.lang.String} object.
*/
public void setText(String string) {
Listener[] listeners = text.getListeners(SWT.Modify);
/* (non-Javadoc)
* @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
*/
+ /** {@inheritDoc} */
public void modifyText(ModifyEvent e) {
firePropertyChangeEvent(new CdmPropertyChangeEvent(this, e));
}
+ /** {@inheritDoc} */
public void setSelected(boolean selected) {
setBackground(getColor(selected));
}
+ /** {@inheritDoc} */
public void setEnabled(boolean enabled) {
text.setEnabled(enabled);
String symbolicName = enabled ? Resources.COLOR_FONT_DEFAULT : Resources.COLOR_TEXT_DISABLED;
text.setForeground(EditorUtil.getColor(symbolicName));
}
+ /** {@inheritDoc} */
public void setIrrelevant(boolean irrelevant) {
String colorId = irrelevant ? Resources.COLOR_COMPOSITE_IRRELEVANT : Resources.COLOR_COMPOSITE_BACKGROUND;
text.setBackground(color);
}
+ /** {@inheritDoc} */
@Override
public void setBackground(Color color) {
if(label != null)
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.forms.AbstractCdmFormElement#setFocus()
*/
+ /** {@inheritDoc} */
@Override
public void setFocus() {
text.setFocus();
}
/**
- *
+ * <p>getMainControl</p>
+ *
+ * @return a {@link org.eclipse.swt.widgets.Control} object.
*/
public Control getMainControl() {
return text;
}
/**
- *
+ * <p>setTextLimit</p>
+ *
+ * @param limit a int.
*/
public void setTextLimit(int limit) {
text.setTextLimit(limit);