Revision 3be6ef3e
Added by Niels Hoffmann over 13 years ago
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/AbstractEntityCollectionElement.java | ||
---|---|---|
32 | 32 |
import eu.etaxonomy.taxeditor.model.ImageResources; |
33 | 33 |
|
34 | 34 |
/** |
35 |
* <p>Abstract AbstractEntityCollectionElement class.</p> |
|
36 |
* |
|
35 | 37 |
* @author n.hoffmann |
36 | 38 |
* @created Nov 16, 2009 |
37 | 39 |
* @version 1.0 |
... | ... | |
49 | 51 |
private Color backgroundColor; |
50 | 52 |
|
51 | 53 |
/** |
54 |
* <p>Constructor for AbstractEntityCollectionElement.</p> |
|
55 |
* |
|
52 | 56 |
* @param backgroundColor TODO |
53 |
* @param style |
|
54 |
* @param parent |
|
55 |
* @param propertyChangelistener |
|
57 |
* @param style a int. |
|
58 |
* @param formFactory a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory} object. |
|
59 |
* @param section a {@link eu.etaxonomy.taxeditor.forms.AbstractFormSection} object. |
|
60 |
* @param entity a ENTITY object. |
|
61 |
* @param removeListener a {@link org.eclipse.swt.events.SelectionListener} object. |
|
62 |
* @param <ENTITY> a ENTITY object. |
|
56 | 63 |
*/ |
57 | 64 |
public AbstractEntityCollectionElement(CdmFormFactory formFactory, AbstractFormSection section, ENTITY entity, SelectionListener removeListener, |
58 | 65 |
Color backgroundColor, int style) { |
... | ... | |
108 | 115 |
|
109 | 116 |
/** |
110 | 117 |
* Init gets executed before any other setup of the section takes place |
111 |
*
|
|
118 |
* |
|
112 | 119 |
* Implement this if you want to configure the section |
113 | 120 |
*/ |
114 | 121 |
public void init() { |
115 | 122 |
// default implementation is empty |
116 | 123 |
} |
117 | 124 |
|
125 |
/** |
|
126 |
* <p>Setter for the field <code>entity</code>.</p> |
|
127 |
* |
|
128 |
* @param entity a ENTITY object. |
|
129 |
*/ |
|
118 | 130 |
public abstract void setEntity(ENTITY entity); |
119 | 131 |
|
132 |
/** |
|
133 |
* <p>Getter for the field <code>entity</code>.</p> |
|
134 |
* |
|
135 |
* @return a ENTITY object. |
|
136 |
*/ |
|
120 | 137 |
public ENTITY getEntity(){ |
121 | 138 |
return entity; |
122 | 139 |
} |
123 | 140 |
|
124 | 141 |
/** |
125 |
* |
|
126 |
* @param element |
|
127 |
* @param style |
|
142 |
* <p>createControls</p> |
|
143 |
* |
|
144 |
* @param element a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
145 |
* @param style a int. |
|
128 | 146 |
*/ |
129 | 147 |
public abstract void createControls(ICdmFormElement element, int style); |
130 | 148 |
|
149 |
/** {@inheritDoc} */ |
|
131 | 150 |
public void setSelected(boolean selected) { |
132 | 151 |
for(ICdmFormElement element : getElements()){ |
133 | 152 |
if(element instanceof ISelectable){ |
... | ... | |
141 | 160 |
* (non-Javadoc) |
142 | 161 |
* @see eu.etaxonomy.taxeditor.forms.AbstractCdmFormElement#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) |
143 | 162 |
*/ |
163 |
/** {@inheritDoc} */ |
|
144 | 164 |
@Override |
145 | 165 |
public void propertyChange(PropertyChangeEvent event) { |
146 | 166 |
if(event == null){ |
... | ... | |
152 | 172 |
} |
153 | 173 |
} |
154 | 174 |
|
175 |
/** |
|
176 |
* <p>handleEvent</p> |
|
177 |
* |
|
178 |
* @param eventSource a {@link java.lang.Object} object. |
|
179 |
*/ |
|
155 | 180 |
public abstract void handleEvent(Object eventSource); |
156 | 181 |
|
157 | 182 |
/* |
158 | 183 |
* (non-Javadoc) |
159 | 184 |
* @see eu.etaxonomy.taxeditor.forms.AbstractCdmFormElement#getColor(boolean) |
160 | 185 |
*/ |
186 |
/** {@inheritDoc} */ |
|
161 | 187 |
@Override |
162 | 188 |
public Color getColor(boolean selected) { |
163 | 189 |
return selected ? SELECTED : backgroundColor; |
164 | 190 |
} |
165 | 191 |
|
192 |
/** {@inheritDoc} */ |
|
166 | 193 |
public void setBackground(Color color){ |
167 | 194 |
container.setBackground(color); |
168 | 195 |
box.setBackground(color); |
... | ... | |
172 | 199 |
} |
173 | 200 |
|
174 | 201 |
/** |
202 |
* {@inheritDoc} |
|
203 |
* |
|
175 | 204 |
* React when selection occurs |
176 | 205 |
*/ |
177 | 206 |
public void widgetSelected(SelectionEvent e) { |
178 | 207 |
|
179 | 208 |
} |
180 | 209 |
|
210 |
/** {@inheritDoc} */ |
|
181 | 211 |
public void widgetDefaultSelected(SelectionEvent e) {} |
182 | 212 |
|
213 |
/** {@inheritDoc} */ |
|
183 | 214 |
@Override |
184 | 215 |
public Composite getLayoutComposite() { |
185 | 216 |
return container; |
186 | 217 |
} |
187 | 218 |
|
188 | 219 |
/** |
220 |
* <p>Setter for the field <code>backgroundColor</code>.</p> |
|
221 |
* |
|
189 | 222 |
* @param backgroundColor the backgroundColor to set |
190 | 223 |
*/ |
191 | 224 |
public void setBackgroundColor(Color backgroundColor) { |
... | ... | |
195 | 228 |
} |
196 | 229 |
|
197 | 230 |
/** |
231 |
* <p>Getter for the field <code>backgroundColor</code>.</p> |
|
232 |
* |
|
198 | 233 |
* @return the backgroundColor |
199 | 234 |
*/ |
200 | 235 |
public Color getBackgroundColor() { |
201 | 236 |
return backgroundColor; |
202 | 237 |
} |
203 | 238 |
|
239 |
/** |
|
240 |
* <p>getConversationHolder</p> |
|
241 |
* |
|
242 |
* @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object. |
|
243 |
*/ |
|
204 | 244 |
public ConversationHolder getConversationHolder() { |
205 | 245 |
if(getParentElement() instanceof IConversationEnabled){ |
206 | 246 |
return ((IConversationEnabled) getParentElement()).getConversationHolder(); |
... | ... | |
208 | 248 |
throw new IllegalArgumentException("Parent element should be IConversationEnabled"); |
209 | 249 |
} |
210 | 250 |
|
251 |
/** {@inheritDoc} */ |
|
211 | 252 |
public void update(CdmDataChangeMap changeEvents) {} |
212 | 253 |
} |
Also available in: Unified diff
performed javacscript:fix and worked on documentation