This is an automated email from the git hooks/post-receive script. New commit to branch feature/editor in repository eugene. See https://gitlab.nuiton.org/nuiton/eugene.git commit 444fcb8661d1dd81784b0f7293c33863b721a32a Author: Tony CHEMIT <chemit@codelutin.com> Date: Fri Sep 16 12:37:14 2016 +0200 POC --- eugene-editor-maven-plugin/LICENSE.txt | 165 ++++++++ eugene-editor-maven-plugin/README.md | 2 + eugene-editor-maven-plugin/pom.xml | 426 +++++++++++++++++++++ .../src/license/THIRD-PARTY.properties | 37 ++ .../src/main/assembly/bin.xml | 73 ++++ .../src/main/assembly/dist/go.bat | 1 + .../src/main/assembly/dist/go.sh | 4 + .../EugeneEditorApplicationContext.java | 68 ++++ .../application/config/EugeneEditorConfig.java | 23 ++ .../config/EugeneEditorConfigOption.java | 103 +++++ .../editor/application/ui/EugeneEditorCommon.jcss | 26 ++ .../editor/application/ui/EugeneEditorUI.jaxx | 92 +++++ .../editor/application/ui/EugeneEditorUI.jcss | 174 +++++++++ .../application/ui/EugeneEditorUIHandler.java | 26 ++ .../editor/application/ui/EugeneEditorUIMode.java | 11 + .../application/ui/actions/ActionSupport.java | 23 ++ .../ui/actions/ChangeApplicationLocaleAction.java | 53 +++ .../application/ui/actions/CloseProjectAction.java | 29 ++ .../application/ui/actions/GotoSiteAction.java | 29 ++ .../application/ui/actions/OpenProjectAction.java | 29 ++ .../ui/actions/QuitApplicationAction.java | 33 ++ .../application/ui/actions/ShowAboutAction.java | 29 ++ .../application/ui/actions/ShowConfigAction.java | 29 ++ .../eugene/editor/plugin/EugeneEditorMojo.java | 178 +++++++++ .../eugene-editor-maven-plugin_en_GB.properties | 27 ++ .../eugene-editor-maven-plugin_fr_FR.properties | 27 ++ .../src/main/resources/icons/action-about.png | Bin 0 -> 936 bytes .../src/main/resources/icons/action-cancel.png | Bin 0 -> 587 bytes .../src/main/resources/icons/action-close.png | Bin 0 -> 688 bytes .../src/main/resources/icons/action-collapse.png | Bin 0 -> 372 bytes .../src/main/resources/icons/action-config.png | Bin 0 -> 611 bytes .../src/main/resources/icons/action-exit.png | Bin 0 -> 830 bytes .../src/main/resources/icons/action-expand.png | Bin 0 -> 371 bytes .../main/resources/icons/action-fileChooser.png | Bin 0 -> 441 bytes .../src/main/resources/icons/action-help.png | Bin 0 -> 746 bytes .../src/main/resources/icons/action-i18n-en.png | Bin 0 -> 599 bytes .../src/main/resources/icons/action-i18n-fr.png | Bin 0 -> 545 bytes .../src/main/resources/icons/action-i18n-uk.png | Bin 0 -> 599 bytes .../src/main/resources/icons/action-save.png | Bin 0 -> 838 bytes .../src/main/resources/icons/action-select.png | Bin 0 -> 392 bytes .../src/main/resources/icons/action-site.png | Bin 0 -> 928 bytes .../src/main/resources/icons/action-translate.png | Bin 0 -> 790 bytes .../src/main/resources/icons/action-unselect.png | Bin 0 -> 311 bytes .../src/main/resources/log4j.properties | 30 ++ .../src/site/fr/rst/index.rst | 72 ++++ eugene-editor-maven-plugin/src/site/rst/index.rst | 44 +++ eugene-editor-maven-plugin/src/site/site_en.xml | 62 +++ eugene-editor-maven-plugin/src/site/site_fr.xml | 66 ++++ .../org/nuiton/eugene/plugin/GenerateMojo.java | 6 +- pom.xml | 136 +++++++ 50 files changed, 2130 insertions(+), 3 deletions(-) diff --git a/eugene-editor-maven-plugin/LICENSE.txt b/eugene-editor-maven-plugin/LICENSE.txt new file mode 100644 index 0000000..cca7fc2 --- /dev/null +++ b/eugene-editor-maven-plugin/LICENSE.txt @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/eugene-editor-maven-plugin/README.md b/eugene-editor-maven-plugin/README.md new file mode 100644 index 0000000..d2e50d3 --- /dev/null +++ b/eugene-editor-maven-plugin/README.md @@ -0,0 +1,2 @@ +To deploy new version of pom: mvn deploy +To install localy: mvn install diff --git a/eugene-editor-maven-plugin/pom.xml b/eugene-editor-maven-plugin/pom.xml new file mode 100644 index 0000000..4701a1c --- /dev/null +++ b/eugene-editor-maven-plugin/pom.xml @@ -0,0 +1,426 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + EUGene :: Maven plugin + + $HeadURL$ + %% + Copyright (C) 2006 - 2010 CodeLutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Lesser Public License for more details. + + You should have received a copy of the GNU General Lesser Public + License along with this program. If not, see + <http://www.gnu.org/licenses/lgpl-3.0.html>. + #L% + --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.nuiton</groupId> + <artifactId>eugene</artifactId> + <version>3.0-SNAPSHOT</version> + </parent> + + <groupId>org.nuiton.eugene</groupId> + <artifactId>eugene-editor-maven-plugin</artifactId> + <packaging>maven-plugin</packaging> + + <name>EUGene :: Editor Maven Plugin</name> + <description>EUGene model editor maven plugin</description> + <inceptionYear>2016</inceptionYear> + + <properties> + + <javaVersion>1.8</javaVersion> + <signatureArtifactId>java18</signatureArtifactId> + <signatureVersion>1.0</signatureVersion> + + <!-- jaxx configuration --> + <jaxx.addProjectClassPath>true</jaxx.addProjectClassPath> + <jaxx.addSourcesToClassPath>true</jaxx.addSourcesToClassPath> + <jaxx.defaultErrorUIFQN>jaxx.runtime.validator.swing.ui.ImageValidationUI</jaxx.defaultErrorUIFQN> + <jaxx.useUIManagerForIcon>true</jaxx.useUIManagerForIcon> + <jaxx.autoImportCss>true</jaxx.autoImportCss> + <jaxx.autoRecurseInCss>false</jaxx.autoRecurseInCss> + <jaxx.commonCss> + ${project.basedir}/src/main/java/org/nuiton/eugene/editor/application/ui/EugeneEditorUI.jcss + </jaxx.commonCss> + <jaxx.cssExtension>jcss</jaxx.cssExtension> + <jaxx.addAutoHandlerUI>true</jaxx.addAutoHandlerUI> + + <applicationName>EugeneEditor</applicationName> + + <!-- generate license bundled files --> + <license.generateBundle>true</license.generateBundle> + <license.bundleThirdPartyPath>META-INF/${applicationName}-THIRD-PARTY.txt</license.bundleThirdPartyPath> + <license.bundleLicensePath>META-INF/${applicationName}-LICENSE.txt</license.bundleLicensePath> + + <!-- i18n configuration --> + <i18n.bundles>fr_FR,en_GB</i18n.bundles> + <i18n.silent>true</i18n.silent> + <!--<i18n.failsIfAnyKeyMissingValue>true</i18n.failsIfAnyKeyMissingValue>--> + <i18n.checkBundle>true</i18n.checkBundle> + <i18n.showEmpty>true</i18n.showEmpty> + + <i18n.bundleOutputName>${applicationName}-i18n</i18n.bundleOutputName> + <i18n.bundleCsvFile>${applicationName}-i18n.csv</i18n.bundleCsvFile> + <i18n.bundleCsvSeparator>|</i18n.bundleCsvSeparator> + + <maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format> + <buildDate>${maven.build.timestamp}</buildDate> + <buildNumber/> + + </properties> + + <dependencies> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>eugene</artifactId> + <version>${project.version}</version> + <scope>compile</scope> + </dependency> + + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-core</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-model</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-artifact</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-settings</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.maven.plugin-tools</groupId> + <artifactId>maven-plugin-annotations</artifactId> + </dependency> + + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + </dependency> + + <dependency> + <groupId>org.nuiton</groupId> + <artifactId>helper-maven-plugin-api</artifactId> + </dependency> + + <dependency> + <groupId>org.nuiton</groupId> + <artifactId>nuiton-utils</artifactId> + </dependency> + <dependency> + <groupId>org.nuiton</groupId> + <artifactId>nuiton-config</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + </dependency> + + <dependency> + <groupId>commons-collections</groupId> + <artifactId>commons-collections</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-collections4</artifactId> + </dependency> + + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + </dependency> + + <!-- jaxx dependencies --> + + <dependency> + <groupId>org.nuiton.jaxx</groupId> + <artifactId>jaxx-runtime</artifactId> + </dependency> + <dependency> + <groupId>org.nuiton.jaxx</groupId> + <artifactId>jaxx-validator</artifactId> + </dependency> + <dependency> + <groupId>org.nuiton.jaxx</groupId> + <artifactId>jaxx-widgets</artifactId> + </dependency> + <dependency> + <groupId>org.nuiton.jaxx</groupId> + <artifactId>jaxx-widgets-select</artifactId> + </dependency> + <dependency> + <groupId>org.nuiton.jaxx</groupId> + <artifactId>jaxx-widgets-about</artifactId> + </dependency> + <dependency> + <groupId>org.nuiton.jaxx</groupId> + <artifactId>jaxx-config</artifactId> + </dependency> + <dependency> + <groupId>org.nuiton.jaxx</groupId> + <artifactId>jaxx-application-api</artifactId> + </dependency> + + <!-- SwingX --> + <dependency> + <groupId>org.swinglabs.swingx</groupId> + <artifactId>swingx-core</artifactId> + </dependency> + <dependency> + <groupId>org.swinglabs.swingx</groupId> + <artifactId>swingx-painters</artifactId> + </dependency> + <dependency> + <groupId>org.swinglabs.swingx</groupId> + <artifactId>swingx-common</artifactId> + </dependency> + <dependency> + <groupId>org.swinglabs.swingx</groupId> + <artifactId>swingx-autocomplete</artifactId> + </dependency> + <dependency> + <groupId>org.swinglabs</groupId> + <artifactId>jxlayer</artifactId> + </dependency> + + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <scope>runtime</scope> + </dependency> + + </dependencies> + + <build> + + <pluginManagement> + <plugins> + + <plugin> + <artifactId>maven-plugin-plugin</artifactId> + <configuration> + <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound> + </configuration> + <executions> + <execution> + <goals> + <goal>helpmojo</goal> + <goal>descriptor</goal> + </goals> + </execution> + </executions> + </plugin> + + </plugins> + </pluginManagement> + + <plugins> + + <!-- expose new plexus components --> + <plugin> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-metadata</artifactId> + <executions> + <execution> + <goals> + <goal>generate-metadata</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>buildnumber-maven-plugin</artifactId> + <executions> + <execution> + <inherited>false</inherited> + <goals> + <goal>create</goal> + </goals> + <phase>validate</phase> + </execution> + </executions> + <configuration> + <doCheck>false</doCheck> + <doUpdate>false</doUpdate> + </configuration> + </plugin> + + <plugin> + <groupId>${project.groupId}</groupId> + <artifactId>eugene-maven-plugin</artifactId> + <version>${project.version}</version> + <executions> + <execution> + <phase>generate-sources</phase> + <id>generate-config</id> + <configuration> + <modelName>EugeneEditor</modelName> + <packageName>org.nuiton.eugene.editor.application.config</packageName> + </configuration> + <goals> + <goal>generate-config</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.nuiton.jaxx</groupId> + <artifactId>jaxx-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>generate</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.nuiton.i18n</groupId> + <artifactId>i18n-maven-plugin</artifactId> + <executions> + <execution> + <id>scan-sources</id> + <goals> + <goal>parserJava</goal> + <goal>gen</goal> + </goals> + <configuration> + <entries> + <entry> + <specificGoal>parserJava</specificGoal> + <basedir>${project.build.directory}/generated-sources/java/</basedir> + </entry> + </entries> + </configuration> + </execution> + <execution> + <id>make-bundle</id> + <goals> + <goal>bundle</goal> + <goal>generate-csv-bundle</goal> + </goals> + </execution> + </executions> + </plugin> + + </plugins> + </build> + + <profiles> + + <profile> + <id>changelog-profile</id> + <activation> + <property> + <name>performRelease</name> + <value>true</value> + </property> + </activation> + <build> + <defaultGoal>generate-resources</defaultGoal> + + <plugins> + + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>parse-version</id> + <goals> + <goal>parse-version</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>get-changelog</id> + <phase>generate-resources</phase> + <goals> + <goal>copy</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}/changelog</outputDirectory> + <artifactItems> + <artifactItem> + <groupId>${project.parent.groupId}</groupId> + <artifactId>${project.parent.artifactId}</artifactId> + <version>${project.version}</version> + <classifier>changelog</classifier> + <type>pom</type> + </artifactItem> + </artifactItems> + </configuration> + </execution> + </executions> + </plugin> + + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <id>Copy changelog</id> + <phase>process-resources</phase> + <configuration> + <target> + <copy failonerror="true" overwrite="true" + file="${project.build.directory}/changelog/${project.parent.artifactId}-${project.version}-changelog.pom" + tofile="${project.build.directory}/generated-sources/license/${applicationName}.txt"/> + <copy failonerror="true" overwrite="true" + file="${project.build.directory}/changelog/${project.parent.artifactId}-${project.version}-changelog.pom" + tofile="${project.build.directory}/generated-sources/license/META-INF/${applicationName}-CHANGELOG.txt"/> + </target> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + + </plugins> + </build> + </profile> + + </profiles> +</project> diff --git a/eugene-editor-maven-plugin/src/license/THIRD-PARTY.properties b/eugene-editor-maven-plugin/src/license/THIRD-PARTY.properties new file mode 100644 index 0000000..fc3ffd2 --- /dev/null +++ b/eugene-editor-maven-plugin/src/license/THIRD-PARTY.properties @@ -0,0 +1,37 @@ +# Generated by org.codehaus.mojo.license.AddThirdPartyMojo +#------------------------------------------------------------------------------- +# Already used licenses in project : +# - Apache License +# - Apache License Version 2.0 +# - Apache Software License, Version 1.1 +# - BSD License +# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 +# - Eclipse Public License 1.0 +# - Eclipse Public License, Version 1.0 +# - Indiana University Extreme! Lab Software License, vesion 1.1.1 +# - Lesser General Public License (LGPL) v 3.0 +# - Lesser General Public License (LPGL) +# - Lesser General Public License (LPGL) v 2.1 +# - MIT License +# - Mozilla Public License Version 1.0 +# - New BSD License +# - Public Domain +# - The Apache Software License, Version 2.0 +# - The GNU General Public License +# - The SAX License +# - The W3C License +# - http://classworlds.codehaus.org/license.html +# - http://jaxen.codehaus.org/license.html +#------------------------------------------------------------------------------- +# Please fill the missing licenses for dependencies : +# +# +#Sun Aug 09 09:53:01 CEST 2015 +antlr--antlr--2.7.2=BSD License +classworlds--classworlds--1.1-alpha-2=http\://classworlds.codehaus.org/license.html +commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0 +dom4j--dom4j--1.1=BSD License +org.codehaus.plexus--plexus-container-default--1.0-alpha-9-stable-1=The Apache Software License, Version 2.0 +org.codehaus.plexus--plexus-i18n--1.0-beta-10=The Apache Software License, Version 2.0 +org.codehaus.plexus--plexus-velocity--1.1.7=The Apache Software License, Version 2.0 +oro--oro--2.0.8=The Apache Software License, Version 2.0 diff --git a/eugene-editor-maven-plugin/src/main/assembly/bin.xml b/eugene-editor-maven-plugin/src/main/assembly/bin.xml new file mode 100644 index 0000000..17504b2 --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/assembly/bin.xml @@ -0,0 +1,73 @@ +<!-- + #%L + ObServe :: Application Swing + %% + Copyright (C) 2008 - 2016 IRD, Codelutin, Tony Chemit + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program. If not, see + <http://www.gnu.org/licenses/gpl-3.0.html>. + #L% + --> +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> + <id>bin</id> + <formats> + <format>zip</format> + </formats> + + <fileSets> + + <fileSet> + <directory>target</directory> + <outputDirectory/> + <fileMode>0755</fileMode> + <includes> + <include>${project.build.finalName}.jar</include> + <include>${applicationName}.exe</include> + </includes> + </fileSet> + + <fileSet> + <directory>target/classes</directory> + <outputDirectory/> + <includes> + <include>THIRD-PARTY.txt</include> + <include>LICENSE.txt</include> + </includes> + </fileSet> + + <fileSet> + <directory>src/main/assembly/dist</directory> + <outputDirectory/> + <includes> + <include>**/*</include> + </includes> + <excludes> + <exclude>**/*.sh</exclude> + <exclude>**/*.bat</exclude> + </excludes> + </fileSet> + + <fileSet> + <directory>src/main/assembly/dist</directory> + <outputDirectory/> + <fileMode>0755</fileMode> + <filtered>true</filtered> + <includes> + <include>**/*.sh</include> + <include>**/*.bat</include> + </includes> + </fileSet> + </fileSets> +</assembly> diff --git a/eugene-editor-maven-plugin/src/main/assembly/dist/go.bat b/eugene-editor-maven-plugin/src/main/assembly/dist/go.bat new file mode 100755 index 0000000..cffa0cc --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/assembly/dist/go.bat @@ -0,0 +1 @@ +java -Xmx512M -Xms512M -jar ${project.build.finalName}.jar %1 %2 %3 %4 %5 %6 %7 %8 %9 \ No newline at end of file diff --git a/eugene-editor-maven-plugin/src/main/assembly/dist/go.sh b/eugene-editor-maven-plugin/src/main/assembly/dist/go.sh new file mode 100755 index 0000000..065be9f --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/assembly/dist/go.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +MX=512M +java -Xmx${MX} -Xms${MX} -jar ${project.build.finalName}.jar "$@" \ No newline at end of file diff --git a/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/EugeneEditorApplicationContext.java b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/EugeneEditorApplicationContext.java new file mode 100644 index 0000000..b70bb27 --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/EugeneEditorApplicationContext.java @@ -0,0 +1,68 @@ +package org.nuiton.eugene.editor.application; + +import org.nuiton.eugene.editor.application.config.EugeneEditorConfig; +import org.nuiton.eugene.models.object.ObjectModel; +import org.nuiton.eugene.models.stereotype.AggregateStereotypeDefinitionProvider; +import org.nuiton.eugene.models.tagvalue.AggregateTagValueDefinitionProvider; + +/** + * Created on 15/09/16. + * + * @author Tony Chemit - chemit@codelutin.com + */ +public class EugeneEditorApplicationContext { + + private static EugeneEditorApplicationContext instance; + + public static EugeneEditorApplicationContext getInstance() { + return instance; + } + + public static void setInstance(EugeneEditorApplicationContext instance) { + EugeneEditorApplicationContext.instance = instance; + } + + protected final EugeneEditorConfig config; + protected final ClassLoader classLoader; + + protected final AggregateTagValueDefinitionProvider tagValueDefinitionProvider; + protected final AggregateStereotypeDefinitionProvider stereotypeDefinitionProvider; + protected final ObjectModel objectModel; + protected final Object lock = new Object(); + + public EugeneEditorApplicationContext(EugeneEditorConfig config, + ClassLoader classLoader, + AggregateTagValueDefinitionProvider tagValueDefinitionProvider, + AggregateStereotypeDefinitionProvider stereotypeDefinitionProvider, + ObjectModel objectModel) { + this.config = config; + this.classLoader = classLoader; + this.tagValueDefinitionProvider = tagValueDefinitionProvider; + this.stereotypeDefinitionProvider = stereotypeDefinitionProvider; + this.objectModel = objectModel; + } + + public EugeneEditorConfig getConfig() { + return config; + } + + public AggregateTagValueDefinitionProvider getTagValueDefinitionProvider() { + return tagValueDefinitionProvider; + } + + public AggregateStereotypeDefinitionProvider getStereotypeDefinitionProvider() { + return stereotypeDefinitionProvider; + } + + public void lock() throws InterruptedException { + synchronized (lock) { + lock.wait(); + } + } + + public void unlock() { + synchronized (lock) { + lock.notifyAll(); + } + } +} diff --git a/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/config/EugeneEditorConfig.java b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/config/EugeneEditorConfig.java new file mode 100644 index 0000000..fe6f97e --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/config/EugeneEditorConfig.java @@ -0,0 +1,23 @@ +package org.nuiton.eugene.editor.application.config; + +import com.google.common.base.Charsets; +import org.nuiton.config.ApplicationConfig; +import org.nuiton.config.ArgumentsParserException; + +/** + * Created on 15/09/16. + * + * @author Tony Chemit - chemit@codelutin.com + */ +public class EugeneEditorConfig extends GeneratedEugeneEditorConfig { + + public EugeneEditorConfig(String... args) throws ArgumentsParserException { + + ApplicationConfig delegate = get(); + delegate.setEncoding(Charsets.UTF_8.name()); + delegate.setConfigFileName("EugeneEditor.conf"); + delegate.parse(args); + + } + +} diff --git a/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/config/EugeneEditorConfigOption.java b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/config/EugeneEditorConfigOption.java new file mode 100644 index 0000000..e2eed08 --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/config/EugeneEditorConfigOption.java @@ -0,0 +1,103 @@ +package org.nuiton.eugene.editor.application.config; + +import org.nuiton.config.ApplicationConfig; +import org.nuiton.config.ConfigOptionDef; + +import java.io.File; + +import static org.nuiton.i18n.I18n.n; + +/** + * Created on 15/09/16. + * + * @author Tony Chemit - chemit@codelutin.com + */ +public enum EugeneEditorConfigOption implements ConfigOptionDef { + + /** le nom du fichier de configuration (sans le prefix .) */ + CONFIG_FILE( + String.class, ApplicationConfig.CONFIG_FILE_NAME, + n("eugene.editor.config.configFileName.description"), + null + ), + /** le repertoire de stoquage local */ + WORKING_DIRECTORY( + File.class, "eugene.editor.working.directory", + n("eugene.editor.config.workingDirectory.description"), + null + ), + /** le repertoire de stoquage local */ + MODEL_EXTENSION_FILE( + File.class, "eugene.editor.modelExtensionFile", + n("eugene.editor.config.modelExtensionFile.description"), + null + ); + + + /** + * Clef qui represente l'option (c'est celle enregistrée dans le fichier de + * configuration). + */ + protected final String key; + + /** Clef i18n de description de l'option */ + protected final String description; + + /** Type de l'option */ + protected final Class<?> type; + + /** Valeur par défaut de l'option */ + protected String defaultValue; + + EugeneEditorConfigOption(Class<?> type, String key, String description, String defaultValue) { + this.key = key; + this.description = description; + this.type = type; + this.defaultValue = defaultValue; + } + + @Override + public String getKey() { + return key; + } + + @Override + public String getDescription() { + return description; + } + + @Override + public Class<?> getType() { + return type; + } + + @Override + public String getDefaultValue() { + return defaultValue; + } + + @Override + public boolean isTransient() { + // pour le moment on ne sauvegarde rien + return true; + } + + @Override + public boolean isFinal() { + return false; + } + + @Override + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + } + + @Override + public void setTransient(boolean b) { + } + + @Override + public void setFinal(boolean b) { + } + +} diff --git a/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/EugeneEditorCommon.jcss b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/EugeneEditorCommon.jcss new file mode 100644 index 0000000..a133fec --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/EugeneEditorCommon.jcss @@ -0,0 +1,26 @@ + +JToolBar { + borderPainted:false; + floatable:false; + opaque:false; +} + +JTabbedPane { + _notBlocking: true; +} + +FilterableDoubleList { + showDecorator:false; + showReset:true; + showSelectPopupEnabled: true; + filterable:false; + _notBlocking: true; +} + +BeanComboBox { + showReset:true; +} + +BlockingLayerUI { + acceptedComponentTypes: {javax.swing.JScrollBar.class}; +} diff --git a/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/EugeneEditorUI.jaxx b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/EugeneEditorUI.jaxx new file mode 100644 index 0000000..6b22f17 --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/EugeneEditorUI.jaxx @@ -0,0 +1,92 @@ +<JFrame id='mainFrame' width='800' height='800' onWindowClosing='new QuitApplicationAction(this).actionPerformed(null)'> + + <import> + + jaxx.runtime.swing.CardLayout2 + jaxx.runtime.swing.CardLayout2Ext + jaxx.runtime.swing.BlockingLayerUI + jaxx.runtime.swing.StatusMessagePanel + jaxx.runtime.validator.swing.SwingValidatorMessageTableModel + + org.nuiton.eugene.editor.application.ui.actions.ChangeApplicationLocaleAction + org.nuiton.eugene.editor.application.ui.actions.CloseProjectAction + org.nuiton.eugene.editor.application.ui.actions.GotoSiteAction + org.nuiton.eugene.editor.application.ui.actions.OpenProjectAction + org.nuiton.eugene.editor.application.ui.actions.QuitApplicationAction + org.nuiton.eugene.editor.application.ui.actions.ShowAboutAction + org.nuiton.eugene.editor.application.ui.actions.ShowConfigAction + + org.jdesktop.swingx.JXTitledPanel + + java.util.Locale + + javax.swing.BoxLayout + javax.swing.JComponent + javax.swing.UIManager + javax.swing.Icon + + </import> + + <Boolean id='busy' javaBean='false'/> + <EugeneEditorUIMode id='mode' javaBean="EugeneEditorUIMode.PROJECT"/> + + <CardLayout2 id='contentLayout'/> + <CardLayout2Ext id='bodyLayout' constructorParams='this, "body"'/> + <BlockingLayerUI id='busyBlockLayerUI'/> + + <!-- menu --> + <JMenuBar id='menu'> + + <JMenu id='menuFile'> + <JMenuItem id='menuFileOpenProject'/> + <JMenuItem id='menuFileCloseProject'/> + <JMenuItem id='menuFileQuitApplication'/> + </JMenu> + + <JMenu id='menuConfiguration'> + <JMenu id='menuLanguage'> + <JMenuItem id='menuLanguageUK'/> + <JMenuItem id='menuLanguageFR'/> + </JMenu> + <JSeparator/> + <JMenuItem id='menuShowConfiguration'/> + </JMenu> + + <JMenu id='menuHelp'> + <JMenuItem id='menuHelpSite'/> + <JMenuItem id='menuHelpAbout'/> + </JMenu> + + </JMenuBar> + + <JPanel id='body' constraints="BorderLayout.CENTER" decorator='boxed'> + + <JSplitPane id='projectPane' constraints="EugeneEditorUIMode.PROJECT.name()"> + + <JXTitledPanel id='projectNavigationView'> + <JScrollPane id='projectNavigationScrollPane'> + <!--columnHeaderView='{navigationTreeHeader}'>--> + <JTree id="projectNavigation"/> + <!--<BeanTreeHeader id='navigationTreeHeader' tree='{navigation}'/>--> + </JScrollPane> + </JXTitledPanel> + + <JSplitPane id='splitpane2'> + + <JPanel id="content"/> + + <JXTitledPanel id='messageView'> + <JScrollPane> + <JTable id='errorTable'/> + </JScrollPane> + </JXTitledPanel> + + </JSplitPane> + + </JSplitPane> + + </JPanel> + + <StatusMessagePanel id='status' constraints="BorderLayout.SOUTH"/> + +</JFrame> \ No newline at end of file diff --git a/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/EugeneEditorUI.jcss b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/EugeneEditorUI.jcss new file mode 100644 index 0000000..e395457 --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/EugeneEditorUI.jcss @@ -0,0 +1,174 @@ +/* + * #%L + * ObServe :: Swing + * %% + * Copyright (C) 2008 - 2010 IRD, Codelutin, Tony Chemit + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +JToolBar { + borderPainted: false; + floatable: false; + opaque: false; +} + +JSplitPane { + oneTouchExpandable: true; + continuousLayout: false; + dividerSize: 6; +} + +#mainFrame { + defaultCloseOperation: "do_nothing_on_close"; + /*iconImage: {SwingUtil.createImageIcon("logo-OT_web.png").getImage()};*/ +} + +#menu { + enabled: {!isBusy()}; +} + +#menuFile { + text: "eugene.editor.menu.file"; + mnemonic: F; + /*enabled: {getHandler().acceptMode(getMode(), !isBusy(), !isMainFromSynchro(), ObserveUIMode.NO_DB, ObserveUIMode.DB)};*/ +} + +#menuFileOpenProject { + action: {new OpenProjectAction(this)}; +} + +#menuFileCloseProject { + action: {new CloseProjectAction(this)}; +} + +#menuFileQuitApplication { + action: {new QuitApplicationAction(this)}; +} + + +#menuConfiguration { + text: "eugene.editor.menu.configuration"; + toolTipText: "eugene.editor.menu.configuration.tip"; + mnemonic: C; + /*enabled: {getHandler().acceptMode(getMode(), !isBusy(), !isMainFromSynchro(), ObserveUIMode.DB, ObserveUIMode.NO_DB)};*/ +} + +#menuShowConfiguration { + action: {new ShowConfigAction(this)}; +} + +#menuLanguage { + text: "eugene.editor.menu.locale"; + toolTipText: "eugene.editor.menu.locale"; + actionIcon: "translate"; + mnemonic: L; + /*enabled: {getHandler().acceptMode(getMode(), !isBusy(), !isMainFromSynchro(), ObserveUIMode.DB, ObserveUIMode.NO_DB)};*/ +} + +#menuLanguageFR { + action: {new ChangeApplicationLocaleAction(this, Locale.FRANCE, t("eugene.editor.action.locale.fr"), t("eugene.editor.action.locale.fr.tip"))}; + /*enabled: {!getHandler().acceptLocale(getConfig().getLocale(), "fr_FR")};*/ +} + +#menuLanguageUK { + action: {new ChangeApplicationLocaleAction(this, Locale.UK, t("eugene.editor.action.locale.uk"), t("eugene.editor.action.locale.uk.tip"))}; + /*enabled: {!getHandler().acceptLocale(getConfig().getLocale(), "en_GB")};*/ +} + +#menuHelp { + text: "eugene.editor.menu.help"; + mnemonic: A; + enabled: {!isBusy()}; +} + +#menuHelpSite { + action: {new GotoSiteAction(this)}; +} + +#menuHelpAbout { + action: {new ShowAboutAction(this)}; +} + +#errorTable { + rowSelectionAllowed: true; + autoCreateRowSorter: true; + autoResizeMode: 2; + cellSelectionEnabled: false; + selectionMode: 0; + minimumSize: {SwingUtil.newMinDimension()}; + model: {getContextValue(SwingValidatorMessageTableModel.class)}; +} + +#busyBlockLayerUI { + useIcon: false; + blockingColor: {UIManager.getColor("BlockingLayerUI.blockingColor")}; + block: {isBusy()}; + /*acceptedComponentNames: {SwingUtil.ACCEPTABLE_COMPONENTS};*/ +} + +#projectPane { + orientation: {JSplitPane.HORIZONTAL_SPLIT}; + resizeWeight: 1.0; +} + +#splitpane2 { + orientation: {JSplitPane.VERTICAL_SPLIT}; + resizeWeight: 0.80; +} + +#contentLayout { + useOnlyVisibleComponentDimension: true; +} + +#projectNavigationView { + title: "eugene.editor.title.view.navigation"; +} + +#projectNavigation { + rootVisible: false; + largeModel: true; + minimumSize: {SwingUtil.newMinDimension()}; + font-size:11; + /*model: {getTreeHelper().getModel()}; + selectionModel: {getTreeHelper().newNavigationSelectionModel()}; + cellRenderer: {new NavigationTreeCellRenderer()};*/ +} + +#projectNavigationTreeHeader { + showSelectActions: false; +} + +#messageView { + title: "eugene.editor.view.message"; +} + +#bodyLayout { + selected: {getMode().name()}; +} + +#body { + layout: {bodyLayout}; +} + +#content { + layout: {contentLayout}; +} + +#status { + showBusy: {true}; + busy: {isBusy()}; +} diff --git a/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/EugeneEditorUIHandler.java b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/EugeneEditorUIHandler.java new file mode 100644 index 0000000..dcf9793 --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/EugeneEditorUIHandler.java @@ -0,0 +1,26 @@ +package org.nuiton.eugene.editor.application.ui; + +import jaxx.runtime.spi.UIHandler; +import jaxx.runtime.validator.swing.SwingValidatorMessageTableModel; + +/** + * Created on 16/09/16. + * + * @author Tony Chemit - chemit@codelutin.com + * @since 3.0 + */ +public class EugeneEditorUIHandler implements UIHandler<EugeneEditorUI> { + + @Override + public void beforeInit(EugeneEditorUI ui) { + + SwingValidatorMessageTableModel errorModel = new SwingValidatorMessageTableModel(); + ui.setContextValue(errorModel); + + } + + @Override + public void afterInit(EugeneEditorUI ui) { + + } +} diff --git a/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/EugeneEditorUIMode.java b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/EugeneEditorUIMode.java new file mode 100644 index 0000000..918d895 --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/EugeneEditorUIMode.java @@ -0,0 +1,11 @@ +package org.nuiton.eugene.editor.application.ui; + +/** + * Created on 16/09/16. + * + * @author Tony Chemit - chemit@codelutin.com + */ +public enum EugeneEditorUIMode { + + PROJECT, CONFIG +} diff --git a/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/ActionSupport.java b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/ActionSupport.java new file mode 100644 index 0000000..e41bbe6 --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/ActionSupport.java @@ -0,0 +1,23 @@ +package org.nuiton.eugene.editor.application.ui.actions; + +import org.nuiton.eugene.editor.application.ui.EugeneEditorUI; + +import javax.swing.AbstractAction; + +/** + * Created on 16/09/16. + * + * @author Tony Chemit - chemit@codelutin.com + */ +public abstract class ActionSupport extends AbstractAction { + + private final EugeneEditorUI ui; + + public ActionSupport(EugeneEditorUI ui) { + this.ui = ui; + } + + protected EugeneEditorUI getUi() { + return ui; + } +} diff --git a/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/ChangeApplicationLocaleAction.java b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/ChangeApplicationLocaleAction.java new file mode 100644 index 0000000..62ce479 --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/ChangeApplicationLocaleAction.java @@ -0,0 +1,53 @@ +package org.nuiton.eugene.editor.application.ui.actions; + +import jaxx.runtime.SwingUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.nuiton.eugene.editor.application.EugeneEditorApplicationContext; +import org.nuiton.eugene.editor.application.config.EugeneEditorConfig; +import org.nuiton.eugene.editor.application.ui.EugeneEditorUI; + +import java.awt.event.ActionEvent; +import java.util.Locale; + +/** + * Created on 16/09/16. + * + * @author Tony Chemit - chemit@codelutin.com + */ +public class ChangeApplicationLocaleAction extends ActionSupport { + + /** Logger. */ + private static final Log log = LogFactory.getLog(ChangeApplicationLocaleAction.class); + + private final Locale newLocale; + + public ChangeApplicationLocaleAction(EugeneEditorUI ui, Locale newLocale, String name, String description) { + super(ui); + this.newLocale = newLocale; + putValue(NAME, name); + putValue(SMALL_ICON, SwingUtil.getUIManagerActionIcon("i18n-" + newLocale.getLanguage())); + putValue(SHORT_DESCRIPTION, description); + putValue(MNEMONIC_KEY, (int) newLocale.getLanguage().toUpperCase().charAt(0)); + + } + + @Override + public void actionPerformed(ActionEvent e) { + + if (log.isInfoEnabled()) { + log.info("Changing application language..."); + } + boolean canContinue = true; + if (canContinue) { + + EugeneEditorConfig config = EugeneEditorApplicationContext.getInstance().getConfig(); + + // sauvegarde de la nouvelle locale + //config.setLocale(newLocale); + + //ObserveUICallback.ui.run(); + } + + } +} diff --git a/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/CloseProjectAction.java b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/CloseProjectAction.java new file mode 100644 index 0000000..196fae0 --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/CloseProjectAction.java @@ -0,0 +1,29 @@ +package org.nuiton.eugene.editor.application.ui.actions; + +import jaxx.runtime.SwingUtil; +import org.nuiton.eugene.editor.application.ui.EugeneEditorUI; + +import java.awt.event.ActionEvent; + +import static org.nuiton.i18n.I18n.t; + +/** + * Created on 16/09/16. + * + * @author Tony Chemit - chemit@codelutin.com + */ +public class CloseProjectAction extends ActionSupport { + + public CloseProjectAction(EugeneEditorUI ui) { + super(ui); + putValue(NAME, t("eugene.editor.action.closeProject")); + putValue(SMALL_ICON, SwingUtil.getUIManagerActionIcon("closeProject")); + putValue(SHORT_DESCRIPTION, t("eugene.editor.action.closeProject.tip")); + putValue(MNEMONIC_KEY, (int) 'f'); + } + + @Override + public void actionPerformed(ActionEvent e) { + + } +} diff --git a/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/GotoSiteAction.java b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/GotoSiteAction.java new file mode 100644 index 0000000..bd738ab --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/GotoSiteAction.java @@ -0,0 +1,29 @@ +package org.nuiton.eugene.editor.application.ui.actions; + +import jaxx.runtime.SwingUtil; +import org.nuiton.eugene.editor.application.ui.EugeneEditorUI; + +import java.awt.event.ActionEvent; + +import static org.nuiton.i18n.I18n.t; + +/** + * Created on 16/09/16. + * + * @author Tony Chemit - chemit@codelutin.com + */ +public class GotoSiteAction extends ActionSupport { + + public GotoSiteAction(EugeneEditorUI ui) { + super(ui); + putValue(NAME, t("eugene.editor.action.site")); + putValue(SMALL_ICON, SwingUtil.getUIManagerActionIcon("site")); + putValue(SHORT_DESCRIPTION, t("eugene.editor.action.site.tip")); + putValue(MNEMONIC_KEY, (int) 's'); + } + + @Override + public void actionPerformed(ActionEvent e) { + + } +} diff --git a/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/OpenProjectAction.java b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/OpenProjectAction.java new file mode 100644 index 0000000..bf05d40 --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/OpenProjectAction.java @@ -0,0 +1,29 @@ +package org.nuiton.eugene.editor.application.ui.actions; + +import jaxx.runtime.SwingUtil; +import org.nuiton.eugene.editor.application.ui.EugeneEditorUI; + +import java.awt.event.ActionEvent; + +import static org.nuiton.i18n.I18n.t; + +/** + * Created on 16/09/16. + * + * @author Tony Chemit - chemit@codelutin.com + */ +public class OpenProjectAction extends ActionSupport { + + public OpenProjectAction(EugeneEditorUI ui) { + super(ui); + putValue(NAME, t("eugene.editor.action.openProject")); + putValue(SMALL_ICON, SwingUtil.getUIManagerActionIcon("openProject")); + putValue(SHORT_DESCRIPTION, t("eugene.editor.action.openProject.tip")); + putValue(MNEMONIC_KEY, (int) 'o'); + } + + @Override + public void actionPerformed(ActionEvent e) { + + } +} diff --git a/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/QuitApplicationAction.java b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/QuitApplicationAction.java new file mode 100644 index 0000000..4e41013 --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/QuitApplicationAction.java @@ -0,0 +1,33 @@ +package org.nuiton.eugene.editor.application.ui.actions; + +import jaxx.runtime.SwingUtil; +import org.nuiton.eugene.editor.application.EugeneEditorApplicationContext; +import org.nuiton.eugene.editor.application.ui.EugeneEditorUI; + +import java.awt.event.ActionEvent; + +import static org.nuiton.i18n.I18n.t; + +/** + * Created on 16/09/16. + * + * @author Tony Chemit - chemit@codelutin.com + */ +public class QuitApplicationAction extends ActionSupport { + + public QuitApplicationAction(EugeneEditorUI ui) { + super(ui); + putValue(NAME, t("eugene.editor.action.exit")); + putValue(SMALL_ICON, SwingUtil.getUIManagerActionIcon("exit")); + putValue(SHORT_DESCRIPTION, t("eugene.editor.action.exit.tip")); + putValue(MNEMONIC_KEY, (int) 'q'); + } + + @Override + public void actionPerformed(ActionEvent e) { + + getUi().dispose(); + + EugeneEditorApplicationContext.getInstance().unlock(); + } +} diff --git a/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/ShowAboutAction.java b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/ShowAboutAction.java new file mode 100644 index 0000000..7809f40 --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/ShowAboutAction.java @@ -0,0 +1,29 @@ +package org.nuiton.eugene.editor.application.ui.actions; + +import jaxx.runtime.SwingUtil; +import org.nuiton.eugene.editor.application.ui.EugeneEditorUI; + +import java.awt.event.ActionEvent; + +import static org.nuiton.i18n.I18n.t; + +/** + * Created on 16/09/16. + * + * @author Tony Chemit - chemit@codelutin.com + */ +public class ShowAboutAction extends ActionSupport { + + public ShowAboutAction(EugeneEditorUI ui) { + super(ui); + putValue(NAME, t("eugene.editor.action.showAbout")); + putValue(SMALL_ICON, SwingUtil.getUIManagerActionIcon("about")); + putValue(SHORT_DESCRIPTION, t("eugene.editor.action.showAbout.tip")); + putValue(MNEMONIC_KEY, (int) 'p'); + } + + @Override + public void actionPerformed(ActionEvent e) { + + } +} diff --git a/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/ShowConfigAction.java b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/ShowConfigAction.java new file mode 100644 index 0000000..2801781 --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/application/ui/actions/ShowConfigAction.java @@ -0,0 +1,29 @@ +package org.nuiton.eugene.editor.application.ui.actions; + +import jaxx.runtime.SwingUtil; +import org.nuiton.eugene.editor.application.ui.EugeneEditorUI; + +import java.awt.event.ActionEvent; + +import static org.nuiton.i18n.I18n.t; + +/** + * Created on 16/09/16. + * + * @author Tony Chemit - chemit@codelutin.com + */ +public class ShowConfigAction extends ActionSupport { + + public ShowConfigAction(EugeneEditorUI ui) { + super(ui); + putValue(NAME, t("eugene.editor.action.showConfig")); + putValue(SMALL_ICON, SwingUtil.getUIManagerActionIcon("config")); + putValue(SHORT_DESCRIPTION, t("eugene.editor.action.showConfig.tip")); + putValue(MNEMONIC_KEY, (int) 'c'); + } + + @Override + public void actionPerformed(ActionEvent e) { + + } +} diff --git a/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/plugin/EugeneEditorMojo.java b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/plugin/EugeneEditorMojo.java new file mode 100644 index 0000000..34d28e4 --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/java/org/nuiton/eugene/editor/plugin/EugeneEditorMojo.java @@ -0,0 +1,178 @@ +package org.nuiton.eugene.editor.plugin; + +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.plugins.annotations.ResolutionScope; +import org.apache.maven.project.MavenProject; +import org.nuiton.eugene.ModelReader; +import org.nuiton.eugene.editor.application.EugeneEditorApplicationContext; +import org.nuiton.eugene.editor.application.config.EugeneEditorConfig; +import org.nuiton.eugene.editor.application.ui.EugeneEditorUI; +import org.nuiton.eugene.models.object.ObjectModel; +import org.nuiton.eugene.models.object.reader.extension.LoadModelExtension; +import org.nuiton.eugene.models.stereotype.AggregateStereotypeDefinitionProvider; +import org.nuiton.eugene.models.stereotype.StereotypeDefinitionProvider; +import org.nuiton.eugene.models.stereotype.StereotypeDefinitionProviders; +import org.nuiton.eugene.models.tagvalue.AggregateTagValueDefinitionProvider; +import org.nuiton.eugene.models.tagvalue.TagValueDefinitionProvider; +import org.nuiton.eugene.models.tagvalue.TagValueDefinitionProviders; +import org.nuiton.plugin.AbstractPlugin; + +import javax.swing.SwingUtilities; +import java.io.File; +import java.net.URLClassLoader; +import java.util.Map; + +/** + * Laucnh the editor on models detected in project. + * + * Created on 16/09/16. + * + * @author Tony Chemit - chemit@codelutin.com + * @since 3.0 + */ +@Mojo(name = "run", requiresDependencyResolution = ResolutionScope.RUNTIME) +public class EugeneEditorMojo extends AbstractPlugin { + + /** + * Pour activer le mode verbeux. + */ + @Parameter(property = "eugene.verbose", defaultValue = "${maven.verbose}") + protected boolean verbose; + + /** + * Encoding to be used for generation of files. + */ + @Parameter(property = "eugene.encoding", defaultValue = "${project.build.sourceEncoding}") + protected String encoding; + + /** + * The source directory where to scan options java file. + */ + @Parameter(property = "eugene.sourceDirectory", defaultValue = "${basedir}/src/main/xmi", required = true) + private File sourceDirectory; + + /** + * The source directory where to scan options java file. + */ + @Parameter(property = "eugene.generatedSourceDirectory", defaultValue = "${project.build.directory}/generated-sources/models", required = true) + private File generatedSourceDirectory; + + /** + * The source directory where to scan options java file. + */ + @Parameter(property = "eugene.workingDirectory", defaultValue = "${project.build.directory}/eugeneEditor", required = true) + private File workingDirectory; + + /** + * Maven project. + */ + @Parameter(defaultValue = "${project}", readonly = true) + protected MavenProject project; + + /** + * All available tag value providers introspects via plexus. + */ + @Component(role = TagValueDefinitionProvider.class) + protected Map<String, TagValueDefinitionProvider> tagValueDefinitionProviders; + + /** + * All available stereotype providers introspects via plexus. + */ + @Component(role = StereotypeDefinitionProvider.class) + protected Map<String, StereotypeDefinitionProvider> stereotypeDefinitionProviders; + + @Component(hint = "xmlobjectmodel") + protected ModelReader modelReader; + + protected ObjectModel model; + protected AggregateTagValueDefinitionProvider tagValueDefinitionProvider; + protected AggregateStereotypeDefinitionProvider stereotypeDefinitionProvider; + protected ClassLoader contextClassLoader; + protected URLClassLoader classLoader; + + @Override + protected void init() throws Exception { + + contextClassLoader = Thread.currentThread().getContextClassLoader(); + classLoader = initClassLoader(getProject(), generatedSourceDirectory, true, false, false, true, true); + + tagValueDefinitionProvider = TagValueDefinitionProviders.newProvider(tagValueDefinitionProviders.values(), verbose); + stereotypeDefinitionProvider = StereotypeDefinitionProviders.newProvider(stereotypeDefinitionProviders.values(), verbose); + + modelReader.setVerbose(verbose); + modelReader.setTagValueDefinitionProvider(tagValueDefinitionProvider); + modelReader.setStereotypeDefinitionProvider(stereotypeDefinitionProvider); + + File[] files = generatedSourceDirectory.listFiles(f -> f.getName().endsWith(".objectmodel")); + if (files != null) { + + getLog().info("Found " + files.length + " model file(s)."); + model = (ObjectModel) modelReader.read(files); + } + + LoadModelExtension<ObjectModel> loadModelExtension = new LoadModelExtension<>(verbose, false, model); + + File[] extensionFiles = sourceDirectory.listFiles(f -> f.getName().endsWith(".objectmodel-ext")); + if (extensionFiles != null) { + + getLog().info("Found " + extensionFiles.length + " model extension file(s)."); + + for (File file : extensionFiles) { + getLog().info("Loading extension file: " + file); + loadModelExtension.load(file); + } + + } + + } + + @Override + protected void doAction() throws Exception { + + Thread.currentThread().setContextClassLoader(classLoader); + try { + + EugeneEditorConfig config = new EugeneEditorConfig(); + config.setWorkingDirectory(workingDirectory); + EugeneEditorApplicationContext applicationContext = new EugeneEditorApplicationContext( + config, + classLoader, + tagValueDefinitionProvider, + stereotypeDefinitionProvider, + model); + + EugeneEditorApplicationContext.setInstance(applicationContext); + + SwingUtilities.invokeLater(() -> new EugeneEditorUI().setVisible(true)); + + applicationContext.lock(); + + + } finally { + + Thread.currentThread().setContextClassLoader(contextClassLoader); + } + } + + @Override + public boolean isVerbose() { + return verbose; + } + + @Override + public void setVerbose(boolean verbose) { + this.verbose = verbose; + } + + @Override + public MavenProject getProject() { + return project; + } + + @Override + public void setProject(MavenProject project) { + this.project = project; + } +} diff --git a/eugene-editor-maven-plugin/src/main/resources/i18n/eugene-editor-maven-plugin_en_GB.properties b/eugene-editor-maven-plugin/src/main/resources/i18n/eugene-editor-maven-plugin_en_GB.properties new file mode 100644 index 0000000..b6f268a --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/resources/i18n/eugene-editor-maven-plugin_en_GB.properties @@ -0,0 +1,27 @@ +eugene.editor.action.closeProject=Close project +eugene.editor.action.closeProject.tip=Close project +eugene.editor.action.exit=Quit +eugene.editor.action.exit.tip=Quit editor +eugene.editor.action.locale.fr=FR +eugene.editor.action.locale.fr.tip=French +eugene.editor.action.locale.uk=EN +eugene.editor.action.locale.uk.tip=English +eugene.editor.action.openProject=Open project +eugene.editor.action.openProject.tip=Open project +eugene.editor.action.showAbout=About +eugene.editor.action.showAbout.tip=About +eugene.editor.action.showConfig=Config +eugene.editor.action.showConfig.tip=Open config +eugene.editor.action.site=Site +eugene.editor.action.site.tip=Go to site +eugene.editor.config.configFileName.description=Configuration file +eugene.editor.config.workingDirectory.description=Data directory +eugene.editor.config.modelExtensionFile.description=PRoject in edition +eugene.editor.menu.configuration=Configuration +eugene.editor.menu.configuration.tip=Configuration +eugene.editor.menu.file=File +eugene.editor.menu.help=Help +eugene.editor.menu.locale=Languages +eugene.editor.message.no.project.loaded=< No project open > +eugene.editor.title.view.navigation=Navigation +eugene.editor.view.message=Messages diff --git a/eugene-editor-maven-plugin/src/main/resources/i18n/eugene-editor-maven-plugin_fr_FR.properties b/eugene-editor-maven-plugin/src/main/resources/i18n/eugene-editor-maven-plugin_fr_FR.properties new file mode 100644 index 0000000..156c497 --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/resources/i18n/eugene-editor-maven-plugin_fr_FR.properties @@ -0,0 +1,27 @@ +eugene.editor.action.closeProject=Fermer le projet +eugene.editor.action.closeProject.tip=Fermer le projet +eugene.editor.action.exit=Quitter +eugene.editor.action.exit.tip=Quitter l'éditeur +eugene.editor.action.locale.fr=FR +eugene.editor.action.locale.fr.tip=Français +eugene.editor.action.locale.uk=EN +eugene.editor.action.locale.uk.tip=Anglais +eugene.editor.action.openProject=Ouvrir un projet +eugene.editor.action.openProject.tip=Ouvrir un projet +eugene.editor.action.showAbout=À propos +eugene.editor.action.showAbout.tip=À propos +eugene.editor.action.showConfig=Préférences +eugene.editor.action.showConfig.tip=Préférences +eugene.editor.action.site=Site web +eugene.editor.action.site.tip=Accéder au site web de l'éditeur +eugene.editor.config.configFileName.description=Fichier de configuration +eugene.editor.config.workingDirectory.description=Répertoire de données de l'application +eugene.editor.config.modelExtensionFile.description=Fichier en cours d'édition +eugene.editor.menu.configuration=Configuration +eugene.editor.menu.configuration.tip=Configuration +eugene.editor.menu.file=Fichier +eugene.editor.menu.help=Aide +eugene.editor.menu.locale=Langues +eugene.editor.message.no.project.loaded=< Aucun projet ouvert > +eugene.editor.title.view.navigation=Navigation +eugene.editor.view.message=Messages diff --git a/eugene-editor-maven-plugin/src/main/resources/icons/action-about.png b/eugene-editor-maven-plugin/src/main/resources/icons/action-about.png new file mode 100644 index 0000000..0d826bb Binary files /dev/null and b/eugene-editor-maven-plugin/src/main/resources/icons/action-about.png differ diff --git a/eugene-editor-maven-plugin/src/main/resources/icons/action-cancel.png b/eugene-editor-maven-plugin/src/main/resources/icons/action-cancel.png new file mode 100644 index 0000000..c149c2b Binary files /dev/null and b/eugene-editor-maven-plugin/src/main/resources/icons/action-cancel.png differ diff --git a/eugene-editor-maven-plugin/src/main/resources/icons/action-close.png b/eugene-editor-maven-plugin/src/main/resources/icons/action-close.png new file mode 100644 index 0000000..2541d2b Binary files /dev/null and b/eugene-editor-maven-plugin/src/main/resources/icons/action-close.png differ diff --git a/eugene-editor-maven-plugin/src/main/resources/icons/action-collapse.png b/eugene-editor-maven-plugin/src/main/resources/icons/action-collapse.png new file mode 100644 index 0000000..f88a24a Binary files /dev/null and b/eugene-editor-maven-plugin/src/main/resources/icons/action-collapse.png differ diff --git a/eugene-editor-maven-plugin/src/main/resources/icons/action-config.png b/eugene-editor-maven-plugin/src/main/resources/icons/action-config.png new file mode 100644 index 0000000..9460dfc Binary files /dev/null and b/eugene-editor-maven-plugin/src/main/resources/icons/action-config.png differ diff --git a/eugene-editor-maven-plugin/src/main/resources/icons/action-exit.png b/eugene-editor-maven-plugin/src/main/resources/icons/action-exit.png new file mode 100644 index 0000000..a77152b Binary files /dev/null and b/eugene-editor-maven-plugin/src/main/resources/icons/action-exit.png differ diff --git a/eugene-editor-maven-plugin/src/main/resources/icons/action-expand.png b/eugene-editor-maven-plugin/src/main/resources/icons/action-expand.png new file mode 100644 index 0000000..3c19e48 Binary files /dev/null and b/eugene-editor-maven-plugin/src/main/resources/icons/action-expand.png differ diff --git a/eugene-editor-maven-plugin/src/main/resources/icons/action-fileChooser.png b/eugene-editor-maven-plugin/src/main/resources/icons/action-fileChooser.png new file mode 100755 index 0000000..523a651 Binary files /dev/null and b/eugene-editor-maven-plugin/src/main/resources/icons/action-fileChooser.png differ diff --git a/eugene-editor-maven-plugin/src/main/resources/icons/action-help.png b/eugene-editor-maven-plugin/src/main/resources/icons/action-help.png new file mode 100755 index 0000000..4ed65a9 Binary files /dev/null and b/eugene-editor-maven-plugin/src/main/resources/icons/action-help.png differ diff --git a/eugene-editor-maven-plugin/src/main/resources/icons/action-i18n-en.png b/eugene-editor-maven-plugin/src/main/resources/icons/action-i18n-en.png new file mode 100644 index 0000000..ff701e1 Binary files /dev/null and b/eugene-editor-maven-plugin/src/main/resources/icons/action-i18n-en.png differ diff --git a/eugene-editor-maven-plugin/src/main/resources/icons/action-i18n-fr.png b/eugene-editor-maven-plugin/src/main/resources/icons/action-i18n-fr.png new file mode 100644 index 0000000..8332c4e Binary files /dev/null and b/eugene-editor-maven-plugin/src/main/resources/icons/action-i18n-fr.png differ diff --git a/eugene-editor-maven-plugin/src/main/resources/icons/action-i18n-uk.png b/eugene-editor-maven-plugin/src/main/resources/icons/action-i18n-uk.png new file mode 100644 index 0000000..ff701e1 Binary files /dev/null and b/eugene-editor-maven-plugin/src/main/resources/icons/action-i18n-uk.png differ diff --git a/eugene-editor-maven-plugin/src/main/resources/icons/action-save.png b/eugene-editor-maven-plugin/src/main/resources/icons/action-save.png new file mode 100644 index 0000000..41b3f43 Binary files /dev/null and b/eugene-editor-maven-plugin/src/main/resources/icons/action-save.png differ diff --git a/eugene-editor-maven-plugin/src/main/resources/icons/action-select.png b/eugene-editor-maven-plugin/src/main/resources/icons/action-select.png new file mode 100644 index 0000000..bbee129 Binary files /dev/null and b/eugene-editor-maven-plugin/src/main/resources/icons/action-select.png differ diff --git a/eugene-editor-maven-plugin/src/main/resources/icons/action-site.png b/eugene-editor-maven-plugin/src/main/resources/icons/action-site.png new file mode 100644 index 0000000..ac5957a Binary files /dev/null and b/eugene-editor-maven-plugin/src/main/resources/icons/action-site.png differ diff --git a/eugene-editor-maven-plugin/src/main/resources/icons/action-translate.png b/eugene-editor-maven-plugin/src/main/resources/icons/action-translate.png new file mode 100644 index 0000000..63ce64d Binary files /dev/null and b/eugene-editor-maven-plugin/src/main/resources/icons/action-translate.png differ diff --git a/eugene-editor-maven-plugin/src/main/resources/icons/action-unselect.png b/eugene-editor-maven-plugin/src/main/resources/icons/action-unselect.png new file mode 100644 index 0000000..3b49008 Binary files /dev/null and b/eugene-editor-maven-plugin/src/main/resources/icons/action-unselect.png differ diff --git a/eugene-editor-maven-plugin/src/main/resources/log4j.properties b/eugene-editor-maven-plugin/src/main/resources/log4j.properties new file mode 100644 index 0000000..647902a --- /dev/null +++ b/eugene-editor-maven-plugin/src/main/resources/log4j.properties @@ -0,0 +1,30 @@ +### +# #%L +# EUGene :: Maven plugin +# %% +# Copyright (C) 2006 - 2010 CodeLutin +# %% +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Lesser Public License for more details. +# +# You should have received a copy of the GNU General Lesser Public +# License along with this program. If not, see +# <http://www.gnu.org/licenses/lgpl-3.0.html>. +# #L% +### +# Global logging configuration +log4j.rootLogger=ERROR, stdout +# Console output... +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) %M - %m%n +# package level +log4j.logger.org.nuiton=WARN +log4j.logger.org.nuiton.eugene.editor=INFO diff --git a/eugene-editor-maven-plugin/src/site/fr/rst/index.rst b/eugene-editor-maven-plugin/src/site/fr/rst/index.rst new file mode 100644 index 0000000..f98996d --- /dev/null +++ b/eugene-editor-maven-plugin/src/site/fr/rst/index.rst @@ -0,0 +1,72 @@ +.. - +.. * #%L +.. * EUGene :: Maven plugin +.. * %% +.. * Copyright (C) 2006 - 2010 CodeLutin +.. * %% +.. * This program is free software: you can redistribute it and/or modify +.. * it under the terms of the GNU Lesser General Public License as +.. * published by the Free Software Foundation, either version 3 of the +.. * License, or (at your option) any later version. +.. * +.. * This program is distributed in the hope that it will be useful, +.. * but WITHOUT ANY WARRANTY; without even the implied warranty of +.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.. * GNU General Lesser Public License for more details. +.. * +.. * You should have received a copy of the GNU General Lesser Public +.. * License along with this program. If not, see +.. * <http://www.gnu.org/licenses/lgpl-3.0.html>. +.. * #L% +.. - + +=================== +Maven-eugene-plugin +=================== + +.. contents:: + +Présentation +------------ + +Le plugin eugene-maven-plugin permet l'utilisation depuis maven de +Eugene. Pour plus de détails sur Eugene veuillez consulter +l'adresse suivante http://doc.nuiton.org/eugene/eugene + +Nouvautés dans la version 2.2 +----------------------------- + +Recherche de fichiers dans le class-path +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Il est possible désormais d'utiliser des fichiers contenus dans le class-path, +que ce soit des modèles zargo, xmi ou model. + +La page d'`usage`_ explique comment cela fonctionne. + +Respect des hiérarchies répertoires +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +On respecte conserve désormais de bout en bout les répertoires relatifs dont +sont extrait les données lors d'un cycle de génération et ceci afin d'éviter +toute collision de noms de fichiers et mieux s'y retrouver. + +Meilleure copie des ressources +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +L'algorithme de recopie des rsesources a été revu et est désormais spécifique à +chaque type de writer. + +Globalement, pour tous les writers fournis par le plugin, à chaque fichier +à traiter par un writer, on y associe un fichier de properties du même nom. + +Ce mécanisme n'est pas actuellement extensible mais pourrait le devenir si le +besoin est présent. + +Utilisation dans le pom.xml +--------------------------- + +Voir la `page`_ de détail des goals ou bien la page d'`usage`_ des goals. + +.. _page: plugin-info.html +.. _usage: usage.html diff --git a/eugene-editor-maven-plugin/src/site/rst/index.rst b/eugene-editor-maven-plugin/src/site/rst/index.rst new file mode 100644 index 0000000..e970fe1 --- /dev/null +++ b/eugene-editor-maven-plugin/src/site/rst/index.rst @@ -0,0 +1,44 @@ +.. - +.. * #%L +.. * EUGene :: Maven plugin +.. * %% +.. * Copyright (C) 2006 - 2010 CodeLutin +.. * %% +.. * This program is free software: you can redistribute it and/or modify +.. * it under the terms of the GNU Lesser General Public License as +.. * published by the Free Software Foundation, either version 3 of the +.. * License, or (at your option) any later version. +.. * +.. * This program is distributed in the hope that it will be useful, +.. * but WITHOUT ANY WARRANTY; without even the implied warranty of +.. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.. * GNU General Lesser Public License for more details. +.. * +.. * You should have received a copy of the GNU General Lesser Public +.. * License along with this program. If not, see +.. * <http://www.gnu.org/licenses/lgpl-3.0.html>. +.. * #L% +.. - + +=================== +Maven-eugene-plugin +=================== + +.. contents:: + + +Abstract +-------- + +The *eugene-maven-plugin* permits to use the *EUGene* api from maven. + +For more information about *EUGene* api, see documention here : +http://doc.nuiton.org/eugene/eugene + +Usage in your pom.xml +--------------------- + +See the `details`_ page of goal or the `usage`_ page. + +.. _details: ./plugin-info.html +.. _usage: ./usage.html diff --git a/eugene-editor-maven-plugin/src/site/site_en.xml b/eugene-editor-maven-plugin/src/site/site_en.xml new file mode 100644 index 0000000..28e482f --- /dev/null +++ b/eugene-editor-maven-plugin/src/site/site_en.xml @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + EUGene :: Maven plugin + %% + Copyright (C) 2006 - 2012 CodeLutin, Tony Chemit + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Lesser Public License for more details. + + You should have received a copy of the GNU General Lesser Public + License along with this program. If not, see + <http://www.gnu.org/licenses/lgpl-3.0.html>. + #L% + --> + +<project name="${project.name}" + xmlns="http://maven.apache.org/DECORATION/1.4.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/DECORATION/1.4.0 http://maven.apache.org/xsd/decoration-1.4.0.xsd"> + + <bannerLeft> + <name>${project.name}</name> + </bannerLeft> + + <body> + + <links> + <item name="[fr" href="fr/index.html"/> + <item name="en]" href="index.html"/> + </links> + + <breadcrumbs> + <item name="${project.name}" href="./index.html"/> + </breadcrumbs> + + <menu ref="parent"/> + + <menu name="User"> + <item href="index.html" name="Index"/> + <item href="usage.html" name="Usage"/> + <item href="example.html" name="Examples"/> + <item name="Goals" href="plugin-info.html"> + <item name="generate" href="generate-mojo.html"/> + <item name="available-data" href="available-data-mojo.html"/> + <item name="tag-values-report" href="tag-values-report.html"/> + <item name="stereotypes-report" href="stereotypes-report.html"/> + <item name="help" href="help-mojo.html"/> + </item> + </menu> + + <menu ref="reports"/> + + </body> +</project> diff --git a/eugene-editor-maven-plugin/src/site/site_fr.xml b/eugene-editor-maven-plugin/src/site/site_fr.xml new file mode 100644 index 0000000..21ca847 --- /dev/null +++ b/eugene-editor-maven-plugin/src/site/site_fr.xml @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + #%L + EUGene :: Maven plugin + %% + Copyright (C) 2006 - 2012 CodeLutin, Tony Chemit + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Lesser Public License for more details. + + You should have received a copy of the GNU General Lesser Public + License along with this program. If not, see + <http://www.gnu.org/licenses/lgpl-3.0.html>. + #L% + --> + +<project name="${project.name}" + xmlns="http://maven.apache.org/DECORATION/1.4.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/DECORATION/1.4.0 http://maven.apache.org/xsd/decoration-1.4.0.xsd"> + + <bannerLeft> + <name>${project.name}</name> + </bannerLeft> + + <body> + + <links> + <item name="[fr" href="index.html"/> + <item name="en]" href="../index.html"/> + </links> + + <breadcrumbs> + <item name="${project.name}" href="./index.html"/> + </breadcrumbs> + + <!-- TC-20100117 : ne fonctionne pas sur une langue non principale --> + <!--<menu ref="parent"/>--> + <menu name="Parent Projet"> + <item name="Eugene" href="../../fr/index.html"/> + </menu> + + <menu name="Utilisateur"> + <item href="index.html" name="Accueil"/> + <item href="usage.html" name="Utilisation"/> + <item href="example.html" name="Examples"/> + <item name="Goals" href="plugin-info.html"> + <item name="generate" href="generate-mojo.html"/> + <item name="available-data" href="available-data-mojo.html"/> + <item name="tag-values-report" href="tag-values-report.html"/> + <item name="stereotypes-report" href="stereotypes-report.html"/> + <item name="help" href="help-mojo.html"/> + </item> + </menu> + + <menu ref="reports"/> + + </body> +</project> diff --git a/eugene-maven-plugin/src/main/java/org/nuiton/eugene/plugin/GenerateMojo.java b/eugene-maven-plugin/src/main/java/org/nuiton/eugene/plugin/GenerateMojo.java index a76908c..0bdde81 100644 --- a/eugene-maven-plugin/src/main/java/org/nuiton/eugene/plugin/GenerateMojo.java +++ b/eugene-maven-plugin/src/main/java/org/nuiton/eugene/plugin/GenerateMojo.java @@ -67,7 +67,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; import java.util.ArrayList; -import java.util.Arrays; +import java.util.Collections; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; @@ -929,7 +929,7 @@ public class GenerateMojo extends AbstractPlugin implements ChainedFileWriterCon project.addTestCompileSourceRoot(destDirGen.getPath()); Resource resources = new Resource(); resources.setDirectory(destDirGen.getAbsolutePath()); - resources.setExcludes(Arrays.asList("**/*.java")); + resources.setExcludes(Collections.singletonList("**/*.java")); if (isVerbose()) { getLog().info("Add test resource root :" + resources); } @@ -944,7 +944,7 @@ public class GenerateMojo extends AbstractPlugin implements ChainedFileWriterCon project.addCompileSourceRoot(destDirGen.getPath()); Resource resources = new Resource(); resources.setDirectory(destDirGen.getAbsolutePath()); - resources.setExcludes(Arrays.asList("**/*.java")); + resources.setExcludes(Collections.singletonList("**/*.java")); if (isVerbose()) { getLog().info("Add resource root :" + resources); } diff --git a/pom.xml b/pom.xml index 9b2f645..34a1f59 100644 --- a/pom.xml +++ b/pom.xml @@ -125,6 +125,7 @@ <module>eugene-plantuml-templates</module> <module>eugene-yaml-templates</module> <module>eugene-maven-plugin</module> + <module>eugene-editor-maven-plugin</module> </modules> <scm> @@ -152,6 +153,9 @@ <plexusPluginVersion>1.3.8</plexusPluginVersion> <doxiaVersion>1.6</doxiaVersion> <mavenVersion>3.3.9</mavenVersion> + <jaxxVersion>2.33-SNAPSHOT</jaxxVersion> + <i18nVersion>3.6.2</i18nVersion> + <swingXVersion>1.6.5-1</swingXVersion> <ciViewId>Eugene</ciViewId> <javaVersion>1.7</javaVersion> @@ -450,6 +454,75 @@ <scope>runtime</scope> </dependency> + + <dependency> + <groupId>org.nuiton.jaxx</groupId> + <artifactId>jaxx-runtime</artifactId> + <version>${jaxxVersion}</version> + </dependency> + <dependency> + <groupId>org.nuiton.jaxx</groupId> + <artifactId>jaxx-validator</artifactId> + <version>${jaxxVersion}</version> + </dependency> + <dependency> + <groupId>org.nuiton.jaxx</groupId> + <artifactId>jaxx-widgets</artifactId> + <version>${jaxxVersion}</version> + </dependency> + + <dependency> + <groupId>org.nuiton.jaxx</groupId> + <artifactId>jaxx-widgets-select</artifactId> + <version>${jaxxVersion}</version> + </dependency> + <dependency> + <groupId>org.nuiton.jaxx</groupId> + <artifactId>jaxx-widgets-about</artifactId> + <version>${jaxxVersion}</version> + </dependency> + <dependency> + <groupId>org.nuiton.jaxx</groupId> + <artifactId>jaxx-config</artifactId> + <version>${jaxxVersion}</version> + </dependency> + <dependency> + <groupId>org.nuiton.jaxx</groupId> + <artifactId>jaxx-application-api</artifactId> + <version>${jaxxVersion}</version> + </dependency> + <dependency> + <groupId>org.nuiton.jaxx</groupId> + <artifactId>jaxx-application-swing</artifactId> + <version>${jaxxVersion}</version> + </dependency> + + <dependency> + <groupId>org.swinglabs</groupId> + <artifactId>jxlayer</artifactId> + <version>3.0.4</version> + </dependency> + <dependency> + <groupId>org.swinglabs.swingx</groupId> + <artifactId>swingx-core</artifactId> + <version>${swingXVersion}</version> + </dependency> + <dependency> + <groupId>org.swinglabs.swingx</groupId> + <artifactId>swingx-painters</artifactId> + <version>${swingXVersion}</version> + </dependency> + <dependency> + <groupId>org.swinglabs.swingx</groupId> + <artifactId>swingx-common</artifactId> + <version>${swingXVersion}</version> + </dependency> + <dependency> + <groupId>org.swinglabs.swingx</groupId> + <artifactId>swingx-autocomplete</artifactId> + <version>${swingXVersion}</version> + </dependency> + <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> @@ -499,6 +572,17 @@ </configuration> </plugin> + <plugin> + <groupId>org.nuiton.i18n</groupId> + <artifactId>i18n-maven-plugin</artifactId> + <version>${i18nVersion}</version> + </plugin> + <plugin> + <groupId>org.nuiton.jaxx</groupId> + <artifactId>jaxx-maven-plugin</artifactId> + <version>${jaxxVersion}</version> + </plugin> + </plugins> </pluginManagement> <extensions> @@ -554,5 +638,57 @@ </plugins> </build> </profile> + + <profile> + <id>generate-changelog</id> + <activation> + <property> + <name>performRelease</name> + <value>true</value> + </property> + </activation> + + <properties> + + <redmine.xmlPath>${project.build.directory}/changes/changes.xml</redmine.xmlPath> + </properties> + <build> + <defaultGoal>process-classes</defaultGoal> + <plugins> + + <!-- Generate changelog.txt and attach it to project --> + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>jredmine-maven-plugin</artifactId> + <executions> + <execution> + <id>generate-changes</id> + <goals> + <goal>generate-changes</goal> + </goals> + <phase>process-classes</phase> + <configuration> + <generateOnce>true</generateOnce> + <actionMapping>fix:1, add:2, update:4</actionMapping> + </configuration> + </execution> + <execution> + <id>generate-changelog</id> + <inherited>false</inherited> + <goals> + <goal>generate-changelog</goal> + </goals> + <phase>process-classes</phase> + <configuration> + <attach>true</attach> + </configuration> + </execution> + </executions> + </plugin> + + </plugins> + </build> + </profile> + </profiles> </project> -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.