</menuContribution>\r
<menuContribution\r
locationURI="popup:#BulkEditorContext">\r
+ <command\r
+ commandId="eu.etaxonomy.taxeditor.navigation.command.update.editSelection"\r
+ label="Edit"\r
+ style="push">\r
+ <visibleWhen>\r
+ <reference\r
+ definitionId="isTaxonBulkEditorInput">\r
+ </reference>\r
+ </visibleWhen>\r
+ </command>\r
+ <separator\r
+ name="taxeditor-bulkeditor.separator1"\r
+ visible="true">\r
+ </separator>\r
<menu\r
label="%menu.label.1">\r
<dynamic\r
</visibleWhen>\r
</menu>\r
<separator\r
- name="taxeditor-bulkeditor.separator1"\r
- visible="true">\r
+ name="eu.etaxonomy.taxeditor.bulkeditor.separator1">\r
</separator>\r
<command\r
commandId="bulkeditor.commands.setmergetarget"\r
</test>\r
</with>\r
</definition>\r
+ <definition\r
+ id="isTaxonBulkEditorInput">\r
+ <with\r
+ variable="activeEditor">\r
+ <test\r
+ property="taxeditor-bulkeditor.propertyTester.isTaxonEditor">\r
+ </test>\r
+ </with>\r
+ </definition>\r
</extension>\r
<extension\r
point="org.eclipse.core.expressions.propertyTesters">\r
class="eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorPropertyTester"\r
id="taxeditor-bulkeditor.PropertyTester"\r
namespace="taxeditor-bulkeditor.propertyTester"\r
- properties="isMergingEnabled"\r
- type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">\r
- </propertyTester>\r
- <propertyTester\r
- class="eu.etaxonomy.taxeditor.bulkeditor.PropertyTester"\r
- id="eu.etaxonomy.taxeditor.bulkeditor.propertyTester"\r
- namespace="eu.etaxonomy.taxeditor.bulkeditor.propertyTester"\r
- properties="isDerivedUnitEditor"\r
+ properties="isMergingEnabled, isDerivedUnitEditor, isTaxonEditor, isGroupEditor"\r
type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">\r
</propertyTester>\r
</extension>\r
// $Id$
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
import org.apache.log4j.Logger;
import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorInput;
-import eu.etaxonomy.cdm.model.common.Group;
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
import eu.etaxonomy.taxeditor.bulkeditor.input.GroupEditorInput;
import eu.etaxonomy.taxeditor.bulkeditor.input.OccurrenceEditorInput;
-import eu.etaxonomy.taxeditor.ui.section.description.DerivedUnitElement;
+import eu.etaxonomy.taxeditor.bulkeditor.input.TaxonEditorInput;
/**
* <p>BulkEditorPropertyTester class.</p>
* @version 1.0
*/
public class BulkEditorPropertyTester extends PropertyTester {
- private static final Logger logger = Logger
+
+ @SuppressWarnings("unused")
+ private static final Logger logger = Logger
.getLogger(BulkEditorPropertyTester.class);
- private static final String GROUP = "isGroup";
- private static final String DERIVEDUNIT = "isDerivedUnit";
+ private static final String IS_MERGING_ENABLED = "isMergingEnabled";
+
+ private static final String IS_GROUP_EDITOR = "isGroupEditor";
+ public static final String IS_DERIVED_UNIT_EDITOR = "isDerivedUnitEditor";
+ public static final String IS_TAXON_EDITOR = "isTaxonEditor";
+
/* (non-Javadoc)
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
*/
/** {@inheritDoc} */
- public boolean test(Object receiver, String property, Object[] args,
+ @Override
+ public boolean test(Object receiver, String property, Object[] args,
Object expectedValue) {
BulkEditor bulkEditor = (BulkEditor) receiver;
-
- if ("isMergingEnabled".equals(property)) {
+
+ if (IS_MERGING_ENABLED.equals(property)) {
IEditorInput input = bulkEditor.getEditorInput();
if (input instanceof AbstractBulkEditorInput) {
- return ((AbstractBulkEditorInput) input).isMergingEnabled();
- }
+ return ((AbstractBulkEditorInput<?>) input).isMergingEnabled();
+ }
}
- if(GROUP.equals(property)){
- return isGroup(bulkEditor);
+ else if(IS_GROUP_EDITOR.equals(property)){
+ return bulkEditor.getEditorInput() instanceof GroupEditorInput;
}
-
- if (DERIVEDUNIT.equals(property)){
-
- return isDerivedUnit(bulkEditor);
+ else if (IS_DERIVED_UNIT_EDITOR.equals(property)){
+ return bulkEditor.getEditorInput() instanceof OccurrenceEditorInput;
}
+ else if(IS_TAXON_EDITOR.equals(property)){
+ return bulkEditor.getEditorInput() instanceof TaxonEditorInput;
+ }
// if (("isPublishFlagEditingEnabled").equals(property)) {
// IEditorInput input = bulkEditor.getEditorInput();
// if (input instanceof NameEditorInput) {
// }
return false;
}
-
- private boolean isDerivedUnit(BulkEditor bulkEditor) {
- IEditorInput input = bulkEditor.getEditorInput();
- return (input instanceof OccurrenceEditorInput) ? true : false;
- }
-
- private boolean isGroup(BulkEditor bulkEditor) {
- IEditorInput input = bulkEditor.getEditorInput();
- return (input instanceof GroupEditorInput) ? true : false;
- }
}
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.handlers.HandlerUtil;
ISelection selection = HandlerUtil.getCurrentSelection(event);
- if(selection instanceof StructuredSelection){
- final StructuredSelection structuredSelection = (StructuredSelection) selection;
+ if(selection instanceof IStructuredSelection){
+ final IStructuredSelection structuredSelection = (IStructuredSelection) selection;
if(structuredSelection.size() == 1 && structuredSelection.getFirstElement() instanceof Classification){
Classification classification = (Classification) structuredSelection.getFirstElement();