branch develop updated (c8953de -> 4efddf4)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository jaxx. See https://gitlab.nuiton.org/nuiton/jaxx.git from c8953de Remove unused code new e14d98a Readd missing i18n new 0d08206 Introduce a AboutPanelBuilder (See #4024) new 0b552ae Rename AboutPanel → AboutUI (See #4024) new 4efddf4 Mise en place de AboutUI dans la démo (See #4024) The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: 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) commit 0b552ae623c68cca9f212557dab6b41fef9727c4 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Sep 13 13:39:28 2016 +0200 Rename AboutPanel → AboutUI (See #4024) commit 0d082061890fa74f595b9a1d060042ee18d0f465 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Sep 13 12:29:38 2016 +0200 Introduce a AboutPanelBuilder (See #4024) commit e14d98a2d20f70184783217eb1fe9d39d748046f Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Sep 13 12:28:42 2016 +0200 Readd missing i18n Summary of changes: 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 +- .../org/nuiton/jaxx/widgets/about/AboutPanel.jaxx | 110 ------------ .../jaxx/widgets/about/AboutPanelHandler.java | 186 -------------------- .../org/nuiton/jaxx/widgets/about/AboutUI.jaxx | 73 ++++++++ .../nuiton/jaxx/widgets/about/AboutUIBuilder.java | 188 +++++++++++++++++++++ .../i18n/jaxx-widgets-about_en_GB.properties | 3 +- .../i18n/jaxx-widgets-about_es_ES.properties | 3 +- .../i18n/jaxx-widgets-about_fr_FR.properties | 3 +- .../src/main/resources/icons/action-close.png | Bin 0 -> 518 bytes .../resources/i18n/jaxx-widgets_en_GB.properties | 4 + .../resources/i18n/jaxx-widgets_es_ES.properties | 4 + .../resources/i18n/jaxx-widgets_fr_FR.properties | 4 + pom.xml | 54 +++++- 21 files changed, 447 insertions(+), 345 deletions(-) delete mode 100644 jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanel.jaxx delete mode 100644 jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanelHandler.java create mode 100644 jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutUI.jaxx create mode 100644 jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutUIBuilder.java create mode 100644 jaxx-widgets-about/src/main/resources/icons/action-close.png -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
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 e14d98a2d20f70184783217eb1fe9d39d748046f Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Sep 13 12:28:42 2016 +0200 Readd missing i18n --- jaxx-widgets/src/main/resources/i18n/jaxx-widgets_en_GB.properties | 4 ++++ jaxx-widgets/src/main/resources/i18n/jaxx-widgets_es_ES.properties | 4 ++++ jaxx-widgets/src/main/resources/i18n/jaxx-widgets_fr_FR.properties | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/jaxx-widgets/src/main/resources/i18n/jaxx-widgets_en_GB.properties b/jaxx-widgets/src/main/resources/i18n/jaxx-widgets_en_GB.properties index 3792a3f..954b4ea 100644 --- a/jaxx-widgets/src/main/resources/i18n/jaxx-widgets_en_GB.properties +++ b/jaxx-widgets/src/main/resources/i18n/jaxx-widgets_en_GB.properties @@ -1,3 +1,7 @@ +aboutframe.about=About +aboutframe.license=License +aboutframe.ok=OK +aboutframe.thirdparty=Third party bean.action.selected.move.down=Move down bean.action.selected.move.down.tip=Move down the selected item bean.action.selected.move.up=Move up diff --git a/jaxx-widgets/src/main/resources/i18n/jaxx-widgets_es_ES.properties b/jaxx-widgets/src/main/resources/i18n/jaxx-widgets_es_ES.properties index f314694..4d58091 100644 --- a/jaxx-widgets/src/main/resources/i18n/jaxx-widgets_es_ES.properties +++ b/jaxx-widgets/src/main/resources/i18n/jaxx-widgets_es_ES.properties @@ -1,3 +1,7 @@ +aboutframe.about=A cerca de +aboutframe.license=Licecia +aboutframe.ok=OK +aboutframe.thirdparty=Tierce partie bean.action.selected.move.down=Descendre bean.action.selected.move.down.tip=Descendre l'élément sélectionné bean.action.selected.move.up=Monter diff --git a/jaxx-widgets/src/main/resources/i18n/jaxx-widgets_fr_FR.properties b/jaxx-widgets/src/main/resources/i18n/jaxx-widgets_fr_FR.properties index b9ea451..abb0e71 100644 --- a/jaxx-widgets/src/main/resources/i18n/jaxx-widgets_fr_FR.properties +++ b/jaxx-widgets/src/main/resources/i18n/jaxx-widgets_fr_FR.properties @@ -1,3 +1,7 @@ +aboutframe.about=À propos +aboutframe.license=Licence +aboutframe.ok=OK +aboutframe.thirdparty=Tierce partie bean.action.selected.move.down=Descendre bean.action.selected.move.down.tip=Descendre l'élément sélectionné bean.action.selected.move.up=Monter -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
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 0d082061890fa74f595b9a1d060042ee18d0f465 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Sep 13 12:29:38 2016 +0200 Introduce a AboutPanelBuilder (See #4024) --- .../org/nuiton/jaxx/widgets/about/AboutPanel.jaxx | 52 ++---- .../jaxx/widgets/about/AboutPanelBuilder.java | 187 +++++++++++++++++++++ .../jaxx/widgets/about/AboutPanelHandler.java | 151 +++-------------- .../i18n/jaxx-widgets-about_en_GB.properties | 3 +- .../i18n/jaxx-widgets-about_es_ES.properties | 3 +- .../i18n/jaxx-widgets-about_fr_FR.properties | 3 +- .../src/main/resources/icons/action-close.png | Bin 0 -> 518 bytes 7 files changed, 231 insertions(+), 168 deletions(-) diff --git a/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanel.jaxx b/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanel.jaxx index 84f1f06..596c526 100644 --- a/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanel.jaxx +++ b/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanel.jaxx @@ -20,53 +20,26 @@ #L% --> -<Table insets='1' background='{getBackgroundColor()}' border='{BorderFactory.createLineBorder(Color.BLACK, 1)}'> +<Table insets='1' border='{BorderFactory.createLineBorder(Color.BLACK, 1)}'> <import> java.awt.Color - java.awt.Frame javax.swing.BorderFactory javax.swing.SwingConstants - </import> - <AboutPanelHandler id='handler' constructorParams='this'/> + static org.nuiton.i18n.I18n.t; + </import> <String id='title' javaBean='null'/> <String id='iconPath' javaBean='null'/> - <String id='aboutText' javaBean='null'/> - <String id='bottomText' javaBean='null'/> - <Color id='backgroundColor' javaBean='null'/> - <script><![CDATA[ -public void setLicenseFile(String filename) { - handler.setLicenseFile(filename); -} - -public void setThirdpartyFile(String filename) { - handler.setThirdpartyFile(filename); -} -public void addTab(String tabTitle, String resourceName) { - handler.addTab(tabTitle, resourceName); -} -public void buildTopPanel() { - handler.buildTopPanel(); -} - -public void init() { - handler.init(); -} - -public void showInDialog(Frame ui, boolean undecorated) { - handler.showInDialog(ui, undecorated); -} - -void $afterCompleteSetup() { - handler.$afterCompleteSetup(); +public void display() { + handler.display(this); } ]]> @@ -76,6 +49,10 @@ void $afterCompleteSetup() { <JPanel background='{Color.WHITE}' layout='{new BorderLayout()}'> <JLabel text='{SwingUtil.getStringValue(getTitle())}' visible='{getTitle() != null}' font-size='12' constraints='BorderLayout.CENTER'/> + + <JToolBar constraints='BorderLayout.EAST' opaque="false" borderPainted="false" floatable="false"> + <JButton id='close' borderPainted="false" focusable="false" rolloverEnabled="false"/> + </JToolBar> </JPanel> </cell> </row> @@ -86,15 +63,7 @@ void $afterCompleteSetup() { </row> <row> <cell weighty='1' fill='both'> - <JTabbedPane id='tabs'> - <tab title="aboutframe.about"> - <JScrollPane id='aboutContent' border='{null}'> - <JEditorPane contentType='text/html' editable='false' border='{null}' - text='{SwingUtil.getStringValue(getAboutText())}' - onHyperlinkUpdate='SwingUtil.openLink(event)'/> - </JScrollPane> - </tab> - </JTabbedPane> + <JTabbedPane id='tabs'/> </cell> </row> <row> @@ -102,7 +71,6 @@ void $afterCompleteSetup() { <JPanel layout='{new BorderLayout()}'> <JLabel id='bottomLabel' constraints='BorderLayout.CENTER' horizontalAlignment='{SwingConstants.CENTER}' text='{SwingUtil.getStringValue(getBottomText())}' visible='{getBottomText() != null}'/> - <JButton id='close' action='{handler.closeAction}' constraints='BorderLayout.EAST'/> </JPanel> </cell> </row> diff --git a/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanelBuilder.java b/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanelBuilder.java new file mode 100644 index 0000000..314d418 --- /dev/null +++ b/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanelBuilder.java @@ -0,0 +1,187 @@ +package org.nuiton.jaxx.widgets.about; + +import com.google.common.base.Preconditions; +import com.google.common.io.Resources; +import jaxx.runtime.SwingUtil; +import org.nuiton.util.Resource; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.Icon; +import javax.swing.JComponent; +import javax.swing.JDialog; +import javax.swing.JEditorPane; +import javax.swing.JLabel; +import javax.swing.JScrollPane; +import javax.swing.SwingUtilities; +import javax.swing.event.HyperlinkEvent; +import javax.swing.event.HyperlinkListener; +import java.awt.Frame; +import java.awt.event.ActionEvent; +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +import static org.nuiton.i18n.I18n.t; +import static org.nuiton.jaxx.widgets.about.AboutPanelHandler.CLOSE_ACTION; + +/** + * Created on 12/09/16. + * + * @author Tony Chemit - chemit@codelutin.com + */ +public class AboutPanelBuilder { + + protected final AboutPanel aboutPanel; + + protected final Frame parent; + + public AboutPanelBuilder(Frame parent) { + Preconditions.checkNotNull(parent); + this.parent = parent; + this.aboutPanel = new AboutPanel(); + this.aboutPanel.putClientProperty(AboutPanelHandler.PARENT, parent); + + Action closeAction = new AbstractAction(CLOSE_ACTION) { + private static final long serialVersionUID = 1L; + + @Override + public void actionPerformed(ActionEvent e) { + JDialog container = aboutPanel.getParentContainer(JDialog.class); + container.dispose(); + } + + }; + closeAction.putValue(Action.NAME, null); + closeAction.putValue(Action.SMALL_ICON, SwingUtil.getUIManagerActionIcon(CLOSE_ACTION)); + closeAction.putValue(Action.SHORT_DESCRIPTION, t("aboutframe.close")); + aboutPanel.getClose().setAction(closeAction); + } + + public static AboutPanelBuilder builder(Frame parent) { + return new AboutPanelBuilder(parent); + } + + public AboutPanelBuilder setTitle(String title) { + aboutPanel.setTitle(title); + return this; + } + + public AboutPanelBuilder setIconPath(String iconPath) { + aboutPanel.setIconPath(iconPath); + if (iconPath != null) { + Icon logoIcon = Resource.getIcon(iconPath); + aboutPanel.getTopPanel().add(new JLabel(logoIcon)); + } + return this; + } + + public AboutPanelBuilder setBottomText(String bottomText) { + aboutPanel.setBottomText(bottomText); + return this; + } + + public AboutPanelBuilder undecorated() { + aboutPanel.putClientProperty(AboutPanelHandler.UNDECORATED, true); + return this; + } + + public AboutPanelBuilder addAboutTab(String aboutText, boolean html) { + return addTab0(t("aboutframe.about"), aboutText, html); + } + + public AboutPanelBuilder addDefaultLicenseTab(String projectName, boolean html) { + return addLicenseTab("META-INF/" + projectName + "-LICENSE.txt", html); + } + + public AboutPanelBuilder addLicenseTab(String resourceName, boolean html) { + String tabContent = load(resourceName); + addTab0(t("aboutframe.license"), tabContent, html); + return this; + } + + public AboutPanelBuilder addDefaultThirdPartyTab(String projectName, boolean html) { + return addThirdPartyTab("META-INF/" + projectName + "-THIRD-PARTY.txt", html); + } + + public AboutPanelBuilder addThirdPartyTab(String resourceName, boolean html) { + String tabContent = load(resourceName); + return addTab0(t("aboutframe.thirdparty"), tabContent, html); + } + + public AboutPanelBuilder addDefaultChangelogTab(String projectName, boolean html) { + return addChangelogTab("META-INF/" + projectName + "-CHANGELOG.txt", html); + } + + public AboutPanelBuilder addChangelogTab(String resourceName, boolean html) { + String tabContent = load(resourceName); + return addTab0(t("aboutframe.changelog"), tabContent, html); + } + + public AboutPanelBuilder addTab(String tabTitle, String tabContent, boolean html) { + return addTab0(tabTitle, tabContent, html); + } + + public AboutPanelBuilder addTabFromResource(String tabTitle, String resourceName, boolean html) { + String tabContent = load(resourceName); + return addTab0(tabTitle, tabContent, html); + } + + public AboutPanelBuilder addTab(String tabTitle, JComponent component) { + JScrollPane scrollPane = new JScrollPane(); + scrollPane.setBorder(null); + aboutPanel.tabs.addTab(tabTitle, component); + return this; + } + + public AboutPanel build() { + return aboutPanel; + } + + protected AboutPanelBuilder addTab0(String tabTitle, String tabContent, boolean html) { + + JScrollPane scrollPane = new JScrollPane(); + scrollPane.setBorder(null); + aboutPanel.tabs.addTab(tabTitle, scrollPane); + + final JEditorPane jEditorPane = new JEditorPane(); + jEditorPane.setBorder(null); + if (html) { + // must be done before set in text + jEditorPane.setContentType("text/html"); + } + jEditorPane.setText(tabContent); + jEditorPane.setEditable(false); + jEditorPane.setFont(jEditorPane.getFont().deriveFont((float) 11)); + jEditorPane.addHyperlinkListener(new HyperlinkListener() { + @Override + public void hyperlinkUpdate(HyperlinkEvent e) { + SwingUtil.openLink(e); + } + }); + + scrollPane.getViewport().add(jEditorPane); + SwingUtilities.invokeLater(new Runnable() { + + @Override + public void run() { + jEditorPane.setCaretPosition(0); + } + }); + + return this; + } + + protected String load(String resourceName) { + String result = null; + try { + result = Resources.asCharSource(Resources.getResource(resourceName), StandardCharsets.UTF_8).read(); + + } catch (IOException ex) { + // ignore it + } + if (result == null) { + result = "resource " + resourceName + " not found"; + } + return result; + } +} diff --git a/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanelHandler.java b/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanelHandler.java index 7737af9..7c3cca5 100644 --- a/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanelHandler.java +++ b/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanelHandler.java @@ -23,31 +23,17 @@ package org.nuiton.jaxx.widgets.about; import jaxx.runtime.JAXXUtil; import jaxx.runtime.SwingUtil; -import org.apache.commons.io.IOUtils; +import jaxx.runtime.spi.UIHandler; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.nuiton.util.Resource; -import javax.swing.AbstractAction; -import javax.swing.Action; -import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JDialog; -import javax.swing.JLabel; import javax.swing.JRootPane; -import javax.swing.JScrollPane; -import javax.swing.JTextArea; import javax.swing.KeyStroke; -import javax.swing.SwingUtilities; -import java.awt.Component; import java.awt.Frame; -import java.awt.event.ActionEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; -import java.io.IOException; -import java.io.InputStream; - -import static org.nuiton.i18n.I18n.t; /** * Handler of the ui {@link AboutPanel}. @@ -55,132 +41,51 @@ import static org.nuiton.i18n.I18n.t; * @author Tony Chemit - chemit@codelutin.com * @since 2.4 */ -public class AboutPanelHandler { +public class AboutPanelHandler implements UIHandler<AboutPanel> { private static final Log log = LogFactory.getLog(AboutPanelHandler.class); - protected final AboutPanel ui; - - public AboutPanelHandler(AboutPanel ui) { - this.ui = ui; - } - - final protected Action closeAction = new AbstractAction("close") { - private static final long serialVersionUID = 1L; - - @Override - public void actionPerformed(ActionEvent e) { - JDialog container = ui.getParentContainer(JDialog.class); - if (container != null) { - container.dispose(); - } else { - ui.setVisible(false); - } - } - }; + public static final String CLOSE_ACTION = "close"; + public static final String UNDECORATED = "undecorated"; + public static final String PARENT = "parent"; - public void setLicenseFile(String filename) { - addTab(t("aboutframe.license"), filename); + @Override + public void beforeInit(AboutPanel aboutPanel) { } - public void setThirdpartyFile(String filename) { - addTab(t("aboutframe.thirdparty"), filename); + @Override + public void afterInit(final AboutPanel aboutPanel) { } - public void addTab(String tabTitle, String resourceName) { - String tabContent = load(resourceName); + public void display(final AboutPanel ui) { - JScrollPane scrollPane = new JScrollPane(); - scrollPane.setBorder(null); - ui.tabs.add(scrollPane); - ui.tabs.setTitleAt(ui.tabs.getTabCount() - 1, tabTitle); - - final JTextArea textArea = new JTextArea(); - textArea.setText(tabContent); - textArea.setEditable(false); - scrollPane.getViewport().add(textArea); - SwingUtilities.invokeLater(new Runnable() { - - @Override - public void run() { - textArea.setCaretPosition(0); - } - }); - - } + boolean undecorated = (Boolean) ui.getClientProperty(UNDECORATED); + Frame parent = (Frame) ui.getClientProperty(PARENT); - public void buildTopPanel() { - // image - JLabel labelIcon; - if (ui.iconPath != null) { - Icon logoIcon = Resource.getIcon(ui.iconPath); - labelIcon = new JLabel(logoIcon); - } else { - labelIcon = new JLabel(); + JDialog dialog = new JDialog(parent, true); + dialog.add(ui); + if (ui.getIconPath() != null) { + dialog.setIconImage(SwingUtil.createIcon(ui.getIconPath()).getImage()); } - ui.topPanel.add(labelIcon); - } - - public void init() { - if (ui.getAboutText() == null) { - ui.tabs.remove(ui.aboutContent); - } - } - - public void showInDialog(Frame ui, boolean undecorated) { - JDialog f = new JDialog(ui, true); - f.add(this.ui); - if (this.ui.iconPath != null) { - f.setIconImage(SwingUtil.createIcon(this.ui.iconPath).getImage()); - } - f.setResizable(true); - f.setSize(550, 450); - f.setUndecorated(undecorated); - JRootPane rootPane = f.getRootPane(); - rootPane.setDefaultButton(this.ui.close); - rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "close"); - rootPane.getActionMap().put("close", closeAction); - f.addWindowListener(new WindowAdapter() { + dialog.setResizable(true); + dialog.setSize(550, 450); + dialog.setUndecorated(undecorated); + dialog.addWindowListener(new WindowAdapter() { @Override public void windowClosed(WindowEvent e) { - Component ui = (Component) e.getSource(); - if (log.isInfoEnabled()) { - log.info("destroy ui " + ui); + if (log.isDebugEnabled()) { + log.debug("destroy ui " + ui); } JAXXUtil.destroy(ui); - JAXXUtil.destroy(AboutPanelHandler.this.ui); } }); - SwingUtil.center(ui, f); - f.setVisible(true); - } + JRootPane rootPane = dialog.getRootPane(); + rootPane.setDefaultButton(ui.getClose()); + rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), CLOSE_ACTION); + rootPane.getActionMap().put(CLOSE_ACTION, ui.getClose().getAction()); - protected String load(String filename) { - InputStream licenseStream = getClass().getResourceAsStream("/" + filename); - String result = null; - try { - if (licenseStream != null) { - result = IOUtils.toString(licenseStream); - } - } catch (IOException ex) { - // ignore it - } finally { - if (licenseStream != null) { - try { - licenseStream.close(); - } catch (IOException ex) { - log.error("could not close file " + filename); - } - } - } - if (result == null) { - result = "resource " + filename + " not found"; - } - return result; - } + SwingUtil.center(parent, dialog); + dialog.setVisible(true); - void $afterCompleteSetup() { - buildTopPanel(); - ui.close.setText(t("aboutframe.ok")); } } diff --git a/jaxx-widgets-about/src/main/resources/i18n/jaxx-widgets-about_en_GB.properties b/jaxx-widgets-about/src/main/resources/i18n/jaxx-widgets-about_en_GB.properties index 180c699..bbbe5c5 100644 --- a/jaxx-widgets-about/src/main/resources/i18n/jaxx-widgets-about_en_GB.properties +++ b/jaxx-widgets-about/src/main/resources/i18n/jaxx-widgets-about_en_GB.properties @@ -1,4 +1,5 @@ aboutframe.about=About +aboutframe.changelog=Changelog +aboutframe.close=Quit (ESCAPE) aboutframe.license=License -aboutframe.ok=OK aboutframe.thirdparty=Third party diff --git a/jaxx-widgets-about/src/main/resources/i18n/jaxx-widgets-about_es_ES.properties b/jaxx-widgets-about/src/main/resources/i18n/jaxx-widgets-about_es_ES.properties index 6f31c24..2623ddc 100644 --- a/jaxx-widgets-about/src/main/resources/i18n/jaxx-widgets-about_es_ES.properties +++ b/jaxx-widgets-about/src/main/resources/i18n/jaxx-widgets-about_es_ES.properties @@ -1,4 +1,5 @@ aboutframe.about=A cerca de +aboutframe.changelog=Histórico +aboutframe.close=Dejar (ESCAPE) aboutframe.license=Licecia -aboutframe.ok=OK aboutframe.thirdparty=Tierce partie diff --git a/jaxx-widgets-about/src/main/resources/i18n/jaxx-widgets-about_fr_FR.properties b/jaxx-widgets-about/src/main/resources/i18n/jaxx-widgets-about_fr_FR.properties index 6653653..9966aa1 100644 --- a/jaxx-widgets-about/src/main/resources/i18n/jaxx-widgets-about_fr_FR.properties +++ b/jaxx-widgets-about/src/main/resources/i18n/jaxx-widgets-about_fr_FR.properties @@ -1,4 +1,5 @@ aboutframe.about=À propos +aboutframe.changelog=Historique +aboutframe.close=Quitter (ESCAPE) aboutframe.license=Licence -aboutframe.ok=OK aboutframe.thirdparty=Tierce partie diff --git a/jaxx-widgets-about/src/main/resources/icons/action-close.png b/jaxx-widgets-about/src/main/resources/icons/action-close.png new file mode 100644 index 0000000..93edaf0 Binary files /dev/null and b/jaxx-widgets-about/src/main/resources/icons/action-close.png differ -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
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 0b552ae623c68cca9f212557dab6b41fef9727c4 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Sep 13 13:39:28 2016 +0200 Rename AboutPanel → AboutUI (See #4024) --- .../org/nuiton/jaxx/widgets/about/AboutPanel.jaxx | 78 ------------------- .../jaxx/widgets/about/AboutPanelHandler.java | 91 ---------------------- .../org/nuiton/jaxx/widgets/about/AboutUI.jaxx | 73 +++++++++++++++++ ...{AboutPanelBuilder.java => AboutUIBuilder.java} | 87 +++++++++++---------- 4 files changed, 117 insertions(+), 212 deletions(-) diff --git a/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanel.jaxx b/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanel.jaxx deleted file mode 100644 index 596c526..0000000 --- a/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanel.jaxx +++ /dev/null @@ -1,78 +0,0 @@ -<!-- - #%L - JAXX :: Widgets - %% - Copyright (C) 2008 - 2014 Code Lutin, 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% - --> - -<Table insets='1' border='{BorderFactory.createLineBorder(Color.BLACK, 1)}'> - - <import> - java.awt.Color - javax.swing.BorderFactory - javax.swing.SwingConstants - - static org.nuiton.i18n.I18n.t; - </import> - - <String id='title' javaBean='null'/> - - <String id='iconPath' javaBean='null'/> - - <String id='bottomText' javaBean='null'/> - - <script><![CDATA[ - -public void display() { - handler.display(this); -} - -]]> - </script> - <row> - <cell weightx='1' fill='both'> - <JPanel background='{Color.WHITE}' layout='{new BorderLayout()}'> - <JLabel text='{SwingUtil.getStringValue(getTitle())}' visible='{getTitle() != null}' font-size='12' - constraints='BorderLayout.CENTER'/> - - <JToolBar constraints='BorderLayout.EAST' opaque="false" borderPainted="false" floatable="false"> - <JButton id='close' borderPainted="false" focusable="false" rolloverEnabled="false"/> - </JToolBar> - </JPanel> - </cell> - </row> - <row> - <cell weightx='1' fill='both'> - <JPanel id='topPanel'/> - </cell> - </row> - <row> - <cell weighty='1' fill='both'> - <JTabbedPane id='tabs'/> - </cell> - </row> - <row> - <cell fill='both'> - <JPanel layout='{new BorderLayout()}'> - <JLabel id='bottomLabel' constraints='BorderLayout.CENTER' horizontalAlignment='{SwingConstants.CENTER}' - text='{SwingUtil.getStringValue(getBottomText())}' visible='{getBottomText() != null}'/> - </JPanel> - </cell> - </row> - -</Table> diff --git a/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanelHandler.java b/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanelHandler.java deleted file mode 100644 index 7c3cca5..0000000 --- a/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanelHandler.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * #%L - * JAXX :: Widgets - * %% - * Copyright (C) 2008 - 2014 Code Lutin, 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% - */ -package org.nuiton.jaxx.widgets.about; - -import jaxx.runtime.JAXXUtil; -import jaxx.runtime.SwingUtil; -import jaxx.runtime.spi.UIHandler; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import javax.swing.JComponent; -import javax.swing.JDialog; -import javax.swing.JRootPane; -import javax.swing.KeyStroke; -import java.awt.Frame; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; - -/** - * Handler of the ui {@link AboutPanel}. - * - * @author Tony Chemit - chemit@codelutin.com - * @since 2.4 - */ -public class AboutPanelHandler implements UIHandler<AboutPanel> { - - private static final Log log = LogFactory.getLog(AboutPanelHandler.class); - - public static final String CLOSE_ACTION = "close"; - public static final String UNDECORATED = "undecorated"; - public static final String PARENT = "parent"; - - @Override - public void beforeInit(AboutPanel aboutPanel) { - } - - @Override - public void afterInit(final AboutPanel aboutPanel) { - } - - public void display(final AboutPanel ui) { - - boolean undecorated = (Boolean) ui.getClientProperty(UNDECORATED); - Frame parent = (Frame) ui.getClientProperty(PARENT); - - JDialog dialog = new JDialog(parent, true); - dialog.add(ui); - if (ui.getIconPath() != null) { - dialog.setIconImage(SwingUtil.createIcon(ui.getIconPath()).getImage()); - } - dialog.setResizable(true); - dialog.setSize(550, 450); - dialog.setUndecorated(undecorated); - dialog.addWindowListener(new WindowAdapter() { - @Override - public void windowClosed(WindowEvent e) { - if (log.isDebugEnabled()) { - log.debug("destroy ui " + ui); - } - JAXXUtil.destroy(ui); - } - }); - JRootPane rootPane = dialog.getRootPane(); - rootPane.setDefaultButton(ui.getClose()); - rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), CLOSE_ACTION); - rootPane.getActionMap().put(CLOSE_ACTION, ui.getClose().getAction()); - - SwingUtil.center(parent, dialog); - dialog.setVisible(true); - - } -} diff --git a/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutUI.jaxx b/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutUI.jaxx new file mode 100644 index 0000000..904a402 --- /dev/null +++ b/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutUI.jaxx @@ -0,0 +1,73 @@ +<!-- + #%L + JAXX :: Widgets + %% + Copyright (C) 2008 - 2014 Code Lutin, 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% + --> +<JDialog resizable="true" undecorated="true" onWindowClosed="SwingUtil.destroy(this)" + iconImage="{SwingUtil.createIcon(getIconPath()).getImage()}"> + <import> + java.awt.Color + javax.swing.BorderFactory + javax.swing.SwingConstants + </import> + + <String id='iconPath' javaBean='"/icons/action-close.png"'/> + + <script><![CDATA[ +public void display() { + setSize((int)(getOwner().getWidth() * 0.7), (int)(getOwner().getHeight() * 0.7)); + SwingUtil.center(getOwner(), this); + setVisible(true); +} +]]> + </script> + + <Table insets='1' border='{BorderFactory.createLineBorder(Color.BLACK, 1)}'> + <row> + <cell weightx='1' fill='both'> + <JPanel background='{Color.WHITE}' layout='{new BorderLayout()}'> + <JLabel id="titleLabel" visible='{getTitle() != null}' font-size='12' constraints='BorderLayout.CENTER'/> + + <JToolBar constraints='BorderLayout.EAST' opaque="false" borderPainted="false" floatable="false"> + <JButton id='close' actionIcon="close" toolTipText="aboutframe.close" borderPainted="false" focusable="false"/> + </JToolBar> + </JPanel> + </cell> + </row> + <row> + <cell weightx='1' fill='both'> + <JPanel id='topPanel'/> + </cell> + </row> + <row> + <cell weighty='1' fill='both'> + <JTabbedPane id='tabs'/> + </cell> + </row> + <row> + <cell fill='both'> + <JPanel layout='{new BorderLayout()}'> + <JLabel id='bottomLabel' constraints='BorderLayout.CENTER' horizontalAlignment='{SwingConstants.CENTER}' + visible='{bottomLabel.getText() != null}'/> + </JPanel> + </cell> + </row> + + </Table> +</JDialog> \ No newline at end of file diff --git a/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanelBuilder.java b/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutUIBuilder.java similarity index 60% rename from jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanelBuilder.java rename to jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutUIBuilder.java index 314d418..ee50295 100644 --- a/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutPanelBuilder.java +++ b/jaxx-widgets-about/src/main/java/org/nuiton/jaxx/widgets/about/AboutUIBuilder.java @@ -9,10 +9,12 @@ import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.Icon; import javax.swing.JComponent; -import javax.swing.JDialog; import javax.swing.JEditorPane; import javax.swing.JLabel; +import javax.swing.JRootPane; import javax.swing.JScrollPane; +import javax.swing.JTabbedPane; +import javax.swing.KeyStroke; import javax.swing.SwingUtilities; import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkListener; @@ -22,126 +24,125 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import static org.nuiton.i18n.I18n.t; -import static org.nuiton.jaxx.widgets.about.AboutPanelHandler.CLOSE_ACTION; /** * Created on 12/09/16. * * @author Tony Chemit - chemit@codelutin.com */ -public class AboutPanelBuilder { +public class AboutUIBuilder { - protected final AboutPanel aboutPanel; + public static final String CLOSE_ACTION = "close"; - protected final Frame parent; + protected final AboutUI ui; - public AboutPanelBuilder(Frame parent) { + public AboutUIBuilder(Frame parent) { Preconditions.checkNotNull(parent); - this.parent = parent; - this.aboutPanel = new AboutPanel(); - this.aboutPanel.putClientProperty(AboutPanelHandler.PARENT, parent); + this.ui = new AboutUI(parent, true); Action closeAction = new AbstractAction(CLOSE_ACTION) { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { - JDialog container = aboutPanel.getParentContainer(JDialog.class); - container.dispose(); + ui.dispose(); } }; closeAction.putValue(Action.NAME, null); - closeAction.putValue(Action.SMALL_ICON, SwingUtil.getUIManagerActionIcon(CLOSE_ACTION)); - closeAction.putValue(Action.SHORT_DESCRIPTION, t("aboutframe.close")); - aboutPanel.getClose().setAction(closeAction); + closeAction.putValue(Action.SMALL_ICON, ui.getClose().getIcon()); + closeAction.putValue(Action.SHORT_DESCRIPTION, ui.getClose().getToolTipText()); + ui.getClose().setAction(closeAction); + + JRootPane rootPane = ui.getRootPane(); + rootPane.setDefaultButton(ui.getClose()); + rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), CLOSE_ACTION); + rootPane.getActionMap().put(CLOSE_ACTION, closeAction); + } - public static AboutPanelBuilder builder(Frame parent) { - return new AboutPanelBuilder(parent); + public static AboutUIBuilder builder(Frame parent) { + return new AboutUIBuilder(parent); } - public AboutPanelBuilder setTitle(String title) { - aboutPanel.setTitle(title); + public AboutUIBuilder setTitle(String title) { + ui.getTitleLabel().setText(title); return this; } - public AboutPanelBuilder setIconPath(String iconPath) { - aboutPanel.setIconPath(iconPath); + public AboutUIBuilder setIconPath(String iconPath) { + ui.setIconPath(iconPath); if (iconPath != null) { Icon logoIcon = Resource.getIcon(iconPath); - aboutPanel.getTopPanel().add(new JLabel(logoIcon)); + ui.getTopPanel().add(new JLabel(logoIcon)); } return this; } - public AboutPanelBuilder setBottomText(String bottomText) { - aboutPanel.setBottomText(bottomText); - return this; - } - - public AboutPanelBuilder undecorated() { - aboutPanel.putClientProperty(AboutPanelHandler.UNDECORATED, true); + public AboutUIBuilder setBottomText(String bottomText) { + ui.getBottomLabel().setText(bottomText); return this; } - public AboutPanelBuilder addAboutTab(String aboutText, boolean html) { + public AboutUIBuilder addAboutTab(String aboutText, boolean html) { return addTab0(t("aboutframe.about"), aboutText, html); } - public AboutPanelBuilder addDefaultLicenseTab(String projectName, boolean html) { + public AboutUIBuilder addDefaultLicenseTab(String projectName, boolean html) { return addLicenseTab("META-INF/" + projectName + "-LICENSE.txt", html); } - public AboutPanelBuilder addLicenseTab(String resourceName, boolean html) { + public AboutUIBuilder addLicenseTab(String resourceName, boolean html) { String tabContent = load(resourceName); addTab0(t("aboutframe.license"), tabContent, html); return this; } - public AboutPanelBuilder addDefaultThirdPartyTab(String projectName, boolean html) { + public AboutUIBuilder addDefaultThirdPartyTab(String projectName, boolean html) { return addThirdPartyTab("META-INF/" + projectName + "-THIRD-PARTY.txt", html); } - public AboutPanelBuilder addThirdPartyTab(String resourceName, boolean html) { + public AboutUIBuilder addThirdPartyTab(String resourceName, boolean html) { String tabContent = load(resourceName); return addTab0(t("aboutframe.thirdparty"), tabContent, html); } - public AboutPanelBuilder addDefaultChangelogTab(String projectName, boolean html) { + public AboutUIBuilder addDefaultChangelogTab(String projectName, boolean html) { return addChangelogTab("META-INF/" + projectName + "-CHANGELOG.txt", html); } - public AboutPanelBuilder addChangelogTab(String resourceName, boolean html) { + public AboutUIBuilder addChangelogTab(String resourceName, boolean html) { String tabContent = load(resourceName); return addTab0(t("aboutframe.changelog"), tabContent, html); } - public AboutPanelBuilder addTab(String tabTitle, String tabContent, boolean html) { + public AboutUIBuilder addTab(String tabTitle, String tabContent, boolean html) { return addTab0(tabTitle, tabContent, html); } - public AboutPanelBuilder addTabFromResource(String tabTitle, String resourceName, boolean html) { + public AboutUIBuilder addTabFromResource(String tabTitle, String resourceName, boolean html) { String tabContent = load(resourceName); return addTab0(tabTitle, tabContent, html); } - public AboutPanelBuilder addTab(String tabTitle, JComponent component) { + public AboutUIBuilder addTab(String tabTitle, JComponent component) { JScrollPane scrollPane = new JScrollPane(); scrollPane.setBorder(null); - aboutPanel.tabs.addTab(tabTitle, component); + ui.tabs.addTab(tabTitle, component); return this; } - public AboutPanel build() { - return aboutPanel; + public AboutUI build() { + return ui; } - protected AboutPanelBuilder addTab0(String tabTitle, String tabContent, boolean html) { + protected AboutUIBuilder addTab0(String tabTitle, String tabContent, boolean html) { JScrollPane scrollPane = new JScrollPane(); scrollPane.setBorder(null); - aboutPanel.tabs.addTab(tabTitle, scrollPane); + + JTabbedPane tabs = ui.getTabs(); + tabs.addTab(tabTitle, scrollPane); final JEditorPane jEditorPane = new JEditorPane(); jEditorPane.setBorder(null); -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
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>.
participants (1)
-
nuiton.org scm