Revision 8481f952
Added by Andreas Müller almost 4 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TextActionElement.java | ||
---|---|---|
1 | 1 |
/** |
2 |
*
|
|
2 |
* |
|
3 | 3 |
*/ |
4 | 4 |
package eu.etaxonomy.taxeditor.ui.element; |
5 | 5 |
|
... | ... | |
19 | 19 |
* <p>TextActionElement class.</p> |
20 | 20 |
* |
21 | 21 |
* @author nho |
22 |
* @version $Id: $ |
|
23 | 22 |
*/ |
24 | 23 |
public class TextActionElement extends AbstractCdmFormElement implements ModifyListener, ISelectable{ |
25 | 24 |
|
... | ... | |
40 | 39 |
*/ |
41 | 40 |
protected TextActionElement(CdmFormFactory toolkit, ICdmFormElement parentElement, String labelString, String buttonLabel, String initialText, int style) { |
42 | 41 |
super(toolkit, parentElement); |
43 |
|
|
42 |
|
|
44 | 43 |
label = toolkit.createLabel(getLayoutComposite(), labelString, SWT.WRAP); |
45 | 44 |
addControl(label); |
46 |
|
|
45 |
|
|
47 | 46 |
box = formFactory.createComposite(getLayoutComposite()); |
48 | 47 |
box.setLayout(LayoutConstants.LAYOUT(2, false)); |
49 | 48 |
box.setLayoutData(LayoutConstants.FILL_HORIZONTALLY()); |
50 | 49 |
addControl(box); |
51 |
|
|
50 |
|
|
52 | 51 |
text = toolkit.createText(box, "", style); |
53 | 52 |
addControl(text); |
54 | 53 |
text.setLayoutData(LayoutConstants.FILL_HORIZONTALLY()); |
55 |
|
|
54 |
|
|
56 | 55 |
setText(CdmUtils.Nz(initialText)); |
57 |
|
|
56 |
|
|
58 | 57 |
button = toolkit.createButton(box, buttonLabel, SWT.PUSH); |
59 | 58 |
addControl(button); |
60 | 59 |
} |
... | ... | |
95 | 94 |
button.removeSelectionListener(listener); |
96 | 95 |
} |
97 | 96 |
|
98 |
/* (non-Javadoc) |
|
99 |
* @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent) |
|
100 |
*/ |
|
101 |
/** {@inheritDoc} */ |
|
102 |
public void modifyText(ModifyEvent e) { |
|
97 |
@Override |
|
98 |
public void modifyText(ModifyEvent e) { |
|
103 | 99 |
propertyChange(null); |
104 | 100 |
} |
105 |
|
|
101 |
|
|
106 | 102 |
/** |
107 | 103 |
* <p>addModifyListener</p> |
108 | 104 |
* |
... | ... | |
111 | 107 |
public void addModifyListener(ModifyListener listener){ |
112 | 108 |
text.addModifyListener(listener); |
113 | 109 |
} |
114 |
|
|
110 |
|
|
115 | 111 |
/** |
116 | 112 |
* <p>removeModifyListener</p> |
117 | 113 |
* |
... | ... | |
120 | 116 |
public void removeModifyListener(ModifyListener listener){ |
121 | 117 |
text.removeModifyListener(listener); |
122 | 118 |
} |
123 |
|
|
124 |
/** {@inheritDoc} */ |
|
119 |
|
|
125 | 120 |
@Override |
126 | 121 |
public void setBackground(Color color) { |
127 | 122 |
label.setBackground(color); |
128 | 123 |
} |
129 |
|
|
124 |
|
|
130 | 125 |
@Override |
131 | 126 |
public void setSelected(boolean selected) { |
132 | 127 |
setBackground(selected ? SELECTED : getPersistentBackground()); |
Also available in: Unified diff
cleanup