Revision c4957163
Added by Patrick Plitzner over 10 years ago
- removed usage of compatibility interface IEntitySelectionElement
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/basicFields/EntitySelectionFieldController.java | ||
---|---|---|
13 | 13 |
import org.eclipse.jface.wizard.WizardDialog; |
14 | 14 |
import org.eclipse.swt.events.SelectionAdapter; |
15 | 15 |
import org.eclipse.swt.events.SelectionEvent; |
16 |
import org.eclipse.swt.events.SelectionListener; |
|
16 | 17 |
import org.eclipse.swt.graphics.Color; |
17 | 18 |
import org.eclipse.swt.widgets.Button; |
18 | 19 |
import org.eclipse.swt.widgets.Composite; |
... | ... | |
21 | 22 |
import org.springframework.security.core.GrantedAuthority; |
22 | 23 |
|
23 | 24 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
25 |
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled; |
|
24 | 26 |
import eu.etaxonomy.cdm.common.CdmUtils; |
25 | 27 |
import eu.etaxonomy.cdm.model.common.Group; |
26 | 28 |
import eu.etaxonomy.cdm.model.common.ICdmBase; |
... | ... | |
30 | 32 |
import eu.etaxonomy.taxeditor.model.ImageResources; |
31 | 33 |
import eu.etaxonomy.taxeditor.preference.Resources; |
32 | 34 |
import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement; |
33 |
import eu.etaxonomy.taxeditor.ui.campanula.compatibility.IEntitySelectionElement; |
|
34 | 35 |
import eu.etaxonomy.taxeditor.ui.dialog.selection.SelectionDialogFactory; |
35 | 36 |
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement; |
36 | 37 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
37 | 38 |
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent; |
39 |
import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement; |
|
40 |
import eu.etaxonomy.taxeditor.ui.element.IEntityElement; |
|
41 |
import eu.etaxonomy.taxeditor.ui.element.ILabeledElement; |
|
42 |
import eu.etaxonomy.taxeditor.ui.element.ISelectableElement; |
|
38 | 43 |
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants; |
39 | 44 |
import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator; |
40 | 45 |
import eu.etaxonomy.taxeditor.ui.selection.EditFromSelectionWizard; |
46 |
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement; |
|
41 | 47 |
|
42 | 48 |
/** |
43 | 49 |
* @author pplitzner |
44 | 50 |
* @date 13.08.2013 |
45 | 51 |
* |
46 | 52 |
*/ |
47 |
public class EntitySelectionFieldController<T extends ICdmBase> extends AbstractCdmFormElement implements IEntitySelectionElement<T>{
|
|
53 |
public class EntitySelectionFieldController<T extends ICdmBase> extends AbstractCdmFormElement implements SelectionListener, IEnableableFormElement, ISelectableElement, IEntityElement<T>, ILabeledElement, IConversationEnabled {
|
|
48 | 54 |
|
49 | 55 |
/** |
50 | 56 |
* Bitmask for configuring functionality of selection element |
... | ... | |
172 | 178 |
button_edit = entitySelectionField.getButton_edit(); |
173 | 179 |
if (isEditable) { |
174 | 180 |
addControl(button_edit); |
175 |
button_edit.addSelectionListener(new EditListener(this)); |
|
181 |
//TODO: this worked with the extracted (but now reverted) interfaces done for campanula |
|
182 |
// button_edit.addSelectionListener(new EditListener(this)); |
|
176 | 183 |
} |
177 | 184 |
else{ |
178 | 185 |
button_edit.setVisible(false); |
... | ... | |
260 | 267 |
} |
261 | 268 |
} |
262 | 269 |
|
263 |
@Override |
|
264 | 270 |
public void updateFromWizard() { |
265 | 271 |
updateElement(); |
266 | 272 |
firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null)); |
... | ... | |
328 | 334 |
return selectionArbitrator; |
329 | 335 |
} |
330 | 336 |
|
331 |
@Override |
|
332 | 337 |
public Shell getShell() { |
333 | 338 |
return getLayoutComposite().getShell(); |
334 | 339 |
} |
... | ... | |
359 | 364 |
|
360 | 365 |
private class EditListener extends SelectionAdapter { |
361 | 366 |
|
362 |
private final IEntitySelectionElement<T> selectionElement;
|
|
367 |
private final EntitySelectionElement<T> selectionElement; |
|
363 | 368 |
|
364 |
public EditListener(IEntitySelectionElement<T> selectionElement) {
|
|
369 |
public EditListener(EntitySelectionElement<T> selectionElement) { |
|
365 | 370 |
this.selectionElement = selectionElement; |
366 | 371 |
} |
367 | 372 |
|
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EntitySelectionElement.java | ||
---|---|---|
8 | 8 |
import org.eclipse.swt.SWT; |
9 | 9 |
import org.eclipse.swt.events.SelectionAdapter; |
10 | 10 |
import org.eclipse.swt.events.SelectionEvent; |
11 |
import org.eclipse.swt.events.SelectionListener; |
|
11 | 12 |
import org.eclipse.swt.graphics.Color; |
12 | 13 |
import org.eclipse.swt.widgets.Button; |
13 | 14 |
import org.eclipse.swt.widgets.Composite; |
... | ... | |
16 | 17 |
import org.springframework.security.core.GrantedAuthority; |
17 | 18 |
|
18 | 19 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
20 |
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled; |
|
19 | 21 |
import eu.etaxonomy.cdm.common.CdmUtils; |
20 | 22 |
import eu.etaxonomy.cdm.model.common.Group; |
21 | 23 |
import eu.etaxonomy.cdm.model.common.ICdmBase; |
... | ... | |
25 | 27 |
import eu.etaxonomy.taxeditor.preference.Resources; |
26 | 28 |
import eu.etaxonomy.taxeditor.store.StoreUtil; |
27 | 29 |
import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement; |
28 |
import eu.etaxonomy.taxeditor.ui.campanula.compatibility.IEntitySelectionElement; |
|
29 | 30 |
import eu.etaxonomy.taxeditor.ui.dialog.selection.SelectionDialogFactory; |
30 | 31 |
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement; |
31 | 32 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
32 | 33 |
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent; |
34 |
import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement; |
|
35 |
import eu.etaxonomy.taxeditor.ui.element.IEntityElement; |
|
36 |
import eu.etaxonomy.taxeditor.ui.element.ILabeledElement; |
|
37 |
import eu.etaxonomy.taxeditor.ui.element.ISelectableElement; |
|
33 | 38 |
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants; |
34 | 39 |
import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator; |
35 | 40 |
|
... | ... | |
44 | 49 |
* @param <T> |
45 | 50 |
*/ |
46 | 51 |
public class EntitySelectionElement<T extends ICdmBase> extends |
47 |
AbstractCdmFormElement implements IEntitySelectionElement<T>{
|
|
52 |
AbstractCdmFormElement implements SelectionListener, IEnableableFormElement, ISelectableElement, IEntityElement<T>, ILabeledElement, IConversationEnabled {
|
|
48 | 53 |
|
49 | 54 |
/** |
50 | 55 |
* Bitmask for configuring functionality of selection element |
... | ... | |
266 | 271 |
} |
267 | 272 |
} |
268 | 273 |
|
269 |
@Override |
|
270 | 274 |
public void updateFromWizard() { |
271 | 275 |
updateElement(); |
272 | 276 |
firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null)); |
... | ... | |
339 | 343 |
* |
340 | 344 |
* @return a {@link org.eclipse.swt.widgets.Shell} object. |
341 | 345 |
*/ |
342 |
@Override |
|
343 | 346 |
public Shell getShell() { |
344 | 347 |
return getLayoutComposite().getShell(); |
345 | 348 |
} |
Also available in: Unified diff