cdmlib-plugin/src/main/assembly/assembly.xml -text
cdmlib-plugin/src/test/java/eu/etaxonomy/cdm/aspectj/PropertyChangeTest.java -text
/pom.xml -text
+src/changes/changes.xml -text
src/site/apt/download.apt -text
src/site/apt/getting-started.apt -text
src/site/apt/index.apt -text
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry exported="true" kind="lib" path="lib/google-api-translate-java-0.92.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/dozer-5.3.0.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.aop-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.aop-3.0.4.RELEASE-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.asm-3.0.4.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.aspects-3.0.4.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.beans-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.beans-3.0.4.RELEASE-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.context-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.context-3.0.4.RELEASE-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.context.support-3.0.4.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.core-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.core-3.0.4.RELEASE-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.expression-3.0.4.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.jdbc-3.0.4.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.orm-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.orm-3.0.4.RELEASE-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.oxm-3.0.4.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.transaction-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.transaction-3.0.4.RELEASE-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.web-3.0.4.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.web.servlet-3.0.4.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/activation-1.1.jar"/>
+ <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" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry exported="true" kind="lib" path="lib/activation-1.1.jar" sourcepath="lib/activation-1.1src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/antlr-2.7.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/aopalliance-1.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/asm-attrs.jar"/>
<classpathentry exported="true" kind="lib" path="lib/aspectjweaver-1.6.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/avalon-framework-4.2.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/batik-all-1.7.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/c3p0-0.9.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/c3p0-0.9.1.jar" sourcepath="lib/c3p0-0.9.1src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-2.5.jar" sourcepath="lib/cdmlib-commons-2.5src.zip"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-2.5.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-2.5.jar" sourcepath="lib/cdmlib-ext-2.5src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/cdmlib-io-2.5.jar" sourcepath="lib/cdmlib-io-2.5src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/cdmlib-model-2.5.jar" sourcepath="lib/cdmlib-model-2.5src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-2.5.jar" sourcepath="lib/cdmlib-persistence-2.5src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/cdmlib-print-2.5.jar" sourcepath="lib/cdmlib-print-2.5src.zip"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-2.5.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-2.5.jar" sourcepath="lib/cdmlib-remote-2.5src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/cdmlib-services-2.5.jar" sourcepath="lib/cdmlib-services-2.5src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/cglib-2.1.3.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/commons-beanutils-1.7.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-beanutils-1.7.0.jar" sourcepath="lib/commons-beanutils-1.7.0src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/commons-collections-3.2.jar" sourcepath="lib/commons-collections-3.2src.zip"/>
- <classpathentry exported="true" kind="lib" path="lib/commons-dbcp-1.2.2.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/commons-io-1.3.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/commons-io-1.4.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-dbcp-1.2.2.jar" sourcepath="lib/commons-dbcp-1.2.2src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-io-1.3.1.jar" sourcepath="/Users/n.hoffmann/.m2/repository/commons-io/commons-io/1.3.1/commons-io-1.3.1-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-io-1.4.jar" sourcepath="lib/commons-io-1.4src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/commons-lang-2.4.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-logging-1.0.4.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/commons-pool-1.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-pool-1.3.jar" sourcepath="lib/commons-pool-1.3src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/dom4j-1.6.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/ehcache-1.2.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/ehcache-1.2.3.jar" sourcepath="lib/ehcache-1.2.3src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/ejb3-persistence.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/ezmorph-1.0.4.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/ezmorph-1.0.4.jar" sourcepath="lib/ezmorph-1.0.4src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/fop.jar"/>
<classpathentry exported="true" kind="lib" path="lib/h2-1.1.115.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate-annotations-3.4.0-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate-commons-annotations-3.4.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate-annotations-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-annotations-3.4.0-SNAPSHOTsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate-commons-annotations-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-commons-annotations-3.4.0-SNAPSHOTsrc.zip"/>
<classpathentry exported="true" kind="lib" path="lib/hibernate-core-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-core-3.4.0-SNAPSHOTsrc.zip"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate-envers-3.4.0-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate-search-3.1.0.GA.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate-envers-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-envers-3.4.0-SNAPSHOTsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate-search-3.1.0.GA.jar" sourcepath="lib/hibernate-search-3.1.0.GAsrc.zip"/>
<classpathentry exported="true" kind="lib" path="lib/hibernate-tools-3.2.0.ga.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate-validator-4.0.0.CR1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate-validator-4.0.0.CR1.jar" sourcepath="lib/hibernate-validator-4.0.0.CR1src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/hsqldb.jar"/>
<classpathentry exported="true" kind="lib" path="lib/httpclient-4.0.1.jar" sourcepath="lib/httpclient-4.0.1src.zip"/>
- <classpathentry exported="true" kind="lib" path="lib/httpcore-4.0.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/httpcore-4.0.1.jar" sourcepath="lib/httpcore-4.0.1src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/javassist.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jaxb-api-2.1.6.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/jaxb-impl-2.1.6.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jaxb-impl-2.1.6.jar" sourcepath="lib/jaxb-impl-2.1.6src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/jaxen-1.1.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jdbc-1.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jdbc2_0-stdext.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jdom.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/joda-time-1.5.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/joda-time-1.5.jar" sourcepath="lib/joda-time-1.5src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/joda-time-hibernate-1.0.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/json-lib-2.2.3-jdk15.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/jsr250-api-1.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/json-lib-2.2.3-jdk15.jar" sourcepath="lib/json-lib-2.2.3-jdk15src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/jsr250-api-1.0.jar" sourcepath="lib/jsr250-api-1.0src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/jta.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jtds-1.2.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/junit-4.4.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/log4j-1.2.14.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/log4j-1.2.14.jar" sourcepath="lib/log4j-1.2.14src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/lsid-client-1.1.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/lsid-server-1.1.2.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/lucene-core-2.4.0.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/lucene-spellchecker-2.4.0.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/mail-1.4.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/lucene-core-2.4.0.jar" sourcepath="lib/lucene-core-2.4.0src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/lucene-spellchecker-2.4.0.jar" sourcepath="lib/lucene-spellchecker-2.4.0src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/mail-1.4.jar" sourcepath="lib/mail-1.4src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/msbase-2000.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/mssqlserver-2000.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/msutil-2000.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/sanselan-0.97-incubator.jar"/>
<classpathentry exported="true" kind="lib" path="lib/saxon9he.jar"/>
<classpathentry exported="true" kind="lib" path="lib/serializer-2.7.0.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/servlet-api-2.5.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.5.2.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/slf4j-log4j12-1.5.2.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/spring-modules-cache-0.7.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/spring-modules-lucene-0.8a.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/spring-security-core-3.0.0.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/wsdl4j-1.6.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/servlet-api-2.5.jar" sourcepath="lib/servlet-api-2.5src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.5.2.jar" sourcepath="lib/slf4j-api-1.5.2src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/slf4j-log4j12-1.5.2.jar" sourcepath="lib/slf4j-log4j12-1.5.2src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/spring-modules-cache-0.7.jar" sourcepath="lib/spring-modules-cache-0.7src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/spring-modules-lucene-0.8a.jar" sourcepath="lib/spring-modules-lucene-0.8asrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/spring-security-core-3.0.0.RELEASE.jar" sourcepath="lib/spring-security-core-3.0.0.RELEASEsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/wsdl4j-1.6.1.jar" sourcepath="lib/wsdl4j-1.6.1src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/xalan-2.7.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xercesImpl-2.7.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xercesImpl.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xml-apis-1.3.04.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xml-apis-ext-1.3.04.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xml-apis.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/xml-resolver-1.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/xml-resolver-1.2.jar" sourcepath="lib/xml-resolver-1.2src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/xmlgraphics-commons-1.3.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xom-1.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xsltc.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/xstream-1.3.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/xstream-1.3.1.jar" sourcepath="lib/xstream-1.3.1src.zip"/>
<classpathentry exported="true" kind="lib" path="lib/yjp-controller-api-redist-8.0.1.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry combineaccessrules="false" kind="src" path="/cdmlib-commons"/>
- <classpathentry combineaccessrules="false" kind="src" path="/cdmlib-ext"/>
- <classpathentry combineaccessrules="false" kind="src" path="/cdmlib-io"/>
- <classpathentry combineaccessrules="false" kind="src" path="/cdmlib-model"/>
- <classpathentry combineaccessrules="false" kind="src" path="/cdmlib-persistence"/>
- <classpathentry combineaccessrules="false" kind="src" path="/cdmlib-print"/>
- <classpathentry combineaccessrules="false" kind="src" path="/cdmlib-remote"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.aop-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.aop-3.0.4.RELEASE-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.asm-3.0.4.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.aspects-3.0.4.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.beans-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.beans-3.0.4.RELEASE-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.context-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.context-3.0.4.RELEASE-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.context.support-3.0.4.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.core-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.core-3.0.4.RELEASE-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.expression-3.0.4.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.jdbc-3.0.4.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.orm-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.orm-3.0.4.RELEASE-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.oxm-3.0.4.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.transaction-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.transaction-3.0.4.RELEASE-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.web-3.0.4.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.web.servlet-3.0.4.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/dozer-5.3.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/google-api-translate-java-0.92.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<inceptionYear>2007</inceptionYear>
<packaging>pom</packaging>
<properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <cdmlib.version>2.5</cdmlib.version>
</properties>
<modules>
<module>taxeditor-store</module>
<url>http://dev.e-taxonomy.eu/trac/</url>
</issueManagement>
<ciManagement>
- <system>Hudson</system>
- <url>http://160.45.63.201/hudson</url>
+ <system>Hudson</system>
+ <url>http://160.45.63.201/hudson</url>
</ciManagement>
<!-- **** REPOSITORIES **** -->
<repositories>
- <!-- sun repository -->
- <repository>
- <id>java.net</id>
- <url>http://download.java.net/maven/1/</url>
- </repository>
<!-- the cdm internal repository -->
<repository>
<id>EditRepository</id>
<url>http://wp5.e-taxonomy.eu/cdmlib/mavenrepo/</url>
</repository>
- <!-- apache incubating repository -->
- <repository>
- <id>ApacheIncubating</id>
- <url>http://people.apache.org/repo/m2-incubating-repository/</url>
- </repository>
- <!-- eclipse repository -->
- <repository>
- <id>EclipseRepository</id>
- <url>http://repo1.maven.org/eclipse/</url>
- </repository>
- <!-- Neccessary for hibernate-envers -->
- <repository>
- <releases>
- <enabled>true</enabled>
- <updatePolicy>always</updatePolicy>
- <checksumPolicy>warn</checksumPolicy>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- <checksumPolicy>fail</checksumPolicy>
- </snapshots>
- <id>jboss-repository</id>
- <name>JBoss Repository</name>
- <url>http://repository.jboss.com/maven2</url>
- </repository>
</repositories>
<build>
<plugins>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.2</version>
</plugin>
- <plugin>
- <!-- if you use @todo tags to remind you of things to be done (which is a good coding practice), the taglist report will generate a list of all the items marked @todo or TODO -->
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>taglist-maven-plugin</artifactId>
- <version>2.4</version>
- </plugin>
- <plugin>
- <!-- Test coverage can be a useful indication of the quality of your unit tests. It basically tells you how much of your code is actually run by your unit tests, which, in turn, can give you a good idea of the tests' quality -->
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>cobertura-maven-plugin</artifactId>
- <version>2.4</version>
- <!--
- <executions>
- <execution>
- <id>clean</id>
- <phase>clean</phase>
- <goals>
- <goal>clean</goal>
- </goals>
- </execution>
- </executions>
- -->
- </plugin>
- <!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-project-info-reports-plugin</artifactId>
+ <artifactId>maven-changes-plugin</artifactId>
+ <version>2.3</version>
+ <configuration>
+ <issueLinkTemplatePerSystem>
+ <default>%URL%/ticket/%ISSUE%</default>
+ </issueLinkTemplatePerSystem>
+ </configuration>
<reportSets>
<reportSet>
<reports>
- <report>dependencies</report>
- <report>project-team</report>
- <report>mailing-list</report>
- <report>cim</report>
- <report>issue-tracking</report>
- <report>license</report>
- <report>scm</report>
+ <report>changes-report</report>
</reports>
</reportSet>
</reportSets>
- </plugin> -->
- <!-- The changes-maven-plugin plug-in uses a special XML file (src/changes/changes.xml) to track releases and changes in each release -->
- <!--
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>changes-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
</plugin>
- -->
- <!-- The changelog plug-in generates a nice report describing which files have been changed and by whom -->
- <!--
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>changelog-maven-plugin</artifactId>
- </plugin>
- -->
</plugins>
</reporting>
<!-- DISTRIBUTION MANAGEMENT -->
</dependencies>
<dependencyManagement>
<dependencies>
+ <!-- ******* TAXEDITOR ******* -->
<dependency>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-store</artifactId>
<artifactId>taxeditor-application</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>eu.etaxonomy</groupId>
+ <artifactId>taxeditor-printpublisher</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <!-- ******* CDMLIB ******* -->
+ <dependency>
+ <groupId>eu.etaxonomy</groupId>
+ <artifactId>cdmlib-model</artifactId>
+ <version>${cdmlib.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>eu.etaxonomy</groupId>
+ <artifactId>cdmlib-commons</artifactId>
+ <version>${cdmlib.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>eu.etaxonomy</groupId>
+ <artifactId>cdmlib-services</artifactId>
+ <version>${cdmlib.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>eu.etaxonomy</groupId>
+ <artifactId>cdmlib-io</artifactId>
+ <version>${cdmlib.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>eu.etaxonomy</groupId>
+ <artifactId>cdmlib-ext</artifactId>
+ <version>${cdmlib.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>eu.etaxonomy</groupId>
+ <artifactId>cdmlib-persistence</artifactId>
+ <version>${cdmlib.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>eu.etaxonomy</groupId>
+ <artifactId>cdmlib-remote</artifactId>
+ <version>${cdmlib.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>eu.etaxonomy</groupId>
+ <artifactId>cdmlib-print</artifactId>
+ <version>${cdmlib.version}</version>
+ </dependency>
+ <!-- ******* ECLIPSE ******* -->
+ <dependency>
+ <groupId>org.eclipse</groupId>
+ <artifactId>help</artifactId>
+ <version>3.5.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse</groupId>
+ <artifactId>ecf</artifactId>
+ <version>3.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse</groupId>
+ <artifactId>text</artifactId>
+ <version>3.5.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.core</groupId>
+ <artifactId>commands</artifactId>
+ <version>3.6.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.core</groupId>
+ <artifactId>filebuffers</artifactId>
+ <version>3.5.100</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.core</groupId>
+ <artifactId>runtime</artifactId>
+ <version>3.6.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.core</groupId>
+ <artifactId>expressions</artifactId>
+ <version>3.4.200</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.core</groupId>
+ <artifactId>filesystem</artifactId>
+ <version>1.3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.core</groupId>
+ <artifactId>jobs</artifactId>
+ <version>3.5.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.core</groupId>
+ <artifactId>contenttype</artifactId>
+ <version>3.4.100</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.core</groupId>
+ <artifactId>databinding</artifactId>
+ <version>1.3.100</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.core</groupId>
+ <artifactId>resources</artifactId>
+ <version>3.6.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>common</artifactId>
+ <version>3.6.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>preferences</artifactId>
+ <version>3.3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>app</artifactId>
+ <version>1.3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>registry</artifactId>
+ <version>3.5.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.equinox.p2</groupId>
+ <artifactId>core</artifactId>
+ <version>2.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.equinox.p2</groupId>
+ <artifactId>operations</artifactId>
+ <version>2.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.ui</groupId>
+ <artifactId>workbench</artifactId>
+ <version>3.6.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse</groupId>
+ <artifactId>ui</artifactId>
+ <version>3.6.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.ui</groupId>
+ <artifactId>editors</artifactId>
+ <version>3.6.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.ui</groupId>
+ <artifactId>navigator</artifactId>
+ <version>3.5.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.ui</groupId>
+ <artifactId>forms</artifactId>
+ <version>3.5.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.ui</groupId>
+ <artifactId>ide</artifactId>
+ <version>3.6.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.ui.workbench</groupId>
+ <artifactId>texteditor</artifactId>
+ <version>3.6.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse</groupId>
+ <artifactId>jface</artifactId>
+ <version>3.6.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jface</groupId>
+ <artifactId>databinding</artifactId>
+ <version>1.4.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jface</groupId>
+ <artifactId>text</artifactId>
+ <version>3.6.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.equinox.p2.metadata</groupId>
+ <artifactId>repository</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.ecf</groupId>
+ <artifactId>filetransfer</artifactId>
+ <version>4.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.ecf</groupId>
+ <artifactId>identity</artifactId>
+ <version>3.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.ecf.provider</groupId>
+ <artifactId>filetransfer</artifactId>
+ <version>3.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse</groupId>
+ <artifactId>swt</artifactId>
+ <version>3.6.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse</groupId>
+ <artifactId>osgi</artifactId>
+ <version>3.6.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.swt.cocoa</groupId>
+ <artifactId>macosx</artifactId>
+ <version>3.6.0</version>
+ </dependency>
<!-- ******* VARIOUS ******* -->
+ <dependency>
+ <groupId>com.google.api</groupId>
+ <artifactId>translate</artifactId>
+ <version>0.92</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.3.2</version>
+ </dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
</dependency>
- <!-- hibernate 3.4 uses slf4j -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.5.2</version>
- </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
--- /dev/null
+<document xmlns="http://maven.apache.org/changes/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 http://maven.apache.org/xsd/changes-1.0.0.xsd">
+ <properties>
+ <title>Taxonomic Editor Releases</title>
+ <author email="n.hoffmann@bgbm.org">Niels Hoffmann</author>
+ </properties>
+ <body>
+
+ <release version="3.0.0.beta" date="2010-09-07" description="Version 3.0 pre-release">
+ <action dev="n.hoffmann" type="fix">
+ Test
+ </action>
+ </release>
+
+ </body>
+</document>
\ No newline at end of file
+Setting up a Taxonomic Editor development environment
+
+ This document describes all steps necessarry to create a development environment to develop the EDIT Taxonomic Editor. If you are looking for
+ instructions on how to install the EDIT Taxonomic Editor please consult the {{{./manual.html} manual}}.
+
+ <Table of Contents>
+
+%{toc|section=0|fromDepth=2|toDepth=3}
+
+* Requirements
+
+ * CDM Library development environment set up on your machine (please follow the instructions on {{{http://wp5.e-taxonomy.eu/cdmlib/getting-started.html#Developing_the_CDM_Library}how to install a CDM Library development environment}})
+
+ * Eclipse PDE Version >= 3.6
+
+
+* Checking out the sources
+
+ Use subversion to check out the sources from the EDIT repository to a location on your development machine.
+
+---
+$ svn co http://dev.e-taxonomy.eu/svn/trunk/taxeditor
+---
+
+ This will leave you with a directory <<<taxeditor/>>> containing everything that is needed. We will have a look at the contents later on.
+
+* Setting up eclipse
+
+ The Taxonomic Editor uses maven for convenient configuration and automation of common tasks, such as setting up eclipse.
+
+---
+$ cd taxeditor/
+$ mvn eclipse:eclipse
+---
+
+ This will take some time, as maven will download the required dependencies and configure the projects. After maven has finished follow these steps:
+
+ * Start up eclipse (make sure you have the required version installed) and open a workspace.
+
+ * Open up the Import Wizard via <File -\> Import...> from the menu
+
+ * Choose <General -\> Existing projects into Workspace > and click next.
+
+ * Check <Select Root Directory> and browse to the <<<taxeditor/>>> directory. After confirming the directory selection dialog, the <Projects> list should contain a number of projects.
+
+ * Click <Select All> and finish the wizard.
+
+ The package exporer should show a bunch of projects. Although it will also show a bunch of errors, so please read on.
+
+
+* Initializing the cdmlib plugin
+
+ The <cdmlib-plugin> project contains all dependencies needed for the CDM Library to work except the <<<cdmlib-*>>> artifacts itself. Therefore the
+ <<<cdmlib-plugin>>> project will show an error. In order to include these artifacts the project contains a shell (and bash) script to copy these from your local maven repository. Please make sure, that the <<<cdmlib-*>>> artifacts exist in your repository.
+
+---
+$ cd taxeditor/cdmlib-plugin/
+$ ./_makeSources.sh
+---
+
+ Refresh the <<<cdmlib-plugin>>> project; the errors should be gone.
+
+ <<Note:>> This will change in the very near future as these dependencies will also be managed by maven.
+
+ After this you have to update the classpaths of all plugin projects as well. To do this right-click any of the <taxeditor-*> projects and choose <PDE Tools -\> Update Classpath...>. Click <Select All> in the dialog and confirm. After a rebuild of your entire workspace all errors should be gone and you are ready to go.
+
+* Bundle overview
+
+ Let's have a quick look at the projects:
+
+** <taxeditor-store>
+
+
+
+** <taxeditor-navigation>
+
+ The <Taxon Navigator> as well as the <Search> view are located in this plugin.
+
+** <taxeditor-editor>
+
+ Everything that has to do with editing a taxon or data that is connected to a taxon resides in this plugin. This includes the <Name Editor>, the <Details View>,
+ the <Supplemental View>, the <Descriptive Data View> as well as the <Media View>. All interface elements that are used in the <taxeditor-bulkeditor> plugin are
+ also located here.
+
+** <taxeditor-bulkeditor>
+
+ The different bulkeditors are in this plugin.
+
+** <taxeditor-printpublisher>
+
+ This plugin is a frontend and GUI for the <cdmlib-print> module. Please see the {{{http://wp5.e-taxonomy.eu/printpublisher/}according documentation}} for further information.
+
+** <taxeditor-application>
+
+ This plugin bundles all the previous plugins into an application and configures the look and feel.
+
+** <taxeditor-cdmlib-plugin>
+
+ As said before, <cdmlib> dependecies reside in this plugin. Please also note that this plugin does not contain any sourcecode.
+
+** <taxeditor-feature-platform>
+
+ A feature containing all dependencies for the eclipse platform.
+
+** <taxeditor-feature-product>
+
+ A feature configuring the standalone application and bundling all plugins and dependencies.
+
+* Creating a launch configuration
+
+ To start the Taxonomic Editor from your newly created development environment you need to create a launch configuration.
+
+ * Expand <taxeditor-feature-product> and open <<<taxeditor.product>>>
+
+ * In the <Testing> section (down left) click on <Launch an Eclipse application in Debug mode>
+
+ The Taxonomic Editor should launch.
+
+* Where do I go from here?
<?xml version="1.0" encoding="UTF-8"?>
-<faqs xmlns="http://maven.apache.org/FML/1.0.1"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/FML/1.0.1 http://maven.apache.org/xsd/fml-1.0.1.xsd"
- title="Frequently Asked Questions"
- toplink="false">
-
- <part id="general">
- <title>General</title>
-
- <faq id="whats-foo">
- <question>
- What is Foo?
- </question>
- <answer>
- <p>some markup goes here</p>
-
- <source>some source code</source>
-
- <p>some markup goes here</p>
- </answer>
- </faq>
-
- <faq id="whats-bar">
- <question>
- What is Bar?
- </question>
- <answer>
- <p>some markup goes here</p>
- </answer>
- </faq>
- </part>
-
- <part id="install">
-
- <title>Installation</title>
-
- <faq id="how-install">
- <question>
- How do I install Foo?
- </question>
- <answer>
- <p>some markup goes here</p>
- </answer>
- </faq>
-
- </part>
-
-</faqs>
\ No newline at end of file
+<faqs xmlns="http://maven.apache.org/FML/1.0.1"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/FML/1.0.1 http://maven.apache.org/xsd/fml-1.0.1.xsd"
+ title="Troubleshooting"
+ toplink="true">
+ <part id="general">
+ <title>General</title>
+ <faq id="whats-foo">
+ <question>How can I configure logging in the editor?</question>
+ <answer>
+ <p>To get log4j to read your own configuration when developing the editor or
+ anything that has to do with cdmLibrary eclipse plugin you have to tell
+ log4j explicitly what configuration it should use. Otherwise it will scan
+ the classpath and use the first log4j.xml/log4j.properties file it finds
+ (which is mostly the log4j.properties in cdmlib-commons as it will be the
+ first one it encounters).</p>
+ <p>Passing the following argument to the Virtual Machine however does the trick:</p>
+ <source>-Dlog4j.configuration=file:///<path to your personal\>/log4j.properties</source>
+ <p>If you run into trouble , you can debug log4j's startup sequence by passing
+ another argument to the VM.</p>
+ <source>-Dlog4j.debug</source>
+ </answer>
+ </faq>
+ </part>
+</faqs>
<body>
<links>
<item name="CDM Library" href="http://wp5.e-taxonomy.eu/cdmlib/"/>
- <item name="CDM Server" href="http://wp5.e-taxonomy.eu/cdmserver/"/>
- <item name="Dataportal" href="http://wp5.e-taxonomy.eu/dataportal/"/>
+ <item name="CDM Server" href="http://wp5.e-taxonomy.eu/cdm-server/"/>
+ <item name="Dataportal" href="http://wp5.e-taxonomy.eu/portal/"/>
<item name="Print Publisher" href="http://wp5.e-taxonomy.eu/printpublisher/"/>
<item name="CDM Setups" href="http://wp5.e-taxonomy.eu/cdm-setups/"/>
</links>
<menu name="General Information">
<item name="Overview" href="index.html"/>
<item name="Screenshots" href="screenshots.html"/>
+ <item name="Manual" href="manual.html"/>
<item name="FAQ" href="faq.html"/>
- <item name="License" href="license.html"/>
- <item name="Download" href="download.html"/>
+ <item name="Releases" href="changes-report.html"/>
+ <item name="Download" href="http://wp5.e-taxonomy.eu/download/taxeditor/"/>
</menu>
<menu name="Developer">
<item name="Getting started" href="getting-started.html"/>
- <item name="Modules" href="modules.html"/>
<item name="Javadocs" href="apidocs/index.html"/>
<item name="Troubleshooting" href="troubleshooting.html"/>
<item name="Wiki" href="http://dev.e-taxonomy.eu/trac/wiki/TaxonomicEditor"/>
<item name="Continuous Integration" href="integration.html"/>
<item name="Issue Tracking" href="http://dev.e-taxonomy.eu/trac/"/>
<item name="Source Repository" href="source-repository.html"/>
+ <item name="License" href="license.html"/>
</menu>
</body>
</project>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-editor</artifactId>
</dependency>
+ <dependency>
+ <groupId>eu.etaxonomy</groupId>
+ <artifactId>taxeditor-printpublisher</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.equinox.p2</groupId>
+ <artifactId>operations</artifactId>
+ </dependency>
</dependencies>
</project>
/**
* This class controls all aspects of the application's execution
+ *
+ * @author n.hoffmann
+ * @version $Id: $
*/
public class Application implements IApplication {
/* (non-Javadoc)
* @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
*/
+ /** {@inheritDoc} */
public Object start(IApplicationContext context) {
Display display = PlatformUI.createDisplay();
try {
/* (non-Javadoc)
* @see org.eclipse.equinox.app.IApplication#stop()
*/
+ /**
+ * <p>stop</p>
+ */
public void stop() {
final IWorkbench workbench = PlatformUI.getWorkbench();
if (workbench == null)
* An action bar advisor is responsible for creating, adding, and disposing of
* the actions added to a workbench window. Each window will be populated with
* new actions.
+ *
+ * @author n.hoffmann
+ * @version $Id: $
*/
public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
private IWorkbenchAction saveAction;
private IWorkbenchAction saveAllAction;
+ /**
+ * <p>Constructor for ApplicationActionBarAdvisor.</p>
+ *
+ * @param configurer a {@link org.eclipse.ui.application.IActionBarConfigurer} object.
+ */
public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
super(configurer);
}
+ /** {@inheritDoc} */
protected void makeActions(final IWorkbenchWindow window) {
StoreUtil.setStatusLineManager(getActionBarConfigurer().getStatusLineManager());
import eu.etaxonomy.taxeditor.model.AbstractUtility;
/**
+ * <p>ApplicationUtil class.</p>
+ *
* @author n.hoffmann
* @created Oct 13, 2010
* @version 1.0
*/
public class ApplicationUtil extends AbstractUtility {
+ /**
+ * <p>getPluginId</p>
+ *
+ * @return a {@link java.lang.String} object.
+ */
protected static String getPluginId(){
return TaxonomicEditorPlugin.PLUGIN_ID;
}
import org.eclipse.ui.application.WorkbenchAdvisor;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+/**
+ * <p>ApplicationWorkbenchAdvisor class.</p>
+ *
+ * @author n.hoffmann
+ * @version $Id: $
+ */
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
private static final String PERSPECTIVE_ID = Perspective.ID;
* (non-Javadoc)
* @see org.eclipse.ui.application.WorkbenchAdvisor#createWorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)
*/
+ /** {@inheritDoc} */
public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
IWorkbenchWindowConfigurer configurer) {
return new ApplicationWorkbenchWindowAdvisor(configurer);
* (non-Javadoc)
* @see org.eclipse.ui.application.WorkbenchAdvisor#getInitialWindowPerspectiveId()
*/
+ /**
+ * <p>getInitialWindowPerspectiveId</p>
+ *
+ * @return a {@link java.lang.String} object.
+ */
public String getInitialWindowPerspectiveId() {
return PERSPECTIVE_ID;
}
* (non-Javadoc)
* @see org.eclipse.ui.application.WorkbenchAdvisor#initialize(org.eclipse.ui.application.IWorkbenchConfigurer)
*/
+ /** {@inheritDoc} */
public void initialize(IWorkbenchConfigurer configurer) {
super.initialize(configurer);
/* (non-Javadoc)
* @see org.eclipse.ui.application.WorkbenchAdvisor#preStartup()
*/
+ /** {@inheritDoc} */
@Override
public void preStartup() {
// TODO Auto-generated method stub
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
+/**
+ * <p>ApplicationWorkbenchWindowAdvisor class.</p>
+ *
+ * @author n.hoffmann
+ * @version $Id: $
+ */
public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
+ /**
+ * <p>Constructor for ApplicationWorkbenchWindowAdvisor.</p>
+ *
+ * @param configurer a {@link org.eclipse.ui.application.IWorkbenchWindowConfigurer} object.
+ */
public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
super(configurer);
}
+ /** {@inheritDoc} */
public ActionBarAdvisor createActionBarAdvisor(
IActionBarConfigurer configurer) {
return new ApplicationActionBarAdvisor(configurer);
}
+ /**
+ * <p>preWindowOpen</p>
+ */
public void preWindowOpen() {
IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
configurer.setInitialSize(new Point(963, 637));
configurer.setShowProgressIndicator(true);
}
+ /**
+ * <p>postWindowOpen</p>
+ */
public void postWindowOpen() {
PreferencesUtil.checkNomenclaturalCode();
}
-
\ No newline at end of file
+
-// $Id$\r
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.taxeditor;\r
-\r
-import java.net.MalformedURLException;\r
-import java.net.URL;\r
-\r
-import org.apache.log4j.Logger;\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.ui.PartInitException;\r
-import org.eclipse.ui.PlatformUI;\r
-import org.eclipse.ui.browser.IWorkbenchBrowserSupport;\r
-\r
-/**\r
- * @author p.ciardelli\r
- * @created 04.09.2009\r
- * @version 1.0\r
- */\r
-public class OpenExternalAboutPlatformHandler extends AbstractHandler {\r
- private static final Logger logger = Logger.getLogger(OpenExternalAboutPlatformHandler.class);\r
-\r
- /* (non-Javadoc)\r
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)\r
- */\r
- public Object execute(ExecutionEvent event) throws ExecutionException {\r
- String url = "http://wp5.e-taxonomy.eu/blog/";\r
-\r
- try {\r
- PlatformUI.getWorkbench().getBrowserSupport().createBrowser\r
- (IWorkbenchBrowserSupport.AS_EXTERNAL, "aCustomId", "url", "url").openURL(new URL(url));\r
- } catch (PartInitException e) {\r
- logger.error(e);\r
- throw new RuntimeException(e);\r
- } catch (MalformedURLException e) {\r
- logger.error(e);\r
- throw new RuntimeException(e);\r
- }\r
-\r
- return null;\r
- }\r
-}\r
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* 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.
+*/
+
+package eu.etaxonomy.taxeditor;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+
+/**
+ * <p>OpenExternalAboutPlatformHandler class.</p>
+ *
+ * @author p.ciardelli
+ * @created 04.09.2009
+ * @version 1.0
+ */
+public class OpenExternalAboutPlatformHandler extends AbstractHandler {
+ private static final Logger logger = Logger.getLogger(OpenExternalAboutPlatformHandler.class);
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ /** {@inheritDoc} */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ String url = "http://wp5.e-taxonomy.eu/blog/";
+
+ try {
+ PlatformUI.getWorkbench().getBrowserSupport().createBrowser
+ (IWorkbenchBrowserSupport.AS_EXTERNAL, "aCustomId", "url", "url").openURL(new URL(url));
+ } catch (PartInitException e) {
+ logger.error(e);
+ throw new RuntimeException(e);
+ } catch (MalformedURLException e) {
+ logger.error(e);
+ throw new RuntimeException(e);
+ }
+
+ return null;
+ }
+}
-// $Id$\r
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.taxeditor;\r
-\r
-import java.net.MalformedURLException;\r
-import java.net.URL;\r
-\r
-import org.apache.log4j.Logger;\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.ui.PartInitException;\r
-import org.eclipse.ui.PlatformUI;\r
-import org.eclipse.ui.browser.IWorkbenchBrowserSupport;\r
-\r
-/**\r
- * @author p.ciardelli\r
- * @created 04.09.2009\r
- * @version 1.0\r
- */\r
-public class OpenExternalHelpHandler extends AbstractHandler {\r
- private static final Logger logger = Logger.getLogger(OpenExternalHelpHandler.class);\r
-\r
- /* (non-Javadoc)\r
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)\r
- */\r
- public Object execute(ExecutionEvent event) throws ExecutionException {\r
- String url = "http://wp5.e-taxonomy.eu/download/taxeditor/stable/EDITTaxonomicEditor-UserManual.pdf";\r
- \r
- try {\r
- PlatformUI.getWorkbench().getBrowserSupport().createBrowser\r
- (IWorkbenchBrowserSupport.AS_EXTERNAL, "aCustomId", "url", "url").openURL(new URL(url));\r
- } catch (PartInitException e) {\r
- logger.error(e);\r
- throw new RuntimeException(e);\r
- } catch (MalformedURLException e) {\r
- logger.error(e);\r
- throw new RuntimeException(e);\r
- }\r
-\r
- return null;\r
- }\r
-}\r
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* 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.
+*/
+
+package eu.etaxonomy.taxeditor;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+
+/**
+ * <p>OpenExternalHelpHandler class.</p>
+ *
+ * @author p.ciardelli
+ * @created 04.09.2009
+ * @version 1.0
+ */
+public class OpenExternalHelpHandler extends AbstractHandler {
+ private static final Logger logger = Logger.getLogger(OpenExternalHelpHandler.class);
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ /** {@inheritDoc} */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ String url = "http://wp5.e-taxonomy.eu/download/taxeditor/stable/EDITTaxonomicEditor-UserManual.pdf";
+
+ try {
+ PlatformUI.getWorkbench().getBrowserSupport().createBrowser
+ (IWorkbenchBrowserSupport.AS_EXTERNAL, "aCustomId", "url", "url").openURL(new URL(url));
+ } catch (PartInitException e) {
+ logger.error(e);
+ throw new RuntimeException(e);
+ } catch (MalformedURLException e) {
+ logger.error(e);
+ throw new RuntimeException(e);
+ }
+
+ return null;
+ }
+}
-// $Id$\r
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.taxeditor;\r
-\r
-import java.net.MalformedURLException;\r
-import java.net.URL;\r
-\r
-import org.apache.log4j.Logger;\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.ui.PartInitException;\r
-import org.eclipse.ui.PlatformUI;\r
-import org.eclipse.ui.browser.IWorkbenchBrowserSupport;\r
-\r
-/**\r
- * @author p.ciardelli\r
- * @created 04.09.2009\r
- * @version 1.0\r
- */\r
-public class OpenExternalParserHelpHandler extends AbstractHandler {\r
- private static final Logger logger = Logger.getLogger(OpenExternalParserHelpHandler.class);\r
-\r
- /* (non-Javadoc)\r
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)\r
- */\r
- public Object execute(ExecutionEvent event) throws ExecutionException {\r
- String url = "http://dev.e-taxonomy.eu/trac/wiki/NameParserDocumentation";\r
-\r
- try {\r
- PlatformUI.getWorkbench().getBrowserSupport().createBrowser\r
- (IWorkbenchBrowserSupport.AS_EXTERNAL, "aCustomId", "url", "url").openURL(new URL(url));\r
- } catch (PartInitException e) {\r
- logger.error(e);\r
- throw new RuntimeException(e);\r
- } catch (MalformedURLException e) {\r
- logger.error(e);\r
- throw new RuntimeException(e);\r
- }\r
-\r
- return null;\r
- }\r
-}\r
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* 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.
+*/
+
+package eu.etaxonomy.taxeditor;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+
+/**
+ * <p>OpenExternalParserHelpHandler class.</p>
+ *
+ * @author p.ciardelli
+ * @created 04.09.2009
+ * @version 1.0
+ */
+public class OpenExternalParserHelpHandler extends AbstractHandler {
+ private static final Logger logger = Logger.getLogger(OpenExternalParserHelpHandler.class);
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ /** {@inheritDoc} */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ String url = "http://dev.e-taxonomy.eu/trac/wiki/NameParserDocumentation";
+
+ try {
+ PlatformUI.getWorkbench().getBrowserSupport().createBrowser
+ (IWorkbenchBrowserSupport.AS_EXTERNAL, "aCustomId", "url", "url").openURL(new URL(url));
+ } catch (PartInitException e) {
+ logger.error(e);
+ throw new RuntimeException(e);
+ } catch (MalformedURLException e) {
+ logger.error(e);
+ throw new RuntimeException(e);
+ }
+
+ return null;
+ }
+}
/**
* This class shows an example for checking for updates and performing the
- * update synchronously. It is up to the caller to run this in a job if
+ * update synchronously. It is up to the caller to run this in a job if
* a background update check is desired. This is a reasonable way to run an
* operation when user intervention is not required. Another approach is
* to separately perform the resolution and provisioning steps, deciding
* whether to perform these synchronously or in a job.
- *
+ *
* Any p2 operation can be run modally (synchronously), or the job
* can be requested and scheduled by the caller.
- *
+ *
+ * @see UpdateOperation#resolveModal(IProgressMonitor)
+ * @see UpdateOperation#getResolveJob(IProgressMonitor)
+ * @see UpdateOperation#getProvisioningJob(IProgressMonitor)
+ * @see UpdateOperation#resolveModal(IProgressMonitor)
+ * @see UpdateOperation#getResolveJob(IProgressMonitor)
+ * @see UpdateOperation#getProvisioningJob(IProgressMonitor)
* @see UpdateOperation#resolveModal(IProgressMonitor)
* @see UpdateOperation#getResolveJob(IProgressMonitor)
* @see UpdateOperation#getProvisioningJob(IProgressMonitor)
+ * @author n.hoffmann
+ * @version $Id: $
*/
public class P2Util {
-package eu.etaxonomy.taxeditor;\r
-\r
-import org.eclipse.ui.IFolderLayout;\r
-import org.eclipse.ui.IPageLayout;\r
-import org.eclipse.ui.IPerspectiveFactory;\r
-import org.eclipse.ui.progress.IProgressConstants;\r
-\r
-import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;\r
-import eu.etaxonomy.taxeditor.navigation.search.SearchResultView;\r
-\r
-public class Perspective implements IPerspectiveFactory {\r
-\r
- public static final String ID = "eu.etaxonomy.taxeditor.application.perspective";\r
- \r
- /* (non-Javadoc)\r
- * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)\r
- */\r
- public void createInitialLayout(IPageLayout layout) {\r
- IFolderLayout navigationFolder = layout.createFolder("navigation", IPageLayout.LEFT, 0.25f,\r
- layout.getEditorArea());\r
- \r
- // Note: ":*" is what allows us to call multiple searchResultView's with unique secondaryIds;\r
- // this can only be done here, with a placeholder, not in plugin.xml\r
- navigationFolder.addPlaceholder(SearchResultView.ID + ":*");\r
- navigationFolder.addView(TaxonNavigator.ID);\r
- \r
- navigationFolder.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID);\r
- }\r
-}
\ No newline at end of file
+package eu.etaxonomy.taxeditor;
+
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+import org.eclipse.ui.progress.IProgressConstants;
+
+import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
+import eu.etaxonomy.taxeditor.navigation.search.SearchResultView;
+
+/**
+ * <p>Perspective class.</p>
+ *
+ * @author n.hoffmann
+ * @version $Id: $
+ */
+public class Perspective implements IPerspectiveFactory {
+
+ /** Constant <code>ID="eu.etaxonomy.taxeditor.application.pers"{trunked}</code> */
+ public static final String ID = "eu.etaxonomy.taxeditor.application.perspective";
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
+ */
+ /** {@inheritDoc} */
+ public void createInitialLayout(IPageLayout layout) {
+ IFolderLayout navigationFolder = layout.createFolder("navigation", IPageLayout.LEFT, 0.25f,
+ layout.getEditorArea());
+
+ // Note: ":*" is what allows us to call multiple searchResultView's with unique secondaryIds;
+ // this can only be done here, with a placeholder, not in plugin.xml
+ navigationFolder.addPlaceholder(SearchResultView.ID + ":*");
+ navigationFolder.addView(TaxonNavigator.ID);
+
+ navigationFolder.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID);
+ }
+}
-// $Id$\r
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.taxeditor;\r
-\r
-import org.apache.log4j.Logger;\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.ui.handlers.HandlerUtil;\r
-\r
-/**\r
- * Now handled entirely by native save action. \r
- * \r
- * @author p.ciardelli\r
- * @created 04.09.2009\r
- * @version 1.0\r
- * @deprecated\r
- * @see ApplicationActionBarAdvisor\r
- */\r
-public class SaveAllHandler extends AbstractHandler {\r
- private static final Logger logger = Logger.getLogger(SaveAllHandler.class);\r
-\r
- /* (non-Javadoc)\r
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)\r
- */\r
- public Object execute(ExecutionEvent event) throws ExecutionException {\r
- HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().saveAllEditors(false);\r
- return null;\r
- }\r
-}\r
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* 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.
+*/
+
+package eu.etaxonomy.taxeditor;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * Now handled entirely by native save action.
+ *
+ * @author p.ciardelli
+ * @created 04.09.2009
+ * @version 1.0
+ * @see ApplicationActionBarAdvisor
+ */
+public class SaveAllHandler extends AbstractHandler {
+ private static final Logger logger = Logger.getLogger(SaveAllHandler.class);
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ /** {@inheritDoc} */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().saveAllEditors(false);
+ return null;
+ }
+}
-// $Id$\r
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.taxeditor;\r
-\r
-import org.apache.log4j.Logger;\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.ui.IEditorPart;\r
-import org.eclipse.ui.handlers.HandlerUtil;\r
-\r
-/**\r
- * Now handled entirely by native save action. \r
- * \r
- * @author p.ciardelli\r
- * @created 04.09.2009\r
- * @version 1.0\r
- * @deprecated\r
- * @see ApplicationActionBarAdvisor\r
- */\r
-public class SaveHandler extends AbstractHandler {\r
- private static final Logger logger = Logger.getLogger(SaveHandler.class);\r
-\r
- /* (non-Javadoc)\r
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)\r
- */\r
- public Object execute(ExecutionEvent event) throws ExecutionException {\r
- IEditorPart editor = HandlerUtil.getActiveEditor(event);\r
- if (editor != null) {\r
- HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().saveEditor(editor, false);\r
- }\r
- return null;\r
- }\r
-}\r
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* 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.
+*/
+
+package eu.etaxonomy.taxeditor;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * Now handled entirely by native save action.
+ *
+ * @author p.ciardelli
+ * @created 04.09.2009
+ * @version 1.0
+ * @see ApplicationActionBarAdvisor
+ */
+public class SaveHandler extends AbstractHandler {
+ private static final Logger logger = Logger.getLogger(SaveHandler.class);
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ /** {@inheritDoc} */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IEditorPart editor = HandlerUtil.getActiveEditor(event);
+ if (editor != null) {
+ HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().saveEditor(editor, false);
+ }
+ return null;
+ }
+}
/**
* The activator class controls the plug-in life cycle
+ *
+ * @author n.hoffmann
+ * @version $Id: $
*/
public class TaxonomicEditorPlugin extends AbstractUIPlugin {
private static final Logger logger = Logger
.getLogger(TaxonomicEditorPlugin.class);
// The plug-in ID
+ /** Constant <code>PLUGIN_ID="eu.etaxonomy.taxeditor.application"</code> */
public static final String PLUGIN_ID = "eu.etaxonomy.taxeditor.application";
// The shared instance
private ServiceReference packageAdminRef;
+ /** Constant <code>bundleContext</code> */
protected static BundleContext bundleContext;
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
+ /** {@inheritDoc} */
public void start(BundleContext context) throws Exception {
super.start(context);
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
+ /** {@inheritDoc} */
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-store</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.eclipse.ui</groupId>
+ <artifactId>editors</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.core</groupId>
+ <artifactId>filebuffers</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.ui.workbench</groupId>
+ <artifactId>texteditor</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.core</groupId>
+ <artifactId>resources</artifactId>
+ </dependency>
</dependencies>
</project>
-// $Id$\r
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.taxeditor.annotatedlineeditor;\r
-\r
-import java.util.Iterator;\r
-import java.util.List;\r
-\r
-import org.eclipse.core.runtime.Assert;\r
-import org.eclipse.core.runtime.CoreException;\r
-import org.eclipse.core.runtime.IProgressMonitor;\r
-import org.eclipse.jface.operation.IRunnableContext;\r
-import org.eclipse.jface.text.BadLocationException;\r
-import org.eclipse.jface.text.Document;\r
-import org.eclipse.jface.text.IDocument;\r
-import org.eclipse.jface.text.Position;\r
-import org.eclipse.jface.text.source.Annotation;\r
-import org.eclipse.jface.text.source.IAnnotationModel;\r
-import org.eclipse.ui.IEditorInput;\r
-import org.eclipse.ui.texteditor.AbstractDocumentProvider;\r
-\r
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;\r
-import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;\r
-\r
-\r
-\r
-/**\r
- * Using an <code>IEditorPart</code>, creates a document where each line is associated\r
- * with an entity. Mapping between document positions and entities is stored in\r
- * <code>LineAnnotation</code>s in a <code>LineAnnotationModel</code>. \r
- * <p>\r
- * Requires:\r
- * <ul>\r
- * <li>an <code>IEntityCreator</code> to create entities for new lines;\r
- * <li>an <code>IEntityPersistenceService</code> for interacting with the persistence layer; and\r
- * <li>an <code>ILineDisplayStrategy</code> for various visual manifestations of the domain object. \r
- * </ul> \r
- * \r
- * @author p.ciardelli\r
- * @created 25.06.2009\r
- * @version 1.0\r
- * @author n.hoffmann\r
- */\r
-public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {\r
-\r
- private IDocument document;\r
-\r
- private LineAnnotationModel annotationModel;\r
-\r
- private IEntityCreator entityCreator;\r
- \r
- private ILineDisplayStrategy lineDisplayStrategy;\r
-\r
- private IEditorInput input;\r
- \r
- public AnnotatedLineDocumentProvider(IEditorInput input){\r
- this.input = input;\r
- }\r
- \r
- @Override\r
- public IAnnotationModel getAnnotationModel(Object element) {\r
- if (element == input) {\r
- \r
- // Create model as necessary\r
- if (annotationModel == null) {\r
- annotationModel = new LineAnnotationModel(getLineDisplayStrategy(element));\r
- annotationModel.setEntityCreator(getEntityCreator(element));\r
- }\r
- return annotationModel;\r
- }\r
- \r
- return null;\r
- }\r
- \r
- @Override\r
- protected IAnnotationModel createAnnotationModel(Object element)\r
- throws CoreException {\r
- return getAnnotationModel(element);\r
- }\r
-\r
- @Override\r
- public IDocument getDocument(Object element) {\r
- return document;\r
- }\r
- \r
- @Override\r
- protected IDocument createDocument(Object element) throws CoreException {\r
- \r
- if (element instanceof IEditorInput) {\r
- IEditorInput input = (IEditorInput) element;\r
- document = new Document("");\r
-// IAnnotationModel model = getAnnotationModel(element);\r
- \r
- List<?> entityList = getEntityList(element);\r
- \r
- if(entityList != null){\r
- for (Object entity : entityList) {\r
- try {\r
- createAnnotatedLine(input, entity);\r
- } catch (BadLocationException e) {\r
- BulkEditorUtil.error(getClass(), "Problems creating annotated line: ", e);\r
- }\r
- } \r
- }\r
- \r
- return document;\r
- }\r
- return null;\r
- }\r
-\r
- /**\r
- * Creates an annotated line at the end of the document associated with the element\r
- * @return \r
- * @throws BadLocationException \r
- */\r
- protected LineAnnotation createAnnotatedLine(Object element, Object entity) throws BadLocationException {\r
- \r
- Document document = (Document) getDocument(element);\r
- ILineDisplayStrategy lineDisplayStrategy = getLineDisplayStrategy(element);\r
- \r
- LineAnnotation annotation = new LineAnnotation(entity, lineDisplayStrategy);\r
- \r
- // Is document zero length, or is last char in document line delimiter?\r
- int docLength = document.getLength();\r
- boolean useDelimiter = false;\r
- if (docLength > 0) {\r
- if (docLength > 1 && !document.get(docLength - 2, 2).equals(document.getDefaultLineDelimiter())) {\r
- useDelimiter = true;\r
- }\r
- }\r
- if (useDelimiter) {\r
- document.replace(docLength, 0, document.getDefaultLineDelimiter());\r
- }\r
- \r
- String text;\r
- if (lineDisplayStrategy.isEntityCacheEmpty(entity)) {\r
- text = lineDisplayStrategy.getEmptyCacheMessage(entity);\r
- } else {\r
- text = lineDisplayStrategy.getText(entity);\r
- }\r
- text += lineDisplayStrategy.getSupplementalText(entity);\r
- docLength = document.getLength();\r
- document.replace(docLength, 0, text);\r
- \r
- Position position = new Position(docLength, text.length());\r
- \r
- IAnnotationModel model = getAnnotationModel(element);\r
- model.addAnnotation(annotation, position);\r
- \r
-// lineDisplayStrategy.addDisplayListener(entity, \r
-// new EntityListenerImpl((LineAnnotation) annotation, element));\r
-// \r
- return annotation;\r
- }\r
- \r
- \r
- public void updateLineFromAnnotation(LineAnnotation annotation) {\r
- \r
- IAnnotationModel model = getAnnotationModel(input);\r
- IDocument document = getDocument(input);\r
- ILineDisplayStrategy lineDisplay = getLineDisplayStrategy(input);\r
- \r
- Object entity = annotation.getEntity();\r
- String text = "";\r
- if (getLineDisplayStrategy(input).isEntityCacheEmpty(entity)) {\r
- text = lineDisplay.getEmptyCacheMessage(entity);\r
- } else {\r
- text = lineDisplay.getText(entity);\r
- } \r
- text += lineDisplay.getSupplementalText(entity);\r
- \r
- try {\r
- if (model.getPosition(annotation) == null) {\r
- return;\r
- }\r
- int offset = model.getPosition(annotation).getOffset(); \r
- int line = document.getLineOfOffset(offset);\r
- int lineLength = document.getLineLength(document.getLineOfOffset(offset));\r
- if (document.getLineDelimiter(line) != null) {\r
- lineLength -= document.getLineDelimiter(line).length();\r
- }\r
- document.replace(offset, lineLength, text);\r
- } catch (BadLocationException e) {\r
- BulkEditorUtil.error(getClass(), "Problem updating annotated line: " ,e);\r
- }\r
- }\r
-\r
-// class EntityListenerImpl extends EntityListener {\r
-//\r
-// private LineAnnotation lineAnnotation;\r
-// private Object element;\r
-//\r
-// EntityListenerImpl(LineAnnotation lineAnnotation, Object element) {\r
-// this.lineAnnotation = lineAnnotation;\r
-// this.element = element;\r
-// }\r
-// /* (non-Javadoc)\r
-// * @see eu.etaxonomy.taxeditor.annotatedlineeditor.EntityDisplayListener#updateDisplay()\r
-// */\r
-// @Override\r
-// protected void updateEntity() {\r
-// lineAnnotation.setDirty(true);\r
-// updateLineFromAnnotation(element, lineAnnotation);\r
-// }\r
-// }\r
- \r
- /**\r
- * @param element \r
- * @return\r
- */\r
- private List<?> getEntityList(Object element) {\r
- if (element instanceof AbstractBulkEditorInput) {\r
- return ((AbstractBulkEditorInput)element).listEntities();\r
- }\r
- return null;\r
- }\r
-\r
- @Override\r
- protected void doSaveDocument(IProgressMonitor monitor, Object element,\r
- IDocument document, boolean overwrite) throws CoreException {\r
- if (element instanceof AbstractBulkEditorInput) {\r
- \r
- IEntityPersistenceService persistenceService = (AbstractBulkEditorInput) element;\r
- \r
- // Get new containers from annotation model\r
- LineAnnotationModel model = (LineAnnotationModel) getAnnotationModel(element);\r
- Iterator iterator = model.getAnnotationIterator();\r
- while (iterator.hasNext()) {\r
- Annotation annotation = (Annotation) iterator.next();\r
- if (annotation instanceof IEntityContainer<?>) {\r
- IEntityContainer<?> container = (IEntityContainer<?>) annotation;\r
- if (container.isMarkedAsNew() || container.isDirty()) {\r
- persistenceService.save(container.getEntity()); // save\r
- container.setDirty(false);\r
- container.markAsNew(false);\r
- }\r
- }\r
- }\r
- for (LineAnnotation annotation : model.getDeletedAnnotations()) {\r
- if (annotation.isMarkedAsNew()) {\r
- continue;\r
- }\r
- if (annotation.isMarkedAsMerged()) {\r
- persistenceService.merge(annotation.getEntity(), annotation.getMergeTarget()); // merge \r
- } else {\r
- // TODO clarify w AM whether this needs to be executed on merged objects\r
- persistenceService.delete(annotation.getEntity()); // delete\r
- }\r
- }\r
- model.clearDeletedAnnotations();\r
- }\r
- }\r
-\r
- @Override\r
- protected IRunnableContext getOperationRunner(IProgressMonitor monitor) {\r
- return null;\r
- }\r
- \r
- @Override\r
- public boolean isModifiable(Object element) {\r
- return true;\r
- }\r
- \r
- @Override\r
- public boolean isReadOnly(Object element) {\r
- // enables copy & paste\r
- return false;\r
- }\r
-\r
- /**\r
- * @param entityCreator\r
- * @param element\r
- */\r
- public void setEntityCreator(IEntityCreator<?> entityCreator, Object element) {\r
- if (element instanceof IEditorInput) {\r
- this.entityCreator = entityCreator;\r
- }\r
- }\r
- \r
- /**\r
- * @param element\r
- * @return\r
- */\r
- public IEntityCreator<?> getEntityCreator(Object element) {\r
- if (element instanceof IEditorInput) {\r
-// Assert.isNotNull(entityCreator, "No IEntityCreator set for this element.");\r
- return entityCreator;\r
- }\r
- return null;\r
- }\r
-\r
- /**\r
- * @param lineDisplayStrategy\r
- * @param input\r
- */\r
- public void setLineDisplayStrategy(\r
- ILineDisplayStrategy lineDisplayStrategy, Object element) {\r
- if (element instanceof IEditorInput) {\r
- this.lineDisplayStrategy = lineDisplayStrategy;\r
- } \r
- }\r
- \r
- /**\r
- * @param element\r
- * @return\r
- */\r
- protected ILineDisplayStrategy getLineDisplayStrategy(Object element) {\r
- if (element instanceof IEditorInput) {\r
- Assert.isNotNull(lineDisplayStrategy, "No ILineDisplayStrategy set for this element.");\r
- return lineDisplayStrategy;\r
- }\r
- return null;\r
- }\r
- \r
- public void removeAnnotatedLine(Object entity){\r
- LineAnnotation annotation = (LineAnnotation) annotationModel.getAnnotation(entity);\r
- removeAnnotatedLine(annotation);\r
- }\r
- \r
- /**\r
- * @param editorInput\r
- * @param lineno\r
- */\r
- public void removeAnnotatedLine(Object element, int lineno) {\r
- LineAnnotation annotation = (LineAnnotation) annotationModel.getAnnotationAtLine(lineno, document);\r
- removeAnnotatedLine(annotation);\r
- }\r
- \r
- public void removeAnnotatedLine(LineAnnotation annotation) {\r
- if (annotation != null) {\r
- Document document = (Document) getDocument(input);\r
- LineAnnotationModel model = (LineAnnotationModel) getAnnotationModel(input);\r
- \r
- Position position = model.getPosition(annotation);\r
- int offset = position.getOffset();\r
- int length = position.getLength();\r
- \r
- Object entity = annotation.getEntity();\r
- annotation.markAsDeleted();\r
- model.removeAnnotation(annotation);\r
- \r
- // Immediately followed by a delimiter?\r
- int annotationEnd = offset + length;\r
- try {\r
- if (document.getLength() > annotationEnd + 1 && document.get(annotationEnd, 2).equals(document.getDefaultLineDelimiter())) {\r
- length += 2;\r
- }\r
- } catch (BadLocationException e1) {\r
- BulkEditorUtil.error(getClass(), "Problems removing annotated line", e1);\r
- }\r
- \r
- try {\r
- document.replace(offset, length, "");\r
- } catch (BadLocationException e) {\r
- BulkEditorUtil.error(getClass(), "Problems removing annotated line", e);\r
- }\r
- } \r
- }\r
- \r
- /* (non-Javadoc)\r
- * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#changed(java.lang.Object)\r
- */\r
- @Override\r
- public void changed(Object entity) {\r
- LineAnnotation annotation = (LineAnnotation) annotationModel.getAnnotation(entity);\r
- if(annotation != null){\r
- annotation.setDirty(true);\r
- updateLineFromAnnotation(annotation);\r
- }\r
- }\r
-}
\ No newline at end of file
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* 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.
+*/
+package eu.etaxonomy.taxeditor.annotatedlineeditor;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.source.Annotation;
+import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.texteditor.AbstractDocumentProvider;
+
+import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
+import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
+
+
+
+/**
+ * Using an <code>IEditorPart</code>, creates a document where each line is associated
+ * with an entity. Mapping between document positions and entities is stored in
+ * <code>LineAnnotation</code>s in a <code>LineAnnotationModel</code>.
+ * <p>
+ * Requires:
+ * <ul>
+ * <li>an <code>IEntityCreator</code> to create entities for new lines;
+ * <li>an <code>IEntityPersistenceService</code> for interacting with the persistence layer; and
+ * <li>an <code>ILineDisplayStrategy</code> for various visual manifestations of the domain object.
+ * </ul>
+ *
+ * @author p.ciardelli
+ * @author n.hoffmann
+ * @created 25.06.2009
+ * @version 1.0
+ */
+public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
+
+ private IDocument document;
+
+ private LineAnnotationModel annotationModel;
+
+ private IEntityCreator entityCreator;
+
+ private ILineDisplayStrategy lineDisplayStrategy;
+
+ private IEditorInput input;
+
+ /**
+ * <p>Constructor for AnnotatedLineDocumentProvider.</p>
+ *
+ * @param input a {@link org.eclipse.ui.IEditorInput} object.
+ */
+ public AnnotatedLineDocumentProvider(IEditorInput input){
+ this.input = input;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public IAnnotationModel getAnnotationModel(Object element) {
+ if (element == input) {
+
+ // Create model as necessary
+ if (annotationModel == null) {
+ annotationModel = new LineAnnotationModel(getLineDisplayStrategy(element));
+ annotationModel.setEntityCreator(getEntityCreator(element));
+ }
+ return annotationModel;
+ }
+
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ protected IAnnotationModel createAnnotationModel(Object element)
+ throws CoreException {
+ return getAnnotationModel(element);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public IDocument getDocument(Object element) {
+ return document;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ protected IDocument createDocument(Object element) throws CoreException {
+
+ if (element instanceof IEditorInput) {
+ IEditorInput input = (IEditorInput) element;
+ document = new Document("");
+// IAnnotationModel model = getAnnotationModel(element);
+
+ List<?> entityList = getEntityList(element);
+
+ if(entityList != null){
+ for (Object entity : entityList) {
+ try {
+ createAnnotatedLine(input, entity);
+ } catch (BadLocationException e) {
+ BulkEditorUtil.error(getClass(), "Problems creating annotated line: ", e);
+ }
+ }
+ }
+
+ return document;
+ }
+ return null;
+ }
+
+ /**
+ * Creates an annotated line at the end of the document associated with the element
+ *
+ * @throws org.eclipse.jface.text.BadLocationException if any.
+ * @param element a {@link java.lang.Object} object.
+ * @param entity a {@link java.lang.Object} object.
+ * @return a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation} object.
+ */
+ protected LineAnnotation createAnnotatedLine(Object element, Object entity) throws BadLocationException {
+
+ Document document = (Document) getDocument(element);
+ ILineDisplayStrategy lineDisplayStrategy = getLineDisplayStrategy(element);
+
+ LineAnnotation annotation = new LineAnnotation(entity, lineDisplayStrategy);
+
+ // Is document zero length, or is last char in document line delimiter?
+ int docLength = document.getLength();
+ boolean useDelimiter = false;
+ if (docLength > 0) {
+ if (docLength > 1 && !document.get(docLength - 2, 2).equals(document.getDefaultLineDelimiter())) {
+ useDelimiter = true;
+ }
+ }
+ if (useDelimiter) {
+ document.replace(docLength, 0, document.getDefaultLineDelimiter());
+ }
+
+ String text;
+ if (lineDisplayStrategy.isEntityCacheEmpty(entity)) {
+ text = lineDisplayStrategy.getEmptyCacheMessage(entity);
+ } else {
+ text = lineDisplayStrategy.getText(entity);
+ }
+ text += lineDisplayStrategy.getSupplementalText(entity);
+ docLength = document.getLength();
+ document.replace(docLength, 0, text);
+
+ Position position = new Position(docLength, text.length());
+
+ IAnnotationModel model = getAnnotationModel(element);
+ model.addAnnotation(annotation, position);
+
+// lineDisplayStrategy.addDisplayListener(entity,
+// new EntityListenerImpl((LineAnnotation) annotation, element));
+//
+ return annotation;
+ }
+
+
+ /**
+ * <p>updateLineFromAnnotation</p>
+ *
+ * @param annotation a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation} object.
+ */
+ public void updateLineFromAnnotation(LineAnnotation annotation) {
+
+ IAnnotationModel model = getAnnotationModel(input);
+ IDocument document = getDocument(input);
+ ILineDisplayStrategy lineDisplay = getLineDisplayStrategy(input);
+
+ Object entity = annotation.getEntity();
+ String text = "";
+ if (getLineDisplayStrategy(input).isEntityCacheEmpty(entity)) {
+ text = lineDisplay.getEmptyCacheMessage(entity);
+ } else {
+ text = lineDisplay.getText(entity);
+ }
+ text += lineDisplay.getSupplementalText(entity);
+
+ try {
+ if (model.getPosition(annotation) == null) {
+ return;
+ }
+ int offset = model.getPosition(annotation).getOffset();
+ int line = document.getLineOfOffset(offset);
+ int lineLength = document.getLineLength(document.getLineOfOffset(offset));
+ if (document.getLineDelimiter(line) != null) {
+ lineLength -= document.getLineDelimiter(line).length();
+ }
+ document.replace(offset, lineLength, text);
+ } catch (BadLocationException e) {
+ BulkEditorUtil.error(getClass(), "Problem updating annotated line: " ,e);
+ }
+ }
+
+// class EntityListenerImpl extends EntityListener {
+//
+// private LineAnnotation lineAnnotation;
+// private Object element;
+//
+// EntityListenerImpl(LineAnnotation lineAnnotation, Object element) {
+// this.lineAnnotation = lineAnnotation;
+// this.element = element;
+// }
+// /* (non-Javadoc)
+// * @see eu.etaxonomy.taxeditor.annotatedlineeditor.EntityDisplayListener#updateDisplay()
+// */
+// @Override
+// protected void updateEntity() {
+// lineAnnotation.setDirty(true);
+// updateLineFromAnnotation(element, lineAnnotation);
+// }
+// }
+
+ /**
+ * @param element
+ * @return
+ */
+ private List<?> getEntityList(Object element) {
+ if (element instanceof AbstractBulkEditorInput) {
+ return ((AbstractBulkEditorInput)element).listEntities();
+ }
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ protected void doSaveDocument(IProgressMonitor monitor, Object element,
+ IDocument document, boolean overwrite) throws CoreException {
+ if (element instanceof AbstractBulkEditorInput) {
+
+ IEntityPersistenceService persistenceService = (AbstractBulkEditorInput) element;
+
+ // Get new containers from annotation model
+ LineAnnotationModel model = (LineAnnotationModel) getAnnotationModel(element);
+ Iterator iterator = model.getAnnotationIterator();
+ while (iterator.hasNext()) {
+ Annotation annotation = (Annotation) iterator.next();
+ if (annotation instanceof IEntityContainer<?>) {
+ IEntityContainer<?> container = (IEntityContainer<?>) annotation;
+ if (container.isMarkedAsNew() || container.isDirty()) {
+ persistenceService.save(container.getEntity()); // save
+ container.setDirty(false);
+ container.markAsNew(false);
+ }
+ }
+ }
+ for (LineAnnotation annotation : model.getDeletedAnnotations()) {
+ if (annotation.isMarkedAsNew()) {
+ continue;
+ }
+ if (annotation.isMarkedAsMerged()) {
+ persistenceService.merge(annotation.getEntity(), annotation.getMergeTarget()); // merge
+ } else {
+ // TODO clarify w AM whether this needs to be executed on merged objects
+ persistenceService.delete(annotation.getEntity()); // delete
+ }
+ }
+ model.clearDeletedAnnotations();
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ protected IRunnableContext getOperationRunner(IProgressMonitor monitor) {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public boolean isModifiable(Object element) {
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public boolean isReadOnly(Object element) {
+ // enables copy & paste
+ return false;
+ }
+
+ /**
+ * <p>Setter for the field <code>entityCreator</code>.</p>
+ *
+ * @param entityCreator a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator} object.
+ * @param element a {@link java.lang.Object} object.
+ */
+ public void setEntityCreator(IEntityCreator<?> entityCreator, Object element) {
+ if (element instanceof IEditorInput) {
+ this.entityCreator = entityCreator;
+ }
+ }
+
+ /**
+ * <p>Getter for the field <code>entityCreator</code>.</p>
+ *
+ * @param element a {@link java.lang.Object} object.
+ * @return a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator} object.
+ */
+ public IEntityCreator<?> getEntityCreator(Object element) {
+ if (element instanceof IEditorInput) {
+// Assert.isNotNull(entityCreator, "No IEntityCreator set for this element.");
+ return entityCreator;
+ }
+ return null;
+ }
+
+ /**
+ * <p>Setter for the field <code>lineDisplayStrategy</code>.</p>
+ *
+ * @param lineDisplayStrategy a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy} object.
+ * @param element a {@link java.lang.Object} object.
+ */
+ public void setLineDisplayStrategy(
+ ILineDisplayStrategy lineDisplayStrategy, Object element) {
+ if (element instanceof IEditorInput) {
+ this.lineDisplayStrategy = lineDisplayStrategy;
+ }
+ }
+
+ /**
+ * <p>Getter for the field <code>lineDisplayStrategy</code>.</p>
+ *
+ * @param element a {@link java.lang.Object} object.
+ * @return a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy} object.
+ */
+ protected ILineDisplayStrategy getLineDisplayStrategy(Object element) {
+ if (element instanceof IEditorInput) {
+ Assert.isNotNull(lineDisplayStrategy, "No ILineDisplayStrategy set for this element.");
+ return lineDisplayStrategy;
+ }
+ return null;
+ }
+
+ /**
+ * <p>removeAnnotatedLine</p>
+ *
+ * @param entity a {@link java.lang.Object} object.
+ */
+ public void removeAnnotatedLine(Object entity){
+ LineAnnotation annotation = (LineAnnotation) annotationModel.getAnnotation(entity);
+ removeAnnotatedLine(annotation);
+ }
+
+ /**
+ * <p>removeAnnotatedLine</p>
+ *
+ * @param lineno a int.
+ * @param element a {@link java.lang.Object} object.
+ */
+ public void removeAnnotatedLine(Object element, int lineno) {
+ LineAnnotation annotation = (LineAnnotation) annotationModel.getAnnotationAtLine(lineno, document);
+ removeAnnotatedLine(annotation);
+ }
+
+ /**
+ * <p>removeAnnotatedLine</p>
+ *
+ * @param annotation a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation} object.
+ */
+ public void removeAnnotatedLine(LineAnnotation annotation) {
+ if (annotation != null) {
+ Document document = (Document) getDocument(input);
+ LineAnnotationModel model = (LineAnnotationModel) getAnnotationModel(input);
+
+ Position position = model.getPosition(annotation);
+ int offset = position.getOffset();
+ int length = position.getLength();
+
+ Object entity = annotation.getEntity();
+ annotation.markAsDeleted();
+ model.removeAnnotation(annotation);
+
+ // Immediately followed by a delimiter?
+ int annotationEnd = offset + length;
+ try {
+ if (document.getLength() > annotationEnd + 1 && document.get(annotationEnd, 2).equals(document.getDefaultLineDelimiter())) {
+ length += 2;
+ }
+ } catch (BadLocationException e1) {
+ BulkEditorUtil.error(getClass(), "Problems removing annotated line", e1);
+ }
+
+ try {
+ document.replace(offset, length, "");
+ } catch (BadLocationException e) {
+ BulkEditorUtil.error(getClass(), "Problems removing annotated line", e);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#changed(java.lang.Object)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void changed(Object entity) {
+ LineAnnotation annotation = (LineAnnotation) annotationModel.getAnnotation(entity);
+ if(annotation != null){
+ annotation.setDirty(true);
+ updateLineFromAnnotation(annotation);
+ }
+ }
+}
-// $Id$\r
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.taxeditor.annotatedlineeditor;\r
-\r
-import org.eclipse.core.runtime.CoreException;\r
-import org.eclipse.core.runtime.IProgressMonitor;\r
-import org.eclipse.jface.text.BadLocationException;\r
-import org.eclipse.jface.text.source.ISourceViewer;\r
-import org.eclipse.jface.text.source.IVerticalRuler;\r
-import org.eclipse.swt.widgets.Composite;\r
-import org.eclipse.ui.IEditorInput;\r
-import org.eclipse.ui.editors.text.TextEditor;\r
-\r
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;\r
-import eu.etaxonomy.cdm.model.common.CdmBase;\r
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;\r
-import eu.etaxonomy.taxeditor.operations.IPostOperationEnabled;\r
-\r
-/**\r
- * A list-based editor, where each line in the editor's document is associated with a domain object.\r
- * <p>\r
- * Extending classes must set:\r
- * <ul>\r
- * <li>an <code>IEntityCreator</code> to create a new domain object when the user creates a new line;\r
- * <li>an <code>IEntityPersistenceService</code> for interacting with the persistence layer; and\r
- * <li>an <code>ILineDisplayStrategy</code> for various visual manifestations of the domain object. \r
- * </ul>\r
- * \r
- * @author p.ciardelli\r
- * @created 25.06.2009\r
- * @version 1.0\r
- */\r
-public class AnnotatedLineEditor extends TextEditor implements IConversationEnabled, IPostOperationEnabled {\r
- \r
- private ConversationHolder conversation;\r
- \r
- private IEntityPersistenceService persistenceService;\r
- protected ILineDisplayStrategy lineDisplayStrategy;\r
- private IEntityCreatorService entityCreatorService;\r
- private IEntityCreator<?> entityCreator;\r
- \r
- \r
- public AnnotatedLineEditor(ConversationHolder conversation) {\r
- this.conversation = conversation;\r
- }\r
- \r
- /* (non-Javadoc)\r
- * @see org.eclipse.ui.editors.text.TextEditor#doSetInput(org.eclipse.ui.IEditorInput)\r
- */\r
- @Override\r
- protected void doSetInput(IEditorInput input) throws CoreException {\r
-\r
- AnnotatedLineDocumentProvider provider = createAnnotatedLineDocumentProvider();\r
- if (entityCreatorService != null) {\r
- provider.setEntityCreator(entityCreatorService.getEntityCreator(input), input);\r
- } else {\r
- provider.setEntityCreator(entityCreator, input);\r
- }\r
- provider.setLineDisplayStrategy(lineDisplayStrategy, input);\r
- setDocumentProvider(provider);\r
- \r
- super.doSetInput(input); \r
- }\r
- \r
- /**\r
- * @return\r
- */\r
- protected AnnotatedLineDocumentProvider createAnnotatedLineDocumentProvider() {\r
- return new AnnotatedLineDocumentProvider(getEditorInput());\r
- }\r
-\r
- /**\r
- * @param entityCreatorService\r
- */\r
- protected void setEntityCreatorService(IEntityCreatorService entityCreatorService) {\r
- this.entityCreatorService = entityCreatorService;\r
- }\r
- \r
- protected void setEntityCreator(IEntityCreator entityCreator) {\r
- this.entityCreator = entityCreator;\r
- }\r
- \r
- /**\r
- * @param bulkEditorPersistenceService\r
- */\r
- protected void setPersistenceService(\r
- IEntityPersistenceService persistenceService) {\r
- this.persistenceService = persistenceService; \r
- }\r
- \r
- protected IEntityPersistenceService getPersistenceService() {\r
- return persistenceService; \r
- }\r
-\r
- /**\r
- * @param bulkEditorLineDisplay\r
- */\r
- protected void setLineDisplayStrategy(\r
- ILineDisplayStrategy lineDisplayStrategy) {\r
- this.lineDisplayStrategy = lineDisplayStrategy; \r
- }\r
- \r
- @Override\r
- protected ISourceViewer createSourceViewer(Composite parent,\r
- IVerticalRuler ruler, int styles) {\r
- \r
- fAnnotationAccess= getAnnotationAccess();\r
- fOverviewRuler= createOverviewRuler(getSharedColors()); \r
- LineSelectionViewer viewer = new LineSelectionViewer(parent, ruler, getOverviewRuler(), \r
- isOverviewRulerVisible(), styles);\r
-// isOverviewRulerVisible(), styles | SWT.WRAP);\r
- getSourceViewerDecorationSupport(viewer);\r
- \r
- return viewer;\r
- }\r
- \r
- /**\r
- * Create an annotated line with an "empty" entity, i.e. using the editor\r
- * input's default entity type and a zero-length title cache. \r
- * \r
- * @return\r
- */\r
- public LineAnnotation createAnnotatedLineNewObject() {\r
- \r
- // Create new object\r
- Object entity = ((AnnotatedLineDocumentProvider) getDocumentProvider()).\r
- getEntityCreator(getEditorInput()).createEntity(null);\r
-\r
- LineAnnotation annotation = createAnnotatedLine(entity);\r
- if (annotation != null) {\r
- annotation.markAsNew(true);\r
- }\r
- return annotation;\r
- }\r
- \r
- /**\r
- * Create an annotated line, first creating an entity of type "key" - this key\r
- * must be recognized by the editor's entity creator.\r
- * \r
- * @param key\r
- * @param value\r
- * @return \r
- */\r
- public LineAnnotation createAnnotatedLineNewObject(Object key, String titleCache) {\r
- \r
- // Create new object\r
- Object entity = ((AnnotatedLineDocumentProvider) getDocumentProvider()).\r
- getEntityCreator(getEditorInput()).createEntity(key, titleCache);\r
-\r
- LineAnnotation annotation = createAnnotatedLine(entity);\r
- if (annotation != null) {\r
- annotation.markAsNew(true);\r
- }\r
- return annotation;\r
- \r
- }\r
- \r
- /**\r
- * Creates an annotated line at the end of the document. The annotation contains the entity.\r
- * \r
- * @param entity\r
- * @return\r
- */\r
- public LineAnnotation createAnnotatedLine(Object entity) {\r
- \r
- IEditorInput input = getEditorInput();\r
- AnnotatedLineDocumentProvider provider = (AnnotatedLineDocumentProvider) getDocumentProvider();\r
- \r
- LineAnnotation annotation = null;\r
- try {\r
- annotation = provider.createAnnotatedLine(input, entity);\r
-\r
- // Jump to new line\r
- int start= provider.getAnnotationModel(input).getPosition(annotation).getOffset();\r
- selectAndReveal(start, 0);\r
- \r
- } catch (BadLocationException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
- } \r
- return annotation;\r
- }\r
- \r
- /**\r
- * @param line\r
- */\r
- public void removeAnnotatedLine(int lineno) {\r
- ((AnnotatedLineDocumentProvider) getDocumentProvider()).removeAnnotatedLine(lineno);\r
- }\r
-\r
- /**\r
- * @param annotation\r
- */\r
- public void removeAnnotatedLine(LineAnnotation annotation) {\r
- ((AnnotatedLineDocumentProvider) getDocumentProvider()).removeAnnotatedLine(annotation);\r
- }\r
- \r
- /* (non-Javadoc)\r
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#doSave(org.eclipse.core.runtime.IProgressMonitor)\r
- */\r
- @Override\r
- public void doSave(IProgressMonitor progressMonitor) {\r
- if (getConversationHolder() != null) {\r
- if( ! getConversationHolder().isBound()){\r
- getConversationHolder().bind();\r
- }\r
- super.doSave(progressMonitor);\r
- getConversationHolder().commit(true);\r
- } else {\r
- super.doSave(progressMonitor); \r
- }\r
- firePropertyChange(PROP_DIRTY);\r
- }\r
- \r
- /* (non-Javadoc)\r
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#setFocus()\r
- */\r
- @Override\r
- public void setFocus() {\r
- super.setFocus();\r
- if (getConversationHolder() != null) {\r
- getConversationHolder().bind();\r
- }\r
- // TODO pass focus to underlying widgets\r
- }\r
-\r
- /* (non-Javadoc)\r
- * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()\r
- */\r
- public ConversationHolder getConversationHolder() {\r
- return conversation;\r
- }\r
-\r
- /* (non-Javadoc)\r
- * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)\r
- */\r
- public void update(CdmDataChangeMap changeEvents) {}\r
-\r
- /* (non-Javadoc)\r
- * @see eu.etaxonomy.taxeditor.operations.IPostOperationEnabled#postOperation(eu.etaxonomy.cdm.model.common.CdmBase)\r
- */\r
- public boolean postOperation(CdmBase objectAffectedByOperation) {\r
- return false;\r
- }\r
- \r
- /* (non-Javadoc)\r
- * @see org.eclipse.ui.editors.text.TextEditor#dispose()\r
- */\r
- @Override\r
- public void dispose() {\r
- super.dispose();\r
- conversation.close();\r
- }\r
-\r
- public boolean onComplete() {\r
- // TODO Auto-generated method stub\r
- return false;\r
- }\r
-}
\ No newline at end of file
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* 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.
+*/
+package eu.etaxonomy.taxeditor.annotatedlineeditor;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.IVerticalRuler;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.editors.text.TextEditor;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.operations.IPostOperationEnabled;
+
+/**
+ * A list-based editor, where each line in the editor's document is associated with a domain object.
+ * <p>
+ * Extending classes must set:
+ * <ul>
+ * <li>an <code>IEntityCreator</code> to create a new domain object when the user creates a new line;
+ * <li>an <code>IEntityPersistenceService</code> for interacting with the persistence layer; and
+ * <li>an <code>ILineDisplayStrategy</code> for various visual manifestations of the domain object.
+ * </ul>
+ *
+ * @author p.ciardelli
+ * @created 25.06.2009
+ * @version 1.0
+ */
+public class AnnotatedLineEditor extends TextEditor implements IConversationEnabled, IPostOperationEnabled {
+
+ private ConversationHolder conversation;
+
+ private IEntityPersistenceService persistenceService;
+ protected ILineDisplayStrategy lineDisplayStrategy;
+ private IEntityCreatorService entityCreatorService;
+ private IEntityCreator<?> entityCreator;
+
+
+ /**
+ * <p>Constructor for AnnotatedLineEditor.</p>
+ *
+ * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
+ */
+ public AnnotatedLineEditor(ConversationHolder conversation) {
+ this.conversation = conversation;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.editors.text.TextEditor#doSetInput(org.eclipse.ui.IEditorInput)
+ */
+ /** {@inheritDoc} */
+ @Override
+ protected void doSetInput(IEditorInput input) throws CoreException {
+
+ AnnotatedLineDocumentProvider provider = createAnnotatedLineDocumentProvider();
+ if (entityCreatorService != null) {
+ provider.setEntityCreator(entityCreatorService.getEntityCreator(input), input);
+ } else {
+ provider.setEntityCreator(entityCreator, input);
+ }
+ provider.setLineDisplayStrategy(lineDisplayStrategy, input);
+ setDocumentProvider(provider);
+
+ super.doSetInput(input);
+ }
+
+ /**
+ * <p>createAnnotatedLineDocumentProvider</p>
+ *
+ * @return a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.AnnotatedLineDocumentProvider} object.
+ */
+ protected AnnotatedLineDocumentProvider createAnnotatedLineDocumentProvider() {
+ return new AnnotatedLineDocumentProvider(getEditorInput());
+ }
+
+ /**
+ * <p>Setter for the field <code>entityCreatorService</code>.</p>
+ *
+ * @param entityCreatorService a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreatorService} object.
+ */
+ protected void setEntityCreatorService(IEntityCreatorService entityCreatorService) {
+ this.entityCreatorService = entityCreatorService;
+ }
+
+ /**
+ * <p>Setter for the field <code>entityCreator</code>.</p>
+ *
+ * @param entityCreator a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator} object.
+ */
+ protected void setEntityCreator(IEntityCreator entityCreator) {
+ this.entityCreator = entityCreator;
+ }
+
+ /**
+ * <p>Setter for the field <code>persistenceService</code>.</p>
+ *
+ * @param persistenceService a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService} object.
+ */
+ protected void setPersistenceService(
+ IEntityPersistenceService persistenceService) {
+ this.persistenceService = persistenceService;
+ }
+
+ /**
+ * <p>Getter for the field <code>persistenceService</code>.</p>
+ *
+ * @return a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService} object.
+ */
+ protected IEntityPersistenceService getPersistenceService() {
+ return persistenceService;
+ }
+
+ /**
+ * <p>Setter for the field <code>lineDisplayStrategy</code>.</p>
+ *
+ * @param lineDisplayStrategy a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy} object.
+ */
+ protected void setLineDisplayStrategy(
+ ILineDisplayStrategy lineDisplayStrategy) {
+ this.lineDisplayStrategy = lineDisplayStrategy;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ protected ISourceViewer createSourceViewer(Composite parent,
+ IVerticalRuler ruler, int styles) {
+
+ fAnnotationAccess= getAnnotationAccess();
+ fOverviewRuler= createOverviewRuler(getSharedColors());
+ LineSelectionViewer viewer = new LineSelectionViewer(parent, ruler, getOverviewRuler(),
+ isOverviewRulerVisible(), styles);
+// isOverviewRulerVisible(), styles | SWT.WRAP);
+ getSourceViewerDecorationSupport(viewer);
+
+ return viewer;
+ }
+
+ /**
+ * Create an annotated line with an "empty" entity, i.e. using the editor
+ * input's default entity type and a zero-length title cache.
+ *
+ * @return a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation} object.
+ */
+ public LineAnnotation createAnnotatedLineNewObject() {
+
+ // Create new object
+ O