eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/UsesLabelProvider.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/UsesViewPart.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/handler/CreateUseHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/handler/DeleteUseHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/handler/DynamicFeatureMenu.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/operation/CreateTaxonUseOperation.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/operation/DeleteTaxonUseOperation.java -text
eu.etaxonomy.taxeditor.editor/.settings
eu.etaxonomy.taxeditor.editor/target
eu.etaxonomy.taxeditor.feature.platform/.settings
+eu.etaxonomy.taxeditor.feature.platform/bin
eu.etaxonomy.taxeditor.feature.platform/target
eu.etaxonomy.taxeditor.feature/.settings
eu.etaxonomy.taxeditor.feature/compile.eu.etaxonomy.taxeditor.product.feature.xml
--- /dev/null
+package eu.etaxonomy.taxeditor.editor.view.uses.handler;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+import org.eclipse.core.commands.AbstractHandler;\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+import org.eclipse.core.commands.common.NotDefinedException;\r
+import org.eclipse.core.commands.operations.IUndoContext;\r
+import org.eclipse.jface.viewers.IStructuredSelection;\r
+import org.eclipse.jface.viewers.TreePath;\r
+import org.eclipse.jface.viewers.TreeSelection;\r
+import org.eclipse.ui.IWorkbenchPart;\r
+import org.eclipse.ui.handlers.HandlerUtil;\r
+\r
+import eu.etaxonomy.cdm.model.description.DescriptionElementBase;\r
+import eu.etaxonomy.cdm.model.description.TaxonDescription;\r
+import eu.etaxonomy.cdm.model.media.Media;\r
+import eu.etaxonomy.taxeditor.editor.EditorUtil;\r
+import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.DeleteDescriptionElementOperation;\r
+import eu.etaxonomy.taxeditor.editor.view.media.operation.DeleteMediaOperation;\r
+import eu.etaxonomy.taxeditor.editor.view.uses.operation.DeleteTaxonUseOperation;\r
+import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;\r
+import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
+\r
+public class DeleteUseHandler extends AbstractHandler {\r
+\r
+ /*\r
+ * (non-Javadoc)\r
+ * \r
+ * @see\r
+ * org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.\r
+ * ExecutionEvent)\r
+ */\r
+ /** {@inheritDoc} */\r
+ public Object execute(ExecutionEvent event) throws ExecutionException {\r
+ IStructuredSelection selection = (IStructuredSelection) HandlerUtil\r
+ .getActiveSite(event).getSelectionProvider().getSelection();\r
+\r
+ IWorkbenchPart part = HandlerUtil.getActivePart(event);\r
+ IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part\r
+ : null;\r
+\r
+ try {\r
+ String label = event.getCommand().getName();\r
+\r
+ IUndoContext undoContext = EditorUtil.getUndoContext();\r
+\r
+ List<AbstractPostOperation> operations = new ArrayList<AbstractPostOperation>();\r
+\r
+ for (Object object : selection.toArray()) {\r
+\r
+ AbstractPostOperation operation = null;\r
+\r
+ // TaxonDescription\r
+ if (object instanceof TaxonDescription) {\r
+ operations.add(new DeleteTaxonUseOperation(label,\r
+ undoContext, (TaxonDescription) object,\r
+ postOperationEnabled));\r
+ }\r
+ // DescriptionElementBase\r
+ else if (object instanceof DescriptionElementBase) {\r
+ operations.add(new DeleteDescriptionElementOperation(label,\r
+ undoContext, (DescriptionElementBase) object,\r
+ postOperationEnabled));\r
+ } else if (object instanceof FeatureNodeContainer) {\r
+ List<DescriptionElementBase> descriptions = ((FeatureNodeContainer) object)\r
+ .getDescriptionElementsForEntireBranch();\r
+\r
+ for (DescriptionElementBase description : descriptions) {\r
+ operations.add(new DeleteDescriptionElementOperation(\r
+ label, undoContext, description,\r
+ postOperationEnabled));\r
+ }\r
+ }\r
+ // Media\r
+ else if (object instanceof Media) {\r
+ TreeSelection treeSelection = (TreeSelection) selection;\r
+\r
+ TreePath[] path = treeSelection.getPathsFor(object);\r
+\r
+ TaxonDescription imageGallery = (TaxonDescription) path[0]\r
+ .getFirstSegment();\r
+\r
+ operations\r
+ .add(new DeleteMediaOperation(label, undoContext,\r
+ imageGallery, (Media) object,\r
+ postOperationEnabled));\r
+ } else {\r
+ EditorUtil.error(getClass(),\r
+ "Selection is not valid for this delete handler",\r
+ null);\r
+ }\r
+ }\r
+\r
+ // execute all cumulated operations\r
+ for (AbstractPostOperation operation : operations) {\r
+ EditorUtil.executeOperation(operation);\r
+ }\r
+\r
+ } catch (NotDefinedException e) {\r
+ EditorUtil.warn(getClass(), "Command name not set.");\r
+ }\r
+\r
+ return null;\r
+ }\r
+}\r
<projectDescription>
<name>eu.etaxonomy.taxeditor.feature.platform</name>
- <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
- <projects/>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
</projectDescription>
\ No newline at end of file
fragment="true"
unpack="false"/>
+ <plugin
+ id="org.hamcrest"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.hamcrest.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.apache.lucene"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.apache.lucene.analysis"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.help.base"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.help.webapp"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.apache.jasper"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.jsp.jasper.registry"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.http.registry"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.jdt.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
</feature>
<projectDescription>
<name>eu.etaxonomy.taxeditor.feature</name>
- <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+ <comment></comment>
<projects>
<project>eu.etaxonomy.taxeditor.application</project>
<project>eu.etaxonomy.taxeditor.bulkeditor</project>
<project>eu.etaxonomy.taxeditor.printpublisher</project>
<project>eu.etaxonomy.taxeditor.store</project>
</projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
</projectDescription>
\ No newline at end of file
org.eclipse.core.runtime,
org.eclipse.help.ui,
org.eclipse.help.webapp,
- org.hamcrest;bundle-version="1.1.0"
+ org.hamcrest
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
- <classpathentry kind="src" path="src/test/java"/>\r
- <classpathentry kind="src" path="src/main/resources"/>\r
- <classpathentry kind="output" path="target"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src/test/java"/>
+ <classpathentry kind="src" path="src/main/resources"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
</goals>
</execution>
</executions>
+ <configuration>
+ <products>
+ <product>
+ <id>eu.etaxonomy.taxeditor.product</id>
+ <rootFolder>EDIT Taxonomic Editor</rootFolder>
+ </product>
+ </products>
+ </configuration>
</plugin>
</plugins>
</build>
<repository>
<id>eclipse-indigo</id>
<layout>p2</layout>
+ <url>http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site/</url>
+ </repository>
+ <repository>
+ <id>eclipse-swtbot</id>
+ <layout>p2</layout>
<url>http://download.eclipse.org/releases/indigo</url>
</repository>
</repositories>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
- <!--target>
- <artifact>
- <groupId>eu.etaxonomy</groupId>
- <artifactId>eu.etaxonomy.taxeditor</artifactId>
- <version>${taxeditor.version}</version>
- <classifier>rcp</classifier>
- </artifact>
- </target-->
- <!--ignoreTychoRepositories>true</ignoreTychoRepositories-->
<environments>
<environment>
<os>macosx</os>
</configuration>
</plugin>
</plugins>
- <!--pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.3.1</version>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>wagon-maven-plugin</artifactId>
- <version>1.0-beta-3</version>
- </plugin-->
- <!--plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-packaging-plugin</artifactId>
- <version>${tycho.version}</version-->
- <!--executions>
- <execution>
- <id>timestamp</id>
- <phase>validate</phase>
- <goals>
- <goal>timestamp</goal>
- </goals>
- </execution>
- </executions-->
- <!-- for some reason configuration won't work here, have to define
- in each module -->
- <!--configuration>
- <archive>
- <addMavenDescriptor>false</addMavenDescriptor>
- </archive>
- <environments>
- <environment>
- <os>macosx</os>
- <ws>cocoa</ws>
- <arch>x86</arch>
- </environment>
- </environments>
- </configuration>
- </plugin-->
- <!--/plugins>
- </pluginManagement-->
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<site>
<id>wp5.e-taxonomy.eu</id>
<name>EDIT Taxonomic Editor</name>
- <url>scpexe://160.45.63.151/var/www/wp5.e-taxonomy.eu/taxeditor/</url>
+ <url>scpexe://wp5.e-taxonomy.eu/var/www/wp5.e-taxonomy.eu/taxeditor/</url>
</site>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>wp5.e-taxonomy.eu</id>
<name>Edit Maven Repository</name>
- <url>scpexe://160.45.63.151/var/www/wp5.e-taxonomy.eu/mavenrepo/</url>
+ <url>scpexe://wp5.e-taxonomy.eu/var/www/wp5.e-taxonomy.eu/mavenrepo/</url>
</repository>
</distributionManagement>
</project>