Revision 884aefac
Added by Katja Luther about 4 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/OpenDerivativeEditorForDescriptionElement.java | ||
---|---|---|
4 | 4 |
import java.util.UUID; |
5 | 5 |
|
6 | 6 |
import org.eclipse.e4.ui.workbench.modeling.EPartService; |
7 |
import org.eclipse.jface.viewers.IStructuredSelection; |
|
7 | 8 |
import org.eclipse.swt.widgets.Shell; |
8 | 9 |
|
9 |
import eu.etaxonomy.cdm.api.service.IDescriptionService; |
|
10 |
import eu.etaxonomy.cdm.model.description.DescriptionElementBase; |
|
11 | 10 |
import eu.etaxonomy.cdm.model.description.IndividualsAssociation; |
12 | 11 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
13 | 12 |
import eu.etaxonomy.taxeditor.editor.AppModelId; |
... | ... | |
16 | 15 |
import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateViewEditorInput; |
17 | 16 |
import eu.etaxonomy.taxeditor.handler.defaultHandler.e4.DefaultOpenHandlerBaseE4; |
18 | 17 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
19 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
20 | 18 |
|
21 | 19 |
public class OpenDerivativeEditorForDescriptionElement extends DefaultOpenHandlerBaseE4<IndividualsAssociation> { |
22 | 20 |
|
23 |
@Override |
|
24 |
protected IndividualsAssociation getEntity(UUID uuid) { |
|
25 |
DescriptionElementBase descriptionElement = CdmStore.getService(IDescriptionService.class).loadDescriptionElement(uuid, null); |
|
26 |
if(descriptionElement!=null && descriptionElement.isInstanceOf(IndividualsAssociation.class)){ |
|
27 |
return (IndividualsAssociation) descriptionElement; |
|
28 |
} |
|
29 |
return null; |
|
30 |
} |
|
21 |
// @Override
|
|
22 |
// protected IndividualsAssociation getEntity(UUID uuid) {
|
|
23 |
// DescriptionElementBase descriptionElement = CdmStore.getService(IDescriptionService.class).loadDescriptionElement(uuid, null);
|
|
24 |
// if(descriptionElement!=null && descriptionElement.isInstanceOf(IndividualsAssociation.class)){
|
|
25 |
// return (IndividualsAssociation) descriptionElement;
|
|
26 |
// }
|
|
27 |
// return null;
|
|
28 |
// }
|
|
31 | 29 |
|
32 | 30 |
@Override |
33 | 31 |
protected void open(IndividualsAssociation entity, Shell shell, EPartService partService) { |
... | ... | |
46 | 44 |
* {@inheritDoc} |
47 | 45 |
*/ |
48 | 46 |
@Override |
49 |
protected boolean canExecute(IndividualsAssociation entity) {
|
|
47 |
protected boolean canExecute(IStructuredSelection entity) {
|
|
50 | 48 |
return true; |
51 | 49 |
} |
52 | 50 |
|
... | ... | |
54 | 52 |
protected String getPartId() { |
55 | 53 |
return AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_DERIVATEVIEW; |
56 | 54 |
} |
55 |
|
|
56 |
|
|
57 | 57 |
} |
Also available in: Unified diff
ref #8047: allow multiselect for open distribution editor