This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository jaxx. See https://gitlab.nuiton.org/nuiton/jaxx.git commit 4efddf4dcb10018d77814006aebd42e9ec9ad9cd Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Sep 13 14:21:14 2016 +0200 Mise en place de AboutUI dans la démo (See #4024) --- jaxx-demo/pom.xml | 74 ++++++++++++++++++++++ jaxx-demo/src/main/filters/jaxx-demo.properties | 6 +- jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java | 8 --- .../src/main/java/jaxx/demo/DemoUIHandler.java | 50 ++++++++------- .../feature/nav/tree/NavDemoTreeCellRenderer.java | 8 ++- .../main/java/jaxx/demo/tree/DemoCellRenderer.java | 8 ++- .../main/resources/i18n/jaxx-demo_en_GB.properties | 2 +- .../main/resources/i18n/jaxx-demo_es_ES.properties | 2 +- .../main/resources/i18n/jaxx-demo_fr_FR.properties | 2 +- pom.xml | 54 +++++++++++++++- 10 files changed, 168 insertions(+), 46 deletions(-) diff --git a/jaxx-demo/pom.xml b/jaxx-demo/pom.xml index 46e1491..80f1487 100644 --- a/jaxx-demo/pom.xml +++ b/jaxx-demo/pom.xml @@ -92,6 +92,12 @@ <dependency> <groupId>${project.groupId}</groupId> + <artifactId>jaxx-widgets-about</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>${project.groupId}</groupId> <artifactId>jaxx-widgets-gis</artifactId> <version>${project.version}</version> </dependency> @@ -408,5 +414,73 @@ </profile> + <profile> + <id>changelog-profile</id> + <activation> + <property> + <name>performRelease</name> + <value>true</value> + </property> + </activation> + <build> + <defaultGoal>generate-resources</defaultGoal> + + <plugins> + + <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>generate-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/CHANGELOG.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/jaxx-demo-CHANGELOG.txt"/> + </target> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + + </plugins> + </build> + </profile> + </profiles> </project> diff --git a/jaxx-demo/src/main/filters/jaxx-demo.properties b/jaxx-demo/src/main/filters/jaxx-demo.properties index 572bbdc..d92ee16 100644 --- a/jaxx-demo/src/main/filters/jaxx-demo.properties +++ b/jaxx-demo/src/main/filters/jaxx-demo.properties @@ -21,12 +21,10 @@ ### application.name=${project.name} application.version=${project.version} -application.site.url=http://maven-site.nuiton.org/jaxx/jaxx-demo +application.site.url=http://jaxx.nuiton.org/v/latest/jaxx-demo application.icon.path=/icons/jaxx.png -application.license.path=META-INF/${project.artifactId}-LICENSE.txt -application.third-party.path=META-INF/${project.artifactId}-THIRD-PARTY.txt #licence.name=${project.licenses[0].license.name} #licence.url=${project.licenses.0.url} application.organisation.name=${project.organization.name} application.organisation.url=${project.organization.url} -application.help.path=http://maven-site.nuiton.org/jaxx/jaxx-demo/help +application.help.path=http://jaxx.nuiton.org/v/latest/jaxx-demo/help diff --git a/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java b/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java index ba16604..be27f34 100644 --- a/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java +++ b/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java @@ -348,14 +348,6 @@ public class DemoConfig extends AbstractBean implements Supplier<ApplicationConf return applicationConfig.getOption("application.icon.path"); } - public String getLicensePath() { - return applicationConfig.getOption("application.license.path"); - } - - public String getThirdParty() { - return applicationConfig.getOption("application.third-party.path"); - } - public String getHelpLocation() { return applicationConfig.getOption("application.help.path"); } diff --git a/jaxx-demo/src/main/java/jaxx/demo/DemoUIHandler.java b/jaxx-demo/src/main/java/jaxx/demo/DemoUIHandler.java index d0d2a8b..78b26ab 100644 --- a/jaxx-demo/src/main/java/jaxx/demo/DemoUIHandler.java +++ b/jaxx-demo/src/main/java/jaxx/demo/DemoUIHandler.java @@ -31,7 +31,6 @@ import jaxx.runtime.context.DefaultApplicationContext; import jaxx.runtime.context.JAXXContextEntryDef; import jaxx.runtime.context.JAXXInitialContext; import jaxx.runtime.spi.UIHandler; -import jaxx.runtime.swing.AboutPanel; import jaxx.runtime.swing.ErrorDialogUI; import jaxx.runtime.swing.config.ConfigUIHelper; import jaxx.runtime.swing.log.JAXXLog4jUI; @@ -40,6 +39,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.decorator.DecoratorProvider; import org.nuiton.i18n.I18n; +import org.nuiton.jaxx.widgets.about.AboutUI; +import org.nuiton.jaxx.widgets.about.AboutUIBuilder; import javax.swing.AbstractAction; import javax.swing.InputMap; @@ -61,8 +62,8 @@ import java.net.URL; import java.util.Arrays; import java.util.Locale; -import static org.nuiton.i18n.I18n.t; import static org.nuiton.i18n.I18n.n; +import static org.nuiton.i18n.I18n.t; /** * Le handler de l'ui principale. @@ -70,7 +71,7 @@ import static org.nuiton.i18n.I18n.n; * @author Tony Chemit - chemit@codelutin.com * @see DemoUI */ -public class DemoUIHandler implements UIHandler<DemoUI>{ +public class DemoUIHandler implements UIHandler<DemoUI> { /** Logger */ static private Log log = LogFactory.getLog(DemoUIHandler.class); @@ -467,35 +468,35 @@ public class DemoUIHandler implements UIHandler<DemoUI>{ helper.addOption(DemoConfig.Option.FULL_SCREEN). setOptionPropertyName(DemoConfig.PROPERTY_FULLSCREEN). - setOptionCallBack("ui"); + setOptionCallBack("ui"); helper.addOption(DemoConfig.Option.FONT_SIZE). setOptionPropertyName(DemoConfig.PROPERTY_FONT_SIZE). - setOptionCallBack("ui"); + setOptionCallBack("ui"); helper.addOption(DemoConfig.Option.LOCALE). setOptionPropertyName(DemoConfig.PROPERTY_LOCALE). - setOptionCallBack("ui"); + setOptionCallBack("ui"); helper.addOption(DemoConfig.Option.DEMO_COLOR). setOptionPropertyName(DemoConfig.PROPERTY_DEMO_COLOR). - setOptionCallBack("ui"); + setOptionCallBack("ui"); helper.addOption(DemoConfig.Option.DEMO_CLASS). setOptionPropertyName(DemoConfig.PROPERTY_DEMO_CLASS). - setOptionCallBack("ui"); + setOptionCallBack("ui"); helper.addOption(DemoConfig.Option.KEY_OPEN_CONFIG). setOptionPropertyName(DemoConfig.PROPERTY_KEY_OPEN_CONFIG). - setOptionCallBack("ui"); + setOptionCallBack("ui"); helper.addOption(DemoConfig.Option.LOG_LEVEL). setOptionPropertyName(DemoConfig.PROPERTY_LOG_LEVEL). - setOptionCallBack("log"); + setOptionCallBack("log"); helper.addOption(DemoConfig.Option.LOG_PATTERN_LAYOUT). setOptionPropertyName(DemoConfig.PROPERTY_LOG_PATTERN_LAYOUT). - setOptionCallBack("log"); + setOptionCallBack("log"); helper.buildUI(context, "jaxxdemo.config.category.other"); @@ -554,19 +555,20 @@ public class DemoUIHandler implements UIHandler<DemoUI>{ DemoConfig config = ui.getConfig(); String iconPath = config.getIconPath(); - String licensePath = config.getLicensePath(); - String thirdPartyPath = config.getThirdParty(); - - AboutPanel about = new AboutPanel(); - about.setTitle(t("jaxxdemo.title.about")); - about.setAboutText(t("jaxxdemo.about.message")); - about.setBottomText(ui.getConfig().getCopyrightText()); - about.setIconPath(iconPath); - about.setLicenseFile(licensePath); - about.setThirdpartyFile(thirdPartyPath); - about.buildTopPanel(); - about.init(); - about.showInDialog(ui, true); + + String name = "jaxx-demo"; + AboutUI about = AboutUIBuilder.builder(ui) + .setIconPath(config.getIconPath()) + .setTitle(t("jaxxdemo.title.about")) + .setBottomText(ui.getConfig().getCopyrightText()) + .addAboutTab(t("jaxxdemo.about.message"), true) + .addDefaultLicenseTab(name, false) + .addDefaultThirdPartyTab(name, false) + .addDefaultChangelogTab(name, false) + .build(); + + about.display(); + } DemoUI getUI(JAXXContext context) { diff --git a/jaxx-demo/src/main/java/jaxx/demo/feature/nav/tree/NavDemoTreeCellRenderer.java b/jaxx-demo/src/main/java/jaxx/demo/feature/nav/tree/NavDemoTreeCellRenderer.java index 62b4a52..51ecbc8 100644 --- a/jaxx-demo/src/main/java/jaxx/demo/feature/nav/tree/NavDemoTreeCellRenderer.java +++ b/jaxx-demo/src/main/java/jaxx/demo/feature/nav/tree/NavDemoTreeCellRenderer.java @@ -99,6 +99,10 @@ public class NavDemoTreeCellRenderer extends AbstractNavTreeCellRenderer<Default boolean leaf, int row, boolean hasFocus) { + if (!(value instanceof NavDemoTreeNode)) { + return super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); + } + // get node NavDemoTreeNode node = (NavDemoTreeNode) value; @@ -106,8 +110,6 @@ public class NavDemoTreeCellRenderer extends AbstractNavTreeCellRenderer<Default String text = getNodeText(node); // Render node - return super.getTreeCellRendererComponent(tree, text, sel, - expanded, leaf, - row, hasFocus); + return super.getTreeCellRendererComponent(tree, text, sel, expanded, leaf, row, hasFocus); } } diff --git a/jaxx-demo/src/main/java/jaxx/demo/tree/DemoCellRenderer.java b/jaxx-demo/src/main/java/jaxx/demo/tree/DemoCellRenderer.java index 54b949a..f53565f 100644 --- a/jaxx-demo/src/main/java/jaxx/demo/tree/DemoCellRenderer.java +++ b/jaxx-demo/src/main/java/jaxx/demo/tree/DemoCellRenderer.java @@ -90,6 +90,10 @@ public class DemoCellRenderer extends AbstractNavTreeCellRenderer<DefaultTreeMod boolean leaf, int row, boolean hasFocus) { + if (!(value instanceof DemoNode)) { + return super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); + } + // get node DemoNode node = (DemoNode) value; @@ -97,8 +101,6 @@ public class DemoCellRenderer extends AbstractNavTreeCellRenderer<DefaultTreeMod String text = getNodeText(node); // Render node - return super.getTreeCellRendererComponent(tree, text, sel, - expanded, leaf, - row, hasFocus); + return super.getTreeCellRendererComponent(tree, text, sel, expanded, leaf, row, hasFocus); } } diff --git a/jaxx-demo/src/main/resources/i18n/jaxx-demo_en_GB.properties b/jaxx-demo/src/main/resources/i18n/jaxx-demo_en_GB.properties index e2b6cf5..c55e00d 100644 --- a/jaxx-demo/src/main/resources/i18n/jaxx-demo_en_GB.properties +++ b/jaxx-demo/src/main/resources/i18n/jaxx-demo_en_GB.properties @@ -143,7 +143,7 @@ jaxx.demo.label.id=Id jaxx.demo.label.id.tip=Identifiant jaxx.demo.label.lastName=Last name jaxx.demo.label.lastName.tip=Last name -jaxxdemo.about.message=<h3>JAXX Demo</h3><hr/>For more informations, visit the <a href\="http\://maven-site.nuiton.org/jaxx/jaxx-demo">website of the project</a>. +jaxxdemo.about.message=<h3>JAXX Demo</h3><hr/>For more informations, visit the <a href\="http\://jaxx.nuiton.org/v/latest/jaxx-demo">website of the project</a>. jaxxdemo.action.about=About... jaxxdemo.action.about.mnemonic=A jaxxdemo.action.about.tip=About JAXXDemo... diff --git a/jaxx-demo/src/main/resources/i18n/jaxx-demo_es_ES.properties b/jaxx-demo/src/main/resources/i18n/jaxx-demo_es_ES.properties index ea70726..7c28a84 100644 --- a/jaxx-demo/src/main/resources/i18n/jaxx-demo_es_ES.properties +++ b/jaxx-demo/src/main/resources/i18n/jaxx-demo_es_ES.properties @@ -143,7 +143,7 @@ jaxx.demo.label.id= jaxx.demo.label.id.tip= jaxx.demo.label.lastName= jaxx.demo.label.lastName.tip= -jaxxdemo.about.message=<h3>JAXX Demo</h3><hr/>Pour plus d'informations, vous pouvez visiter le <a href\="http\://maven-site.nuiton.org/jaxx/jaxx-demo">site du projet</a>. +jaxxdemo.about.message=<h3>JAXX Demo</h3><hr/>Pour plus d'informations, vous pouvez visiter le <a href\="http\://jaxx.nuiton.org/v/latest/jaxx-demo">site du projet</a>. jaxxdemo.action.about=A propos jaxxdemo.action.about.mnemonic= jaxxdemo.action.about.tip=A propos de JAXX Demo... diff --git a/jaxx-demo/src/main/resources/i18n/jaxx-demo_fr_FR.properties b/jaxx-demo/src/main/resources/i18n/jaxx-demo_fr_FR.properties index 252cef7..88f62fe 100644 --- a/jaxx-demo/src/main/resources/i18n/jaxx-demo_fr_FR.properties +++ b/jaxx-demo/src/main/resources/i18n/jaxx-demo_fr_FR.properties @@ -143,7 +143,7 @@ jaxx.demo.label.id=Id jaxx.demo.label.id.tip=Identifiant jaxx.demo.label.lastName=Nom jaxx.demo.label.lastName.tip=Nom -jaxxdemo.about.message=<h3>JAXX Demo</h3><hr/>Pour plus d'informations, vous pouvez visiter le <a href\="http\://maven-site.nuiton.org/jaxx/jaxx-demo">site du projet</a>. +jaxxdemo.about.message=<h3>JAXX Demo</h3><hr/>Pour plus d'informations, vous pouvez visiter le <a href\="http\://jaxx.nuiton.org/v/latest/jaxx-demo">site du projet</a>. jaxxdemo.action.about=A propos jaxxdemo.action.about.mnemonic=A jaxxdemo.action.about.tip=A propos de JAXX Demo... diff --git a/pom.xml b/pom.xml index 6ed3c69..8d659a8 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.nuiton</groupId> <artifactId>nuitonpom</artifactId> - <version>10.2</version> + <version>10.3</version> </parent> <artifactId>jaxx</artifactId> @@ -682,6 +682,58 @@ </reporting> </profile> + <profile> + <id>generate-changelog</id> + <activation> + <property> + <name>performRelease</name> + <value>true</value> + </property> + </activation> + + <properties> + <jredminePluginVersion>1.10</jredminePluginVersion> + <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> + <url>https://forge.nuiton.org</url> + </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>.