Revision 7cce7fa3
Added by Patrick Plitzner about 6 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionElementsHandler.java | ||
---|---|---|
179 | 179 |
MHandledMenuItem menuItem){ |
180 | 180 |
boolean canExecute = false; |
181 | 181 |
FactualDataPartE4 factualDataPart = (FactualDataPartE4) activePart.getObject(); |
182 |
ISelection selection = factualDataPart.getViewer().getSelection(); |
|
183 |
if(selection instanceof IStructuredSelection){ |
|
184 |
Object firstElement = ((IStructuredSelection) selection).getFirstElement(); |
|
185 |
canExecute = firstElement instanceof FeatureNodeContainer |
|
186 |
|| firstElement instanceof DescriptionElementBase; |
|
187 |
menuItem.setVisible(canExecute); |
|
182 |
|
|
183 |
Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(factualDataPart.getSelectionProvidingPart()); |
|
184 |
if(e4WrappedPart instanceof MultiPageTaxonEditor){ |
|
185 |
ISelection selection = factualDataPart.getViewer().getSelection(); |
|
186 |
if(selection instanceof IStructuredSelection){ |
|
187 |
Object firstElement = ((IStructuredSelection) selection).getFirstElement(); |
|
188 |
canExecute = firstElement instanceof FeatureNodeContainer |
|
189 |
|| firstElement instanceof DescriptionElementBase; |
|
190 |
menuItem.setVisible(canExecute); |
|
191 |
} |
|
188 | 192 |
} |
189 | 193 |
return canExecute; |
190 | 194 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionToOtherTaxonHandler.java | ||
---|---|---|
159 | 159 |
MHandledMenuItem menuItem){ |
160 | 160 |
boolean canExecute = false; |
161 | 161 |
FactualDataPartE4 factualDataPart = (FactualDataPartE4) activePart.getObject(); |
162 |
ISelection selection = factualDataPart.getViewer().getSelection(); |
|
163 |
if(selection instanceof IStructuredSelection){ |
|
164 |
Object firstElement = ((IStructuredSelection) selection).getFirstElement(); |
|
165 |
canExecute = firstElement instanceof FeatureNodeContainer |
|
166 |
|| firstElement instanceof DescriptionElementBase |
|
167 |
|| firstElement instanceof DescriptionBase; |
|
168 |
menuItem.setVisible(canExecute); |
|
162 |
|
|
163 |
Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(factualDataPart.getSelectionProvidingPart()); |
|
164 |
if(e4WrappedPart instanceof MultiPageTaxonEditor){ |
|
165 |
ISelection selection = factualDataPart.getViewer().getSelection(); |
|
166 |
if(selection instanceof IStructuredSelection){ |
|
167 |
Object firstElement = ((IStructuredSelection) selection).getFirstElement(); |
|
168 |
canExecute = firstElement instanceof FeatureNodeContainer |
|
169 |
|| firstElement instanceof DescriptionElementBase |
|
170 |
|| firstElement instanceof DescriptionBase; |
|
171 |
menuItem.setVisible(canExecute); |
|
172 |
} |
|
169 | 173 |
} |
170 | 174 |
return canExecute; |
171 | 175 |
} |
Also available in: Unified diff
ref #6907 Disable move description operations for specimen editor