Revision e61f3556
Added by Andreas Müller about 3 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/e4/handler/NewObjectHandlerE4.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.taxeditor.annotatedlineeditor.e4.handler; |
11 | 10 |
|
12 | 11 |
import javax.inject.Named; |
... | ... | |
32 | 31 |
import eu.etaxonomy.taxeditor.l10n.Messages; |
33 | 32 |
|
34 | 33 |
/** |
35 |
* |
|
36 | 34 |
* @author pplitzner |
37 | 35 |
* @date 12.09.2017 |
38 |
* |
|
39 | 36 |
*/ |
40 | 37 |
public class NewObjectHandlerE4 { |
41 | 38 |
|
... | ... | |
77 | 74 |
nonEmptyInputValidator); |
78 | 75 |
|
79 | 76 |
if (dialog.open() != Window.CANCEL) { |
80 |
IEntityCreator entityCreator = bulkEditor.getEditorInput().getEntityCreator(); |
|
77 |
IEntityCreator<?> entityCreator = bulkEditor.getEditorInput().getEntityCreator();
|
|
81 | 78 |
Object createdEntity = entityCreator.createEntity(key, dialog.getValue()); |
82 | 79 |
if (createdEntity == null){ |
83 | 80 |
return; |
... | ... | |
91 | 88 |
|
92 | 89 |
} |
93 | 90 |
IStructuredSelection selection = new StructuredSelection(createdEntity); |
94 |
|
|
95 | 91 |
bulkEditor.refresh(); |
96 |
|
|
97 |
|
|
98 | 92 |
bulkEditor.setFocus(); |
99 |
|
|
100 | 93 |
bulkEditor.setSelection(selection); |
101 |
|
|
102 |
|
|
103 | 94 |
} |
104 | 95 |
} |
105 | 96 |
} |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/e4/ReferencingObjectsViewE4.java | ||
---|---|---|
551 | 551 |
protected String getViewName() { |
552 | 552 |
return "Referencing Objects"; |
553 | 553 |
} |
554 |
|
|
555 |
} |
|
554 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/TermBasePropertyTester.java | ||
---|---|---|
13 | 13 |
|
14 | 14 |
import eu.etaxonomy.cdm.api.service.IVocabularyService; |
15 | 15 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
16 |
import eu.etaxonomy.cdm.model.term.DefinedTermBase; |
|
17 | 16 |
import eu.etaxonomy.cdm.model.common.Marker; |
18 | 17 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
18 |
import eu.etaxonomy.cdm.model.term.DefinedTermBase; |
|
19 | 19 |
import eu.etaxonomy.cdm.model.term.TermBase; |
20 | 20 |
import eu.etaxonomy.cdm.model.term.TermVocabulary; |
21 | 21 |
import eu.etaxonomy.cdm.persistence.dto.TermDto; |
... | ... | |
25 | 25 |
/** |
26 | 26 |
* @author l.morris |
27 | 27 |
* @date 9 Jan 2012 |
28 |
* |
|
29 | 28 |
*/ |
30 | 29 |
public class TermBasePropertyTester extends PropertyTester { |
31 | 30 |
|
32 | 31 |
private static final String IS_MODIFIABLE = "isModifiable"; |
33 | 32 |
|
34 |
|
|
35 |
/* (non-Javadoc) |
|
36 |
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object) |
|
37 |
*/ |
|
38 | 33 |
@Override |
39 | 34 |
public boolean test(Object receiver, String property, Object[] args, |
40 | 35 |
Object expectedValue) { |
... | ... | |
63 | 58 |
return true; |
64 | 59 |
} |
65 | 60 |
|
66 |
TermVocabulary vocabulary = null; |
|
61 |
TermVocabulary<?> vocabulary = null;
|
|
67 | 62 |
|
68 | 63 |
if(object instanceof DefinedTermBase){ |
69 |
vocabulary = ((DefinedTermBase) object).getVocabulary(); |
|
64 |
vocabulary = ((DefinedTermBase<?>) object).getVocabulary();
|
|
70 | 65 |
}else if(object instanceof TermVocabulary){ |
71 |
vocabulary = (TermVocabulary) object; |
|
66 |
vocabulary = (TermVocabulary<?>) object;
|
|
72 | 67 |
}else if(object instanceof TermDto){ |
73 | 68 |
vocabulary = CdmStore.getService(IVocabularyService.class).load(((TermDto) object).getVocabularyUuid()); |
74 | 69 |
}else if(object instanceof TermVocabularyDto){ |
... | ... | |
87 | 82 |
|
88 | 83 |
return true; |
89 | 84 |
} |
90 |
|
|
91 | 85 |
} |
Also available in: Unified diff
cleanup