/**
- *
+ *
*/
package eu.etaxonomy.taxeditor.ui.element;
import org.eclipse.swt.widgets.Text;
import eu.etaxonomy.cdm.common.CdmUtils;
-import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
/**
* <p>TextActionElement class.</p>
*
* @author nho
- * @version $Id: $
*/
public class TextActionElement extends AbstractCdmFormElement implements ModifyListener, ISelectable{
*/
protected TextActionElement(CdmFormFactory toolkit, ICdmFormElement parentElement, String labelString, String buttonLabel, String initialText, int style) {
super(toolkit, parentElement);
-
+
label = toolkit.createLabel(getLayoutComposite(), labelString, SWT.WRAP);
addControl(label);
-
+
box = formFactory.createComposite(getLayoutComposite());
box.setLayout(LayoutConstants.LAYOUT(2, false));
box.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
addControl(box);
-
+
text = toolkit.createText(box, "", style);
addControl(text);
text.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
-
+
setText(CdmUtils.Nz(initialText));
-
+
button = toolkit.createButton(box, buttonLabel, SWT.PUSH);
addControl(button);
}
button.removeSelectionListener(listener);
}
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- /** {@inheritDoc} */
- public void modifyText(ModifyEvent e) {
+ @Override
+ public void modifyText(ModifyEvent e) {
propertyChange(null);
}
-
+
/**
* <p>addModifyListener</p>
*
public void addModifyListener(ModifyListener listener){
text.addModifyListener(listener);
}
-
+
/**
* <p>removeModifyListener</p>
*
public void removeModifyListener(ModifyListener listener){
text.removeModifyListener(listener);
}
-
- /** {@inheritDoc} */
+
@Override
public void setBackground(Color color) {
label.setBackground(color);
}
-
+
@Override
public void setSelected(boolean selected) {
setBackground(selected ? SELECTED : getPersistentBackground());