1
|
/**
|
2
|
*
|
3
|
*/
|
4
|
package eu.etaxonomy.taxeditor.singlesource.ui.forms;
|
5
|
|
6
|
import javax.naming.OperationNotSupportedException;
|
7
|
|
8
|
import org.apache.log4j.Logger;
|
9
|
import org.eclipse.swt.events.ModifyEvent;
|
10
|
import org.eclipse.swt.events.ModifyListener;
|
11
|
|
12
|
import eu.etaxonomy.cdm.common.CdmUtils;
|
13
|
import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory;
|
14
|
import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
|
15
|
|
16
|
/**
|
17
|
* <p>
|
18
|
* TextWithLabelElement class.
|
19
|
* </p>
|
20
|
*
|
21
|
* @author n.hoffmann
|
22
|
* @version $Id: $
|
23
|
*/
|
24
|
public class TextWithLabelElementFacadeImpl extends TextWithLabelElementFacade {
|
25
|
private static final Logger logger = Logger.getLogger(TextWithLabelElementFacadeImpl.class);
|
26
|
|
27
|
public TextWithLabelElementFacadeImpl(){
|
28
|
super();
|
29
|
}
|
30
|
|
31
|
protected TextWithLabelElementFacadeImpl(CdmFormFactory formFactory,
|
32
|
ICdmFormElement parentElement, String labelString,
|
33
|
String initialText, Integer textHeight, int style) {
|
34
|
super(formFactory, parentElement, labelString, initialText, textHeight, style);
|
35
|
}
|
36
|
|
37
|
protected Object getInstanceInternal (CdmFormFactory formFactory,
|
38
|
ICdmFormElement parentElement, String labelString,
|
39
|
String initialText, Integer textHeight, int style) {
|
40
|
|
41
|
return new TextWithLabelElementFacadeImpl( formFactory, parentElement, labelString, initialText, textHeight, style);
|
42
|
}
|
43
|
|
44
|
public boolean traverseInternal(int traversal) throws OperationNotSupportedException
|
45
|
{
|
46
|
throw new OperationNotSupportedException("Text.traverse(int) not supported !");
|
47
|
}
|
48
|
|
49
|
public void setTextInternal(String string) {
|
50
|
ModifyListener[] modifyListeners = (ModifyListener[])ModifyEvent.getListeners(text);
|
51
|
for (ModifyListener modifyListener : modifyListeners) {
|
52
|
ModifyEvent.removeListener(text, modifyListener);
|
53
|
}
|
54
|
|
55
|
text.setText(CdmUtils.Nz(string));
|
56
|
|
57
|
for (ModifyListener modifyListener : modifyListeners) {
|
58
|
ModifyEvent.addListener(text, modifyListener);
|
59
|
}
|
60
|
}
|
61
|
|
62
|
}
|