Revision bd122e26
Added by Katja Luther over 1 year ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/NameEditorMenuPropertyTester.java | ||
---|---|---|
18 | 18 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
19 | 19 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
20 | 20 |
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache; |
21 |
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditor;
|
|
21 |
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor; |
|
22 | 22 |
import eu.etaxonomy.taxeditor.event.EventUtility; |
23 | 23 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
24 | 24 |
|
... | ... | |
168 | 168 |
* @return |
169 | 169 |
*/ |
170 | 170 |
public static boolean hasEmptyNames(Object receiver) { |
171 |
TaxonNameEditor editor = (TaxonNameEditor) EventUtility.getTaxonEditor();
|
|
171 |
TaxonEditor editor = (TaxonEditor) EventUtility.getTaxonEditor();
|
|
172 | 172 |
return editor == null ? false : editor.checkForEmptyNames(); |
173 | 173 |
} |
174 | 174 |
|
175 | 175 |
public static boolean isRelatedConcept(Object selectedElement) { |
176 |
if(selectedElement instanceof Taxon && ((Taxon) selectedElement).isRelatedConcept() && !((TaxonNameEditor) EventUtility.getTaxonEditor()).getTaxon().equals(selectedElement)){
|
|
176 |
if(selectedElement instanceof Taxon && ((Taxon) selectedElement).isRelatedConcept() && !((TaxonEditor) EventUtility.getTaxonEditor()).getTaxon().equals(selectedElement)){ |
|
177 | 177 |
return true; |
178 | 178 |
} |
179 | 179 |
return false; |
... | ... | |
184 | 184 |
} |
185 | 185 |
|
186 | 186 |
public static boolean isMisapplication(Object selectedElement) { |
187 |
if(selectedElement instanceof Taxon && ((Taxon) selectedElement).isMisapplication() && !((TaxonNameEditor) EventUtility.getTaxonEditor()).getTaxon().equals(selectedElement)){
|
|
187 |
if(selectedElement instanceof Taxon && ((Taxon) selectedElement).isMisapplication() && !((TaxonEditor) EventUtility.getTaxonEditor()).getTaxon().equals(selectedElement)){ |
|
188 | 188 |
return true; |
189 | 189 |
} |
190 | 190 |
return false; |
191 | 191 |
} |
192 | 192 |
|
193 | 193 |
public static boolean isProparteSynonym(Object selectedElement) { |
194 |
if(selectedElement instanceof Taxon && ((Taxon) selectedElement).isProparteSynonym() && !((TaxonNameEditor) EventUtility.getTaxonEditor()).getTaxon().equals(selectedElement)){
|
|
194 |
if(selectedElement instanceof Taxon && ((Taxon) selectedElement).isProparteSynonym() && !((TaxonEditor) EventUtility.getTaxonEditor()).getTaxon().equals(selectedElement)){ |
|
195 | 195 |
return true; |
196 | 196 |
} |
197 | 197 |
return false; |
... | ... | |
200 | 200 |
if (selectedElement instanceof Synonym){ |
201 | 201 |
return true; |
202 | 202 |
} |
203 |
if(((Taxon) selectedElement).isProparteSynonym() && !((TaxonNameEditor) EventUtility.getTaxonEditor()).getTaxon().equals(selectedElement)){
|
|
203 |
if(((Taxon) selectedElement).isProparteSynonym() && !((TaxonEditor) EventUtility.getTaxonEditor()).getTaxon().equals(selectedElement)){ |
|
204 | 204 |
return false; |
205 | 205 |
} |
206 | 206 |
return true; |
... | ... | |
214 | 214 |
} |
215 | 215 |
|
216 | 216 |
public static boolean isAccepted(Object selectedElement) { |
217 |
TaxonNameEditor editor = (TaxonNameEditor) EventUtility.getTaxonEditor();
|
|
217 |
TaxonEditor editor = (TaxonEditor) EventUtility.getTaxonEditor();
|
|
218 | 218 |
Taxon accepted = editor.getTaxon(); |
219 | 219 |
return (selectedElement instanceof Taxon && accepted.equals(selectedElement)) ? true : false; |
220 | 220 |
} |
Also available in: Unified diff
rename TaxonNameEditor to TaxonEditor and NameViewerE4 to NameViewer