Revision ce33189b
Added by Patrick Plitzner about 9 years ago
- added check for open derivate editor command
- set title of factual data view corresponding to the current selection
eu.etaxonomy.taxeditor.editor/plugin.xml | ||
---|---|---|
641 | 641 |
style="push"> |
642 | 642 |
<visibleWhen |
643 | 643 |
checkEnabled="true"> |
644 |
<with |
|
645 |
variable="selection"> |
|
646 |
<count |
|
647 |
value="+"> |
|
648 |
</count> |
|
649 |
</with> |
|
644 |
<and> |
|
645 |
<with |
|
646 |
variable="selection"> |
|
647 |
<count |
|
648 |
value="+"> |
|
649 |
</count> |
|
650 |
</with> |
|
651 |
<reference |
|
652 |
definitionId="isIndividualsAssociation"> |
|
653 |
</reference> |
|
654 |
</and> |
|
650 | 655 |
</visibleWhen> |
651 | 656 |
</command> |
652 | 657 |
<command |
... | ... | |
1577 | 1582 |
</test> |
1578 | 1583 |
</with> |
1579 | 1584 |
</definition> |
1585 |
<definition |
|
1586 |
id="isIndividualsAssociation"> |
|
1587 |
<with |
|
1588 |
variable="selection"> |
|
1589 |
<test |
|
1590 |
property="eu.etaxonomy.taxeditor.descriptions.propertyTester.isIndividualsAssociation"> |
|
1591 |
</test> |
|
1592 |
</with> |
|
1593 |
</definition> |
|
1580 | 1594 |
</extension> |
1581 | 1595 |
<extension |
1582 | 1596 |
point="org.eclipse.core.expressions.propertyTesters"> |
... | ... | |
1591 | 1605 |
class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DescriptionsMenuPropertyTester" |
1592 | 1606 |
id="eu.etaxonomy.taxeditor.descriptions.PropertyTester" |
1593 | 1607 |
namespace="eu.etaxonomy.taxeditor.descriptions.propertyTester" |
1594 |
properties="isMedia,isDescription,isDescriptionElement,isDeletable,isFeatureNodeContainer,isImageGallery,isTaxonEditor,isBulkEditor,isDerivateEditor" |
|
1608 |
properties="isMedia,isDescription,isDescriptionElement,isDeletable,isFeatureNodeContainer,isImageGallery,isTaxonEditor,isBulkEditor,isDerivateEditor, isIndividualsAssociation"
|
|
1595 | 1609 |
type="org.eclipse.jface.viewers.TreeSelection"> |
1596 | 1610 |
</propertyTester> |
1597 | 1611 |
<propertyTester |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewPart.java | ||
---|---|---|
215 | 215 |
@Override |
216 | 216 |
protected void selectionChanged_internal(IWorkbenchPart part, ISelection selection) { |
217 | 217 |
if(AbstractUtility.getActiveEditor() == null){ |
218 |
setPartName("Factual Data"); |
|
218 | 219 |
showEmptyPage(); |
219 | 220 |
return; |
220 | 221 |
} |
... | ... | |
243 | 244 |
&& ((IStructuredSelection) selection).getFirstElement() instanceof IDescribable<?> |
244 | 245 |
&& part instanceof IPartContentHasFactualData && !(((IStructuredSelection) selection).getFirstElement() instanceof SpecimenOrObservationBase && part instanceof BulkEditor)){ |
245 | 246 |
featureNodeContainerCache.clear(); |
247 |
setPartName("Factual Data: " + ((IStructuredSelection) selection).getFirstElement()); |
|
246 | 248 |
showViewer(part, (IStructuredSelection) selection); |
247 | 249 |
return; |
248 | 250 |
} |
249 | 251 |
else{ |
252 |
setPartName("Factual Data"); |
|
250 | 253 |
showEmptyPage(); |
251 | 254 |
} |
252 | 255 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DescriptionsMenuPropertyTester.java | ||
---|---|---|
8 | 8 |
|
9 | 9 |
import eu.etaxonomy.cdm.model.description.DescriptionBase; |
10 | 10 |
import eu.etaxonomy.cdm.model.description.DescriptionElementBase; |
11 |
import eu.etaxonomy.cdm.model.description.IndividualsAssociation; |
|
11 | 12 |
import eu.etaxonomy.cdm.model.media.Media; |
12 | 13 |
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor; |
13 | 14 |
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor; |
... | ... | |
27 | 28 |
private static final String MEDIA = "isMedia"; |
28 | 29 |
private static final String FEATURE_NODE_CONTAINER = "isFeatureNodeContainer"; |
29 | 30 |
private static final String DESCRIPTION = "isDescription"; |
31 |
private static final String INDIVIDUALS_ASSOCIATION = "isIndividualsAssociation"; |
|
30 | 32 |
private static final String DESCRIPTION_ELEMENT = "isDescriptionElement"; |
31 | 33 |
private static final String DELETABLE = "isDeletable"; |
32 | 34 |
private static final String IMAGE_GALLERY = "isImageGallery"; |
... | ... | |
68 | 70 |
else if(DESCRIPTION.equals(property)){ |
69 | 71 |
return isDescription(selectedElements); |
70 | 72 |
} |
73 |
else if(INDIVIDUALS_ASSOCIATION.equals(property)){ |
|
74 |
return isIndividualsAssociation(selectedElements); |
|
75 |
} |
|
71 | 76 |
else if(DESCRIPTION_ELEMENT.equals(property)){ |
72 | 77 |
return isDescriptionElement(selectedElements); |
73 | 78 |
} |
... | ... | |
84 | 89 |
|
85 | 90 |
private boolean isImageGallery(Object[] selectedElements) { |
86 | 91 |
for (Object object : selectedElements){ |
87 |
if(!(object instanceof DescriptionBase) || !((DescriptionBase) object).isImageGallery()){ |
|
92 |
if(!(object instanceof DescriptionBase) || !((DescriptionBase<?>) object).isImageGallery()){
|
|
88 | 93 |
return false; |
89 | 94 |
} |
90 | 95 |
} |
... | ... | |
136 | 141 |
return true; |
137 | 142 |
} |
138 | 143 |
|
144 |
private boolean isIndividualsAssociation(Object[] selectedElements) { |
|
145 |
for (Object object : selectedElements){ |
|
146 |
if(!(object instanceof IndividualsAssociation)){ |
|
147 |
return false; |
|
148 |
} |
|
149 |
} |
|
150 |
return true; |
|
151 |
} |
|
152 |
|
|
139 | 153 |
private boolean isMedia(Object[] selectedElements) { |
140 | 154 |
for (Object object : selectedElements){ |
141 | 155 |
if(!(object instanceof Media)){ |
Also available in: Unified diff