Revision aeb80bf1
Added by Andreas Müller about 3 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/DateDetailSection.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2018 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
1 | 9 |
package eu.etaxonomy.taxeditor.ui.element; |
2 | 10 |
|
3 | 11 |
import org.eclipse.jface.util.PropertyChangeEvent; |
... | ... | |
30 | 38 |
} |
31 | 39 |
|
32 | 40 |
/** |
33 |
* <p> |
|
34 | 41 |
* Constructor for DateDetailSection. |
35 |
* </p> |
|
36 |
* |
|
37 |
* @param formFactory |
|
38 |
* a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} |
|
39 |
* object. |
|
40 |
* @param parentElement |
|
41 |
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} |
|
42 |
* object. |
|
43 |
* @param style |
|
44 |
* a int. |
|
45 | 42 |
*/ |
46 | 43 |
protected DateDetailSection(CdmFormFactory formFactory, |
47 | 44 |
ICdmFormElement parentElement, boolean includeVerbatim, int style) { |
... | ... | |
69 | 66 |
LayoutConstants.FILL_HORIZONTALLY(6, 1)); |
70 | 67 |
} |
71 | 68 |
|
72 |
|
|
73 |
|
|
74 | 69 |
text_freeText = formFactory.createTextWithLabelElement(this, |
75 | 70 |
"Freetext", null, style); |
76 | 71 |
text_freeText.getMainControl().setLayoutData( |
... | ... | |
111 | 106 |
|
112 | 107 |
|
113 | 108 |
/** |
114 |
* <p> |
|
115 | 109 |
* Setter for the field <code>timePeriod</code>. |
116 |
* </p> |
|
117 |
* |
|
118 |
* @param timePeriod |
|
119 |
* a {@link eu.etaxonomy.cdm.model.common.TimePeriod} object. |
|
120 | 110 |
*/ |
121 | 111 |
@Override |
122 | 112 |
public void setEntity(T timePeriod) { |
... | ... | |
126 | 116 |
} |
127 | 117 |
|
128 | 118 |
/** |
129 |
* When setting the entity through parsing we do not want to alter the parse field
|
|
130 |
* @param timePeriod
|
|
119 |
* When setting the entity through parsing we do not want |
|
120 |
* to alter the parse field
|
|
131 | 121 |
*/ |
132 | 122 |
protected void setEntityInternally(T timePeriod){ |
133 | 123 |
Partial start = timePeriod.getStart(); |
... | ... | |
149 | 139 |
super.setEntity(timePeriod); |
150 | 140 |
} |
151 | 141 |
|
152 |
/** {@inheritDoc} */ |
|
153 | 142 |
@Override |
154 | 143 |
public void propertyChange(PropertyChangeEvent event) { |
155 | 144 |
if (event == null) { |
... | ... | |
168 | 157 |
} |
169 | 158 |
} |
170 | 159 |
|
171 |
/** |
|
172 |
* @param event |
|
173 |
*/ |
|
174 | 160 |
private void handleException(CdmPropertyChangeEvent event) { |
175 | 161 |
firePropertyChangeEvent(new CdmPropertyChangeEvent(this, |
176 | 162 |
event.getException())); |
... | ... | |
212 | 198 |
firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null)); |
213 | 199 |
} |
214 | 200 |
|
215 |
// protected abstract T parseNewInstance() ; |
|
216 |
|
|
217 | 201 |
protected void updateTitle(){ |
218 | 202 |
String title = CdmUtils.Nz(getEntity().toString()); |
219 | 203 |
this.setText(title); |
... | ... | |
224 | 208 |
layout(); |
225 | 209 |
} |
226 | 210 |
|
227 |
/** {@inheritDoc} */ |
|
228 | 211 |
@Override |
229 | 212 |
public void dispose() { |
230 | 213 |
formFactory.removePropertyChangeListener(this); |
Also available in: Unified diff
cleanup