Jaxx-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- 3898 discussions
Author: tchemit
Date: 2014-02-04 08:12:14 +0100 (Tue, 04 Feb 2014)
New Revision: 2782
Url: http://nuiton.org/projects/jaxx/repository/revisions/2782
Log:
fixes #3041: Updates plexus-utils to 3.0.17
refs #3040: updates nuiton-validator to 3.0
refs #3039: updates i18n to 3.0
refs #3038: updates nuiton-utils to 3.0
Modified:
trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationIOUtil.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/AbstractApplicationUIHandler.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/AbstractApplicationAction.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionFactory.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUIHandler.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationErrorHelper.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationUIUtil.java
trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaElement.java
trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFile.java
trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFileGenerator.java
trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTabbedPaneHandler.java
trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JXLayerHandler.java
trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigCallBackUIHandler.java
trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigCategoryUI.css
trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigCategoryUIHandler.java
trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigTableRenderer.java
trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigUIHandler.java
trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/model/ConfigUIModel.java
trunk/jaxx-config/src/test/java/jaxx/runtime/swing/config/model/MyDelegateConfig.java
trunk/jaxx-config/src/test/java/jaxx/runtime/swing/config/model/MyInheritedConfig.java
trunk/jaxx-demo/src/main/java/jaxx/demo/DemoApplicationContext.java
trunk/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java
trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUIHandler.java
trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/BeanComboBoxDemo.css
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/BeanComboBoxDemoHandler.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/BeanDoubleListDemo.css
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/BeanFilterableComboBoxDemo.css
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/BeanFilterableComboBoxDemoHandler.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/CoordinateDemo.css
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/CoordinateDemoHandler.java
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemo.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/SimpleTimeEditorDemo.css
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/SimpleTimeEditorDemo.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/TimeEditorDemo.css
trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/TimeEditorDemo.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/entities/AbstractDemoBean.java
trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Movie.java
trunk/jaxx-demo/src/main/java/jaxx/demo/entities/People.java
trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/NavDemoHandler.java
trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/ActorContentUI.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/ActorsContentUI.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/MovieContentUI.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/MoviesContentUI.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/tree/MoviesTreeNodeLoador.java
trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/treetable/MoviesTreeTableNodeLoador.java
trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/treetable/NavDemoTreeTableModel.java
trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/list/ListBeanValidationDemo.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/list/ListBeanValidationDemoHandler.java
trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/simple/SimpleBeanValidationByListDemo.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/simple/SimpleBeanValidationByTableDemo.jaxx
trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoCellRenderer.java
trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoDataProvider.java
trunk/jaxx-maven-plugin/src/main/java/org/nuiton/jaxx/plugin/NodeItem.java
trunk/jaxx-maven-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1751Test.java
trunk/jaxx-maven-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java
trunk/jaxx-maven-plugin/src/test/java/org/nuiton/jaxx/plugin/I18nTest.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/SwingUtil.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/awt/visitor/ComponentTreeNode.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/model/JaxxDefaultComboBoxModel.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/model/JaxxDefaultListModel.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/tree/AbstractNavTreeCellRenderer.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/I18nTableCellRenderer.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/session/SwingSession.java
trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUtil.java
trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SimpleBeanValidatorMessageTableRenderer.java
trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingListValidatorMessageTableRenderer.java
trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListRenderer.java
trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableRenderer.java
trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorUtil.java
trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/AboutPanelHandler.java
trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/HidorButton.jaxx
trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/I18nEditor.jaxx
trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/I18nEditorHandler.java
trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBox.css
trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBoxHandler.java
trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanDoubleList.css
trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanFilterableComboBox.css
trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanFilterableComboBoxHandler.java
trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanListHeader.css
trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanUIUtil.java
trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/gis/DmdCoordinateConverter.java
trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/gis/DmsCoordinateConverter.java
trunk/pom.xml
Modified: trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationIOUtil.java
===================================================================
--- trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationIOUtil.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationIOUtil.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -82,7 +82,7 @@
try {
ZipUtil.compressFiles(archiveFile, source, files);
} catch (IOException e) {
- throw new ApplicationTechnicalException(_(errorMessage, archiveFile), e);
+ throw new ApplicationTechnicalException(t(errorMessage, archiveFile), e);
}
}
@@ -210,7 +210,7 @@
return Files.newReader(file, Charsets.UTF_8);
} catch (FileNotFoundException e) {
- throw new ApplicationTechnicalException(_(errorMessage, file), e);
+ throw new ApplicationTechnicalException(t(errorMessage, file), e);
}
}
@@ -220,7 +220,7 @@
return Files.newWriter(file, Charsets.UTF_8);
} catch (FileNotFoundException e) {
- throw new ApplicationTechnicalException(_(errorMessage, file), e);
+ throw new ApplicationTechnicalException(t(errorMessage, file), e);
}
}
@@ -231,7 +231,7 @@
try {
ZipUtil.uncompress(file, tempDir);
} catch (IOException e) {
- throw new ApplicationTechnicalException(_(errorMessage, file), e);
+ throw new ApplicationTechnicalException(t(errorMessage, file), e);
}
return tempDir;
}
Modified: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/AbstractApplicationUIHandler.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/AbstractApplicationUIHandler.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/AbstractApplicationUIHandler.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -301,11 +301,11 @@
String htmlMessage = String.format(
CONFIRMATION_FORMAT,
message,
- _("jaxx.application.common.askSaveBeforeLeaving.help"));
+ t("jaxx.application.common.askSaveBeforeLeaving.help"));
int result = JOptionPane.showConfirmDialog(
getTopestUI(),
htmlMessage,
- _("jaxx.application.common.askSaveBeforeLeaving.title"),
+ t("jaxx.application.common.askSaveBeforeLeaving.title"),
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE);
return result;
@@ -315,11 +315,11 @@
String htmlMessage = String.format(
CONFIRMATION_FORMAT,
message,
- _("jaxx.application.common.askCancelEditBeforeLeaving.help"));
+ t("jaxx.application.common.askCancelEditBeforeLeaving.help"));
int i = JOptionPane.showConfirmDialog(
getTopestUI(),
htmlMessage,
- _("jaxx.application.common.askCancelEditBeforeLeaving.title"),
+ t("jaxx.application.common.askCancelEditBeforeLeaving.title"),
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE);
@@ -718,7 +718,7 @@
}
String dateFormat = getContext().getDateFormat();
picker.setFormats(dateFormat);
- picker.setToolTipText(_("jaxx.application.common.datefield.tip", dateFormat));
+ picker.setToolTipText(t("jaxx.application.common.datefield.tip", dateFormat));
picker.getEditor().addFocusListener(new FocusAdapter() {
@Override
@@ -880,10 +880,10 @@
TableColumnExt col = new TableColumnExt(model.getColumnCount());
col.setCellEditor(editor);
col.setCellRenderer(renderer);
- String label = _(identifier.getHeaderI18nKey());
+ String label = t(identifier.getHeaderI18nKey());
col.setHeaderValue(label);
- String tip = _(identifier.getHeaderTipI18nKey());
+ String tip = t(identifier.getHeaderTipI18nKey());
col.setToolTipText(tip);
Modified: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/AbstractApplicationAction.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/AbstractApplicationAction.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/AbstractApplicationAction.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -254,13 +254,13 @@
// file exists ask user to overwrite
String htmlMessage = String.format(
AbstractApplicationUIHandler.CONFIRMATION_FORMAT,
- _("jaxx.application.common.askOverwriteFile.message", file),
- _("jaxx.application.common.askOverwriteFile.help"));
+ t("jaxx.application.common.askOverwriteFile.message", file),
+ t("jaxx.application.common.askOverwriteFile.help"));
result = JOptionPane.showConfirmDialog(
getHandler().getTopestUI(),
htmlMessage,
- _("jaxx.application.common.askOverwriteFile.title"),
+ t("jaxx.application.common.askOverwriteFile.title"),
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION;
} else {
@@ -275,7 +275,7 @@
String htmlMessage = String.format(
AbstractApplicationUIHandler.CONFIRMATION_FORMAT,
message,
- _("jaxx.application.common.askBeforeDelete.help"));
+ t("jaxx.application.common.askBeforeDelete.help"));
int i = JOptionPane.showConfirmDialog(
getHandler().getTopestUI(),
htmlMessage,
Modified: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionFactory.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionFactory.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionFactory.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -62,7 +62,7 @@
ApplicationUIAction<A> result = createUIAction(abstractButton, logicAction);
return result;
} catch (Exception e) {
- throw new ApplicationTechnicalException(_("jaxx.application.action.create.error", actionName), e);
+ throw new ApplicationTechnicalException(t("jaxx.application.action.create.error", actionName), e);
}
}
@@ -86,7 +86,7 @@
A result = ConstructorUtils.invokeConstructor(actionName, handler);
return result;
} catch (Exception e) {
- throw new ApplicationTechnicalException(_("jaxx.application.action.create.error", actionName), e);
+ throw new ApplicationTechnicalException(t("jaxx.application.action.create.error", actionName), e);
}
}
Modified: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUIHandler.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUIHandler.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUIHandler.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -223,12 +223,12 @@
}
protected void showAction(AbstractApplicationAction action) {
- ui.setTitle(_("jaxx.application.title.actionUI",
+ ui.setTitle(t("jaxx.application.title.actionUI",
getContext().getConfiguration().getApplicationName(),
getContext().getConfiguration().getVersion(),
action.getActionDescription()));
ui.getGlobalActionLabel().setText(
- _("jaxx.application.message.action.running",
+ t("jaxx.application.message.action.running",
action.getActionDescription()));
ui.pack();
Modified: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationErrorHelper.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationErrorHelper.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationErrorHelper.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -59,21 +59,21 @@
if (cause == null) {
JOptionPane.showMessageDialog(context.getMainUI(), "<html><body>" + message + "</body></html>",
- _("jaxx.application.error.ui.business.error"),
+ t("jaxx.application.error.ui.business.error"),
JOptionPane.ERROR_MESSAGE);
} else if (cause instanceof ApplicationBusinessException) {
JOptionPane.showMessageDialog(context.getMainUI(), "<html><body>" + cause.getMessage() + "</body></html>",
- _("jaxx.application.error.ui.business.error"),
+ t("jaxx.application.error.ui.business.error"),
JOptionPane.ERROR_MESSAGE);
} else if (cause instanceof ImportRuntimeException) {
JOptionPane.showMessageDialog(context.getMainUI(), cause.getMessage(),
- _("jaxx.application.error.ui.business.error"),
+ t("jaxx.application.error.ui.business.error"),
JOptionPane.ERROR_MESSAGE);
} else {
JXErrorPane pane = new JXErrorPane();
- ErrorInfo info = new ErrorInfo(_("jaxx.application.error.ui.other.error"),
- _("jaxx.application.error.errorpane.htmlmessage", message), null, null,
+ ErrorInfo info = new ErrorInfo(t("jaxx.application.error.ui.other.error"),
+ t("jaxx.application.error.errorpane.htmlmessage", message), null, null,
cause, null, null);
pane.setErrorInfo(info);
pane.setErrorReporter(this);
@@ -105,7 +105,7 @@
public void showWarningDialog(String message) {
JOptionPane.showMessageDialog(context.getMainUI(), "<html><body>" + message + "</body></html>",
- _("jaxx.application.error.ui.business.warning"),
+ t("jaxx.application.error.ui.business.warning"),
JOptionPane.WARNING_MESSAGE);
}
Modified: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationUIUtil.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationUIUtil.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationUIUtil.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -79,7 +79,7 @@
try {
openLink(url.toURI());
} catch (URISyntaxException e) {
- throw new ApplicationTechnicalException(_("jaxx.application.error.cannot.open.link", url), e);
+ throw new ApplicationTechnicalException(t("jaxx.application.error.cannot.open.link", url), e);
}
}
@@ -87,7 +87,7 @@
if (!Desktop.isDesktopSupported()) {
throw new ApplicationTechnicalException(
- _("jaxx.application.error.desktop.not.supported"));
+ t("jaxx.application.error.desktop.not.supported"));
}
Desktop desktop = Desktop.getDesktop();
@@ -95,7 +95,7 @@
if (!desktop.isSupported(Desktop.Action.BROWSE)) {
throw new ApplicationTechnicalException(
- _("jaxx.application.error.desktop.browse.not.supported"));
+ t("jaxx.application.error.desktop.browse.not.supported"));
}
return desktop;
@@ -111,7 +111,7 @@
} catch (Exception e) {
throw new ApplicationTechnicalException(
- _("jaxx.application.error.cannot.open.link", uri), e);
+ t("jaxx.application.error.cannot.open.link", uri), e);
}
}
@@ -119,7 +119,7 @@
if (!Desktop.isDesktopSupported()) {
throw new ApplicationTechnicalException(
- _("jaxx.application.error.desktop.not.supported"));
+ t("jaxx.application.error.desktop.not.supported"));
}
Desktop desktop = Desktop.getDesktop();
@@ -127,7 +127,7 @@
if (!desktop.isSupported(Desktop.Action.MAIL)) {
throw new ApplicationTechnicalException(
- _("jaxx.application.error.desktop.mail.not.supported"));
+ t("jaxx.application.error.desktop.mail.not.supported"));
}
return desktop;
@@ -144,7 +144,7 @@
} catch (Exception e) {
throw new ApplicationTechnicalException(
- _("jaxx.application.error.cannot.mail"), e);
+ t("jaxx.application.error.cannot.mail"), e);
}
}
Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaElement.java
===================================================================
--- trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaElement.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaElement.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -25,7 +25,7 @@
package jaxx.compiler.java;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
import java.lang.reflect.Modifier;
import java.util.Comparator;
Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFile.java
===================================================================
--- trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFile.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFile.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -27,7 +27,7 @@
import jaxx.compiler.finalizers.JAXXCompilerFinalizer;
import jaxx.compiler.types.TypeManager;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFileGenerator.java
===================================================================
--- trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFileGenerator.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/java/JavaFileGenerator.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -27,7 +27,7 @@
import jaxx.compiler.JAXXCompiler;
import jaxx.compiler.java.JavaMethod.MethodOrder;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTabbedPaneHandler.java
===================================================================
--- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTabbedPaneHandler.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JTabbedPaneHandler.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -89,7 +89,7 @@
String title = tabInfo.getTitle();
if (title != null) {
if (I18nHelper.isI18nAttribute(ATTRIBUTE_TITLE)) {
- if (!title.startsWith("_(\"")) {
+ if (!title.startsWith("t(\"")) {
// we did not have the invocation code, add it
title = I18nHelper.addI18nInvocation(getId(), ATTRIBUTE_TITLE, TypeManager.getJavaCode(title), compiler);
}
@@ -102,7 +102,7 @@
String toolTipText = tabInfo.getToolTipText();
if (toolTipText != null) {
if (I18nHelper.isI18nAttribute(ATTRIBUTE_TOOL_TIP_TEXT)) {
- if (!toolTipText.startsWith("_(\"")) {
+ if (!toolTipText.startsWith("t(\"")) {
// we did not have the invocation code, add it
toolTipText = I18nHelper.addI18nInvocation(getId(), ATTRIBUTE_TOOL_TIP_TEXT, TypeManager.getJavaCode(toolTipText), compiler);
}
Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JXLayerHandler.java
===================================================================
--- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JXLayerHandler.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/swing/JXLayerHandler.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -30,7 +30,7 @@
import jaxx.compiler.reflect.ClassDescriptor;
import jaxx.compiler.reflect.ClassDescriptorHelper;
import jaxx.compiler.tags.DefaultComponentHandler;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
import org.jdesktop.jxlayer.JXLayer;
import java.awt.Component;
Modified: trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigCallBackUIHandler.java
===================================================================
--- trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigCallBackUIHandler.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigCallBackUIHandler.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -131,14 +131,14 @@
if (log.isDebugEnabled()) {
log.debug("callBackEntry detected " + v.getName());
}
- value = _(v.getDescription());
+ value = t(v.getDescription());
} else if (value instanceof OptionModel) {
OptionModel v = (OptionModel) value;
if (log.isDebugEnabled()) {
log.debug("option detected " + v.getKey());
}
- value = v.getKey() + " (" + _(v.getDescription()) + ")";
+ value = v.getKey() + " (" + t(v.getDescription()) + ")";
}
JLabel rendererComponent;
@@ -183,7 +183,7 @@
ConfigUIHandler.CALLBACKS);
for (CallBackEntry e : callBacks) {
if (log.isInfoEnabled()) {
- log.info("launch callBack " + _(e.getDescription()));
+ log.info("launch callBack " + t(e.getDescription()));
}
e.getAction().run();
}
Modified: trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigCategoryUI.css
===================================================================
--- trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigCategoryUI.css 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigCategoryUI.css 2014-02-04 07:12:14 UTC (rev 2782)
@@ -29,7 +29,7 @@
}
#descriptionPane {
- columnHeaderView:{new JLabel(_("config.description"), SwingUtil.getUIManagerActionIcon("information"), 10)};
+ columnHeaderView:{new JLabel(t("config.description"), SwingUtil.getUIManagerActionIcon("information"), 10)};
}
#description {
@@ -37,7 +37,7 @@
editable:false;
focusable:false;
font-size:10;
- text:{_("config.no.option.selected")};
+ text:{t("config.no.option.selected")};
}
#tablePane {
Modified: trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigCategoryUIHandler.java
===================================================================
--- trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigCategoryUIHandler.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigCategoryUIHandler.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -67,12 +67,12 @@
// prepare table
SwingUtil.setI18nTableHeaderRenderer(
table,
- n_("config.key"),
- n_("config.key.tip"),
- n_("config.value"),
- n_("config.value.tip"),
- n_("config.defaultValue"),
- n_("config.defaultValue.tip"));
+ n("config.key"),
+ n("config.key.tip"),
+ n("config.value"),
+ n("config.value.tip"),
+ n("config.defaultValue"),
+ n("config.defaultValue.tip"));
ConfigTableRenderer renderer = new ConfigTableRenderer();
SwingUtil.setTableColumnRenderer(table, 0, renderer);
@@ -104,16 +104,16 @@
}
StringBuilder buffer = new StringBuilder();
if (option == null) {
- buffer.append(_("config.no.option.selected"));
+ buffer.append(t("config.no.option.selected"));
} else {
- buffer.append(_("config.option.label", option.getKey(), _(option.getDescription()))).append('\n');
+ buffer.append(t("config.option.label", option.getKey(), t(option.getDescription()))).append('\n');
if (option.isModified()) {
String oValue = option.toString(option.getOriginalValue());
String mValue = option.toString(option.getValue());
- buffer.append(_("config.option.modified", oValue, mValue)).append('\n');
+ buffer.append(t("config.option.modified", oValue, mValue)).append('\n');
}
if (option.isFinal()) {
- buffer.append(_("config.option.final")).append('\n');
+ buffer.append(t("config.option.final")).append('\n');
}
}
description.setText(buffer.toString());
Modified: trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigTableRenderer.java
===================================================================
--- trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigTableRenderer.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigTableRenderer.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -90,19 +90,19 @@
}
protected Component getKeyCellRenderer(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column, OptionModel key, boolean isValid, boolean isModified) {
- String tooltip = _(key.getDescription()) + " (" + key.getKey() + ")";
+ String tooltip = t(key.getDescription()) + " (" + key.getKey() + ")";
String originalValue = key.toString(key.getOriginalValue());
boolean isFinal = key.isFinal();
if (isFinal) {
- tooltip += " [" + _("config.unmodifiable") + ']';
+ tooltip += " [" + t("config.unmodifiable") + ']';
}
if (isModified) {
- String s = _("config.modified", originalValue);
+ String s = t("config.modified", originalValue);
value = value + " *";
tooltip += " [" + s + ']';
}
if (!isValid) {
- String s2 = _("config.unvalid", originalValue, key.getType());
+ String s2 = t("config.unvalid", originalValue, key.getType());
tooltip += " (" + s2 + ")";
value = value + " !";
}
Modified: trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigUIHandler.java
===================================================================
--- trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigUIHandler.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigUIHandler.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -137,12 +137,12 @@
// build categories tabs
for (CategoryModel categoryModel : model) {
String category = categoryModel.getCategory();
- String categoryLabel = _(categoryModel.getCategoryLabel());
+ String categoryLabel = t(categoryModel.getCategoryLabel());
ConfigCategoryUI p = new ConfigCategoryUI(
new JAXXInitialContext().add(ui).add(categoryModel));
p.getCategoryLabel().setText(categoryLabel);
p.setName(category);
- categories.addTab(_(category), null, p, categoryLabel);
+ categories.addTab(t(category), null, p, categoryLabel);
}
model.setCategory(defaultCategory);
@@ -174,7 +174,7 @@
public void displayUI(Frame parentUI, boolean undecorated) {
JDialog f = new JDialog(parentUI, true);
- f.setTitle(_("config.title"));
+ f.setTitle(t("config.title"));
f.add(ui);
if (parentUI != null) {
f.setIconImage(parentUI.getIconImage());
@@ -309,26 +309,26 @@
boolean canContinue = true;
ConfigUIModel model = ui.getModel();
CategoryModel categoryModel = model.getCategoryModel();
- String categoryName = _(categoryModel.getCategory());
+ String categoryName = t(categoryModel.getCategory());
if (!categoryModel.isValid()) {
// the category is not valid
// get all the invalid options
StringBuilder buffer = new StringBuilder();
- buffer.append(_("config.message.quit.invalid.category",
+ buffer.append(t("config.message.quit.invalid.category",
categoryName));
buffer.append('\n');
for (OptionModel m : categoryModel.getInvalidOptions()) {
buffer.append("\n- ").append(m.getKey());
}
buffer.append('\n');
- int reponse = askUser(_("config.title.need.confirm"),
+ int reponse = askUser(t("config.title.need.confirm"),
buffer.toString(),
JOptionPane.ERROR_MESSAGE,
new Object[]{
- _("config.choice.continue"),
- _("config.choice.cancel")},
+ t("config.choice.continue"),
+ t("config.choice.cancel")},
0);
switch (reponse) {
@@ -348,20 +348,20 @@
// category was modified, ask user if wants to save
StringBuilder buffer = new StringBuilder();
- buffer.append(_("config.message.quit.valid.and.modified.category",
+ buffer.append(t("config.message.quit.valid.and.modified.category",
categoryName)).append('\n');
for (OptionModel m : categoryModel.getModifiedOptions()) {
buffer.append("\n- ").append(m.getKey());
}
buffer.append('\n');
- int reponse = askUser(_("config.title.need.confirm"),
+ int reponse = askUser(t("config.title.need.confirm"),
buffer.toString(),
JOptionPane.WARNING_MESSAGE,
new Object[]{
- _("config.choice.save"),
- _("config.choice.doNotSave"),
- _("config.choice.cancel")},
+ t("config.choice.save"),
+ t("config.choice.doNotSave"),
+ t("config.choice.cancel")},
0);
switch (reponse) {
Modified: trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/model/ConfigUIModel.java
===================================================================
--- trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/model/ConfigUIModel.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/model/ConfigUIModel.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -148,7 +148,7 @@
public void addCategory(CategoryModel category) {
if (categories.containsKey(category.getCategory())) {
throw new IllegalArgumentException(
- _("config.error.category.already.exists",
+ t("config.error.category.already.exists",
category.getCategory()));
}
categories.put(category.getCategory(), category);
@@ -162,7 +162,7 @@
public void setCategory(String category) {
if (!categories.containsKey(category)) {
throw new IllegalArgumentException(
- _("config.error.category.not.found", category));
+ t("config.error.category.not.found", category));
}
CategoryModel newCategoryModel = categories.get(category);
setCategoryModel(newCategoryModel);
@@ -321,7 +321,7 @@
applicationConfig.save(configFile, false, transients.toArray(new String[transients.size()]));
} catch (IOException eee) {
if (log.isWarnEnabled()) {
- log.warn(_("config.error.applicationconfig.save", configFile),
+ log.warn(t("config.error.applicationconfig.save", configFile),
eee);
}
}
Modified: trunk/jaxx-config/src/test/java/jaxx/runtime/swing/config/model/MyDelegateConfig.java
===================================================================
--- trunk/jaxx-config/src/test/java/jaxx/runtime/swing/config/model/MyDelegateConfig.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-config/src/test/java/jaxx/runtime/swing/config/model/MyDelegateConfig.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -191,12 +191,12 @@
public enum Option implements ConfigOptionDef {
- CONFIG_FILE(ApplicationConfig.CONFIG_FILE_NAME, _("jaxxdemo.config.configFileName.description"), "jaxxdemo", String.class, true, true),
- FULL_SCREEN("ui.fullscreen", _("jaxxdemo.config.ui.fullscreen"), "false", Boolean.class, false, false),
- LOCALE("ui." + PROPERTY_LOCALE, _("jaxxdemo.config.ui." + PROPERTY_LOCALE), Locale.FRANCE.toString(), Locale.class, false, false),
- FONT_SIZE("ui." + PROPERTY_FONT_SIZE, _("jaxxdemo.config.ui." + PROPERTY_FONT_SIZE), "10f", Float.class, false, false),
- DEMO_COLOR("ui." + PROPERTY_DEMO_COLOR, _("jaxxdemo.config.ui.demoColor"), "#ffffff", Color.class, false, false),
- DEMO_CLASS("ui." + PROPERTY_DEMO_CLASS, _("jaxxdemo.config.ui.demoClass"), "java.io.File", Class.class, false, false);
+ CONFIG_FILE(ApplicationConfig.CONFIG_FILE_NAME, t("jaxxdemo.config.configFileName.description"), "jaxxdemo", String.class, true, true),
+ FULL_SCREEN("ui.fullscreen", t("jaxxdemo.config.ui.fullscreen"), "false", Boolean.class, false, false),
+ LOCALE("ui." + PROPERTY_LOCALE, t("jaxxdemo.config.ui." + PROPERTY_LOCALE), Locale.FRANCE.toString(), Locale.class, false, false),
+ FONT_SIZE("ui." + PROPERTY_FONT_SIZE, t("jaxxdemo.config.ui." + PROPERTY_FONT_SIZE), "10f", Float.class, false, false),
+ DEMO_COLOR("ui." + PROPERTY_DEMO_COLOR, t("jaxxdemo.config.ui.demoColor"), "#ffffff", Color.class, false, false),
+ DEMO_CLASS("ui." + PROPERTY_DEMO_CLASS, t("jaxxdemo.config.ui.demoClass"), "java.io.File", Class.class, false, false);
public final String key;
Modified: trunk/jaxx-config/src/test/java/jaxx/runtime/swing/config/model/MyInheritedConfig.java
===================================================================
--- trunk/jaxx-config/src/test/java/jaxx/runtime/swing/config/model/MyInheritedConfig.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-config/src/test/java/jaxx/runtime/swing/config/model/MyInheritedConfig.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -203,12 +203,12 @@
public enum Option implements ConfigOptionDef {
- CONFIG_FILE(CONFIG_FILE_NAME, _("jaxxdemo.config.configFileName.description"), "jaxxdemo", String.class, true, true),
- FULL_SCREEN("ui.fullscreen", _("jaxxdemo.config.ui.fullscreen"), "false", Boolean.class, false, false),
- LOCALE("ui." + PROPERTY_LOCALE, _("jaxxdemo.config.ui." + PROPERTY_LOCALE), Locale.FRANCE.toString(), Locale.class, false, false),
- FONT_SIZE("ui." + PROPERTY_FONT_SIZE, _("jaxxdemo.config.ui." + PROPERTY_FONT_SIZE), "10f", Float.class, false, false),
- DEMO_COLOR("ui." + PROPERTY_DEMO_COLOR, _("jaxxdemo.config.ui.demoColor"), "#ffffff", Color.class, false, false),
- DEMO_CLASS("ui." + PROPERTY_DEMO_CLASS, _("jaxxdemo.config.ui.demoClass"), "java.io.File", Class.class, false, false);
+ CONFIG_FILE(CONFIG_FILE_NAME, t("jaxxdemo.config.configFileName.description"), "jaxxdemo", String.class, true, true),
+ FULL_SCREEN("ui.fullscreen", t("jaxxdemo.config.ui.fullscreen"), "false", Boolean.class, false, false),
+ LOCALE("ui." + PROPERTY_LOCALE, t("jaxxdemo.config.ui." + PROPERTY_LOCALE), Locale.FRANCE.toString(), Locale.class, false, false),
+ FONT_SIZE("ui." + PROPERTY_FONT_SIZE, t("jaxxdemo.config.ui." + PROPERTY_FONT_SIZE), "10f", Float.class, false, false),
+ DEMO_COLOR("ui." + PROPERTY_DEMO_COLOR, t("jaxxdemo.config.ui.demoColor"), "#ffffff", Color.class, false, false),
+ DEMO_CLASS("ui." + PROPERTY_DEMO_CLASS, t("jaxxdemo.config.ui.demoClass"), "java.io.File", Class.class, false, false);
public final String key;
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoApplicationContext.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoApplicationContext.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoApplicationContext.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -141,7 +141,7 @@
String value = (String) helpMapping.get(helpId);
if (value == null) {
- throw new RuntimeException(_("jaxxdemo.context.helpPage.notFound", helpId));
+ throw new RuntimeException(t("jaxxdemo.context.helpPage.notFound", helpId));
}
String helpDirectory = getConfig().getHelpResourceWithLocale(value);
@@ -162,10 +162,10 @@
if (log.isInfoEnabled()) {
log.info("help-uri: " + resolvedUri);
}
- getMainUI().getP().setStatus(_("jaxxdemo.openHelp", helpId));
+ getMainUI().getP().setStatus(t("jaxxdemo.openHelp", helpId));
// SwingUtil.openLink(resolvedUri);
// } catch (URISyntaxException e) {
-// throw new RuntimeException(_("jaxxdemo.context.helpPage.notFound", resolvedUri));
+// throw new RuntimeException(t("jaxxdemo.context.helpPage.notFound", resolvedUri));
// }
}
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoConfig.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -376,42 +376,42 @@
CONFIG_FILE(
ApplicationConfig.CONFIG_FILE_NAME,
- _("jaxxdemo.config.configFileName.description"),
+ t("jaxxdemo.config.configFileName.description"),
"jaxxdemo",
String.class,
true,
true),
FULL_SCREEN(
"ui.fullscreen",
- _("jaxxdemo.config.ui.fullscreen"),
+ t("jaxxdemo.config.ui.fullscreen"),
"false",
Boolean.class,
false,
false),
LOCALE(
"ui." + PROPERTY_LOCALE,
- _("jaxxdemo.config.ui.locale"),
+ t("jaxxdemo.config.ui.locale"),
Locale.FRANCE.toString(),
Locale.class,
false,
false),
FONT_SIZE(
"ui." + PROPERTY_FONT_SIZE,
- _("jaxxdemo.config.ui.fontSize"),
+ t("jaxxdemo.config.ui.fontSize"),
"10f",
Float.class,
false,
false),
DEMO_COLOR(
"ui." + PROPERTY_DEMO_COLOR,
- _("jaxxdemo.config.ui.demoColor"),
+ t("jaxxdemo.config.ui.demoColor"),
"#ffffff",
Color.class,
false,
false),
DEMO_CLASS(
"ui." + PROPERTY_DEMO_CLASS,
- _("jaxxdemo.config.ui.demoClass"),
+ t("jaxxdemo.config.ui.demoClass"),
"java.io.File",
Class.class,
false,
@@ -419,28 +419,28 @@
LOG_LEVEL(
"ui." + PROPERTY_LOG_LEVEL,
- _("jaxxdemo.config.ui.logLevel"),
+ t("jaxxdemo.config.ui.logLevel"),
"INFO",
String.class,
false,
false),
LOG_PATTERN_LAYOUT(
"ui." + PROPERTY_LOG_PATTERN_LAYOUT,
- _("jaxxdemo.config.ui.logPatternLayout"),
+ t("jaxxdemo.config.ui.logPatternLayout"),
"%5p [%t] (%F:%L) %M - %m%n",
String.class,
false,
false),
KEY_OPEN_CONFIG(
"ui." + PROPERTY_KEY_OPEN_CONFIG,
- _("jaxxdemo.config.ui.keyOpenConfig"),
+ t("jaxxdemo.config.ui.keyOpenConfig"),
"ctrl alt pressed S",
KeyStroke.class,
false,
false),
DEMO_PATH(
"ui.demo.path",
- _("jaxxdemo.config.ui.demo.path"),
+ t("jaxxdemo.config.ui.demo.path"),
"jaxxdemo.tree/jaxxdemo.component.swing/jaxxdemo.component.swing.buttons/" + JButtonDemo.class.getSimpleName(),
String.class,
false,
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUIHandler.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUIHandler.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoUIHandler.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -441,30 +441,30 @@
ConfigUIHelper helper = new ConfigUIHelper(config);
helper.registerCallBack("ui",
- n_("demo.action.reload.ui"),
+ n("demo.action.reload.ui"),
SwingUtil.createActionIcon("reload-ui"),
reloadUICallback);
helper.registerCallBack("application",
- n_("demo.action.reload.application"),
+ n("demo.action.reload.application"),
SwingUtil.createActionIcon("reload-application"),
reloadApplicationCallback);
helper.registerCallBack("log",
- n_("demo.action.reload.logAppender"),
+ n("demo.action.reload.logAppender"),
SwingUtil.createActionIcon("reload-log"),
reloadLogAppenderCallback);
// categorie repertoires
- helper.addCategory(n_("jaxxdemo.config.category.directories"),
- n_("jaxxdemo.config.category.directories.description"));
+ helper.addCategory(n("jaxxdemo.config.category.directories"),
+ n("jaxxdemo.config.category.directories.description"));
helper.addOption(DemoConfig.Option.CONFIG_FILE);
// others
- helper.addCategory(n_("jaxxdemo.config.category.other"),
- n_("jaxxdemo.config.category.other.description"));
+ helper.addCategory(n("jaxxdemo.config.category.other"),
+ n("jaxxdemo.config.category.other.description"));
helper.addOption(DemoConfig.Option.FULL_SCREEN).
setOptionPropertyName(DemoConfig.PROPERTY_FULLSCREEN).
@@ -523,7 +523,7 @@
public void showLogs(DemoUI ui) {
JAXXLog4jUI log4jUI = new JAXXLog4jUI();
- String title = _("jaxxdemo.title.showLog");
+ String title = t("jaxxdemo.title.showLog");
log4jUI.setTitle(title);
log4jUI.showInDialog(ui, false);
}
@@ -535,7 +535,7 @@
URL siteURL = config.getApplicationSiteUrl();
- log.info(_("jaxxdemo.message.goto.site", siteURL));
+ log.info(t("jaxxdemo.message.goto.site", siteURL));
if (log.isDebugEnabled()) {
log.debug("goto " + siteURL);
@@ -559,8 +559,8 @@
String thirdPartyPath = config.getThirdParty();
AboutPanel about = new AboutPanel();
- about.setTitle(_("jaxxdemo.title.about"));
- about.setAboutText(_("jaxxdemo.about.message"));
+ about.setTitle(t("jaxxdemo.title.about"));
+ about.setAboutText(t("jaxxdemo.about.message"));
about.setBottomText(ui.getConfig().getCopyrightText());
about.setIconPath(iconPath);
about.setLicenseFile(licensePath);
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/RunDemo.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -97,7 +97,7 @@
log.debug("i18n loading time : " + StringUtil.convertTime(t00, System.nanoTime()));
}
- log.info(_("jaxxdemo.message.config.loaded", config.getVersion()));
+ log.info(t("jaxxdemo.message.config.loaded", config.getVersion()));
// init jaxx logger
JAXXLog4jUI.init(config.getLogLevel(), config.getLogPatternLayout());
@@ -107,9 +107,9 @@
SwingUtil.initNimbusLoookAndFeel();
} catch (Exception e) {
// could not find nimbus look-and-feel
- log.warn(_("jaxxdemo.warning.nimbus.landf"));
+ log.warn(t("jaxxdemo.warning.nimbus.landf"));
} catch (Throwable e) {
- log.warn(_("jaxxdemo.warning.no.ui"));
+ log.warn(t("jaxxdemo.warning.no.ui"));
}
@@ -117,14 +117,14 @@
log.debug("init done in " + StringUtil.convertTime(t0, System.nanoTime()));
}
- log.info(_("jaxxdemo.init.context.done", StringUtil.convertTime(startingTime, System.nanoTime())));
+ log.info(t("jaxxdemo.init.context.done", StringUtil.convertTime(startingTime, System.nanoTime())));
// on affiche l'ui principale
DemoUIHandler handler = new DemoUIHandler();
DemoUI ui = handler.initUI(rootContext, config);
- log.info(_("jaxxdemo.init.ui.done"));
+ log.info(t("jaxxdemo.init.ui.done"));
DemoApplicationContext.MAIN_UI.setContextValue(rootContext, ui);
@@ -150,7 +150,7 @@
// force to kill main thread
- log.info(_("jaxxdemo.init.closed", new Date()));
+ log.info(t("jaxxdemo.init.closed", new Date()));
Runtime.getRuntime().halt(0);
} catch (Exception ex) {
log.error("error while closing " + ex.getMessage(), ex);
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/BeanComboBoxDemo.css
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/BeanComboBoxDemo.css 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/BeanComboBoxDemo.css 2014-02-04 07:12:14 UTC (rev 2782)
@@ -22,7 +22,7 @@
* #L%
*/
#configurationPanel {
- border: {new TitledBorder(_("jaxxdemo.beancomboboxdemo.configuration"))};
+ border: {new TitledBorder(t("jaxxdemo.beancomboboxdemo.configuration"))};
}
#autoCompleteButton {
@@ -48,7 +48,7 @@
}
#resultPanel {
- border: {new TitledBorder(_("jaxxdemo.beancomboboxdemo.result"))};
+ border: {new TitledBorder(t("jaxxdemo.beancomboboxdemo.result"))};
}
#selectedResult {
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/BeanComboBoxDemoHandler.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/BeanComboBoxDemoHandler.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/BeanComboBoxDemoHandler.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -62,17 +62,17 @@
String result;
if (people == null) {
- result = _("jaxxdemo.beancomboboxdemo.no.people.selected");
+ result = t("jaxxdemo.beancomboboxdemo.no.people.selected");
} else {
- result = _("jaxxdemo.beancomboboxdemo.selected.people", decorator.toString(people));
+ result = t("jaxxdemo.beancomboboxdemo.selected.people", decorator.toString(people));
}
return result;
}
static {
- n_("jaxxdemo.common.people");
- n_("jaxxdemo.common.firstName");
- n_("jaxxdemo.common.lastName");
- n_("jaxxdemo.common.age");
+ n("jaxxdemo.common.people");
+ n("jaxxdemo.common.firstName");
+ n("jaxxdemo.common.lastName");
+ n("jaxxdemo.common.age");
}
}
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/BeanDoubleListDemo.css
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/BeanDoubleListDemo.css 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/BeanDoubleListDemo.css 2014-02-04 07:12:14 UTC (rev 2782)
@@ -22,7 +22,7 @@
* #L%
*/
#configurationPanel {
- border: {new TitledBorder(_("jaxxdemo.beandoublelistdemo.configuration"))};
+ border: {new TitledBorder(t("jaxxdemo.beandoublelistdemo.configuration"))};
}
#filterableButton {
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/BeanFilterableComboBoxDemo.css
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/BeanFilterableComboBoxDemo.css 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/BeanFilterableComboBoxDemo.css 2014-02-04 07:12:14 UTC (rev 2782)
@@ -22,7 +22,7 @@
* #L%
*/
#configurationPanel {
- border: {new TitledBorder(_("jaxxdemo.beanfilterablecomboboxdemo.configuration"))};
+ border: {new TitledBorder(t("jaxxdemo.beanfilterablecomboboxdemo.configuration"))};
}
#filterableButton {
@@ -54,7 +54,7 @@
}
#resultPanel {
- border: {new TitledBorder(_("jaxxdemo.beanfilterablecomboboxdemo.result"))};
+ border: {new TitledBorder(t("jaxxdemo.beanfilterablecomboboxdemo.result"))};
}
#selectedResult {
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/BeanFilterableComboBoxDemoHandler.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/BeanFilterableComboBoxDemoHandler.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/BeanFilterableComboBoxDemoHandler.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -64,17 +64,17 @@
String result;
if (people == null || !People.class.isInstance(people)) {
- result = _("jaxxdemo.beanfilterablecomboboxdemo.no.people.selected");
+ result = t("jaxxdemo.beanfilterablecomboboxdemo.no.people.selected");
} else {
- result = _("jaxxdemo.beanfilterablecomboboxdemo.selected.people", decorator.toString(people));
+ result = t("jaxxdemo.beanfilterablecomboboxdemo.selected.people", decorator.toString(people));
}
return result;
}
static {
- n_("jaxxdemo.common.people");
- n_("jaxxdemo.common.firstName");
- n_("jaxxdemo.common.lastName");
- n_("jaxxdemo.common.age");
+ n("jaxxdemo.common.people");
+ n("jaxxdemo.common.firstName");
+ n("jaxxdemo.common.lastName");
+ n("jaxxdemo.common.age");
}
}
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/CoordinateDemo.css
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/CoordinateDemo.css 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/CoordinateDemo.css 2014-02-04 07:12:14 UTC (rev 2782)
@@ -23,7 +23,7 @@
*/
#config {
- border: {new TitledBorder(_("jaxxdemo.numbereditor.configuration"))};
+ border: {new TitledBorder(t("jaxxdemo.numbereditor.configuration"))};
}
#latitudeShowReset {
@@ -76,7 +76,7 @@
}
#latitudePane {
- border: {new TitledBorder(_("jaxxdemo.coordinate.latitude"))};
+ border: {new TitledBorder(t("jaxxdemo.coordinate.latitude"))};
}
#latitudeDmsEditor {
@@ -106,7 +106,7 @@
}
#longitudePane {
- border: {new TitledBorder(_("jaxxdemo.coordinate.longitude"))};
+ border: {new TitledBorder(t("jaxxdemo.coordinate.longitude"))};
}
#longitudeDmsEditor {
@@ -136,7 +136,7 @@
}
#result {
- border: {new TitledBorder(_("jaxxdemo.coordinate.result"))};
+ border: {new TitledBorder(t("jaxxdemo.coordinate.result"))};
}
#resultLatitude {
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/CoordinateDemoHandler.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/CoordinateDemoHandler.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/CoordinateDemoHandler.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -164,11 +164,11 @@
}
public String getLatitudeText(Float latitude) {
- return _("jaxxdemo.coordinate.result.latitude", latitude);
+ return t("jaxxdemo.coordinate.result.latitude", latitude);
}
public String getLongitudeText(Float longitude) {
- return _("jaxxdemo.coordinate.result.longitude", longitude);
+ return t("jaxxdemo.coordinate.result.longitude", longitude);
}
protected CoordinateDemoModel getModel() {
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/I18nEditorDemo.jaxx 2014-02-04 07:12:14 UTC (rev 2782)
@@ -36,7 +36,7 @@
if (text==null || text.trim().isEmpty()) {
return null;
}
- return new TitledBorder(_(text));
+ return new TitledBorder(t(text));
}
]]>
</script>
@@ -44,7 +44,7 @@
<row>
<cell>
<JPanel
- border='{new TitledBorder(_("jaxxdemo.i18neditor.configuration"))}'
+ border='{new TitledBorder(t("jaxxdemo.i18neditor.configuration"))}'
layout='{new GridLayout(0,1)}'>
<JCheckBox id='showText'
@@ -67,7 +67,7 @@
<JLabel text='jaxxdemo.i18neditor.popupBorderText'
labelFor='{popupBorderText}'/>
<JTextField id='popupBorderText'
- text='{_("jaxxdemo.i18neditor.popup.title")}'/>
+ text='{t("jaxxdemo.i18neditor.popup.title")}'/>
</JPanel>
</JPanel>
@@ -87,7 +87,7 @@
<row>
<cell>
<JLabel
- border='{new TitledBorder(_("jaxxdemo.i18neditor.selected.locale"))}'
+ border='{new TitledBorder(t("jaxxdemo.i18neditor.selected.locale"))}'
text='{editor.getSelectedLocale().toString()}'/>
</cell>
</row>
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemo.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemo.jaxx 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/NumberEditorDemo.jaxx 2014-02-04 07:12:14 UTC (rev 2782)
@@ -27,6 +27,7 @@
<import>
jaxx.runtime.swing.editor.NumberEditor
+ static org.nuiton.i18n.I18n.t
</import>
<!-- model -->
@@ -50,7 +51,7 @@
<row>
<cell>
<JPanel
- border='{new TitledBorder(_("jaxxdemo.numbereditor.configuration"))}'
+ border='{new TitledBorder(t("jaxxdemo.numbereditor.configuration"))}'
layout='{new GridLayout(0,1)}'>
<JCheckBox id='useFloat'
@@ -73,7 +74,7 @@
text='jaxxdemo.numbereditor.autoPopup'
selected='false'/>
<JPanel
- border='{new TitledBorder(_("jaxxdemo.numbereditor.numberPattern.configuration"))}'
+ border='{new TitledBorder(t("jaxxdemo.numbereditor.numberPattern.configuration"))}'
layout='{new GridLayout(1,0)}'>
<JTextField id='numberPattern' text='{"\\d{0,3}"}'/>
<JButton id='applyNumberPattern'
@@ -98,14 +99,14 @@
</row>
<row>
<cell>
- <JPanel border='{new TitledBorder(_("jaxxdemo.numbereditor.model"))}'
+ <JPanel border='{new TitledBorder(t("jaxxdemo.numbereditor.model"))}'
layout='{new GridLayout(0,1)}'>
<JLabel
- text='{_("jaxxdemo.numbereditor.model.numberPattern", editor.getNumberPattern())}'/>
+ text='{t("jaxxdemo.numbereditor.model.numberPattern", editor.getNumberPattern())}'/>
<JLabel
- text='{_("jaxxdemo.numbereditor.model.int", demoModel.getIntegerProperty())}'/>
+ text='{t("jaxxdemo.numbereditor.model.int", demoModel.getIntegerProperty())}'/>
<JLabel
- text='{_("jaxxdemo.numbereditor.model.float", demoModel.getFloatProperty())}'/>
+ text='{t("jaxxdemo.numbereditor.model.float", demoModel.getFloatProperty())}'/>
</JPanel>
</cell>
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/SimpleTimeEditorDemo.css
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/SimpleTimeEditorDemo.css 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/SimpleTimeEditorDemo.css 2014-02-04 07:12:14 UTC (rev 2782)
@@ -23,18 +23,18 @@
* #L%
*/
#configPanel {
- border:{new TitledBorder(_("jaxxdemo.numbereditor.configuration"))};
+ border:{new TitledBorder(t("jaxxdemo.numbereditor.configuration"))};
layout:{new GridLayout(0,1)};
}
#editor {
property:"time";
- border:{new TitledBorder(_("jaxxdemo.timeeditor.editor"))};
+ border:{new TitledBorder(t("jaxxdemo.timeeditor.editor"))};
bean:{demoModel};
date:{demoModel.getTime()};
}
#resultPane {
- border:{new TitledBorder(_("jaxxdemo.timeeditor.model"))};
+ border:{new TitledBorder(t("jaxxdemo.timeeditor.model"))};
layout:{new BorderLayout()};
}
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/SimpleTimeEditorDemo.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/SimpleTimeEditorDemo.jaxx 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/SimpleTimeEditorDemo.jaxx 2014-02-04 07:12:14 UTC (rev 2782)
@@ -63,7 +63,7 @@
<row>
<cell>
<SimpleTimeEditor id='editor' constructorParams='this'
- border='{new TitledBorder(_("jaxxdemo.timeeditor.editor"))}'/>
+ border='{new TitledBorder(t("jaxxdemo.timeeditor.editor"))}'/>
</cell>
</row>
<row>
@@ -72,7 +72,7 @@
<JPanel id='resultPane'>
<JLabel constraints='BorderLayout.CENTER'
- text='{_("jaxxdemo.timeeditor.value", demoModel.getTime())}'/>
+ text='{t("jaxxdemo.timeeditor.value", demoModel.getTime())}'/>
</JPanel>
</cell>
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/TimeEditorDemo.css
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/TimeEditorDemo.css 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/TimeEditorDemo.css 2014-02-04 07:12:14 UTC (rev 2782)
@@ -23,7 +23,7 @@
* #L%
*/
#configPanel {
- border:{new TitledBorder(_("jaxxdemo.numbereditor.configuration"))};
+ border:{new TitledBorder(t("jaxxdemo.numbereditor.configuration"))};
layout:{new GridLayout(0,1)};
}
@@ -32,19 +32,19 @@
}
#labelConfig {
- text:{_("jaxxdemo.timeeditor.editor")};
+ text:{t("jaxxdemo.timeeditor.editor")};
}
/*FIXME tchemit 2010-09-02 make this works
#editor {
property:"time";
- border:{new TitledBorder(_("jaxxdemo.timeeditor.editor"))};
+ border:{new TitledBorder(t("jaxxdemo.timeeditor.editor"))};
bean:{demoModel};
date:{demoModel.getTime()};
label:{labelConfig.getText()};
}*/
#resultPane {
- border:{new TitledBorder(_("jaxxdemo.timeeditor.model"))};
+ border:{new TitledBorder(t("jaxxdemo.timeeditor.model"))};
layout:{new BorderLayout()};
}
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/TimeEditorDemo.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/TimeEditorDemo.jaxx 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/jaxx/editor/TimeEditorDemo.jaxx 2014-02-04 07:12:14 UTC (rev 2782)
@@ -26,6 +26,7 @@
<import>
jaxx.runtime.swing.editor.TimeEditor
+ static org.nuiton.i18n.I18n.t
</import>
<!-- model -->
@@ -83,7 +84,7 @@
<row>
<cell>
<TimeEditor id='editor' constructorParams='this' property='time'
- border='{new TitledBorder(_("jaxxdemo.timeeditor.editor"))}'
+ border='{new TitledBorder(t("jaxxdemo.timeeditor.editor"))}'
bean='{demoModel}'
date="{demoModel.getTime()}"
label="{labelConfig.getText()}"/>
@@ -95,7 +96,7 @@
<JPanel id='resultPane'>
<JLabel constraints='BorderLayout.CENTER'
- text='{_("jaxxdemo.timeeditor.value", demoModel.getTime())}'/>
+ text='{t("jaxxdemo.timeeditor.value", demoModel.getTime())}'/>
</JPanel>
</cell>
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JComboBoxDemo.jaxx 2014-02-04 07:12:14 UTC (rev 2782)
@@ -27,7 +27,7 @@
<jaxx.demo.DemoPanel>
<import>
javax.swing.DefaultComboBoxModel
- static org.nuiton.i18n.I18n.n_
+ static org.nuiton.i18n.I18n.n
</import>
<script><![CDATA[
@@ -44,9 +44,9 @@
<cell>
<JAXXComboBox id='jaxxComboBox' editable='true'>
- <item value='{_("OK")}' selected='true'/>
- <item value='{_("Cancel")}'/>
- <item value='{_("Help")}'/>
+ <item value='{t("OK")}' selected='true'/>
+ <item value='{t("Cancel")}'/>
+ <item value='{t("Help")}'/>
</JAXXComboBox>
</cell>
@@ -62,7 +62,7 @@
<cell>
<JComboBox id='comboBox'
editable='true'
- model='{new DefaultComboBoxModel(new Object[]{n_("OK"),n_("Cancel"),n_("Help")})}'/>
+ model='{new DefaultComboBoxModel(new Object[]{n("OK"),n("Cancel"),n("Help")})}'/>
</cell>
<cell>
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/entities/AbstractDemoBean.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/entities/AbstractDemoBean.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/entities/AbstractDemoBean.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -26,7 +26,7 @@
import org.jdesktop.beans.AbstractSerializableBean;
-import static org.nuiton.i18n.I18n.n_;
+import static org.nuiton.i18n.I18n.n;
/**
* Abstract demo bean.
@@ -37,8 +37,8 @@
public abstract class AbstractDemoBean extends AbstractSerializableBean {
static {
- n_("jaxxdemo.common.id");
- n_("jaxxdemo.common.image");
+ n("jaxxdemo.common.id");
+ n("jaxxdemo.common.image");
}
public static final String PROPERTY_ID = "id";
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Movie.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Movie.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/entities/Movie.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -31,7 +31,7 @@
import java.util.ArrayList;
import java.util.List;
-import static org.nuiton.i18n.I18n.n_;
+import static org.nuiton.i18n.I18n.n;
/**
* @author tchemit <chemit(a)codelutin.com>
@@ -40,10 +40,10 @@
public class Movie extends AbstractDemoBean {
static {
- n_("jaxxdemo.common.movie");
- n_("jaxxdemo.common.title");
- n_("jaxxdemo.common.year");
- n_("jaxxdemo.common.actors");
+ n("jaxxdemo.common.movie");
+ n("jaxxdemo.common.title");
+ n("jaxxdemo.common.year");
+ n("jaxxdemo.common.actors");
}
protected String title;
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/entities/People.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/entities/People.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/entities/People.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -28,7 +28,7 @@
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
-import static org.nuiton.i18n.I18n.n_;
+import static org.nuiton.i18n.I18n.n;
/**
* @author tchemit <chemit(a)codelutin.com>
@@ -37,10 +37,10 @@
public class People extends AbstractDemoBean {
static {
- n_("jaxxdemo.common.people");
- n_("jaxxdemo.common.firstName");
- n_("jaxxdemo.common.lastName");
- n_("jaxxdemo.common.age");
+ n("jaxxdemo.common.people");
+ n("jaxxdemo.common.firstName");
+ n("jaxxdemo.common.lastName");
+ n("jaxxdemo.common.age");
}
public static final String PROPERTY_FIRST_NAME = "firstName";
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/NavDemoHandler.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/NavDemoHandler.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/NavDemoHandler.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -60,7 +60,7 @@
import java.util.ArrayList;
import java.util.List;
-import static org.nuiton.i18n.I18n.n_;
+import static org.nuiton.i18n.I18n.n;
/**
* Handler of all uis in the Nave demo.
@@ -74,9 +74,9 @@
protected NavDemo ui;
- public static String MOVIES_CATEGORY_NODE = n_("jaxxdemo.common.movies");
+ public static String MOVIES_CATEGORY_NODE = n("jaxxdemo.common.movies");
- public static String ACTORS_CATEGORY_NODE = n_("jaxxdemo.common.actors");
+ public static String ACTORS_CATEGORY_NODE = n("jaxxdemo.common.actors");
@Override
public void beforeInit(NavDemo ui) {
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/ActorContentUI.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/ActorContentUI.jaxx 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/ActorContentUI.jaxx 2014-02-04 07:12:14 UTC (rev 2782)
@@ -40,7 +40,7 @@
verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
<JTextPane editable='false' font-size='11'
- border='{new TitledBorder(_("jaxxdemo.navigation.actor.title"))}'
+ border='{new TitledBorder(t("jaxxdemo.navigation.actor.title"))}'
text='{getHandler().getContent(getData())}'/>
</JScrollPane>
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/ActorsContentUI.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/ActorsContentUI.jaxx 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/ActorsContentUI.jaxx 2014-02-04 07:12:14 UTC (rev 2782)
@@ -29,6 +29,8 @@
jaxx.demo.entities.People
jaxx.runtime.swing.editor.bean.BeanListHeader
jaxx.runtime.swing.renderer.DecoratorProviderListCellRenderer
+
+ static org.nuiton.i18n.I18n.t
</import>
<java.util.List id='data' genericType='People' javaBean='null'/>
@@ -42,7 +44,7 @@
<JPanel layout='{new BorderLayout()}'>
<JScrollPane
- border='{new TitledBorder(_("jaxxdemo.navigation.actors.title"))}'
+ border='{new TitledBorder(t("jaxxdemo.navigation.actors.title"))}'
constraints='BorderLayout.CENTER'
columnHeaderView='{toolbar}'
horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}'
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/MovieContentUI.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/MovieContentUI.jaxx 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/MovieContentUI.jaxx 2014-02-04 07:12:14 UTC (rev 2782)
@@ -40,7 +40,7 @@
verticalScrollBarPolicy='{JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED}'>
<JTextPane
- border='{new TitledBorder(_("jaxxdemo.navigation.movie.title"))}'
+ border='{new TitledBorder(t("jaxxdemo.navigation.movie.title"))}'
editable='false' font-size='11'
text='{getHandler().getContent(getData())}'/>
</JScrollPane>
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/MoviesContentUI.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/MoviesContentUI.jaxx 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/content/MoviesContentUI.jaxx 2014-02-04 07:12:14 UTC (rev 2782)
@@ -29,6 +29,8 @@
jaxx.demo.entities.Movie
jaxx.runtime.swing.editor.bean.BeanListHeader
jaxx.runtime.swing.renderer.DecoratorProviderListCellRenderer
+
+ static org.nuiton.i18n.I18n.t
</import>
<script><![CDATA[
@@ -42,7 +44,7 @@
<JPanel layout='{new BorderLayout()}'>
<JScrollPane
- border='{new TitledBorder(_("jaxxdemo.navigation.movies.title"))}'
+ border='{new TitledBorder(t("jaxxdemo.navigation.movies.title"))}'
constraints='BorderLayout.CENTER'
columnHeaderView='{toolbar}'
horizontalScrollBarPolicy='{JScrollPane.HORIZONTAL_SCROLLBAR_NEVER}'
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/tree/MoviesTreeNodeLoador.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/tree/MoviesTreeNodeLoador.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/tree/MoviesTreeNodeLoador.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -34,7 +34,7 @@
import java.util.List;
-import static org.nuiton.i18n.I18n.n_;
+import static org.nuiton.i18n.I18n.n;
/**
* @author sletellier <letellier(a)codelutin.com>
@@ -83,7 +83,7 @@
// Create clients category node
actorsCategoryNode = new NavDemoTreeNode(
String.class,
- n_(NavDemoHandler.ACTORS_CATEGORY_NODE),
+ n(NavDemoHandler.ACTORS_CATEGORY_NODE),
null,
NavHelper.getChildLoador(ActorsTreeNodeLoador.class)
);
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/treetable/MoviesTreeTableNodeLoador.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/treetable/MoviesTreeTableNodeLoador.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/treetable/MoviesTreeTableNodeLoador.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -34,7 +34,7 @@
import java.util.List;
-import static org.nuiton.i18n.I18n.n_;
+import static org.nuiton.i18n.I18n.n;
/**
* @author sletellier <letellier(a)codelutin.com>
@@ -84,7 +84,7 @@
// Create clients category node
actorsCategoryNode = new NavDemoTreeTableNode(
String.class,
- n_(NavDemoHandler.ACTORS_CATEGORY_NODE),
+ n(NavDemoHandler.ACTORS_CATEGORY_NODE),
null,
NavHelper.getChildLoador(ActorsTreeTableNodeLoador.class)
);
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/treetable/NavDemoTreeTableModel.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/treetable/NavDemoTreeTableModel.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/nav/treetable/NavDemoTreeTableModel.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -55,7 +55,7 @@
// If it's category node
if (node.isStringNode()) {
if (i == 0) {
- return _(id);
+ return t(id);
}
return "";
@@ -107,9 +107,9 @@
@Override
public String[] getColumnsNames() {
- return new String[]{_("jaxxdemo.common.firstName"),
- _("jaxxdemo.common.lastName"),
- _("jaxxdemo.common.age")};
+ return new String[]{t("jaxxdemo.common.firstName"),
+ t("jaxxdemo.common.lastName"),
+ t("jaxxdemo.common.age")};
}
@Override
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/list/ListBeanValidationDemo.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/list/ListBeanValidationDemo.jaxx 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/list/ListBeanValidationDemo.jaxx 2014-02-04 07:12:14 UTC (rev 2782)
@@ -28,7 +28,7 @@
<import>
org.jdesktop.swingx.JXTable
javax.swing.JOptionPane
- static org.nuiton.i18n.I18n.n_
+ static org.nuiton.i18n.I18n.n
jaxx.demo.entities.People
org.nuiton.validator.bean.list.BeanListValidator
jaxx.runtime.validator.swing.SwingListValidatorMessageTableModel
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/list/ListBeanValidationDemoHandler.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/list/ListBeanValidationDemoHandler.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/list/ListBeanValidationDemoHandler.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -43,7 +43,7 @@
import java.util.Arrays;
import java.util.UUID;
-import static org.nuiton.i18n.I18n.n_;
+import static org.nuiton.i18n.I18n.n;
/**
* Handler of UI {@link ListBeanValidationDemo}.
@@ -71,14 +71,14 @@
Arrays.asList(new RowSorter.SortKey(0, SortOrder.ASCENDING)));
SwingUtil.setI18nTableHeaderRenderer(
dataTable,
- n_("jaxx.demo.label.id"),
- n_("jaxx.demo.label.id.tip"),
- n_("jaxx.demo.label.firstName"),
- n_("jaxx.demo.label.firstName.tip"),
- n_("jaxx.demo.label.lastName"),
- n_("jaxx.demo.label.lastName.tip"),
- n_("jaxx.demo.label.age"),
- n_("jaxx.demo.label.age.tip"));
+ n("jaxx.demo.label.id"),
+ n("jaxx.demo.label.id.tip"),
+ n("jaxx.demo.label.firstName"),
+ n("jaxx.demo.label.firstName.tip"),
+ n("jaxx.demo.label.lastName"),
+ n("jaxx.demo.label.lastName.tip"),
+ n("jaxx.demo.label.age"),
+ n("jaxx.demo.label.age.tip"));
SwingUtil.fixTableColumnWidth(dataTable, 3, 35);
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/simple/SimpleBeanValidationByListDemo.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/simple/SimpleBeanValidationByListDemo.jaxx 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/simple/SimpleBeanValidationByListDemo.jaxx 2014-02-04 07:12:14 UTC (rev 2782)
@@ -28,7 +28,7 @@
<import>
javax.swing.JOptionPane
- static org.nuiton.i18n.I18n.n_
+ static org.nuiton.i18n.I18n.n
jaxx.demo.entities.Identity
jaxx.demo.entities.Model
jaxx.runtime.validator.swing.SwingValidatorMessageListRenderer
@@ -93,7 +93,7 @@
</cell>
<cell weightx='1'>
<JTextField id='text' text='{model1.getText()}'
- _validatorLabel='{n_("form.text")}'
+ _validatorLabel='{n("form.text")}'
onKeyReleased='model1.setText(text.getText())'/>
</cell>
</row>
@@ -103,7 +103,7 @@
</cell>
<cell weightx='1'>
<JTextField id='text2' text='{model1.getText2()}'
- _validatorLabel='{n_("form.text2")}'
+ _validatorLabel='{n("form.text2")}'
onKeyReleased='model1.setText2(text2.getText())'/>
</cell>
</row>
@@ -115,7 +115,7 @@
<cell>
<JSlider id='ratio' minimum='0' maximum='100'
value='{model1.getRatio()}'
- _validatorLabel='{n_("form.ratio")}'
+ _validatorLabel='{n("form.ratio")}'
onStateChanged='model1.setRatio(ratio.getValue())'/>
</cell>
</row>
@@ -166,7 +166,7 @@
</cell>
<cell weightx='1'>
<JTextField id='_text' text='{model2.getText()}'
- _validatorLabel='{n_("form2.text")}'
+ _validatorLabel='{n("form2.text")}'
onKeyReleased='model2.setText(_text.getText())'/>
</cell>
</row>
@@ -176,7 +176,7 @@
</cell>
<cell weightx='1'>
<JTextField id='_text2' text='{model2.getText2()}'
- _validatorLabel='{n_("form2.text2")}'
+ _validatorLabel='{n("form2.text2")}'
onKeyReleased='model2.setText2(_text2.getText())'/>
</cell>
</row>
@@ -188,7 +188,7 @@
<cell>
<JSlider id='_ratio' minimum='0' maximum='100'
value='{model2.getRatio()}'
- _validatorLabel='{n_("form2.ratio")}'
+ _validatorLabel='{n("form2.ratio")}'
onStateChanged='model2.setRatio(_ratio.getValue())'/>
</cell>
</row>
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/simple/SimpleBeanValidationByTableDemo.jaxx
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/simple/SimpleBeanValidationByTableDemo.jaxx 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/feature/validation/simple/SimpleBeanValidationByTableDemo.jaxx 2014-02-04 07:12:14 UTC (rev 2782)
@@ -28,7 +28,7 @@
<import>
javax.swing.JOptionPane
- static org.nuiton.i18n.I18n.n_
+ static org.nuiton.i18n.I18n.n
jaxx.demo.entities.Identity
jaxx.demo.entities.Model
jaxx.runtime.validator.swing.SwingValidatorUtil
@@ -99,7 +99,7 @@
<cell weightx='1'>
<JTextField id='text' text='{model1.getText()}'
onKeyReleased='model1.setText(text.getText())'
- _validatorLabel='{n_("form.text")}'
+ _validatorLabel='{n("form.text")}'
/>
</cell>
</row>
@@ -110,7 +110,7 @@
<cell weightx='1'>
<JTextField id='text2' text='{model1.getText2()}'
onKeyReleased='model1.setText2(text2.getText())'
- _validatorLabel='{n_("form.text2")}'
+ _validatorLabel='{n("form.text2")}'
/>
</cell>
</row>
@@ -122,7 +122,7 @@
<cell>
<JSlider id='ratio' minimum='0' maximum='100'
value='{model1.getRatio()}'
- _validatorLabel='{n_("form.ratio")}'
+ _validatorLabel='{n("form.ratio")}'
onStateChanged='model1.setRatio(ratio.getValue())'/>
</cell>
</row>
@@ -173,7 +173,7 @@
</cell>
<cell weightx='1'>
<JTextField id='_text' text='{model2.getText()}'
- _validatorLabel='{n_("form2.text")}'
+ _validatorLabel='{n("form2.text")}'
onKeyReleased='model2.setText(_text.getText())'/>
</cell>
</row>
@@ -183,7 +183,7 @@
</cell>
<cell weightx='1'>
<JTextField id='_text2' text='{model2.getText2()}'
- _validatorLabel='{n_("form2.text2")}'
+ _validatorLabel='{n("form2.text2")}'
onKeyReleased='model2.setText2(_text2.getText())'/>
</cell>
</row>
@@ -195,7 +195,7 @@
<cell>
<JSlider id='_ratio' minimum='0' maximum='100'
value='{model2.getRatio()}'
- _validatorLabel='{n_("form2.ratio")}'
+ _validatorLabel='{n("form2.ratio")}'
onStateChanged='model2.setRatio(_ratio.getValue())'/>
</cell>
</row>
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoCellRenderer.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoCellRenderer.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoCellRenderer.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -70,7 +70,7 @@
if (node.isStringNode()) {
// String node
- toDecorate = _(id);
+ toDecorate = t(id);
} else {
// Demo node
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoDataProvider.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoDataProvider.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/tree/DemoDataProvider.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -75,7 +75,7 @@
import jaxx.demo.component.jaxx.editor.BeanDoubleListDemo;
import jaxx.demo.component.jaxx.editor.BeanFilterableComboBoxDemo;
-import static org.nuiton.i18n.I18n.n_;
+import static org.nuiton.i18n.I18n.n;
/**
* Data provider of the navigation tree.
@@ -100,64 +100,64 @@
}
addMapping("jaxxdemo.tree",
- n_("jaxxdemo.component.swing"),
- n_("jaxxdemo.component.jaxx"),
- n_("jaxxdemo.feature"),
- n_("jaxxdemo.fun")
+ n("jaxxdemo.component.swing"),
+ n("jaxxdemo.component.jaxx"),
+ n("jaxxdemo.feature"),
+ n("jaxxdemo.fun")
);
- addMapping(n_("jaxxdemo.component.swing"),
- n_("jaxxdemo.component.swing.buttons"),
- n_("jaxxdemo.component.swing.form"),
- n_("jaxxdemo.component.swing.layout"),
- n_("jaxxdemo.component.swing.menu"),
- n_("jaxxdemo.component.swing.window"),
+ addMapping(n("jaxxdemo.component.swing"),
+ n("jaxxdemo.component.swing.buttons"),
+ n("jaxxdemo.component.swing.form"),
+ n("jaxxdemo.component.swing.layout"),
+ n("jaxxdemo.component.swing.menu"),
+ n("jaxxdemo.component.swing.window"),
JProgressBarDemo.class
);
- addMapping(n_("jaxxdemo.component.swing.buttons"),
+ addMapping(n("jaxxdemo.component.swing.buttons"),
JButtonDemo.class,
JCheckBoxDemo.class,
JRadioButtonDemo.class,
JToggleButtonDemo.class
);
- addMapping(n_("jaxxdemo.component.swing.form"),
- n_("jaxxdemo.component.swing.form.text"),
+ addMapping(n("jaxxdemo.component.swing.form"),
+ n("jaxxdemo.component.swing.form.text"),
JComboBoxDemo.class,
JListDemo.class,
JSliderDemo.class,
JSpinnerDemo.class
);
- addMapping(n_("jaxxdemo.component.swing.form.text"),
+ addMapping(n("jaxxdemo.component.swing.form.text"),
JPasswordFieldDemo.class,
JTextFieldDemo.class,
JTextAreaDemo.class
);
- addMapping(n_("jaxxdemo.component.swing.layout"),
+ addMapping(n("jaxxdemo.component.swing.layout"),
JSplitPaneDemo.class
);
- addMapping(n_("jaxxdemo.component.swing.menu"),
+ addMapping(n("jaxxdemo.component.swing.menu"),
JMenuItemDemo.class,
JCheckBoxMenuItemDemo.class,
JRadioButtonMenuItemDemo.class
);
- addMapping(n_("jaxxdemo.component.swing.window"),
+ addMapping(n("jaxxdemo.component.swing.window"),
JDialogDemo.class
);
- addMapping(n_("jaxxdemo.component.jaxx"),
+ addMapping(n("jaxxdemo.component.jaxx"),
HidorButtonDemo.class,
- n_("jaxxdemo.component.jaxx.editor"),
+ n("jaxxdemo.component.jaxx.editor"),
StatusMessagePanelDemo.class,
BoxedDecoratorDemo.class
);
- addMapping(n_("jaxxdemo.component.jaxx.editor"),
+ addMapping(n("jaxxdemo.component.jaxx.editor"),
TimeEditorDemo.class,
SimpleTimeEditorDemo.class,
NumberEditorDemo.class,
@@ -172,35 +172,35 @@
CoordinateDemo.class
);
- addMapping(n_("jaxxdemo.feature"),
- n_("jaxxdemo.feature.databinding"),
- n_("jaxxdemo.feature.validation"),
- n_("jaxxdemo.feature.nav")
+ addMapping(n("jaxxdemo.feature"),
+ n("jaxxdemo.feature.databinding"),
+ n("jaxxdemo.feature.validation"),
+ n("jaxxdemo.feature.nav")
);
- addMapping(n_("jaxxdemo.feature.databinding"),
+ addMapping(n("jaxxdemo.feature.databinding"),
BindingExtremeDemo.class,
BeanDataBindingDemo.class
);
- addMapping(n_("jaxxdemo.feature.validation"),
- n_("jaxxdemo.feature.simple.validation"),
- n_("jaxxdemo.feature.list.validation")
+ addMapping(n("jaxxdemo.feature.validation"),
+ n("jaxxdemo.feature.simple.validation"),
+ n("jaxxdemo.feature.list.validation")
);
- addMapping(n_("jaxxdemo.feature.simple.validation"),
+ addMapping(n("jaxxdemo.feature.simple.validation"),
SimpleBeanValidationByListDemo.class,
SimpleBeanValidationByTableDemo.class
);
- addMapping(n_("jaxxdemo.feature.list.validation"),
+ addMapping(n("jaxxdemo.feature.list.validation"),
ListBeanValidationDemo.class
);
- addMapping(n_("jaxxdemo.feature.nav"),
+ addMapping(n("jaxxdemo.feature.nav"),
NavDemo.class
);
- addMapping(n_("jaxxdemo.fun"),
+ addMapping(n("jaxxdemo.fun"),
LabelStyleDemo.class,
CounterDemo.class,
CalculatorDemo.class
Modified: trunk/jaxx-maven-plugin/src/main/java/org/nuiton/jaxx/plugin/NodeItem.java
===================================================================
--- trunk/jaxx-maven-plugin/src/main/java/org/nuiton/jaxx/plugin/NodeItem.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-maven-plugin/src/main/java/org/nuiton/jaxx/plugin/NodeItem.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -141,7 +141,7 @@
public void applyI18n(String prefix, String suffix) {
String key = prefix + getAbsoluteTarget() + suffix;
- text = _(key);
+ text = t(key);
if (!isLeaf()) {
for (NodeItem i : getChilds()) {
i.applyI18n(prefix, suffix);
Modified: trunk/jaxx-maven-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1751Test.java
===================================================================
--- trunk/jaxx-maven-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1751Test.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-maven-plugin/src/test/java/org/nuiton/jaxx/plugin/Bug1751Test.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -37,7 +37,7 @@
assertNumberJaxxFiles(3);
checkPattern(mojo, "implements Serializable", true);
- checkPattern(mojo, "setText(_(\"test\"))", true);
+ checkPattern(mojo, "setText(t(\"test\"))", true);
}
}
\ No newline at end of file
Modified: trunk/jaxx-maven-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java
===================================================================
--- trunk/jaxx-maven-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-maven-plugin/src/test/java/org/nuiton/jaxx/plugin/CompilerValidatorTest.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -31,10 +31,11 @@
import org.apache.maven.plugin.logging.SystemStreamLog;
-
+import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;
+@Ignore
public class CompilerValidatorTest extends JaxxBaseTest {
/** Logger. */
Modified: trunk/jaxx-maven-plugin/src/test/java/org/nuiton/jaxx/plugin/I18nTest.java
===================================================================
--- trunk/jaxx-maven-plugin/src/test/java/org/nuiton/jaxx/plugin/I18nTest.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-maven-plugin/src/test/java/org/nuiton/jaxx/plugin/I18nTest.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -34,12 +34,12 @@
GenerateMojo mojo = getMojo();
mojo.i18nable = false;
mojo.execute();
- checkPattern(mojo, "setText(_(\"test.text\"));", false);
+ checkPattern(mojo, "setText(t(\"test.text\"));", false);
mojo.i18nable = true;
mojo.execute();
- checkPattern(mojo, "setText(_(\"test.text\"));", true);
- checkPattern(mojo, "\"_(\\\"test.text\\\")\"", false);
+ checkPattern(mojo, "setText(t(\"test.text\"));", true);
+ checkPattern(mojo, "t(\\\"test.text\\\")", false);
}
@Test
@@ -47,12 +47,12 @@
GenerateMojo mojo = getMojo();
mojo.i18nable = false;
mojo.execute();
- checkPattern(mojo, "setTitle(_(\"test.title\"));", false);
+ checkPattern(mojo, "setTitle(t(\"test.title\"));", false);
mojo.i18nable = true;
mojo.execute();
- checkPattern(mojo, "setTitle(_(\"test.title\"));", true);
- checkPattern(mojo, "\"_(\\\"test.title\\\")\"", false);
+ checkPattern(mojo, "setTitle(t(\"test.title\"));", true);
+ checkPattern(mojo, "t(\\\"test.title\\\")", false);
}
@Test
@@ -60,11 +60,11 @@
GenerateMojo mojo = getMojo();
mojo.i18nable = false;
mojo.execute();
- checkPattern(mojo, "setToolTipText(_(\"test.toolTipText\"));", false);
+ checkPattern(mojo, "setToolTipText(t(\"test.toolTipText\"));", false);
mojo.i18nable = true;
mojo.execute();
- checkPattern(mojo, "setToolTipText(_(\"test.toolTipText\"));", true);
- checkPattern(mojo, "\"_(\\\"test.toolTipText\\\")\"", false);
+ checkPattern(mojo, "setToolTipText(t(\"test.toolTipText\"));", true);
+ checkPattern(mojo, "t(\\\"test.toolTipText\\\")", false);
}
}
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/SwingUtil.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/SwingUtil.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/SwingUtil.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -1092,7 +1092,7 @@
try {
if (!Desktop.isDesktopSupported()) {
throw new IllegalStateException(
- _("swing.error.desktop.not.supported"));
+ t("swing.error.desktop.not.supported"));
}
@@ -1101,7 +1101,7 @@
if (!desktop.isSupported(Desktop.Action.BROWSE)) {
throw new IllegalStateException(
- _("swing.error.desktop.browse.not.supported"));
+ t("swing.error.desktop.browse.not.supported"));
}
URI uri = new URI(url);
@@ -1497,7 +1497,7 @@
} catch (Exception e) {
throw new RuntimeException(
- _("application.error.cannot.open.link", uri), e);
+ t("application.error.cannot.open.link", uri), e);
}
}
@@ -1505,7 +1505,7 @@
if (!Desktop.isDesktopSupported()) {
throw new RuntimeException(
- _("application.error.desktop.not.supported"));
+ t("application.error.desktop.not.supported"));
}
Desktop desktop = Desktop.getDesktop();
@@ -1513,7 +1513,7 @@
if (!desktop.isSupported(Desktop.Action.BROWSE)) {
throw new RuntimeException(
- _("application.error.desktop.browse.not.supported"));
+ t("application.error.desktop.browse.not.supported"));
}
return desktop;
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/awt/visitor/ComponentTreeNode.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/awt/visitor/ComponentTreeNode.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/awt/visitor/ComponentTreeNode.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -24,7 +24,7 @@
* #L%
*/
-import org.apache.commons.collections.iterators.EnumerationIterator;
+import org.apache.commons.collections4.iterators.EnumerationIterator;
import javax.swing.tree.DefaultMutableTreeNode;
import java.awt.Component;
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/model/JaxxDefaultComboBoxModel.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/model/JaxxDefaultComboBoxModel.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/model/JaxxDefaultComboBoxModel.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -24,7 +24,7 @@
* #L%
*/
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
import javax.swing.AbstractListModel;
import javax.swing.DefaultComboBoxModel;
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/model/JaxxDefaultListModel.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/model/JaxxDefaultListModel.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/model/JaxxDefaultListModel.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -25,7 +25,7 @@
*/
import com.google.common.collect.Lists;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
import javax.swing.AbstractListModel;
import javax.swing.DefaultListModel;
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/tree/AbstractNavTreeCellRenderer.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/tree/AbstractNavTreeCellRenderer.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/nav/tree/AbstractNavTreeCellRenderer.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -100,7 +100,7 @@
// calculer le rendu du noeud
if (node.isStringNode()) {
- text = _(node.getId());
+ text = t(node.getId());
} else {
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/I18nTableCellRenderer.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/I18nTableCellRenderer.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/renderer/I18nTableCellRenderer.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -84,7 +84,7 @@
}
TableColumn col = table.getColumn(table.getColumnName(column));
int index = col.getModelIndex();
- value = _(keys[index]);
+ value = t(keys[index]);
JComponent rendererComponent = (JComponent)
delegate.getTableCellRendererComponent(
table,
@@ -94,7 +94,7 @@
row,
column
);
- rendererComponent.setToolTipText(_(tips[index]));
+ rendererComponent.setToolTipText(t(tips[index]));
return rendererComponent;
}
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/session/SwingSession.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/session/SwingSession.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/session/SwingSession.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -27,8 +27,8 @@
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.collections.Predicate;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.Predicate;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.JXTable;
Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUtil.java
===================================================================
--- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUtil.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/wizard/WizardUtil.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -169,8 +169,8 @@
if (oldStepIndex + 1 == newStepIndex) {
// creation d'un nouvel onglet
WizardStepUI<E, M> c = ui.getStepUI(newStep);
- String title = _(newStep.getLabel());
- String tip = _(newStep.getDescription());
+ String title = t(newStep.getLabel());
+ String tip = t(newStep.getDescription());
tabs.addTab(title, null, (Component) c, tip);
// selection du nouvel onglet
int index = tabs.indexOfComponent((Component) c);
Modified: trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SimpleBeanValidatorMessageTableRenderer.java
===================================================================
--- trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SimpleBeanValidatorMessageTableRenderer.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SimpleBeanValidatorMessageTableRenderer.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -78,20 +78,20 @@
// scope
NuitonValidatorScope scope = (NuitonValidatorScope) value;
icon = SwingValidatorUtil.getIcon(scope);
- String label = _(scope.getLabel());
- toolTipText = _("validator.scope.tip", label);
+ String label = t(scope.getLabel());
+ toolTipText = t("validator.scope.tip", label);
break;
case 1:
// field name
text = getFieldName(table, (String) value, row);
- toolTipText = _("validator.field.tip", text);
+ toolTipText = t("validator.field.tip", text);
break;
case 2:
// message
text = getMessage(table, (String) value, row);
- toolTipText = _("validator.message.tip", text);
+ toolTipText = t("validator.message.tip", text);
break;
}
Modified: trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingListValidatorMessageTableRenderer.java
===================================================================
--- trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingListValidatorMessageTableRenderer.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingListValidatorMessageTableRenderer.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -74,26 +74,26 @@
// scope
NuitonValidatorScope scope = (NuitonValidatorScope) value;
icon = SwingValidatorUtil.getIcon(scope);
- String label = _(scope.getLabel());
- toolTipText = _("validator.scope.tip", label);
+ String label = t(scope.getLabel());
+ toolTipText = t("validator.scope.tip", label);
break;
case 1:
// row bean
text = getBeanValue(table, row);
- toolTipText = _("validator.bean.tip", text);
+ toolTipText = t("validator.bean.tip", text);
break;
case 2:
// field name
text = getFieldName(table, (String) value, row);
- toolTipText = _("validator.field.tip", text);
+ toolTipText = t("validator.field.tip", text);
break;
case 3:
// message
text = getMessage(table, (String) value, row);
- toolTipText = _("validator.message.tip", text);
+ toolTipText = t("validator.message.tip", text);
break;
}
Modified: trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListRenderer.java
===================================================================
--- trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListRenderer.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageListRenderer.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -99,9 +99,9 @@
// text to display
String text = String.format(format, fieldName, message);
- String label = _(model.getScope().getLabel());
- String tmp = _("validator.scope.tip", label);
- String tmp2 = _("validator.field.tip", fieldName);
+ String label = t(model.getScope().getLabel());
+ String tmp = t("validator.scope.tip", label);
+ String tmp2 = t("validator.field.tip", fieldName);
String tooltTipText = String.format(formatTip, tmp, tmp2, message);
Modified: trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableRenderer.java
===================================================================
--- trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableRenderer.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorMessageTableRenderer.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -77,20 +77,20 @@
// scope
NuitonValidatorScope scope = (NuitonValidatorScope) value;
icon = SwingValidatorUtil.getIcon(scope);
- String label = _(scope.getLabel());
- toolTipText = _("validator.scope.tip", label);
+ String label = t(scope.getLabel());
+ toolTipText = t("validator.scope.tip", label);
break;
case 1:
// field name
text = getFieldName(table, (String) value, row);
- toolTipText = _("validator.field.tip", text);
+ toolTipText = t("validator.field.tip", text);
break;
case 2:
// message
text = getMessage(table, (String) value, row);
- toolTipText = _("validator.message.tip", text);
+ toolTipText = t("validator.message.tip", text);
break;
}
Modified: trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorUtil.java
===================================================================
--- trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorUtil.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-validator/src/main/java/jaxx/runtime/validator/swing/SwingValidatorUtil.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -60,7 +60,7 @@
import java.util.List;
import java.util.Map;
-import static org.nuiton.i18n.I18n.n_;
+import static org.nuiton.i18n.I18n.n;
/**
* The helper class for swing validation module.
@@ -277,12 +277,12 @@
Arrays.asList(new RowSorter.SortKey(0, SortOrder.ASCENDING)));
SwingUtil.setI18nTableHeaderRenderer(
errorTable,
- n_("validator.scope.header"),
- n_("validator.scope.header.tip"),
- n_("validator.field.header"),
- n_("validator.field.header.tip"),
- n_("validator.message.header"),
- n_("validator.message.header.tip"));
+ n("validator.scope.header"),
+ n("validator.scope.header.tip"),
+ n("validator.field.header"),
+ n("validator.field.header.tip"),
+ n("validator.message.header"),
+ n("validator.message.header.tip"));
// register a single 'goto widget error' mouse listener on errorTable
registerErrorTableMouseListener(errorTable);
SwingUtil.fixTableColumnWidth(errorTable, 0, 25);
@@ -302,12 +302,12 @@
Arrays.asList(new RowSorter.SortKey(0, SortOrder.ASCENDING)));
SwingUtil.setI18nTableHeaderRenderer(
errorTable,
- n_("validator.scope.header"),
- n_("validator.scope.header.tip"),
- n_("validator.field.header"),
- n_("validator.field.header.tip"),
- n_("validator.message.header"),
- n_("validator.message.header.tip"));
+ n("validator.scope.header"),
+ n("validator.scope.header.tip"),
+ n("validator.field.header"),
+ n("validator.field.header.tip"),
+ n("validator.message.header"),
+ n("validator.message.header.tip"));
SwingUtil.fixTableColumnWidth(errorTable, 0, 25);
}
@@ -326,14 +326,14 @@
Arrays.asList(new RowSorter.SortKey(0, SortOrder.ASCENDING)));
SwingUtil.setI18nTableHeaderRenderer(
errorTable,
- n_("validator.scope.header"),
- n_("validator.scope.header.tip"),
- n_("validator.bean.header"),
- n_("validator.bean.header.tip"),
- n_("validator.field.header"),
- n_("validator.field.header.tip"),
- n_("validator.message.header"),
- n_("validator.message.header.tip"));
+ n("validator.scope.header"),
+ n("validator.scope.header.tip"),
+ n("validator.bean.header"),
+ n("validator.bean.header.tip"),
+ n("validator.field.header"),
+ n("validator.field.header.tip"),
+ n("validator.message.header"),
+ n("validator.message.header.tip"));
SwingUtil.fixTableColumnWidth(errorTable, 0, 25);
}
Modified: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/AboutPanelHandler.java
===================================================================
--- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/AboutPanelHandler.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/AboutPanelHandler.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -185,6 +185,6 @@
void $afterCompleteSetup() {
buildTopPanel();
- ui.close.setText(_("aboutframe.ok"));
+ ui.close.setText(t("aboutframe.ok"));
}
}
Modified: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/HidorButton.jaxx
===================================================================
--- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/HidorButton.jaxx 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/HidorButton.jaxx 2014-02-04 07:12:14 UTC (rev 2782)
@@ -33,6 +33,7 @@
<import>
javax.swing.Icon
javax.swing.JComponent
+ static org.nuiton.i18n.I18n.t
</import>
<HidorButtonHandler id='myHandler' constructorParams='this'/>
@@ -43,9 +44,9 @@
<String id='showText' javaBean='""'/>
- <String id='hideTip' javaBean='_("hidor.hideTip")'/>
+ <String id='hideTip' javaBean='t("hidor.hideTip")'/>
- <String id='showTip' javaBean='_("hidor.showTip")'/>
+ <String id='showTip' javaBean='t("hidor.showTip")'/>
<script><![CDATA[
Modified: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/I18nEditor.jaxx
===================================================================
--- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/I18nEditor.jaxx 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/I18nEditor.jaxx 2014-02-04 07:12:14 UTC (rev 2782)
@@ -46,7 +46,7 @@
jaxx.runtime.swing.renderer.LocaleListCellRenderer
- static org.nuiton.i18n.I18n.n_
+ static org.nuiton.i18n.I18n.n
</import>
<I18nEditorHandler id='handler' constructorParams='this'/>
@@ -55,7 +55,7 @@
<String id='notSelectedToolTipText' javaBean='null'/>
<Border id='popupBorder'
- javaBean='new TitledBorder(_("i18neditor.popup.title"))'/>
+ javaBean='new TitledBorder(t("i18neditor.popup.title"))'/>
<Boolean id='showText' javaBean='Boolean.TRUE'/>
<Boolean id='showIcon' javaBean='Boolean.TRUE'/>
@@ -95,8 +95,8 @@
onStateChanged='log.info(indexes.getSelectedValue())'/>
<script><![CDATA[
-public static final String DEFAULT_SELECTED_TOOLTIP = n_("i18neditor.selected");
-public static final String DEFAULT_NOT_SELECTED_TOOLTIP = n_("i18neditor.unselected");
+public static final String DEFAULT_SELECTED_TOOLTIP = n("i18neditor.selected");
+public static final String DEFAULT_NOT_SELECTED_TOOLTIP = n("i18neditor.unselected");
public static final String LOCALES_PROPERTY = "locales";
public static final String SELECTED_LOCALE_PROPERTY = "selectedLocale";
Modified: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/I18nEditorHandler.java
===================================================================
--- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/I18nEditorHandler.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/I18nEditorHandler.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -64,9 +64,9 @@
this.ui = ui;
}
- public static final String DEFAULT_SELECTED_TOOLTIP = n_("i18neditor.selected");
+ public static final String DEFAULT_SELECTED_TOOLTIP = n("i18neditor.selected");
- public static final String DEFAULT_NOT_SELECTED_TOOLTIP = n_("i18neditor.unselected");
+ public static final String DEFAULT_NOT_SELECTED_TOOLTIP = n("i18neditor.unselected");
public static final String LOCALES_PROPERTY = "locales";
@@ -217,7 +217,7 @@
selectedTip = DEFAULT_SELECTED_TOOLTIP;
}
String tip = ui.renderer.getToolTipText(l);
- tip = _(selectedTip, tip);
+ tip = t(selectedTip, tip);
return tip;
}
@@ -228,7 +228,7 @@
selectedTip = DEFAULT_NOT_SELECTED_TOOLTIP;
}
String tip = ui.renderer.getToolTipText(l);
- tip = _(selectedTip, tip);
+ tip = t(selectedTip, tip);
return tip;
}
Modified: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBox.css
===================================================================
--- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBox.css 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBox.css 2014-02-04 07:12:14 UTC (rev 2782)
@@ -31,7 +31,7 @@
}
#popup {
- border:{new TitledBorder(_("beancombobox.popup.title"))};
+ border:{new TitledBorder(t("beancombobox.popup.title"))};
}
#popupSortLabel {
Modified: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBoxHandler.java
===================================================================
--- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBoxHandler.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanComboBoxHandler.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -28,7 +28,7 @@
import jaxx.runtime.SwingUtil;
import jaxx.runtime.swing.JAXXButtonGroup;
import jaxx.runtime.swing.renderer.DecoratorListCellRenderer;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jdesktop.swingx.autocomplete.ObjectToStringConverter;
Modified: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanDoubleList.css
===================================================================
--- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanDoubleList.css 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanDoubleList.css 2014-02-04 07:12:14 UTC (rev 2782)
@@ -52,7 +52,7 @@
}
#popup {
- border:{new TitledBorder(_("beandoublelist.popup.title"))};
+ border:{new TitledBorder(t("beandoublelist.popup.title"))};
}
#popupSortLabel {
Modified: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanFilterableComboBox.css
===================================================================
--- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanFilterableComboBox.css 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanFilterableComboBox.css 2014-02-04 07:12:14 UTC (rev 2782)
@@ -31,7 +31,7 @@
}
#popup {
- border:{ new TitledBorder(_("beancombobox.popup.title")) };
+ border:{ new TitledBorder(t("beancombobox.popup.title")) };
}
#popupSortLabel {
Modified: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanFilterableComboBoxHandler.java
===================================================================
--- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanFilterableComboBoxHandler.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanFilterableComboBoxHandler.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -30,7 +30,7 @@
import jaxx.runtime.swing.JAXXButtonGroup;
import jaxx.runtime.swing.model.JaxxFilterableComboBoxModel;
import jaxx.runtime.swing.renderer.DecoratorListCellRenderer;
-import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.decorator.DecoratorUtil;
Modified: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanListHeader.css
===================================================================
--- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanListHeader.css 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanListHeader.css 2014-02-04 07:12:14 UTC (rev 2782)
@@ -31,7 +31,7 @@
}
#popup {
- border:{new TitledBorder(_("beanlist.popup.title"))};
+ border:{new TitledBorder(t("beanlist.popup.title"))};
}
#popupSortLabel {
Modified: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanUIUtil.java
===================================================================
--- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanUIUtil.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/bean/BeanUIUtil.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -80,11 +80,11 @@
*/
public class BeanUIUtil {
- public static final String DEFAULT_POPUP_LABEL = n_("bean.popup.label");
+ public static final String DEFAULT_POPUP_LABEL = n("bean.popup.label");
- public static final String DEFAULT_SELECTED_TOOLTIP = n_("bean.sort.on");
+ public static final String DEFAULT_SELECTED_TOOLTIP = n("bean.sort.on");
- public static final String DEFAULT_NOT_SELECTED_TOOLTIP = n_("bean.sort.off");
+ public static final String DEFAULT_NOT_SELECTED_TOOLTIP = n("bean.sort.off");
public static final Object[] EMPTY_CLASS_ARRAY = new Object[0];
@@ -397,16 +397,16 @@
if (nbContext > 1) {
for (int i = 0; i < nbContext; i++) {
String property = i18nPrefix + decorator.getProperty(i);
- String propertyI18n = _(property);
+ String propertyI18n = t(property);
JRadioButtonMenuItem button = new JRadioButtonMenuItem(propertyI18n);
button.putClientProperty(JAXXButtonGroup.BUTTON8GROUP_CLIENT_PROPERTY, indexes);
button.putClientProperty(JAXXButtonGroup.VALUE_CLIENT_PROPERTY, i);
popup.add(button);
if (selectedTip != null) {
- button.putClientProperty(JAXXButtonGroup.SELECTED_TIP_CLIENT_PROPERTY, _(selectedTip, propertyI18n));
+ button.putClientProperty(JAXXButtonGroup.SELECTED_TIP_CLIENT_PROPERTY, t(selectedTip, propertyI18n));
}
if (notSelectedTip != null) {
- button.putClientProperty(JAXXButtonGroup.NOT_SELECTED_TIP_CLIENT_PROPERTY, _(notSelectedTip, propertyI18n));
+ button.putClientProperty(JAXXButtonGroup.NOT_SELECTED_TIP_CLIENT_PROPERTY, t(notSelectedTip, propertyI18n));
}
button.setSelected(false);
indexes.add(button);
@@ -419,21 +419,21 @@
Class<?> type = decorator.getType();
String beanI18nKey;
if (type == null) {
- beanI18nKey = n_("bean.unknown.type");
+ beanI18nKey = n("bean.unknown.type");
} else {
beanI18nKey = i18nPrefix + Introspector.decapitalize(type.getSimpleName());
}
- String beanI18n = _(beanI18nKey);
- title = _(title, beanI18n);
+ String beanI18n = t(beanI18nKey);
+ title = t(title, beanI18n);
} else {
- title = _(title);
+ title = t(title);
}
- sortDown.putClientProperty(JAXXButtonGroup.SELECTED_TIP_CLIENT_PROPERTY, _("bean.sort.down.tip"));
- sortDown.putClientProperty(JAXXButtonGroup.NOT_SELECTED_TIP_CLIENT_PROPERTY, _("bean.sort.down.toSelect.tip"));
+ sortDown.putClientProperty(JAXXButtonGroup.SELECTED_TIP_CLIENT_PROPERTY, t("bean.sort.down.tip"));
+ sortDown.putClientProperty(JAXXButtonGroup.NOT_SELECTED_TIP_CLIENT_PROPERTY, t("bean.sort.down.toSelect.tip"));
- sortUp.putClientProperty(JAXXButtonGroup.SELECTED_TIP_CLIENT_PROPERTY, _("bean.sort.up.tip"));
- sortUp.putClientProperty(JAXXButtonGroup.NOT_SELECTED_TIP_CLIENT_PROPERTY, _("bean.sort.up.toSelect.tip"));
+ sortUp.putClientProperty(JAXXButtonGroup.SELECTED_TIP_CLIENT_PROPERTY, t("bean.sort.up.tip"));
+ sortUp.putClientProperty(JAXXButtonGroup.NOT_SELECTED_TIP_CLIENT_PROPERTY, t("bean.sort.up.toSelect.tip"));
if (nbContext < 2) {
getPopup().remove(popupSeparator);
Modified: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/gis/DmdCoordinateConverter.java
===================================================================
--- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/gis/DmdCoordinateConverter.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/gis/DmdCoordinateConverter.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -57,7 +57,7 @@
if (!isEnabled(aClass)) {
throw new ConversionException(
- _("jaxx.error.no.convertor.coordinateDmd", value));
+ t("jaxx.error.no.convertor.coordinateDmd", value));
}
Object result = null;
Modified: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/gis/DmsCoordinateConverter.java
===================================================================
--- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/gis/DmsCoordinateConverter.java 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/editor/gis/DmsCoordinateConverter.java 2014-02-04 07:12:14 UTC (rev 2782)
@@ -57,7 +57,7 @@
if (!isEnabled(aClass)) {
throw new ConversionException(
- _("jaxx.error.no.convertor.coordinateDms", value));
+ t("jaxx.error.no.convertor.coordinateDms", value));
}
Object result = null;
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-02-02 21:00:16 UTC (rev 2781)
+++ trunk/pom.xml 2014-02-04 07:12:14 UTC (rev 2782)
@@ -115,17 +115,17 @@
<!-- pour un muli module on doit fixer le projectId -->
<projectId>jaxx</projectId>
- <nuitonUtilsVersion>2.7.1</nuitonUtilsVersion>
- <nuitonValidatorVersion>3.0-alpha-1</nuitonValidatorVersion>
+ <nuitonUtilsVersion>3.0-SNAPSHOT</nuitonUtilsVersion>
+ <nuitonValidatorVersion>3.0-SNAPSHOT</nuitonValidatorVersion>
<nuitonConfigVersion>3.0-alpha-1</nuitonConfigVersion>
<nuitonDecoratorVersion>3.0-alpha-2</nuitonDecoratorVersion>
- <nuitonI18nVersion>2.5.2</nuitonI18nVersion>
+ <nuitonI18nVersion>3.0-SNAPSHOT</nuitonI18nVersion>
<nuitonCsvVersion>3.0-alpha-1</nuitonCsvVersion>
<eugeneVersion>2.7.3</eugeneVersion>
<jxLayerVersion>3.0.4</jxLayerVersion>
<javaHelpVersion>2.0.05</javaHelpVersion>
<swingXVersion>1.6.5-1</swingXVersion>
- <plexusUtilVersion>3.0.15</plexusUtilVersion>
+ <plexusUtilVersion>3.0.17</plexusUtilVersion>
<webstartPluginVersion>1.0-beta-6</webstartPluginVersion>
@@ -321,7 +321,6 @@
<dependency>
<groupId>com.fifesoft</groupId>
<artifactId>rsyntaxtextarea</artifactId>
- <!--<version>2.0.7</version>-->
<version>2.5.0</version>
</dependency>
1
0
See <http://ci-ng.nuiton.org/jenkins/job/jaxx/4/changes>
Changes:
[Tony CHEMIT] refs #3019: Use mavenpom 4.7
------------------------------------------
[...truncated 204 lines...]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ jaxx-compiler ---
[INFO] Deleting <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-compiler/target>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ jaxx-compiler ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jaxx-compiler ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ jaxx-compiler ---
[INFO] Compiling 154 source files to <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-compiler/target/clas…>
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[INFO]
[INFO] --- plexus-component-metadata:1.5.5:generate-metadata (default) @ jaxx-compiler ---
[INFO] Discovered 7 component descriptors(s)
[INFO]
[INFO] --- maven-antrun-plugin:1.7:run (generate-surefire-workdir) @ jaxx-compiler ---
[INFO] Executing tasks
main:
[mkdir] Created dir: <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-compiler/target/sure…>
[INFO] Executed tasks
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ jaxx-compiler ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ jaxx-compiler ---
[INFO] Compiling 19 source files to <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-compiler/target/test…>
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[INFO]
[INFO] --- maven-surefire-plugin:2.16:test (default-test) @ jaxx-compiler ---
[INFO] Surefire report directory: <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-compiler/target/sure…>
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running jaxx.compiler.types.InsetsConverterTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.057 sec - in jaxx.compiler.types.InsetsConverterTest
Running jaxx.compiler.types.PrimitiveConverterTest
Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec - in jaxx.compiler.types.PrimitiveConverterTest
Running jaxx.compiler.types.ColorConverterTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec - in jaxx.compiler.types.ColorConverterTest
Running jaxx.compiler.types.TypeManagerTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in jaxx.compiler.types.TypeManagerTest
Running jaxx.compiler.reflect.resolvers.ClassDescriptorResolverFromJavaFileTest
WARN [main] (ClassDescriptorResolverFromJavaFile.java:301) scanCompilationUnitChild - There is more than one type in current file, skip next type...
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.201 sec - in jaxx.compiler.reflect.resolvers.ClassDescriptorResolverFromJavaFileTest
Running jaxx.compiler.reflect.ClassDescriptorTest
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class jaxx.compiler.reflect.ClassDescriptorTest
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class jaxx.junit.classdescriptortest
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class [I
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class [Ljava.lang.Object;
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.012 sec - in jaxx.compiler.reflect.ClassDescriptorTest
Running jaxx.compiler.beans.BeanIntoUtilTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec - in jaxx.compiler.beans.BeanIntoUtilTest
Running jaxx.compiler.binding.JavaParserUtilTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 sec - in jaxx.compiler.binding.JavaParserUtilTest
Running jaxx.compiler.tags.TagManagerTest
INFO [main] (DefaultCompilerConfiguration.java:315) getInitializers - with cl sun.misc.Launcher$AppClassLoader@1c45484a
INFO [main] (DefaultCompilerConfiguration.java:323) getInitializers - detected jaxx.compiler.spi.DefaultInitializer@3ad60318
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class jaxx.runtime.swing.JAXXButtonGroup
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class jaxx.runtime.validator.swing.SwingValidator
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class java.awt.Component
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JCheckBox
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JCheckBoxMenuItem
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JComboBox
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class jaxx.runtime.swing.editor.EnumEditor
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class jaxx.runtime.swing.editor.LocaleEditor
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class jaxx.runtime.swing.JAXXComboBox
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JRadioButton
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JRadioButtonMenuItem
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JToggleButton
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JList
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class jaxx.runtime.swing.JAXXList
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JTree
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class jaxx.runtime.swing.JAXXTree
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JDialog
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JFrame
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JWindow
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class org.jdesktop.jxlayer.JXLayer
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class jaxx.runtime.swing.Application
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JInternalFrame
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JMenu
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JPasswordField
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JPopupMenu
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JProgressBar
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JScrollPane
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JSlider
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JSpinner
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JSplitPane
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JTabbedPane
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.text.JTextComponent
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class javax.swing.JToolBar
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class jaxx.runtime.swing.Table
INFO [main] (ClassDescriptorHelper.java:234) getClassDescriptor - from class jaxx.runtime.swing.JAXXTab
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.18 sec - in jaxx.compiler.tags.TagManagerTest
Running jaxx.compiler.java.JavaMethodTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec - in jaxx.compiler.java.JavaMethodTest
Running jaxx.compiler.java.JavaFieldTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 sec - in jaxx.compiler.java.JavaFieldTest
Results :
Tests run: 64, Failures: 0, Errors: 0, Skipped: 0
[JENKINS] Recording test results
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ jaxx-compiler ---
[INFO] Building jar: <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-compiler/target/jaxx…>
[INFO]
[INFO] --- maven-site-plugin:3.3:attach-descriptor (attach-descriptor) @ jaxx-compiler ---
[JENKINS] Archiving disabled
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building JAXX :: Maven plugin 2.8-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ jaxx-maven-plugin ---
[INFO] Deleting <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-maven-plugin/target>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ jaxx-maven-plugin ---
[INFO]
[INFO] --- maven-plugin-plugin:3.2:helpmojo (default) @ jaxx-maven-plugin ---
[INFO] Using 'UTF-8' encoding to read mojo metadata.
[INFO] Applying mojo extractor for language: java-annotations
[INFO] Mojo extractor for language: java-annotations found 0 mojo descriptors.
[INFO] Applying mojo extractor for language: java
[INFO] Mojo extractor for language: java found 0 mojo descriptors.
[INFO] Applying mojo extractor for language: bsh
[INFO] Mojo extractor for language: bsh found 0 mojo descriptors.
[INFO]
[INFO] --- maven-plugin-plugin:3.2:descriptor (default-descriptor) @ jaxx-maven-plugin ---
[INFO] Using 'UTF-8' encoding to read mojo metadata.
[INFO] Applying mojo extractor for language: java-annotations
[INFO] Mojo extractor for language: java-annotations found 0 mojo descriptors.
[INFO] Applying mojo extractor for language: java
[INFO] Mojo extractor for language: java found 0 mojo descriptors.
[INFO] Applying mojo extractor for language: bsh
[INFO] Mojo extractor for language: bsh found 0 mojo descriptors.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jaxx-maven-plugin ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 8 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ jaxx-maven-plugin ---
[INFO] Compiling 10 source files to <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-maven-plugin/target/…>
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[INFO] 1 warning
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-maven-plugin/src/mai…>:[230,31] cannot find symbol
symbol: method closeQuietly(java.io.Reader)
location: class com.google.common.io.Closeables
[ERROR] <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-maven-plugin/src/mai…>:[283,31] cannot find symbol
symbol: method closeQuietly(java.io.Writer)
location: class com.google.common.io.Closeables
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] JAXX .............................................. SUCCESS [2.869s]
[INFO] JAXX :: Runtime ................................... SUCCESS [6.190s]
[INFO] JAXX :: Validator ................................. SUCCESS [2.065s]
[INFO] JAXX :: Compiler .................................. SUCCESS [4.934s]
[INFO] JAXX :: Maven plugin .............................. FAILURE [3.365s]
[INFO] JAXX :: Widgets ................................... SKIPPED
[INFO] JAXX :: Config .................................... SKIPPED
[INFO] JAXX :: Application API ........................... SKIPPED
[INFO] JAXX :: Application Swing ......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.452s
[INFO] Finished at: Sun Feb 02 21:55:57 CET 2014
[INFO] Final Memory: 48M/496M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project jaxx-maven-plugin: Compilation failure: Compilation failure:
[ERROR] <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-maven-plugin/src/mai…>:[230,31] cannot find symbol
[ERROR] symbol: method closeQuietly(java.io.Reader)
[ERROR] location: class com.google.common.io.Closeables
[ERROR] <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-maven-plugin/src/mai…>:[283,31] cannot find symbol
[ERROR] symbol: method closeQuietly(java.io.Writer)
[ERROR] location: class com.google.common.io.Closeables
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project jaxx-maven-plugin: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:134)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:69)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:858)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 30 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :jaxx-maven-plugin
Sending e-mails to: jaxx-commits(a)list.nuiton.org
channel stopped
1
1
Build failed in Jenkins: jaxx » JAXX :: Maven plugin #4
by admin+ci-nuiton.org@codelutin.com 02 Feb '14
by admin+ci-nuiton.org@codelutin.com 02 Feb '14
02 Feb '14
See <http://ci-ng.nuiton.org/jenkins/job/jaxx/org.nuiton.jaxx$jaxx-maven-plugin/…>
------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building JAXX :: Maven plugin 2.8-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ jaxx-maven-plugin ---
[INFO] Deleting <http://ci-ng.nuiton.org/jenkins/job/jaxx/org.nuiton.jaxx$jaxx-maven-plugin/…>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ jaxx-maven-plugin ---
[INFO]
[INFO] --- maven-plugin-plugin:3.2:helpmojo (default) @ jaxx-maven-plugin ---
[INFO] Using 'UTF-8' encoding to read mojo metadata.
[INFO] Applying mojo extractor for language: java-annotations
[INFO] Mojo extractor for language: java-annotations found 0 mojo descriptors.
[INFO] Applying mojo extractor for language: java
[INFO] Mojo extractor for language: java found 0 mojo descriptors.
[INFO] Applying mojo extractor for language: bsh
[INFO] Mojo extractor for language: bsh found 0 mojo descriptors.
[INFO]
[INFO] --- maven-plugin-plugin:3.2:descriptor (default-descriptor) @ jaxx-maven-plugin ---
[INFO] Using 'UTF-8' encoding to read mojo metadata.
[INFO] Applying mojo extractor for language: java-annotations
[INFO] Mojo extractor for language: java-annotations found 0 mojo descriptors.
[INFO] Applying mojo extractor for language: java
[INFO] Mojo extractor for language: java found 0 mojo descriptors.
[INFO] Applying mojo extractor for language: bsh
[INFO] Mojo extractor for language: bsh found 0 mojo descriptors.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jaxx-maven-plugin ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 8 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ jaxx-maven-plugin ---
[INFO] Compiling 10 source files to <http://ci-ng.nuiton.org/jenkins/job/jaxx/org.nuiton.jaxx$jaxx-maven-plugin/…>
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[INFO] 1 warning
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] <http://ci-ng.nuiton.org/jenkins/job/jaxx/org.nuiton.jaxx$jaxx-maven-plugin/…>:[230,31] cannot find symbol
symbol: method closeQuietly(java.io.Reader)
location: class com.google.common.io.Closeables
[ERROR] <http://ci-ng.nuiton.org/jenkins/job/jaxx/org.nuiton.jaxx$jaxx-maven-plugin/…>:[283,31] cannot find symbol
symbol: method closeQuietly(java.io.Writer)
location: class com.google.common.io.Closeables
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[JENKINS] Archiving disabled
1
1
r2781 - trunk/jaxx-maven-plugin/src/main/java/org/nuiton/jaxx/plugin
by tchemit@users.nuiton.org 02 Feb '14
by tchemit@users.nuiton.org 02 Feb '14
02 Feb '14
Author: tchemit
Date: 2014-02-02 22:00:16 +0100 (Sun, 02 Feb 2014)
New Revision: 2781
Url: http://nuiton.org/projects/jaxx/repository/revisions/2781
Log:
refs #3019: Use mavenpom 4.7
Modified:
trunk/jaxx-maven-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpIdsMojo.java
Modified: trunk/jaxx-maven-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpIdsMojo.java
===================================================================
--- trunk/jaxx-maven-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpIdsMojo.java 2014-02-02 20:49:51 UTC (rev 2780)
+++ trunk/jaxx-maven-plugin/src/main/java/org/nuiton/jaxx/plugin/GenerateHelpIdsMojo.java 2014-02-02 21:00:16 UTC (rev 2781)
@@ -227,7 +227,7 @@
p.load(reader);
reader.close();
} finally {
- Closeables.closeQuietly(reader);
+ Closeables.close(reader, true);
}
}
Set<String> existingId = p.stringPropertyNames();
@@ -280,7 +280,7 @@
resultProperties.store(writer, "Generated by " + getClass().getName());
writer.close();
} finally {
- Closeables.closeQuietly(writer);
+ Closeables.close(writer, true);
}
}
1
0
Author: tchemit
Date: 2014-02-02 21:49:51 +0100 (Sun, 02 Feb 2014)
New Revision: 2780
Url: http://nuiton.org/projects/jaxx/repository/revisions/2780
Log:
refs #3019: Use mavenpom 4.7
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-01-31 10:50:51 UTC (rev 2779)
+++ trunk/pom.xml 2014-02-02 20:49:51 UTC (rev 2780)
@@ -30,7 +30,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmineAndCentral</artifactId>
- <version>4.5</version>
+ <version>4.7-SNAPSHOT</version>
</parent>
<artifactId>jaxx</artifactId>
@@ -106,7 +106,7 @@
<name>JAXX</name>
<description>JAXX Project</description>
<inceptionYear>2008</inceptionYear>
- <url>http://maven-site.nuiton.org/jaxx</url>
+ <url>https://maven-site.nuiton.org/jaxx</url>
<packaging>pom</packaging>
@@ -144,11 +144,11 @@
<!-- Source control management. -->
<scm>
- <connection>scm:svn:http://svn.nuiton.org/svn/jaxx/trunk</connection>
+ <connection>scm:svn:https://nuiton.org/svn/jaxx/trunk</connection>
<developerConnection>
- scm:svn:http://svn.nuiton.org/svn/jaxx/trunk
+ scm:svn:https://nuiton.org/svn/jaxx/trunk
</developerConnection>
- <url>http://nuiton.org/projects/jaxx/repository/show/trunk</url>
+ <url>https://nuiton.org/projects/jaxx/repository/show/trunk</url>
</scm>
<distributionManagement>
1
0
See <http://ci-ng.nuiton.org/jenkins/job/jaxx/2/changes>
Changes:
[Tony CHEMIT] fix license headers
[Tony CHEMIT] fixes #3016: Remove jaxx-swing-action moduel from svn
------------------------------------------
[...truncated 6042 lines...]
60/204 KB
62/204 KB
64/204 KB
66/204 KB
68/204 KB
70/204 KB
72/204 KB
74/204 KB
76/204 KB
78/204 KB
80/204 KB
82/204 KB
84/204 KB
86/204 KB
88/204 KB
90/204 KB
92/204 KB
94/204 KB
96/204 KB
98/204 KB
100/204 KB
102/204 KB
104/204 KB
106/204 KB
108/204 KB
110/204 KB
112/204 KB
114/204 KB
116/204 KB
118/204 KB
120/204 KB
122/204 KB
124/204 KB
126/204 KB
128/204 KB
130/204 KB
132/204 KB
134/204 KB
136/204 KB
138/204 KB
140/204 KB
142/204 KB
144/204 KB
146/204 KB
148/204 KB
150/204 KB
152/204 KB
154/204 KB
156/204 KB
158/204 KB
160/204 KB
162/204 KB
164/204 KB
166/204 KB
168/204 KB
170/204 KB
172/204 KB
174/204 KB
176/204 KB
178/204 KB
180/204 KB
182/204 KB
184/204 KB
186/204 KB
188/204 KB
190/204 KB
192/204 KB
194/204 KB
196/204 KB
198/204 KB
200/204 KB
202/204 KB
204/204 KB
Uploaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (204 KB at 1957.2 KB/sec)
Uploading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
2/3 KB
3/3 KB
Uploaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (3 KB at 41.6 KB/sec)
Uploading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
198/198 B
Uploaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (198 B at 3.3 KB/sec)
Uploading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
2/3 KB
3/3 KB
Uploaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (3 KB at 40.2 KB/sec)
Uploading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
198/198 B
Uploaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (198 B at 3.1 KB/sec)
Uploading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
2/3 KB
3/3 KB
Uploaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (3 KB at 41.6 KB/sec)
Uploading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
198/198 B
Uploaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (198 B at 3.4 KB/sec)
Uploading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
2/3 KB
3/3 KB
Uploaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (3 KB at 40.2 KB/sec)
Uploading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
198/198 B
Uploaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (198 B at 3.4 KB/sec)
Uploading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
2/3 KB
3/3 KB
Uploaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (3 KB at 42.3 KB/sec)
Uploading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
198/198 B
Uploaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (198 B at 3.4 KB/sec)
Uploading: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax…
2/3 KB
3/3 KB
Uploaded: http://nexus.nuiton.org/nexus/content/repositories/snapshots/org/nuiton/jax… (3 KB at 39.5 KB/sec)
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building JAXX :: Demo 2.8-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ jaxx-demo ---
[INFO] Deleting <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-demo/target>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (ensure-no-container-api) @ jaxx-demo ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:check-auto-container (check-central-safe) @ jaxx-demo ---
[INFO] Will use repository http://repo1.maven.org/maven2/
[INFO] Will use repository http://maven.nuiton.org/central-releases
[WARNING] Skip SNAPSHOT dependency : org.nuiton.jaxx:jaxx-runtime:2.8-SNAPSHOT
[WARNING] Skip SNAPSHOT dependency : org.nuiton.jaxx:jaxx-validator:2.8-SNAPSHOT
[WARNING] Skip SNAPSHOT dependency : org.nuiton.jaxx:jaxx-widgets:2.8-SNAPSHOT
[WARNING] Skip SNAPSHOT dependency : org.nuiton.jaxx:jaxx-config:2.8-SNAPSHOT
[WARNING] Skip SNAPSHOT dependency : org.nuiton.jaxx:jaxx-maven-plugin:2.8-SNAPSHOT
[INFO] 47 dependencies to check.
[INFO] 47 artifact(s) resolved by repository http://repo1.maven.org/maven2/ in 293.962ms
[INFO] All dependencies are safe.
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ jaxx-demo ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:share-server-secret (get-redmine-login) @ jaxx-demo ---
[INFO] Exporting server [redmine-nuiton.org] username in ${redmine.username}
[INFO] Exporting server [redmine-nuiton.org] privateKey in ${redmine.apiKey}
[INFO]
[INFO] --- jaxx-maven-plugin:2.8-SNAPSHOT:generate (default) @ jaxx-demo ---
[WARNING] can not find jaxx file corresponding to modified css file jaxx/demo/feature/validation/simple/Validation.css
[INFO] use project compile scope class-path
[INFO] Detects 51 modified jaxx file(s).
ERROR [main] (JAXXEngine.java:363) run - jaxx.compiler.css.parser.TokenMgrError: Lexical error at line 1, column 1. Encountered: "<" (60), after : ""
jaxx.compiler.CompilerException: jaxx.compiler.css.parser.TokenMgrError: Lexical error at line 1, column 1. Encountered: "<" (60), after : ""
at jaxx.compiler.css.StylesheetHelper.processStylesheet(StylesheetHelper.java:81)
at jaxx.compiler.JAXXCompiler.registerStyleSheetFile(JAXXCompiler.java:1029)
at jaxx.compiler.tasks.CompileFirstPassTask.treateFile(CompileFirstPassTask.java:116)
at jaxx.compiler.tasks.CompileFirstPassTask.perform(CompileFirstPassTask.java:66)
at jaxx.compiler.JAXXEngine.run(JAXXEngine.java:352)
at org.nuiton.jaxx.plugin.GenerateMojo.doAction(GenerateMojo.java:522)
at org.nuiton.plugin.AbstractPlugin.execute(AbstractPlugin.java:132)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: jaxx.compiler.css.parser.TokenMgrError: Lexical error at line 1, column 1. Encountered: "<" (60), after : ""
at jaxx.compiler.css.parser.CSSParserTokenManager.getNextToken(CSSParserTokenManager.java:1173)
at jaxx.compiler.css.parser.CSSParser.getToken(CSSParser.java:795)
at jaxx.compiler.css.parser.CSSParser.jjtreeOpenNodeScope(CSSParser.java:40)
at jaxx.compiler.css.parser.CSSParser.Stylesheet(CSSParser.java:66)
at jaxx.compiler.css.StylesheetHelper.processStylesheet(StylesheetHelper.java:79)
... 27 more
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] JAXX .............................................. SUCCESS [15.509s]
[INFO] JAXX :: Runtime ................................... SUCCESS [20.908s]
[INFO] JAXX :: Validator ................................. SUCCESS [8.489s]
[INFO] JAXX :: Compiler .................................. SUCCESS [15.167s]
[INFO] JAXX :: Maven plugin .............................. SUCCESS [14.983s]
[INFO] JAXX :: Widgets ................................... SUCCESS [19.332s]
[INFO] JAXX :: Config .................................... SUCCESS [9.189s]
[INFO] JAXX :: Demo ...................................... FAILURE [1.708s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:45.957s
[INFO] Finished at: Fri Jan 31 10:38:35 CET 2014
[INFO] Final Memory: 97M/1055M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.nuiton.jaxx:jaxx-maven-plugin:2.8-SNAPSHOT:generate (default) on project jaxx-demo: Aborting due to errors reported by jaxxc -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.nuiton.jaxx:jaxx-maven-plugin:2.8-SNAPSHOT:generate (default) on project jaxx-demo: Aborting due to errors reported by jaxxc
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Aborting due to errors reported by jaxxc
at org.nuiton.jaxx.plugin.GenerateMojo.doAction(GenerateMojo.java:528)
at org.nuiton.plugin.AbstractPlugin.execute(AbstractPlugin.java:132)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :jaxx-demo
Build step 'Invoke top-level Maven targets' marked build as failure
1
1
Author: tchemit
Date: 2014-01-31 11:50:51 +0100 (Fri, 31 Jan 2014)
New Revision: 2779
Url: http://nuiton.org/projects/jaxx/repository/revisions/2779
Log:
fixes #3017: Introduce a simple jaxx application framework
Added:
trunk/jaxx-application-api/
trunk/jaxx-application-api/LICENSE.txt
trunk/jaxx-application-api/README.txt
trunk/jaxx-application-api/pom.xml
trunk/jaxx-application-api/src/
trunk/jaxx-application-api/src/license/
trunk/jaxx-application-api/src/license/THIRD-PARTY.properties
trunk/jaxx-application-api/src/main/
trunk/jaxx-application-api/src/main/java/
trunk/jaxx-application-api/src/main/java/org/
trunk/jaxx-application-api/src/main/java/org/nuiton/
trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/
trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/
trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationBusinessException.java
trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationConfiguration.java
trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationContext.java
trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationDataUtil.java
trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationIOUtil.java
trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationTechnicalException.java
trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/listener/
trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/listener/PropagatePropertyChangeListener.java
trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/type/
trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/type/ApplicationProgressionModel.java
trunk/jaxx-application-api/src/main/resources/
trunk/jaxx-application-swing/
trunk/jaxx-application-swing/LICENSE.txt
trunk/jaxx-application-swing/README.txt
trunk/jaxx-application-swing/pom.xml
trunk/jaxx-application-swing/src/
trunk/jaxx-application-swing/src/license/
trunk/jaxx-application-swing/src/license/THIRD-PARTY.properties
trunk/jaxx-application-swing/src/main/
trunk/jaxx-application-swing/src/main/java/
trunk/jaxx-application-swing/src/main/java/org/
trunk/jaxx-application-swing/src/main/java/org/nuiton/
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/AbstractApplicationUIHandler.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/ApplicationUI.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/ApplicationUIContext.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/AbstractApplicationAction.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionEngine.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionException.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionFactory.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionSwingWorker.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUI.css
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUI.jaxx
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUIHandler.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUIModel.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationUIAction.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/ApplicationAction.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/ApplicationActionEngine.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/ApplicationActionEvent.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/ApplicationActionListener.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/CustomTab.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/DelegateTabContainerHandler.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/TabContainerHandler.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/TabContentModel.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/TabHandler.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/AbstractApplicationTableModel.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/AbstractSelectTableAction.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/ColumnIdentifier.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/MoveToNextEditableCellAction.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/MoveToNextEditableRowAction.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/MoveToPreviousEditableCellAction.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/MoveToPreviousEditableRowAction.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ActionListCellRenderer.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationColorHighlighter.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationErrorHelper.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationExceptionHandler.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationUIUtil.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/Cancelable.java
trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/CloseableUI.java
trunk/jaxx-application-swing/src/main/resources/
trunk/jaxx-application-swing/src/main/resources/i18n/
trunk/jaxx-application-swing/src/main/resources/i18n/jaxx-application-swing_en_GB.properties
trunk/jaxx-application-swing/src/main/resources/i18n/jaxx-application-swing_es_ES.properties
trunk/jaxx-application-swing/src/main/resources/i18n/jaxx-application-swing_fr_FR.properties
Modified:
trunk/jaxx-demo/src/main/resources/jaxxdemo-help-fr.properties
trunk/pom.xml
Property changes on: trunk/jaxx-application-api
___________________________________________________________________
Added: svn:ignore
+ target
.idea
*.ipr
*.iws
*.iml
Added: trunk/jaxx-application-api/LICENSE.txt
===================================================================
--- trunk/jaxx-application-api/LICENSE.txt (rev 0)
+++ trunk/jaxx-application-api/LICENSE.txt 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,166 @@
+ 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.
+
Property changes on: trunk/jaxx-application-api/LICENSE.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Property changes on: trunk/jaxx-application-api/README.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-api/pom.xml
===================================================================
--- trunk/jaxx-application-api/pom.xml (rev 0)
+++ trunk/jaxx-application-api/pom.xml 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Ifremer shared :: Application
+ %%
+ Copyright (C) 2013 Ifremer, 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%
+ -->
+
+<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>jaxx</artifactId>
+ <version>2.8-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.nuiton.jaxx</groupId>
+ <artifactId>jaxx-application-api</artifactId>
+ <name>JAXX :: Application API</name>
+
+ <dependencies>
+
+ <!-- Commons -->
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-vfs2</artifactId>
+ </dependency>
+
+ <!-- Guava -->
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+
+ <!-- Nuiton -->
+ <dependency>
+ <groupId>org.nuiton</groupId>
+ <artifactId>nuiton-utils</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.nuiton</groupId>
+ <artifactId>nuiton-config</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.nuiton.i18n</groupId>
+ <artifactId>nuiton-i18n</artifactId>
+ </dependency>
+
+ <!-- SwingX -->
+ <dependency>
+ <groupId>org.swinglabs.swingx</groupId>
+ <artifactId>swingx-common</artifactId>
+ </dependency>
+
+
+ <!-- Test -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+
+ </dependencies>
+
+</project>
Property changes on: trunk/jaxx-application-api/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Property changes on: trunk/jaxx-application-api/src
___________________________________________________________________
Added: svn:ignore
+ target
.idea
*.ipr
*.iws
*.iml
Property changes on: trunk/jaxx-application-api/src/license
___________________________________________________________________
Added: svn:ignore
+ target
.idea
*.ipr
*.iws
*.iml
Added: trunk/jaxx-application-api/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/jaxx-application-api/src/license/THIRD-PARTY.properties (rev 0)
+++ trunk/jaxx-application-api/src/license/THIRD-PARTY.properties 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,21 @@
+# Generated by org.codehaus.mojo.license.AddThirdPartyMojo
+#-------------------------------------------------------------------------------
+# Already used licenses in project :
+# - BSD License
+# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+# - Common Public License Version 1.0
+# - GNU Library or Lesser General Public License
+# - Indiana University Extreme! Lab Software License, vesion 1.1.1
+# - Lesser General Public License (LGPL)
+# - Lesser General Public License (LGPL) v 3.0
+# - Lesser General Public License (LPGL)
+# - Lesser General Public License (LPGL) v 2.1
+# - MIT License
+# - New BSD License
+# - The Apache Software License, Version 2.0
+#-------------------------------------------------------------------------------
+# Please fill the missing licenses for dependencies :
+#
+#
+#Sun Nov 24 23:48:15 CET 2013
+commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
Property changes on: trunk/jaxx-application-api/src/license/THIRD-PARTY.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Property changes on: trunk/jaxx-application-api/src/main
___________________________________________________________________
Added: svn:ignore
+ target
.idea
*.ipr
*.iws
*.iml
Property changes on: trunk/jaxx-application-api/src/main/java
___________________________________________________________________
Added: svn:ignore
+ target
.idea
*.ipr
*.iws
*.iml
Added: trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationBusinessException.java
===================================================================
--- trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationBusinessException.java (rev 0)
+++ trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationBusinessException.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,51 @@
+package org.nuiton.jaxx.application;
+
+/*
+ * #%L
+ * JAXX :: Application API
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+/**
+ * Application business exception, a such exeception should be shown to
+ * user in application.
+ *
+ * Created on 11/23/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class ApplicationBusinessException extends RuntimeException {
+
+ private static final long serialVersionUID = 1L;
+
+ public ApplicationBusinessException(String message) {
+ super(message);
+ }
+
+ public ApplicationBusinessException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public ApplicationBusinessException(Throwable cause) {
+ super(cause);
+ }
+}
Property changes on: trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationBusinessException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationConfiguration.java
===================================================================
--- trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationConfiguration.java (rev 0)
+++ trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationConfiguration.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,58 @@
+package org.nuiton.jaxx.application;
+
+/*
+ * #%L
+ * JAXX :: Application API
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import org.nuiton.config.ApplicationConfig;
+import org.nuiton.util.Version;
+
+import javax.swing.KeyStroke;
+
+/**
+ * Created on 11/24/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public abstract class ApplicationConfiguration {
+
+ /**
+ * Delegate application config.
+ */
+ protected final ApplicationConfig applicationConfig;
+
+ public abstract String getApplicationName();
+
+ public abstract Version getVersion();
+
+ public abstract KeyStroke getShortcutClosePopup();
+
+ public ApplicationConfiguration(ApplicationConfig applicationConfig) {
+ this.applicationConfig = applicationConfig;
+ }
+
+ public ApplicationConfig getApplicationConfig() {
+ return applicationConfig;
+ }
+}
Property changes on: trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationConfiguration.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationContext.java
===================================================================
--- trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationContext.java (rev 0)
+++ trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationContext.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,41 @@
+package org.nuiton.jaxx.application;
+
+/*
+ * #%L
+ * JAXX :: Application API
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+/**
+ * Context of application, may contains config, data sources, ...
+ * <p/>
+ * Created on 11/23/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public interface ApplicationContext {
+
+ /**
+ * @return the application configuration
+ */
+ ApplicationConfiguration getConfiguration();
+}
Property changes on: trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationContext.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationDataUtil.java
===================================================================
--- trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationDataUtil.java (rev 0)
+++ trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationDataUtil.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,77 @@
+package org.nuiton.jaxx.application;
+
+/*
+ * #%L
+ * JAXX :: Application API
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import com.google.common.base.Preconditions;
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.lang3.time.DurationFormatUtils;
+
+import java.util.Date;
+
+/**
+ * Useful methods on data.
+ * <p/>
+ * TODO Needs some javadoc.
+ * <p/>
+ * Created on 11/24/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class ApplicationDataUtil {
+
+ public static void setProperty(Object bean, String property, Object value) {
+ Preconditions.checkNotNull(bean);
+ Preconditions.checkNotNull(property);
+ try {
+ PropertyUtils.setSimpleProperty(bean, property, value);
+ } catch (Exception e) {
+ throw new ApplicationTechnicalException(String.format("Property %1s not found on object of type %2s", property, bean.getClass().getName()), e);
+ }
+ }
+
+ public static Object getProperty(Object bean, String property) {
+ Preconditions.checkNotNull(bean);
+ Preconditions.checkNotNull(property);
+ try {
+ return PropertyUtils.getSimpleProperty(bean, property);
+ } catch (Exception e) {
+ throw new ApplicationTechnicalException(String.format("Property %1s not found on object of type %2s", property, bean.getClass().getName()), e);
+ }
+ }
+
+ public static String getDuration(Date startDate,
+ Date endDate,
+ String format) {
+ String duration = "";
+ if (startDate != null && endDate != null && !startDate.after(endDate)) {
+ duration = DurationFormatUtils.formatPeriod(
+ startDate.getTime(),
+ endDate.getTime(),
+ format);
+ }
+ return duration;
+ }
+}
Property changes on: trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationDataUtil.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationIOUtil.java
===================================================================
--- trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationIOUtil.java (rev 0)
+++ trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationIOUtil.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,256 @@
+package org.nuiton.jaxx.application;
+
+/*
+ * #%L
+ * JAXX :: Application API
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import com.google.common.base.Charsets;
+import com.google.common.io.Files;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.vfs2.FileObject;
+import org.apache.commons.vfs2.FileSelector;
+import org.apache.commons.vfs2.FileSystemManager;
+import org.apache.commons.vfs2.FileType;
+import org.apache.commons.vfs2.VFS;
+import org.nuiton.util.ZipUtil;
+
+import java.io.Closeable;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.Writer;
+import java.util.List;
+import java.util.UUID;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * Useful methods around IO, all method errors are boxes a
+ * {@link ApplicationTechnicalException}.
+ * <p/>
+ * Created on 11/24/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class ApplicationIOUtil {
+
+ protected ApplicationIOUtil() {
+ // no instance
+ }
+
+ public static void close(Closeable toClose, String errorMessage) {
+
+ try {
+ toClose.close();
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(errorMessage, e);
+ }
+ }
+
+ public static void zip(File source, File archiveFile, String errorMessage) {
+ try {
+ ZipUtil.compress(archiveFile, source);
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(errorMessage, e);
+ }
+ }
+
+ public static void zip(File source, File archiveFile, List<File> files, String errorMessage) {
+ try {
+ ZipUtil.compressFiles(archiveFile, source, files);
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(_(errorMessage, archiveFile), e);
+ }
+ }
+
+ public static FileObject resolveFile(String file, String errorMessage) {
+ try {
+ FileSystemManager manager = VFS.getManager();
+ FileObject targetObject = manager.resolveFile(file);
+ return targetObject;
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(errorMessage, e);
+ }
+ }
+
+ public static FileObject[] getChildren(FileObject objectFile, String errorMessage) {
+ try {
+ return objectFile.getChildren();
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(errorMessage, e);
+ }
+ }
+
+ public static FileObject getChild(FileObject objectFile, String name, String errorMessage) {
+ try {
+ return objectFile.getChild(name);
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(errorMessage, e);
+ }
+ }
+
+
+ public static FileType getType(FileObject objectFile, String errorMessage) {
+ try {
+ return objectFile.getType();
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(errorMessage, e);
+ }
+ }
+
+ public static void explode(FileObject archiveFile,
+ File target,
+ FileSelector fileSelector, String errorMessage) {
+ try {
+ FileSystemManager manager = VFS.getManager();
+ FileObject targetObject = manager.toFileObject(target);
+ targetObject.copyFrom(archiveFile, fileSelector);
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(errorMessage, e);
+ }
+ }
+
+ public static void forceMkdir(File dir, String errorMessage) {
+ try {
+ FileUtils.forceMkdir(dir);
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(errorMessage, e);
+ }
+ }
+
+ public static void cleanDirectory(File dir, String errorMessage) {
+ try {
+ FileUtils.cleanDirectory(dir);
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(errorMessage, e);
+ }
+ }
+
+ public static void deleteDirectory(File dir, String errorMessage) {
+ try {
+ FileUtils.deleteDirectory(dir);
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(errorMessage, e);
+ }
+ }
+
+ public static void forceDeleteOnExit(File dir, String errorMessage) {
+ try {
+ FileUtils.forceDeleteOnExit(dir);
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(errorMessage, e);
+ }
+ }
+
+ public static void copyDirectory(File source, File target, String errorMessage) {
+ try {
+ FileUtils.copyDirectory(source, target);
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(errorMessage, e);
+ }
+ }
+
+ public static void copyFileToDirectory(File source, File target, String errorMessage) {
+ try {
+ FileUtils.copyFileToDirectory(source, target);
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(errorMessage, e);
+ }
+ }
+
+ public static void copyFile(File source, File target, String errorMessage) {
+ try {
+ FileUtils.copyFile(source, target);
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(errorMessage, e);
+ }
+ }
+
+ public static void deleteFile(File file, String errorMessage) {
+ try {
+ FileUtils.forceDelete(file);
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(errorMessage, e);
+ }
+ }
+
+ public static String getBaseName(String file) {
+ return FilenameUtils.getBaseName(file);
+ }
+
+ public static String getExtension(String file) {
+ return FilenameUtils.getExtension(file);
+ }
+
+ public static Reader newReader(File file, String errorMessage) {
+ try {
+ return Files.newReader(file, Charsets.UTF_8);
+
+ } catch (FileNotFoundException e) {
+ throw new ApplicationTechnicalException(_(errorMessage, file), e);
+ }
+ }
+
+ public static Writer newWriter(File file, String errorMessage
+ ) {
+ try {
+ return Files.newWriter(file, Charsets.UTF_8);
+
+ } catch (FileNotFoundException e) {
+ throw new ApplicationTechnicalException(_(errorMessage, file), e);
+ }
+ }
+
+ public static File explodeZip(File rootDirectory,
+ File file,
+ String errorMessage) {
+ File tempDir = new File(rootDirectory, UUID.randomUUID().toString());
+ try {
+ ZipUtil.uncompress(file, tempDir);
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(_(errorMessage, file), e);
+ }
+ return tempDir;
+ }
+
+ public static String readContent(File file, String errorMessage) {
+
+ try {
+ return Files.readFirstLine(file, Charsets.UTF_8);
+
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(errorMessage, e);
+ }
+ }
+
+ public static void writeContent(File file, String content, String errorMessage) {
+ try {
+ FileUtils.write(file, content, Charsets.UTF_8);
+ } catch (IOException e) {
+ throw new ApplicationTechnicalException(errorMessage, e);
+ }
+ }
+}
Property changes on: trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationIOUtil.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationTechnicalException.java
===================================================================
--- trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationTechnicalException.java (rev 0)
+++ trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationTechnicalException.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,50 @@
+package org.nuiton.jaxx.application;
+
+/*
+ * #%L
+ * JAXX :: Application API
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+/**
+ * Application Technical exception.
+ *
+ * Created on 11/23/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class ApplicationTechnicalException extends RuntimeException {
+
+ private static final long serialVersionUID = 1L;
+
+ public ApplicationTechnicalException(String message) {
+ super(message);
+ }
+
+ public ApplicationTechnicalException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public ApplicationTechnicalException(Throwable cause) {
+ super(cause);
+ }
+}
Property changes on: trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/ApplicationTechnicalException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/listener/PropagatePropertyChangeListener.java
===================================================================
--- trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/listener/PropagatePropertyChangeListener.java (rev 0)
+++ trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/listener/PropagatePropertyChangeListener.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,80 @@
+package org.nuiton.jaxx.application.listener;
+
+/*
+ * #%L
+ * JAXX :: Application API
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import org.jdesktop.beans.AbstractBean;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+/**
+ * To listen a bean and propagate some of properties.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class PropagatePropertyChangeListener implements PropertyChangeListener {
+
+ public static interface PropagatePropertyChange {
+ void firePropertyChanged(String propertyName,
+ Object oldValue,
+ Object newValue);
+ }
+
+ public static void listenAndPropagate(AbstractBean producer,
+ PropagatePropertyChange consumer,
+ String propertyNameToListen,
+ String propertyNameToForward) {
+ PropagatePropertyChangeListener listener =
+ new PropagatePropertyChangeListener(propertyNameToForward,
+ consumer);
+ producer.addPropertyChangeListener(propertyNameToListen, listener);
+ }
+
+ public static void listenAndPropagateAll(AbstractBean producer,
+ PropagatePropertyChange consumer) {
+ PropagatePropertyChangeListener listener =
+ new PropagatePropertyChangeListener(null, consumer);
+ producer.addPropertyChangeListener(listener);
+ }
+
+ private String propertyName;
+
+ private PropagatePropertyChange editor;
+
+ public PropagatePropertyChangeListener(String propertyName,
+ PropagatePropertyChange editor) {
+ this.propertyName = propertyName;
+ this.editor = editor;
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ String name = propertyName == null ? evt.getPropertyName() : propertyName;
+ editor.firePropertyChanged(name,
+ evt.getOldValue(),
+ evt.getNewValue());
+ }
+}
Property changes on: trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/listener/PropagatePropertyChangeListener.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/type/ApplicationProgressionModel.java
===================================================================
--- trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/type/ApplicationProgressionModel.java (rev 0)
+++ trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/type/ApplicationProgressionModel.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,115 @@
+package org.nuiton.jaxx.application.type;
+
+/*
+ * #%L
+ * JAXX :: Application API
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import org.jdesktop.beans.AbstractSerializableBean;
+
+/**
+ * Simple model for a progression long task.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class ApplicationProgressionModel extends AbstractSerializableBean {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String PROPERTY_TOTAL = "total";
+
+ public static final String PROPERTY_CURRENT = "current";
+
+ public static final String PROPERTY_RATE = "rate";
+
+ public static final String PROPERTY_MESSAGE = "message";
+
+ protected int total;
+
+ protected int current;
+
+ protected float rate;
+
+ protected String message;
+
+ public int getTotal() {
+ return total;
+ }
+
+ public void setTotal(int total) {
+ Object oldValue = getTotal();
+ this.total = total;
+ firePropertyChange(PROPERTY_TOTAL, oldValue, total);
+ setCurrent(0);
+ }
+
+ public void adaptTotal(int total) {
+ int current = getCurrent();
+ setTotal(total);
+ increments(current);
+ Object oldValue = getTotal();
+ this.total = total;
+ firePropertyChange(PROPERTY_TOTAL, oldValue, total);
+ setCurrent(current);
+ }
+
+ public int getCurrent() {
+ return current;
+ }
+
+ public void setCurrent(int current) {
+ Object oldValue = getCurrent();
+ this.current = current;
+ firePropertyChange(PROPERTY_CURRENT, oldValue, current);
+ }
+
+ public void increments(int nb) {
+ setCurrent(current + nb);
+ setRate(getCurrent() / getTotal());
+ }
+
+ public float getRate() {
+ return rate;
+ }
+
+ public void setRate(float rate) {
+ Object oldValue = getRate();
+ this.rate = rate;
+ firePropertyChange(PROPERTY_RATE, oldValue, rate);
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void increments(String message) {
+ increments(1);
+ setMessage(message);
+ }
+
+ public void setMessage(String message) {
+ Object oldValue = getMessage();
+ this.message = message;
+ firePropertyChange(PROPERTY_MESSAGE, oldValue, message);
+ }
+}
Property changes on: trunk/jaxx-application-api/src/main/java/org/nuiton/jaxx/application/type/ApplicationProgressionModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Property changes on: trunk/jaxx-application-api/src/main/resources
___________________________________________________________________
Added: svn:ignore
+ target
.idea
*.ipr
*.iws
*.iml
Property changes on: trunk/jaxx-application-swing
___________________________________________________________________
Added: svn:ignore
+ target
.idea
*.ipr
*.iws
*.iml
Added: trunk/jaxx-application-swing/LICENSE.txt
===================================================================
--- trunk/jaxx-application-swing/LICENSE.txt (rev 0)
+++ trunk/jaxx-application-swing/LICENSE.txt 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,166 @@
+ 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.
+
Property changes on: trunk/jaxx-application-swing/LICENSE.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Property changes on: trunk/jaxx-application-swing/README.txt
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/pom.xml
===================================================================
--- trunk/jaxx-application-swing/pom.xml (rev 0)
+++ trunk/jaxx-application-swing/pom.xml 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Ifremer shared :: Application Swing
+ %%
+ Copyright (C) 2013 Ifremer, 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%
+ -->
+
+<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>jaxx</artifactId>
+ <version>2.8-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.nuiton.jaxx</groupId>
+ <artifactId>jaxx-application-swing</artifactId>
+ <name>JAXX :: Application Swing</name>
+
+ <properties>
+
+ <!-- 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.generateHelp>true</jaxx.generateHelp>
+ <jaxx.generateSearch>false</jaxx.generateSearch>
+ <jaxx.autoImportCss>true</jaxx.autoImportCss>
+ <jaxx.autoRecurseInCss>false</jaxx.autoRecurseInCss>
+ <jaxx.addAutoHandlerUI>true</jaxx.addAutoHandlerUI>
+
+ <!-- Post Release configuration -->
+ <skipPostRelease>false</skipPostRelease>
+
+ </properties>
+
+ <dependencies>
+
+ <!-- Sibling -->
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>jaxx-application-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>jaxx-runtime</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>jaxx-validator</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>jaxx-widgets</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <!-- Commons -->
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- Guava -->
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+
+ <!-- Nuiton -->
+ <dependency>
+ <groupId>org.nuiton</groupId>
+ <artifactId>nuiton-utils</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.nuiton</groupId>
+ <artifactId>nuiton-decorator</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.nuiton.i18n</groupId>
+ <artifactId>nuiton-i18n</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.nuiton</groupId>
+ <artifactId>nuiton-csv</artifactId>
+ </dependency>
+
+ <!-- SwingX -->
+ <dependency>
+ <groupId>org.swinglabs.swingx</groupId>
+ <artifactId>swingx-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.swinglabs.swingx</groupId>
+ <artifactId>swingx-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.swinglabs.swingx</groupId>
+ <artifactId>swingx-autocomplete</artifactId>
+ </dependency>
+
+ <!-- Logging -->
+ <!--dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-jcl</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <scope>runtime</scope>
+ </dependency-->
+
+ <!-- Test -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+
+ <plugins>
+
+ <plugin>
+ <groupId>org.nuiton.jaxx</groupId>
+ <artifactId>jaxx-maven-plugin</artifactId>
+ <version>${project.version}</version>
+ <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>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+
+</project>
Property changes on: trunk/jaxx-application-swing/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Property changes on: trunk/jaxx-application-swing/src
___________________________________________________________________
Added: svn:ignore
+ target
.idea
*.ipr
*.iws
*.iml
Property changes on: trunk/jaxx-application-swing/src/license
___________________________________________________________________
Added: svn:ignore
+ target
.idea
*.ipr
*.iws
*.iml
Added: trunk/jaxx-application-swing/src/license/THIRD-PARTY.properties
===================================================================
--- trunk/jaxx-application-swing/src/license/THIRD-PARTY.properties (rev 0)
+++ trunk/jaxx-application-swing/src/license/THIRD-PARTY.properties 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,25 @@
+# Generated by org.codehaus.mojo.license.AddThirdPartyMojo
+#-------------------------------------------------------------------------------
+# Already used licenses in project :
+# - Apache License
+# - BSD License
+# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+# - Common Public License Version 1.0
+# - GNU General Public License - Version 2 with the class path exception
+# - GNU Library or Lesser General Public License
+# - General Public License (GPL)
+# - Indiana University Extreme! Lab Software License, vesion 1.1.1
+# - Lesser General Public License (LGPL)
+# - Lesser General Public License (LGPL) v 3.0
+# - Lesser General Public License (LPGL)
+# - Lesser General Public License (LPGL) v 2.1
+# - MIT License
+# - New BSD License
+# - The Apache Software License, Version 2.0
+#-------------------------------------------------------------------------------
+# Please fill the missing licenses for dependencies :
+#
+#
+#Sun Nov 24 23:54:27 CET 2013
+commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0
+javassist--javassist--3.11.0.GA=The Apache Software License, Version 2.0
Property changes on: trunk/jaxx-application-swing/src/license/THIRD-PARTY.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Property changes on: trunk/jaxx-application-swing/src/main
___________________________________________________________________
Added: svn:ignore
+ target
.idea
*.ipr
*.iws
*.iml
Property changes on: trunk/jaxx-application-swing/src/main/java
___________________________________________________________________
Added: svn:ignore
+ target
.idea
*.ipr
*.iws
*.iml
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/AbstractApplicationUIHandler.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/AbstractApplicationUIHandler.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/AbstractApplicationUIHandler.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,1019 @@
+package org.nuiton.jaxx.application.swing;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import jaxx.runtime.JAXXUtil;
+import jaxx.runtime.SwingUtil;
+import jaxx.runtime.spi.UIHandler;
+import jaxx.runtime.swing.JAXXWidgetUtil;
+import jaxx.runtime.swing.editor.FileEditor;
+import jaxx.runtime.swing.editor.NumberEditor;
+import jaxx.runtime.swing.editor.SimpleTimeEditor;
+import jaxx.runtime.swing.editor.bean.BeanDoubleList;
+import jaxx.runtime.swing.editor.bean.BeanFilterableComboBox;
+import jaxx.runtime.swing.editor.bean.BeanUIUtil;
+import jaxx.runtime.swing.editor.cell.NumberCellEditor;
+import jaxx.runtime.swing.editor.gis.DmdCoordinateEditor;
+import jaxx.runtime.swing.editor.gis.DmsCoordinateEditor;
+import jaxx.runtime.swing.renderer.DecoratorListCellRenderer;
+import jaxx.runtime.swing.renderer.DecoratorTableCellRenderer;
+import jaxx.runtime.validator.swing.SwingValidator;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.swingx.JXDatePicker;
+import org.jdesktop.swingx.JXTable;
+import org.jdesktop.swingx.autocomplete.ComboBoxCellEditor;
+import org.jdesktop.swingx.autocomplete.ObjectToStringConverter;
+import org.jdesktop.swingx.table.TableColumnExt;
+import org.nuiton.decorator.Decorator;
+import org.nuiton.decorator.JXPathDecorator;
+import org.nuiton.jaxx.application.ApplicationDataUtil;
+import org.nuiton.jaxx.application.swing.action.ApplicationActionUI;
+import org.nuiton.jaxx.application.swing.table.ColumnIdentifier;
+import org.nuiton.jaxx.application.swing.util.ApplicationUIUtil;
+import org.nuiton.jaxx.application.swing.util.Cancelable;
+import org.nuiton.jaxx.application.type.ApplicationProgressionModel;
+
+import javax.swing.AbstractAction;
+import javax.swing.AbstractButton;
+import javax.swing.Action;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JOptionPane;
+import javax.swing.JPopupMenu;
+import javax.swing.JRootPane;
+import javax.swing.JScrollPane;
+import javax.swing.JSpinner;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.JViewport;
+import javax.swing.KeyStroke;
+import javax.swing.ListCellRenderer;
+import javax.swing.ListSelectionModel;
+import javax.swing.ScrollPaneConstants;
+import javax.swing.SwingConstants;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.border.LineBorder;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
+import javax.swing.table.TableColumnModel;
+import javax.swing.text.JTextComponent;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dialog;
+import java.awt.Dimension;
+import java.awt.Frame;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+import java.awt.event.HierarchyEvent;
+import java.awt.event.HierarchyListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.File;
+import java.io.Serializable;
+import java.text.ParseException;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * Handler of any ui.
+ * <p/>
+ * Created on 11/23/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public abstract class AbstractApplicationUIHandler<M, UI extends ApplicationUI<M, ?>> implements UIHandler<UI> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(AbstractApplicationUIHandler.class);
+
+ public abstract void onCloseUI();
+
+ public abstract SwingValidator<M> getValidator();
+
+ public abstract Component getTopestUI();
+
+ public abstract <E> Decorator<E> getDecorator(Class<E> beanType, String decoratorContext);
+
+ /**
+ * Hook to prepare popup just before showing it.
+ * <p/>
+ * The right place to update actions accessibility; a quite better design
+ * than trying to update each time something change in the table...
+ *
+ * @param modelRowIndex selected row index (or lowest selected one)
+ * @param modelColumnIndex selected column index
+ * @since 2.6
+ */
+ protected void beforeOpenPopup(int modelRowIndex, int modelColumnIndex) {
+ // by default do nothing
+ }
+
+ /**
+ * Global application context.
+ */
+ private ApplicationUIContext context;
+
+ /**
+ * UI handled.
+ */
+ protected UI ui;
+
+ //------------------------------------------------------------------------//
+ //-- Public methods --//
+ //------------------------------------------------------------------------//
+
+ public DefaultComboBoxModel newComboModel(Object... items) {
+ return new DefaultComboBoxModel(items);
+ }
+
+ public final M getModel() {
+ return ui.getModel();
+ }
+
+ public final UI getUI() {
+ return ui;
+ }
+
+ @Override
+ public void beforeInit(UI ui) {
+ this.ui = ui;
+ }
+
+ public ApplicationUIContext getContext() {
+ if (context == null) {
+ context = ApplicationUIUtil.getApplicationContext(ui);
+ }
+ return context;
+ }
+
+ public void setText(KeyEvent event, String property) {
+ JTextComponent field = (JTextComponent) event.getSource();
+ String value = field.getText();
+ ApplicationDataUtil.setProperty(getModel(), property, value);
+ }
+
+ public void setFile(ActionEvent event, String property) {
+ FileEditor field = (FileEditor) event.getSource();
+ File value = field.getSelectedFile();
+ ApplicationDataUtil.setProperty(getModel(), property, value);
+ }
+
+ public void setBoolean(ItemEvent event, String property) {
+ boolean value = event.getStateChange() == ItemEvent.SELECTED;
+ ApplicationDataUtil.setProperty(getModel(), property, value);
+ }
+
+ public void setDate(ActionEvent event, String property) {
+ JXDatePicker field = (JXDatePicker) event.getSource();
+ Date value = field.getDate();
+ ApplicationDataUtil.setProperty(getModel(), property, value);
+ }
+
+ public void selectListData(ListSelectionEvent event, String property) {
+ if (!event.getValueIsAdjusting()) {
+ JList list = (JList) event.getSource();
+ ListSelectionModel selectionModel = list.getSelectionModel();
+
+ selectionModel.setValueIsAdjusting(true);
+ try {
+ List<Object> selectedList = Lists.newLinkedList();
+
+ for (int index : list.getSelectedIndices()) {
+ Object o = list.getModel().getElementAt(index);
+ selectedList.add(o);
+ }
+ ApplicationDataUtil.setProperty(getModel(), property, selectedList);
+ } finally {
+ selectionModel.setValueIsAdjusting(false);
+ }
+ }
+ }
+
+ public void openDialog(ApplicationUI dialogContent,
+ String title, Dimension dim) {
+ Component topestUI = getTopestUI();
+
+ JDialog result;
+ if (topestUI instanceof Frame) {
+ result = new JDialog((Frame) topestUI, title, true);
+ } else {
+ result = new JDialog((Dialog) topestUI, title, true);
+ }
+
+ result.add((Component) dialogContent);
+ result.setResizable(true);
+
+ result.setSize(dim);
+
+ final AbstractApplicationUIHandler handler = dialogContent.getHandler();
+
+ if (handler instanceof Cancelable) {
+
+ // add a auto-close action
+ JRootPane rootPane = result.getRootPane();
+
+ KeyStroke shortcutClosePopup = getContext().getConfiguration().getShortcutClosePopup();
+
+ rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
+ shortcutClosePopup, "close");
+ rootPane.getActionMap().put("close", new AbstractAction() {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ ((Cancelable) handler).cancel();
+ }
+ });
+ }
+
+ result.addWindowListener(new WindowAdapter() {
+
+ @Override
+ public void windowClosed(WindowEvent e) {
+ Component ui = (Component) e.getSource();
+ if (log.isDebugEnabled()) {
+ log.debug("Destroy ui " + ui);
+ }
+ JAXXUtil.destroy(ui);
+ }
+ });
+ SwingUtil.center(getContext().getMainUI(), result);
+ result.setVisible(true);
+ }
+
+ public void closeDialog() {
+ getParentContainer(JDialog.class).setVisible(false);
+ }
+
+ public <U extends Container> U getParentContainer(Class<U> uiType) {
+ return SwingUtil.getParentContainer(ui, uiType);
+ }
+
+ public static final String CONFIRMATION_FORMAT = "<html>%s<hr/><br/>%s</html>";
+
+ public int askSaveBeforeLeaving(String message) {
+ String htmlMessage = String.format(
+ CONFIRMATION_FORMAT,
+ message,
+ _("jaxx.application.common.askSaveBeforeLeaving.help"));
+ int result = JOptionPane.showConfirmDialog(
+ getTopestUI(),
+ htmlMessage,
+ _("jaxx.application.common.askSaveBeforeLeaving.title"),
+ JOptionPane.YES_NO_CANCEL_OPTION,
+ JOptionPane.QUESTION_MESSAGE);
+ return result;
+ }
+
+ public boolean askCancelEditBeforeLeaving(String message) {
+ String htmlMessage = String.format(
+ CONFIRMATION_FORMAT,
+ message,
+ _("jaxx.application.common.askCancelEditBeforeLeaving.help"));
+ int i = JOptionPane.showConfirmDialog(
+ getTopestUI(),
+ htmlMessage,
+ _("jaxx.application.common.askCancelEditBeforeLeaving.title"),
+ JOptionPane.OK_CANCEL_OPTION,
+ JOptionPane.QUESTION_MESSAGE);
+
+ boolean result = i == JOptionPane.OK_OPTION;
+ return result;
+ }
+
+ public void showSuccessMessage(String title, String message) {
+
+ Component topestUI = getTopestUI();
+ boolean alwaysOnTop = false;
+
+ if (topestUI instanceof JDialog) {
+ alwaysOnTop = ((JDialog) topestUI).isAlwaysOnTop();
+ }
+
+ if (alwaysOnTop) {
+ ((JDialog) topestUI).setAlwaysOnTop(false);
+ }
+ try {
+
+ JOptionPane.showMessageDialog(
+ topestUI,
+ message,
+ title,
+ JOptionPane.INFORMATION_MESSAGE,
+ UIManager.getIcon("info")
+ );
+ } finally {
+ if (alwaysOnTop) {
+ ((JDialog) topestUI).setAlwaysOnTop(true);
+ }
+ }
+ }
+
+ protected void addHighlighters(final JXTable table) {
+
+ }
+
+ public void autoSelectRowInTable(MouseEvent e, JPopupMenu popup) {
+
+ boolean rightClick = SwingUtilities.isRightMouseButton(e);
+
+ if (rightClick || SwingUtilities.isLeftMouseButton(e)) {
+
+ // get the coordinates of the mouse click
+ Point p = e.getPoint();
+
+ JXTable source = (JXTable) e.getSource();
+
+ int[] selectedRows = source.getSelectedRows();
+ int[] selectedColumns = source.getSelectedColumns();
+
+ // get the row index at this point
+ int rowIndex = source.rowAtPoint(p);
+
+ // get the column index at this point
+ int columnIndex = source.columnAtPoint(p);
+
+ if (log.isDebugEnabled()) {
+ log.debug("At point [" + p + "] found Row " + rowIndex + ", Column " + columnIndex);
+ }
+
+ boolean canContinue = true;
+
+ if (source.isEditing()) {
+
+ // stop editing
+ boolean stopEdit = source.getCellEditor().stopCellEditing();
+ if (!stopEdit) {
+ if (log.isWarnEnabled()) {
+ log.warn("Could not stop edit cell...");
+ }
+ canContinue = false;
+ }
+ }
+
+ if (canContinue) {
+
+ // select row (could empty selection)
+ if (rowIndex == -1) {
+ source.clearSelection();
+ } else if (!ArrayUtils.contains(selectedRows, rowIndex)) {
+ if (ListSelectionModel.MULTIPLE_INTERVAL_SELECTION == source.getSelectionMode()) {
+ // add to selection
+ source.addRowSelectionInterval(rowIndex, rowIndex);
+ } else {
+ // set selection
+ source.setRowSelectionInterval(rowIndex, rowIndex);
+ }
+ }
+
+ // select column (could empty selection)
+ if (columnIndex == -1) {
+ source.clearSelection();
+ } else if (!ArrayUtils.contains(selectedColumns, columnIndex)) {
+ source.setColumnSelectionInterval(columnIndex, columnIndex);
+ }
+
+ if (rightClick) {
+
+ // use now model coordinate
+ int modelRowIndex = rowIndex == -1 ? -1 : source.convertRowIndexToModel(rowIndex);
+ int modelColumnIndex = columnIndex == -1 ? -1 : source.convertColumnIndexToModel(columnIndex);
+
+ beforeOpenPopup(modelRowIndex, modelColumnIndex);
+
+ // on right click show popup
+ popup.show(source, e.getX(), e.getY());
+ }
+ }
+ }
+ }
+
+ public void openRowMenu(KeyEvent e, JPopupMenu popup) {
+
+ if (e.getKeyCode() == KeyEvent.VK_CONTEXT_MENU) {
+
+ JXTable source = (JXTable) e.getSource();
+
+ // get the lowest selected row
+ int[] selectedRows = source.getSelectedRows();
+ int lowestRow = -1;
+ for (int row : selectedRows) {
+ lowestRow = Math.max(lowestRow, row);
+ }
+ // get the selected column
+ int selectedColumn = source.getSelectedColumn();
+ Rectangle r = source.getCellRect(lowestRow, selectedColumn, true);
+
+ // get the point in the middle lower of the cell
+ Point p = new Point(r.x + r.width / 2, r.y + r.height);
+
+ if (log.isDebugEnabled()) {
+ log.debug("Row " + lowestRow + " found t point [" + p + "]");
+ }
+
+ boolean canContinue = true;
+
+ if (source.isEditing()) {
+
+ // stop editing
+ boolean stopEdit = source.getCellEditor().stopCellEditing();
+ if (!stopEdit) {
+ if (log.isWarnEnabled()) {
+ log.warn("Could not stop edit cell...");
+ }
+ canContinue = false;
+ }
+ }
+
+ if (canContinue) {
+
+ // use now model coordinate
+ int rowIndex = source.convertRowIndexToModel(lowestRow);
+ int columnIndex = source.convertColumnIndexToModel(selectedColumn);
+ beforeOpenPopup(rowIndex, columnIndex);
+
+ popup.show(source, p.x, p.y);
+ }
+ }
+ }
+
+ //------------------------------------------------------------------------//
+ //-- Init methods --//
+ //------------------------------------------------------------------------//
+
+ protected void initUIComponent(Object component) {
+ if (component instanceof NumberEditor) {
+
+ initNumberEditor((NumberEditor) component);
+ } else if (component instanceof JXDatePicker) {
+
+ initDatePicker((JXDatePicker) component);
+ } else if (component instanceof SimpleTimeEditor) {
+
+ initTimeEditor((SimpleTimeEditor) component);
+ } else if (component instanceof JLabel) {
+
+ initLabel((JLabel) component);
+ } else if (component instanceof JTextField) {
+
+ initTextField((JTextField) component);
+ } else if (component instanceof AbstractButton) {
+
+ initButton((AbstractButton) component);
+ } else if (component instanceof JScrollPane) {
+
+ initScrollPane((JScrollPane) component);
+ } else if (component instanceof DmsCoordinateEditor) {
+
+ initCoordinateDMSEditor((DmsCoordinateEditor) component);
+ } else if (component instanceof DmdCoordinateEditor) {
+
+ initCoordinateDMDEditor((DmdCoordinateEditor) component);
+ }
+ }
+
+ protected void initUI(UI ui) {
+
+ for (Map.Entry<String, Object> entry : ui.get$objectMap().entrySet()) {
+ Object component = entry.getValue();
+ initUIComponent(component);
+ }
+
+ ((Component) ui).addHierarchyListener(new HierarchyListener() {
+ @Override
+ public void hierarchyChanged(HierarchyEvent e) {
+ JComponent component = getComponentToFocus();
+ if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) > 0
+ && e.getChanged().isShowing()
+ && component != null) {
+ component.requestFocus();
+ }
+ }
+ });
+ }
+
+ protected abstract JComponent getComponentToFocus();
+
+ protected void initTextField(JTextField jTextField) {
+
+ if (isAutoSelectOnFocus(jTextField)) {
+ addAutoSelectOnFocus(jTextField);
+ }
+ }
+
+ protected void initLabel(JLabel jLabel) {
+
+ // by default do nothing more
+ }
+
+ protected void initButton(AbstractButton abstractButton) {
+
+ Class actionName = (Class) abstractButton.getClientProperty("applicationAction");
+ if (actionName != null) {
+ Action action = getContext().getActionFactory().createUIAction(this, abstractButton, actionName);
+ abstractButton.setAction(action);
+ }
+ }
+
+ /**
+ * Prépare un component de choix d'entités pour un type d'entité donné et
+ * pour un service de persistance donné.
+ *
+ * @param comboBox le component graphique à initialiser
+ */
+ protected <E> void initBeanFilterableComboBox(
+ BeanFilterableComboBox<E> comboBox,
+ List<E> data,
+ E selectedData) {
+
+ initBeanFilterableComboBox(comboBox, data, selectedData, null);
+ }
+
+ protected <E> void initBeanFilterableComboBox(
+ BeanFilterableComboBox<E> comboBox,
+ List<E> data,
+ E selectedData,
+ String decoratorContext) {
+
+ Preconditions.checkNotNull(comboBox, "No comboBox!");
+
+ Class<E> beanType = comboBox.getBeanType();
+
+ Preconditions.checkNotNull(beanType, "No beanType on the combobox!");
+
+ Decorator<E> decorator = getDecorator(beanType, decoratorContext);
+
+ if (data == null) {
+ data = Lists.newArrayList();
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug("entity comboBox list [" + beanType.getName() + "] : " +
+ (data == null ? 0 : data.size()));
+ }
+
+ comboBox.setI18nPrefix(getContext().getI18nPrefix());
+
+ // add data list to combo box
+ comboBox.init((JXPathDecorator<E>) decorator, data);
+
+ comboBox.setSelectedItem(selectedData);
+
+ if (log.isDebugEnabled()) {
+ log.debug("combo [" + beanType.getName() + "] : " +
+ comboBox.getData().size());
+ }
+ }
+
+ /**
+ * Prépare un component de choix d'entités pour un type d'entité donné et
+ * pour un service de persistance donné.
+ *
+ * @param list le component graphique à initialiser
+ * @param data la liste des données à mettre dans la liste de gauche
+ * @param selectedData la liste des données à mettre dans la liste de droite
+ */
+ protected <E> void initBeanList(
+ BeanDoubleList<E> list,
+ List<E> data,
+ List<E> selectedData,
+ Decorator<E> selectedDecorator) {
+
+ Preconditions.checkNotNull(list, "No list!");
+
+ Class<E> beanType = list.getBeanType();
+ Preconditions.checkNotNull(beanType, "No beanType on the double list!");
+
+ Decorator<E> decorator = getDecorator(beanType, null);
+
+ if (log.isDebugEnabled()) {
+ log.debug("entity list [" + beanType.getName() + "] : " +
+ (data == null ? 0 : data.size()));
+ }
+
+ list.setI18nPrefix(getContext().getI18nPrefix());
+
+ // add data list to combo box
+ list.init((JXPathDecorator<E>) decorator,
+ (JXPathDecorator<E>) selectedDecorator,
+ data,
+ selectedData);
+
+ if (log.isDebugEnabled()) {
+ log.debug("Jlist [" + beanType.getName() + "] : " +
+ list.getUniverseList().getModel().getSize());
+ }
+ }
+
+ /**
+ * Prépare un component de choix d'entités pour un type d'entité donné et
+ * pour un service de persistance donné.
+ *
+ * @param list le component graphique à initialiser
+ * @param data la liste des données à mettre dans la liste de gauche
+ * @param selectedData la liste des données à mettre dans la liste de droite
+ */
+ protected <E> void initBeanList(
+ BeanDoubleList<E> list,
+ List<E> data,
+ List<E> selectedData) {
+
+ initBeanList(list, data, selectedData, null);
+ }
+
+ protected void initNumberEditor(NumberEditor editor) {
+ if (log.isDebugEnabled()) {
+ log.debug("init number editor " + editor.getName());
+ }
+ editor.init();
+
+ // Force binding if value is already in model
+ Number model = editor.getModel();
+ if (model != null) {
+ editor.setModel(null);
+ editor.setModel(model);
+ }
+
+ if (isAutoSelectOnFocus(editor)) {
+
+ addAutoSelectOnFocus(editor.getTextField());
+ }
+ }
+
+ protected void initTimeEditor(SimpleTimeEditor editor) {
+ if (log.isDebugEnabled()) {
+ log.debug("init time editor " + editor.getName() +
+ " for property " + editor.getModel().getProperty());
+ }
+ editor.init();
+
+ if (isAutoSelectOnFocus(editor)) {
+ addAutoSelectOnFocus(((JSpinner.DefaultEditor) editor.getHour().getEditor()).getTextField());
+ addAutoSelectOnFocus(((JSpinner.DefaultEditor) editor.getMinute().getEditor()).getTextField());
+ }
+ }
+
+ protected void initCoordinateDMSEditor(DmsCoordinateEditor editor) {
+ Object property = editor.getClientProperty("longitudeEditor");
+ boolean longitudeEditor = property != null && Boolean.valueOf(property.toString());
+ editor.init(longitudeEditor);
+ }
+
+ protected void initCoordinateDMDEditor(DmdCoordinateEditor editor) {
+ Object property = editor.getClientProperty("longitudeEditor");
+ boolean longitudeEditor = property != null && Boolean.valueOf(property.toString());
+ editor.init(longitudeEditor);
+ }
+
+ protected void initDatePicker(final JXDatePicker picker) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("disable JXDatePicker editor" + picker.getName());
+ }
+ String dateFormat = getContext().getDateFormat();
+ picker.setFormats(dateFormat);
+ picker.setToolTipText(_("jaxx.application.common.datefield.tip", dateFormat));
+ picker.getEditor().addFocusListener(new FocusAdapter() {
+
+ @Override
+ public void focusLost(FocusEvent e) {
+ try {
+ picker.commitEdit();
+
+ } catch (ParseException ex) {
+ if (log.isDebugEnabled()) {
+ log.debug("format error", ex);
+ }
+ picker.requestFocus();
+ }
+ }
+ });
+
+ if (isAutoSelectOnFocus(picker)) {
+ addAutoSelectOnFocus(picker.getEditor());
+ }
+ }
+
+ protected void initScrollPane(JScrollPane scrollPane) {
+ Boolean onlyVerticalScrollable = (Boolean) scrollPane.getClientProperty("onlyVerticalScrollable");
+ if (onlyVerticalScrollable != null && onlyVerticalScrollable) {
+ scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+ scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
+
+ final JViewport viewport = scrollPane.getViewport();
+ viewport.addChangeListener(new ChangeListener() {
+ @Override
+ public void stateChanged(ChangeEvent e) {
+ Dimension newDimension = new Dimension(viewport.getExtentSize().width,
+ viewport.getViewSize().height);
+ viewport.setViewSize(newDimension);
+ }
+ });
+ }
+ }
+
+ protected boolean isAutoSelectOnFocus(JComponent comp) {
+ Object selectOnFocus = comp.getClientProperty("selectOnFocus");
+ return selectOnFocus != null && Boolean.valueOf(selectOnFocus.toString());
+ }
+
+ protected void addAutoSelectOnFocus(JTextField jTextField) {
+ jTextField.addFocusListener(new FocusAdapter() {
+ @Override
+ public void focusGained(final FocusEvent e) {
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ JTextField source = (JTextField) e.getSource();
+ source.selectAll();
+ }
+ });
+
+ }
+ });
+ }
+
+ protected boolean quitScreen(boolean modelIsValid,
+ boolean modelIsModify,
+ String askGiveUpMessage,
+ String askSaveMessage,
+ Action saveAction) {
+ boolean result;
+
+ if (!modelIsValid) {
+
+ // model is not valid
+ // ask user to qui or not
+ result = askCancelEditBeforeLeaving(askGiveUpMessage);
+
+ } else if (modelIsModify) {
+
+ // something is modify ask user what to do
+ int answer = askSaveBeforeLeaving(askSaveMessage);
+ switch (answer) {
+ case JOptionPane.YES_OPTION:
+
+ // ok save
+ saveAction.actionPerformed(null);
+ result = true;
+ break;
+ case JOptionPane.NO_OPTION:
+
+ // do not save but can still quit the screen (so nothing to do)
+ result = true;
+ break;
+ default:
+ // do not save and stay here (so nothing to do)
+ result = false;
+
+ }
+ } else {
+
+ // model is valid and not modify, can safely quit screen
+ result = true;
+ }
+ return result;
+ }
+
+ //------------------------------------------------------------------------//
+ //-- Decorator API --//
+ //------------------------------------------------------------------------//
+
+ protected String decorate(Serializable object) {
+ return decorate(object, null);
+ }
+
+ protected String decorate(Serializable object, String context) {
+ String result = "";
+ if (object != null) {
+ result = getDecorator(object.getClass(), context).toString(object);
+ }
+ return result;
+ }
+
+ //------------------------------------------------------------------------//
+ //-- List API --//
+ //------------------------------------------------------------------------//
+
+ protected <O> ListCellRenderer newListCellRender(Class<O> type) {
+
+ return newListCellRender(type, null);
+ }
+
+ protected <O> ListCellRenderer newListCellRender(Class<O> type, String name) {
+
+ Decorator<O> decorator = getDecorator(type, name);
+ return newListCellRender(decorator);
+ }
+
+ protected <O> ListCellRenderer newListCellRender(Decorator<O> decorator) {
+
+ Preconditions.checkNotNull(decorator);
+
+ ListCellRenderer result = new DecoratorListCellRenderer(decorator);
+ return result;
+ }
+
+ //FIXME Move this in JAXX
+ protected <B> void changeValidatorContext(String newContext,
+ SwingValidator<B> validator) {
+ B bean = validator.getBean();
+ validator.setContext(newContext);
+ validator.setBean(bean);
+ }
+
+ //------------------------------------------------------------------------//
+ //-- Table API --//
+ //------------------------------------------------------------------------//
+
+ protected <R> TableColumnExt addColumnToModel(TableColumnModel model,
+ TableCellEditor editor,
+ TableCellRenderer renderer,
+ ColumnIdentifier<R> identifier) {
+
+ TableColumnExt col = new TableColumnExt(model.getColumnCount());
+ col.setCellEditor(editor);
+ col.setCellRenderer(renderer);
+ String label = _(identifier.getHeaderI18nKey());
+
+ col.setHeaderValue(label);
+ String tip = _(identifier.getHeaderTipI18nKey());
+
+ col.setToolTipText(tip);
+
+ col.setIdentifier(identifier);
+ model.addColumn(col);
+ // by default no column is sortable, must specify it
+ col.setSortable(false);
+ return col;
+ }
+
+ protected <R> TableColumnExt addColumnToModel(TableColumnModel model,
+ ColumnIdentifier<R> identifier) {
+
+ return addColumnToModel(model, null, null, identifier);
+ }
+
+ protected <R> TableColumnExt addFloatColumnToModel(TableColumnModel model,
+ ColumnIdentifier<R> identifier,
+ String numberPattern,
+ JTable table) {
+
+ NumberCellEditor<Float> editor =
+ JAXXWidgetUtil.newNumberTableCellEditor(Float.class, false);
+ editor.getNumberEditor().setSelectAllTextOnError(true);
+ editor.getNumberEditor().getTextField().setBorder(new LineBorder(Color.GRAY, 2));
+ editor.getNumberEditor().setNumberPattern(numberPattern);
+
+ TableCellRenderer renderer =
+ newNumberCellRenderer(table.getDefaultRenderer(Number.class));
+
+ return addColumnToModel(model, editor, renderer, identifier);
+ }
+
+ protected <R> TableColumnExt addIntegerColumnToModel(TableColumnModel model,
+ ColumnIdentifier<R> identifier,
+ String numberPattern,
+ JTable table) {
+
+ NumberCellEditor<Integer> editor =
+ JAXXWidgetUtil.newNumberTableCellEditor(Integer.class, false);
+ editor.getNumberEditor().setSelectAllTextOnError(true);
+ editor.getNumberEditor().getTextField().setBorder(new LineBorder(Color.GRAY, 2));
+ editor.getNumberEditor().setNumberPattern(numberPattern);
+
+ TableCellRenderer renderer = newNumberCellRenderer(table.getDefaultRenderer(Number.class));
+ return addColumnToModel(model, editor, renderer, identifier);
+ }
+
+
+ protected TableCellRenderer newNumberCellRenderer(final TableCellRenderer defaultRenderer) {
+ TableCellRenderer result = new TableCellRenderer() {
+ @Override
+ public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
+ Component result = defaultRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+ if (result instanceof JLabel) {
+ JLabel jLabel = (JLabel) result;
+ jLabel.setHorizontalTextPosition(SwingConstants.RIGHT);
+
+ }
+ return result;
+ }
+ };
+ return result;
+ }
+
+
+ protected <R> TableColumnExt addBooleanColumnToModel(TableColumnModel model,
+ ColumnIdentifier<R> identifier,
+ JTable table) {
+
+ return addColumnToModel(model,
+ table.getDefaultEditor(Boolean.class),
+ table.getDefaultRenderer(Boolean.class),
+ identifier);
+ }
+
+ protected <R, B> TableColumnExt addComboDataColumnToModel(TableColumnModel model,
+ ColumnIdentifier<R> identifier,
+ Decorator<B> decorator,
+ List<B> data) {
+ JComboBox comboBox = new JComboBox();
+ comboBox.setRenderer(newListCellRender(decorator));
+
+ List<B> dataToList = Lists.newArrayList(data);
+
+ // add a null value at first position
+ if (!dataToList.isEmpty() && dataToList.get(0) != null) {
+ dataToList.add(0, null);
+ }
+ SwingUtil.fillComboBox(comboBox, dataToList, null);
+
+ ObjectToStringConverter converter = BeanUIUtil.newDecoratedObjectToStringConverter(decorator);
+ BeanUIUtil.decorate(comboBox, converter);
+ ComboBoxCellEditor editor = new ComboBoxCellEditor(comboBox);
+
+ return addColumnToModel(model,
+ editor,
+ newTableCellRender(decorator),
+ identifier);
+ }
+
+ protected <O> TableCellRenderer newTableCellRender(Class<O> type) {
+
+ return newTableCellRender(type, null);
+ }
+
+ protected <O> TableCellRenderer newTableCellRender(Class<O> type, String name) {
+
+ Decorator<O> decorator = getDecorator(type, name);
+
+ TableCellRenderer result = newTableCellRender(decorator);
+ return result;
+ }
+
+ protected <O> TableCellRenderer newTableCellRender(Decorator<O> decorator) {
+
+ Preconditions.checkNotNull(decorator);
+
+ DecoratorTableCellRenderer result = new DecoratorTableCellRenderer(decorator, true);
+ return result;
+ }
+
+ protected void incrementsMessage(String message) {
+
+ ApplicationActionUI actionUI = getContext().getActionUI();
+ if (actionUI != null) {
+ ApplicationProgressionModel progressionModel = actionUI.getModel().getProgressionModel();
+ if (progressionModel != null)
+
+ progressionModel.increments(message);
+ }
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/AbstractApplicationUIHandler.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/ApplicationUI.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/ApplicationUI.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/ApplicationUI.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,138 @@
+package org.nuiton.jaxx.application.swing;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import jaxx.runtime.JAXXObject;
+
+/**
+ * Contract to place on each ui.
+ * <p/>
+ * Created on 11/23/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public interface ApplicationUI<M, H extends AbstractApplicationUIHandler<M, ?>> extends JAXXObject {
+
+ M getModel();
+
+ H getHandler();
+
+ /**
+ * Pattern to use for short numeric values in editors with max 1 digits.
+ *
+ * @since 0.2
+ */
+ public static final String INT_1_DIGITS_PATTERN = "\\d{0,1}";
+
+ /**
+ * Pattern to use for short numeric values in editors with max 2 digits.
+ *
+ * @since 0.1
+ */
+ public static final String INT_2_DIGITS_PATTERN = "\\d{0,2}";
+
+ /**
+ * Pattern to use for signed numeric values in editors with max 2 digits.
+ *
+ * @since 2.8
+ */
+ public static final String SIGNED_INT_2_DIGITS_PATTERN = "-?\\d{0,2}";
+
+ /**
+ * Pattern to use for short numeric values in editors with max 3 digits.
+ *
+ * @since 0.1
+ */
+ public static final String INT_3_DIGITS_PATTERN = "\\d{0,3}";
+
+ /**
+ * Pattern to use for singed numeric values in editors with max 3 digits.
+ *
+ * @since 2.8
+ */
+ public static final String SIGNED_INT_3_DIGITS_PATTERN = "-?\\d{0,3}";
+
+ /**
+ * Pattern to use for short numeric values in editors with max 4 digits.
+ *
+ * @since 0.2
+ */
+ public static final String INT_4_DIGITS_PATTERN = "\\d{0,4}";
+
+ /**
+ * Pattern to use for integer numeric values in editors with max 6 digits.
+ *
+ * @since 0.1
+ */
+ public static final String INT_6_DIGITS_PATTERN = "\\d{0,6}";
+
+ /**
+ * Pattern to use for integer numeric values in editors with max 7 digits.
+ *
+ * @since 0.1
+ */
+ public static final String INT_7_DIGITS_PATTERN = "\\d{0,7}";
+
+ /**
+ * Pattern to use for decimal numeric values with 1 decimal digits in
+ * editors.
+ *
+ * @since 0.1
+ */
+ public static final String DECIMAL1_PATTERN = "\\d{0,6}(\\.\\d{0,1})?";
+
+ /**
+ * Pattern to use for decimal numeric values with 2 decimal digits in
+ * editors.
+ *
+ * @since 0.1
+ */
+ public static final String DECIMAL2_PATTERN = "\\d{0,6}(\\.\\d{0,2})?";
+
+ /**
+ * Pattern to use for decimal numeric values with 3 decimal digits in
+ * editors.
+ *
+ * @since 0.1
+ */
+ public static final String DECIMAL3_PATTERN = "\\d{0,6}(\\.\\d{0,3})?";
+
+ /**
+ * Pattern to use for decimal numeric values with 4 decimal digits in
+ * editors.
+ *
+ * @since 2.6
+ */
+ public static final String DECIMAL4_PATTERN = "\\d{0,6}(\\.\\d{0,4})?";
+
+ /**
+ * Pattern to use for decimal numeric values with 2 digits + 3 decimal digits in
+ * editors.
+ *
+ * @since 2.8
+ */
+ public static final String DECIMAL2_DIGITS_PATTERN = "\\d{0,2}(\\.\\d*)?";
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/ApplicationUI.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/ApplicationUIContext.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/ApplicationUIContext.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/ApplicationUIContext.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,84 @@
+package org.nuiton.jaxx.application.swing;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import org.nuiton.jaxx.application.ApplicationContext;
+import org.nuiton.jaxx.application.swing.action.ApplicationActionEngine;
+import org.nuiton.jaxx.application.swing.action.ApplicationActionFactory;
+import org.nuiton.jaxx.application.swing.action.ApplicationActionUI;
+import org.nuiton.jaxx.application.swing.util.ApplicationErrorHelper;
+
+import java.awt.Color;
+import java.awt.Component;
+
+/**
+ * Created on 11/24/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public interface ApplicationUIContext extends ApplicationContext {
+
+ /**
+ * @return the main ui of the application.
+ */
+ Component getMainUI();
+
+ /**
+ * @return the ui used to display long action.
+ */
+ ApplicationActionUI getActionUI();
+
+ /**
+ * Wait until the action ui is not null and then returns it.
+ *
+ * @return the ui used to display long action.
+ */
+ ApplicationActionUI getExistingActionUI();
+
+ Component getBodyUI();
+
+ Component getStatusUI();
+
+ boolean isBusy();
+
+ void setBusy(boolean busy);
+
+ boolean isHideBody();
+
+ void setHideBody(boolean b);
+
+ Color getColorBlockingLayer();
+
+ ApplicationActionFactory getActionFactory();
+
+ ApplicationActionEngine getActionEngine();
+
+ ApplicationErrorHelper getErrorHelper();
+
+ String getI18nPrefix();
+
+ String getDateFormat();
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/ApplicationUIContext.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/AbstractApplicationAction.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/AbstractApplicationAction.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/AbstractApplicationAction.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,326 @@
+package org.nuiton.jaxx.application.swing.action;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import com.google.common.base.Preconditions;
+import jaxx.runtime.FileChooserUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.beans.AbstractBean;
+import org.nuiton.decorator.Decorator;
+import org.nuiton.jaxx.application.ApplicationConfiguration;
+import org.nuiton.jaxx.application.swing.AbstractApplicationUIHandler;
+import org.nuiton.jaxx.application.swing.ApplicationUI;
+import org.nuiton.jaxx.application.swing.ApplicationUIContext;
+import org.nuiton.jaxx.application.type.ApplicationProgressionModel;
+
+import javax.swing.JOptionPane;
+import java.io.File;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * Tutti base action.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public abstract class AbstractApplicationAction<M extends AbstractBean, UI extends ApplicationUI<M, ?>, H extends AbstractApplicationUIHandler<M, UI>>
+ extends AbstractBean {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(AbstractApplicationAction.class);
+
+ public static final String PROPERTY_DONE = "done";
+
+ protected final H handler;
+
+ protected String actionDescription;
+
+ protected final boolean hideBody;
+
+ protected final Object lock = new Object();
+
+ public abstract void doAction() throws Exception;
+
+ protected AbstractApplicationAction(H handler, boolean hideBody) {
+ this.handler = handler;
+ this.hideBody = hideBody;
+ }
+
+ public boolean prepareAction() throws Exception {
+ // by default nothing to prepare
+ return true;
+ }
+
+ protected void releaseAction() {
+ // by default nothing to clean
+ firePropertyChange(PROPERTY_DONE, null, true);
+ }
+
+ public void postSuccessAction() {
+ // by default nothing to do after action
+ }
+
+ public void postFailedAction(Throwable error) {
+ // by default nothing to do after action
+ }
+
+ public H getHandler() {
+ return handler;
+ }
+
+ public M getModel() {
+ return handler.getModel();
+ }
+
+ public final UI getUI() {
+ return handler.getUI();
+ }
+
+ public ApplicationUIContext getContext() {
+ return handler.getContext();
+ }
+
+ public String getActionDescription() {
+ return actionDescription;
+ }
+
+ public void setActionDescription(String actionDescription) {
+ this.actionDescription = actionDescription;
+ }
+
+ public void setProgressionModel(ApplicationProgressionModel progressionModel) {
+ getContext().getActionUI().getModel().setProgressionModel(progressionModel);
+ }
+
+ protected ApplicationProgressionModel getProgressionModel() {
+ return getContext().getActionUI().getModel().getProgressionModel();
+ }
+
+ public boolean isHideBody() {
+ return hideBody;
+ }
+
+ protected ApplicationConfiguration getConfig() {
+ return getContext().getConfiguration();
+ }
+
+ protected abstract void sendMessage(String message);
+
+ protected <O> Decorator<O> getDecorator(Class<O> type, String name) {
+ Decorator<O> decorator = handler.getDecorator(type, name);
+ Preconditions.checkNotNull(decorator);
+ return decorator;
+ }
+
+ protected String decorate(Object object) {
+ return getDecorator(object.getClass(), null).toString(object);
+ }
+
+ protected String decorate(Object object, String context) {
+ return getDecorator(object.getClass(), context).toString(object);
+ }
+
+ /**
+ * Choisir un fichier via un sélecteur graphique de fichiers.
+ *
+ * @param title le titre du dialogue de sélection
+ * @param buttonLabel le label du boutton d'acceptation
+ * @param filters les filtres + descriptions sur le sélecteur de
+ * fichiers
+ * @return le fichier choisi ou le fichier incoming si l'opération a été
+ * annulée
+ */
+ protected File chooseFile(String title,
+ String buttonLabel,
+ String... filters) {
+
+ File file = FileChooserUtil.getFile(title,
+ buttonLabel,
+ getContext().getMainUI(),
+ filters);
+ if (log.isDebugEnabled()) {
+ log.debug(title + " : " + file);
+ }
+ if (file != null) {
+ File newDir = file.isDirectory() ? file : file.getParentFile();
+ FileChooserUtil.setCurrentDirectory(newDir);
+ }
+ return file;
+ }
+
+ /**
+ * Sauver un fichier via un sélecteur graphique de fichiers.
+ *
+ * @param title le titre du dialogue de sélection
+ * @param buttonLabel le label du boutton d'acceptation
+ * @param filters les filtres + descriptions sur le sélecteur de
+ * fichiers
+ * @return le fichier choisi ou {@code null} si pas de fichier choisi ou
+ * pas voulu écrasé un fichier existant.
+ */
+ protected File saveFile(File defaultFile,
+ String filename,
+ String extension,
+ String title,
+ String buttonLabel,
+ String... filters) {
+
+ if (defaultFile != null && FileChooserUtil.isCurrentDirectoryDefault()) {
+
+ // set default directory to this one
+ FileChooserUtil.setCurrentDirectory(defaultFile);
+ }
+ File file = saveFile(filename, extension, title, buttonLabel, filters);
+ return file;
+ }
+
+ /**
+ * Sauver un fichier via un sélecteur graphique de fichiers.
+ *
+ * @param title le titre du dialogue de sélection
+ * @param buttonLabel le label du boutton d'acceptation
+ * @param filters les filtres + descriptions sur le sélecteur de
+ * fichiers
+ * @return le fichier choisi ou {@code null} si pas de fichier choisi ou
+ * pas voulu écrasé un fichier existant.
+ */
+ protected File saveFile(String filename,
+ String extension,
+ String title,
+ String buttonLabel,
+ String... filters) {
+
+ boolean withExtension = StringUtils.isNotBlank(extension);
+ String filenameSuffix = withExtension ? "." + extension : "";
+ File file = FileChooserUtil.saveFile(filename + filenameSuffix, title, buttonLabel, getContext().getMainUI(), filters);
+ if (log.isDebugEnabled()) {
+ log.debug(title + " : " + file);
+ }
+ if (file != null) {
+ Preconditions.checkState(!file.isDirectory());
+
+ // add extension if missing
+ if (withExtension && !file.getName().endsWith(filenameSuffix)) {
+ file = new File(file.getParentFile(), file.getName() + filenameSuffix);
+ }
+
+ // ask user to confirm overwrite.
+ boolean confirm = askOverwriteFile(file);
+
+ if (confirm) {
+
+ // on conserve le répertoire (pour une prochaine utilisation)
+ FileChooserUtil.setCurrentDirectory(file.getParentFile());
+ } else {
+
+ // l'utilisateur n'a pas confirmé l'écrasement
+ // donc pas de fichier en retour
+ file = null;
+ }
+ }
+
+ return file;
+ }
+
+ protected boolean askOverwriteFile(File file) {
+ boolean result;
+ if (file.exists()) {
+
+ // file exists ask user to overwrite
+ String htmlMessage = String.format(
+ AbstractApplicationUIHandler.CONFIRMATION_FORMAT,
+ _("jaxx.application.common.askOverwriteFile.message", file),
+ _("jaxx.application.common.askOverwriteFile.help"));
+
+ result = JOptionPane.showConfirmDialog(
+ getHandler().getTopestUI(),
+ htmlMessage,
+ _("jaxx.application.common.askOverwriteFile.title"),
+ JOptionPane.OK_CANCEL_OPTION,
+ JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION;
+ } else {
+
+ // file does not exist
+ result = true;
+ }
+ return result;
+ }
+
+ protected boolean askBeforeDelete(String title, String message) {
+ String htmlMessage = String.format(
+ AbstractApplicationUIHandler.CONFIRMATION_FORMAT,
+ message,
+ _("jaxx.application.common.askBeforeDelete.help"));
+ int i = JOptionPane.showConfirmDialog(
+ getHandler().getTopestUI(),
+ htmlMessage,
+ title,
+ JOptionPane.OK_CANCEL_OPTION,
+ JOptionPane.QUESTION_MESSAGE);
+
+ boolean result = i == JOptionPane.OK_OPTION;
+ return result;
+ }
+
+ protected void displayInfoMessage(String title, String message) {
+ JOptionPane.showMessageDialog(
+ getHandler().getTopestUI(),
+ message,
+ title,
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+
+ protected void displayWarningMessage(String title, String message) {
+ JOptionPane.showMessageDialog(
+ getHandler().getTopestUI(),
+ message,
+ title,
+ JOptionPane.WARNING_MESSAGE);
+ }
+
+ protected void createProgressionModelIfRequired(int total) {
+ ApplicationProgressionModel progressionModel = getProgressionModel();
+ if (progressionModel == null) {
+ progressionModel = new ApplicationProgressionModel();
+ progressionModel.setTotal(total);
+ progressionModel.setMessage("");
+ progressionModel.setCurrent(0);
+ setProgressionModel(progressionModel);
+ } else {
+ progressionModel.adaptTotal(total);
+ }
+ }
+
+ public ApplicationActionFactory getActionFactory() {
+ return getContext().getActionFactory();
+ }
+
+ public ApplicationActionEngine getActionEngine() {
+ return getContext().getActionEngine();
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/AbstractApplicationAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionEngine.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionEngine.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionEngine.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,101 @@
+package org.nuiton.jaxx.application.swing.action;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import org.nuiton.jaxx.application.swing.AbstractApplicationUIHandler;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.swing.AbstractButton;
+
+/**
+ * To create and consume {@link AbstractApplicationAction}.
+ * Created on 11/24/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class ApplicationActionEngine {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(ApplicationActionEngine.class);
+
+ private final ApplicationActionFactory actionFactory;
+
+ public ApplicationActionEngine(ApplicationActionFactory actionFactory) {
+ this.actionFactory = actionFactory;
+ }
+
+ public <A extends AbstractApplicationAction> void runInternalAction(A action) {
+ Throwable error = null;
+
+ try {
+ action.doAction();
+ action.postSuccessAction();
+ } catch (Throwable e) {
+ error = e;
+ if (log.isErrorEnabled()) {
+ log.error("Error in action:", e);
+ }
+ throw ApplicationActionException.propagateError(action, e);
+ } finally {
+ try {
+ if (error != null) {
+ action.postFailedAction(error);
+ }
+ } finally {
+
+ action.releaseAction();
+ }
+ }
+ }
+
+ public <A extends AbstractApplicationAction> void runInternalAction(AbstractApplicationUIHandler handler,
+ Class<A> actionName) {
+ A action = actionFactory.createLogicAction(handler, actionName);
+ runInternalAction(action);
+ }
+
+ public <A extends AbstractApplicationAction> void runAction(A action) {
+ ApplicationUIAction<A> uiAction = actionFactory.createUIAction(null, action);
+ uiAction.actionPerformed(null);
+ }
+
+ public void runAction(AbstractButton button) {
+ button.getAction().actionPerformed(null);
+ }
+
+ public <A extends AbstractApplicationAction> void runActionAndWait(A action) {
+ ApplicationUIAction<A> uiAction = actionFactory.createUIAction(null, action);
+ uiAction.launchActionAndWait();
+ }
+
+ public <A extends AbstractApplicationAction> void runActionAndWait(AbstractApplicationUIHandler handler,
+ Class<A> actionName) {
+ A logicAction = actionFactory.createLogicAction(handler, actionName);
+ runActionAndWait(logicAction);
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionEngine.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionException.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionException.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionException.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,58 @@
+package org.nuiton.jaxx.application.swing.action;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+/**
+ * To box any error of a {@link AbstractApplicationAction}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class ApplicationActionException extends RuntimeException {
+
+ private static final long serialVersionUID = 1L;
+
+ private final AbstractApplicationAction action;
+
+ public ApplicationActionException(AbstractApplicationAction action, Throwable cause) {
+ super(cause);
+ this.action = action;
+ }
+
+ public static ApplicationActionException propagateError(AbstractApplicationAction action,
+ Throwable cause) {
+ ApplicationActionException result;
+ if (cause instanceof ApplicationActionException) {
+ result = ((ApplicationActionException) cause);
+ } else {
+ result = new ApplicationActionException(action, cause);
+ }
+ return result;
+ }
+
+ public AbstractApplicationAction getAction() {
+ return action;
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionFactory.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionFactory.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionFactory.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,99 @@
+package org.nuiton.jaxx.application.swing.action;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import com.google.common.base.Preconditions;
+import org.nuiton.jaxx.application.ApplicationTechnicalException;
+import org.nuiton.jaxx.application.swing.AbstractApplicationUIHandler;
+import org.apache.commons.lang3.reflect.ConstructorUtils;
+
+import javax.swing.AbstractButton;
+import javax.swing.Action;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * Factory of actions.
+ * <p/>
+ * Created on 11/24/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class ApplicationActionFactory {
+
+ public <A extends AbstractApplicationAction> ApplicationUIAction<A> createUIAction(AbstractApplicationUIHandler handler,
+ Class<A> actionName) {
+ return createUIAction(handler, null, actionName);
+ }
+
+
+ public <A extends AbstractApplicationAction> ApplicationUIAction<A> createUIAction(AbstractApplicationUIHandler handler,
+ AbstractButton abstractButton,
+ Class<A> actionName) {
+ try {
+
+ // create logic action
+ A logicAction = createLogicAction(handler, actionName);
+
+ // create ui action
+ ApplicationUIAction<A> result = createUIAction(abstractButton, logicAction);
+ return result;
+ } catch (Exception e) {
+ throw new ApplicationTechnicalException(_("jaxx.application.action.create.error", actionName), e);
+ }
+
+ }
+
+ public <A extends AbstractApplicationAction> ApplicationUIAction<A> createUIAction(AbstractButton abstractButton,
+ A logicAction) {
+
+ // create ui action
+ ApplicationUIAction<A> result = new ApplicationUIAction<A>(abstractButton,
+ logicAction);
+ return result;
+
+
+ }
+
+ public <A extends AbstractApplicationAction> A createLogicAction(AbstractApplicationUIHandler handler,
+ Class<A> actionName) {
+ try {
+
+ // create action
+ A result = ConstructorUtils.invokeConstructor(actionName, handler);
+ return result;
+ } catch (Exception e) {
+ throw new ApplicationTechnicalException(_("jaxx.application.action.create.error", actionName), e);
+ }
+ }
+
+ public <A extends AbstractApplicationAction> A getLogicAction(AbstractButton b) {
+ Action action = b.getAction();
+ Preconditions.checkNotNull(action);
+ Preconditions.checkState(action instanceof ApplicationUIAction);
+ return ((ApplicationUIAction<A>) action).getLogicAction();
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionFactory.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionSwingWorker.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionSwingWorker.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionSwingWorker.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,186 @@
+package org.nuiton.jaxx.application.swing.action;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.swing.SwingUtilities;
+import javax.swing.SwingWorker;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.Timer;
+import java.util.TimerTask;
+
+/**
+ * Worker to execute logic action.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class ApplicationActionSwingWorker<A extends AbstractApplicationAction> extends SwingWorker<Void, String> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(ApplicationActionSwingWorker.class);
+
+ /**
+ * Timer used to launch timerTask (to open load dialog).
+ *
+ * @since 2.8.2
+ */
+ private static final Timer t = new Timer();
+
+ protected final ApplicationActionUI actionUI;
+
+ protected final A action;
+
+ protected Throwable error;
+
+ protected TimerTask timer;
+
+ protected ApplicationActionSwingWorker(A action) {
+
+ this.action = action;
+ this.actionUI = action.getContext().getActionUI();
+ }
+
+ public Throwable getError() {
+ return error;
+ }
+
+ public boolean isFailed() {
+ return error != null;
+ }
+
+ @Override
+ protected Void doInBackground() throws Exception {
+
+ if (!isCancelled()) {
+
+ timer = new TuttiActionTimerTask();
+
+ t.schedule(timer, 1000);
+
+ try {
+
+ action.doAction();
+
+ } catch (Throwable e) {
+ if (log.isErrorEnabled()) {
+ log.error("Task [" + this + "] Error while doAction: ", e);
+ }
+ error = e;
+ } finally {
+ if (log.isDebugEnabled()) {
+ log.debug("Task [" + this + "] done");
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ protected void done() {
+ super.done();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Task [" + this + "] execute done method after all");
+ }
+
+ if (error == null) {
+
+ // success hook
+ action.postSuccessAction();
+ } else {
+
+ // fail hook
+ action.postFailedAction(error);
+ }
+
+ action.releaseAction();
+
+ if (timer != null) {
+
+ timer.cancel();
+ }
+
+ actionUI.close();
+
+ updateBusyState(false);
+ }
+
+ protected void updateBusyState(boolean busy) {
+
+ boolean hideBody = action.isHideBody();
+
+ action.getContext().setBusy(busy);
+
+ if (hideBody) {
+ action.getContext().setHideBody(!busy);
+ }
+
+ }
+
+ protected class TuttiActionTimerTask extends TimerTask {
+
+ public TuttiActionTimerTask() {
+ action.addPropertyChangeListener(AbstractApplicationAction.PROPERTY_DONE, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ if (actionUI.isVisible()) {
+ actionUI.close();
+ }
+
+ // we do NOT want the timer to wake up then the actionUI dialog
+ cancel();
+ }
+ });
+ }
+
+ @Override
+ public void run() {
+ if (isCancelled() || isDone()) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Task [" + action + "] was already canceled or done, do nothing");
+ }
+ } else {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Task [" + action + "] is started, show waiting dialog");
+ }
+
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ actionUI.open(action);
+ }
+ });
+ }
+ }
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionSwingWorker.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUI.css
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUI.css (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUI.css 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,68 @@
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+#busyBlockLayerUI {
+ useIcon:false;
+ blockingColor: {handler.getContext().getColorBlockingLayer()};
+ block:{true};
+}
+
+#globalPanel {
+ border: {new TitledBorder((String) null)};
+}
+
+#globalActionLabel {
+ border: {new EmptyBorder(5, 5, 5, 5)};
+}
+
+#globalProgressBar {
+ indeterminate: true;
+}
+
+#taskPanel {
+ visible: false;
+ border: {new TitledBorder((String) null)};
+}
+
+#taskProgressBar {
+ indeterminate: false;
+}
+
+#taskActionLabel {
+ border: {new EmptyBorder(5, 5, 5, 5)};
+}
+
+#informationPanel {
+ visible: false;
+ border: {new TitledBorder((String) null)};
+}
+
+#informationLabel {
+ border: {new EmptyBorder(5, 5, 5, 5)};
+}
+
+#okAction {
+ actionIcon: information;
+ text: "tutti.action.ok";
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUI.css
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUI.jaxx
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUI.jaxx (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUI.jaxx 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,74 @@
+<!--
+ #%L
+ JAXX :: Application Swing
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 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 width='300' height='200' modal='true'
+ undecorated='true'
+ implements='org.nuiton.jaxx.application.swing.ApplicationUI<ApplicationActionUIModel, ApplicationActionUIHandler>'>
+ <import>
+
+ org.nuiton.jaxx.application.swing.ApplicationUI
+ org.nuiton.jaxx.application.swing.ApplicationUIContext
+ org.nuiton.jaxx.application.swing.util.ApplicationUIUtil
+
+ jaxx.runtime.swing.BlockingLayerUI
+
+ javax.swing.border.EmptyBorder
+ </import>
+
+ <script><![CDATA[
+
+ public ApplicationActionUI(JFrame frame, ApplicationUIContext context) {
+ super(frame, true);
+ ApplicationUIUtil.setApplicationContext(this, context);
+ }
+
+ public void open(AbstractApplicationAction action) {
+ getModel().setAction(action);
+ }
+
+ public void close() {
+ getModel().clear();
+ }
+ ]]></script>
+
+
+ <BlockingLayerUI id='busyBlockLayerUI'/>
+
+ <ApplicationActionUIModel id='model'
+ initializer='getContextValue(ApplicationActionUIModel.class)'/>
+
+ <JPanel id='rootPanel' layout='{new BorderLayout()}'
+ constraints='BorderLayout.CENTER' decorator='boxed'>
+ <JPanel id='globalPanel' constraints='BorderLayout.NORTH'
+ layout='{new BorderLayout()}'>
+ <JLabel id='globalActionLabel' constraints='BorderLayout.CENTER'/>
+ <JProgressBar id='globalProgressBar' constraints='BorderLayout.SOUTH'/>
+ </JPanel>
+ <JPanel id='taskPanel' constraints='BorderLayout.CENTER'
+ layout='{new BorderLayout()}'>
+ <JLabel id='taskActionLabel' constraints='BorderLayout.CENTER'/>
+ <JProgressBar id='taskProgressBar' constraints='BorderLayout.SOUTH'/>
+ </JPanel>
+ </JPanel>
+
+</JDialog>
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUIHandler.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUIHandler.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUIHandler.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,281 @@
+package org.nuiton.jaxx.application.swing.action;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import org.nuiton.jaxx.application.swing.AbstractApplicationUIHandler;
+import org.nuiton.jaxx.application.type.ApplicationProgressionModel;
+import jaxx.runtime.SwingUtil;
+import jaxx.runtime.validator.swing.SwingValidator;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.decorator.Decorator;
+
+import javax.swing.JComponent;
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class ApplicationActionUIHandler extends AbstractApplicationUIHandler<ApplicationActionUIModel, ApplicationActionUI> {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(ApplicationActionUIHandler.class);
+
+ protected PropertyChangeListener progressionListener = new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ String propertyName = evt.getPropertyName();
+ if (ApplicationProgressionModel.PROPERTY_MESSAGE.equals(propertyName)) {
+
+ // change message
+ String newMessage = (String) evt.getNewValue();
+ ui.getTaskActionLabel().setText("<html><body>" + newMessage + "</body></html>");
+ ui.pack();
+ } else if (ApplicationProgressionModel.PROPERTY_TOTAL.equals(propertyName)) {
+
+ // change total progressbar max
+ ui.getTaskProgressBar().setMaximum((Integer) evt.getNewValue());
+
+ } else if (ApplicationProgressionModel.PROPERTY_CURRENT.equals(propertyName)) {
+
+ // change value of progress bar
+ ui.getTaskProgressBar().setValue((Integer) evt.getNewValue());
+ }
+ }
+ };
+
+ protected ComponentListener listener = new ComponentAdapter() {
+ boolean moving;
+
+ boolean resizing;
+
+ @Override
+ public void componentMoved(ComponentEvent e) {
+
+ Component mainUI = (Component) e.getSource();
+
+ if (!moving && mainUI.isShowing()) {
+
+ moving = true;
+ try {
+ setLocation(mainUI);
+ } finally {
+ moving = false;
+ }
+ }
+ }
+
+ @Override
+ public void componentResized(ComponentEvent e) {
+
+ Component mainUI = (Component) e.getSource();
+
+ if (!resizing && mainUI.isShowing()) {
+
+ resizing = true;
+ try {
+ setSize(mainUI);
+ } finally {
+ resizing = false;
+ }
+ }
+ }
+ };
+
+ //------------------------------------------------------------------------//
+ //-- AbstractTuttiUIHandler methods --//
+ //------------------------------------------------------------------------//
+
+ @Override
+ public void beforeInit(ApplicationActionUI ui) {
+ this.ui = ui;
+ ApplicationActionUIModel model = new ApplicationActionUIModel();
+ ui.setContextValue(model);
+
+ model.addPropertyChangeListener(ApplicationActionUIModel.PROPERTY_ACTION, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ // udpate global label
+ AbstractApplicationAction action = (AbstractApplicationAction) evt.getNewValue();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Action to use: " + action);
+ }
+ if (action == null) {
+
+ // stoping action
+ hideAction();
+ } else {
+
+ // starting action
+ showAction(action);
+ }
+ }
+ });
+
+ model.addPropertyChangeListener(ApplicationActionUIModel.PROPERTY_PROGRESSION_MODEL, new PropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ // change progression model
+
+ ApplicationProgressionModel oldValue = (ApplicationProgressionModel) evt.getOldValue();
+ ApplicationProgressionModel newValue = (ApplicationProgressionModel) evt.getNewValue();
+
+ if (log.isDebugEnabled()) {
+ log.debug("progression model: " + newValue);
+ }
+ if (oldValue != null) {
+ oldValue.removePropertyChangeListener(progressionListener);
+ }
+
+ if (newValue == null) {
+
+ // remove progression model
+ ApplicationActionUIHandler.this.ui.getTaskPanel().setVisible(false);
+ } else {
+
+ // use progression model
+ ApplicationActionUIHandler.this.ui.getTaskPanel().setVisible(true);
+
+ newValue.addPropertyChangeListener(progressionListener);
+ }
+ }
+ });
+ }
+
+ @Override
+ public void afterInit(ApplicationActionUI ui) {
+
+ initUI(this.ui);
+
+ // installation layer de blocage en mode busy
+ SwingUtil.setLayerUI(this.ui.getRootPanel(), this.ui.getBusyBlockLayerUI());
+
+ this.ui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ }
+
+ @Override
+ protected JComponent getComponentToFocus() {
+ return null;
+ }
+
+ @Override
+ public void onCloseUI() {
+
+ }
+
+ @Override
+ public SwingValidator<ApplicationActionUIModel> getValidator() {
+ return null;
+ }
+
+ @Override
+ public Component getTopestUI() {
+ return null;
+ }
+
+ @Override
+ public <E> Decorator<E> getDecorator(Class<E> beanType, String decoratorContext) {
+ return null;
+ }
+
+ //------------------------------------------------------------------------//
+ //-- Internal methods --//
+ //------------------------------------------------------------------------//
+
+ protected void hideAction() {
+ ui.setVisible(false);
+ }
+
+ protected void showAction(AbstractApplicationAction action) {
+ ui.setTitle(_("jaxx.application.title.actionUI",
+ getContext().getConfiguration().getApplicationName(),
+ getContext().getConfiguration().getVersion(),
+ action.getActionDescription()));
+ ui.getGlobalActionLabel().setText(
+ _("jaxx.application.message.action.running",
+ action.getActionDescription()));
+ ui.pack();
+
+ Component mainUI = getContext().getMainUI();
+ if (mainUI != null) {
+ mainUI.addComponentListener(listener);
+
+ setLocation(mainUI);
+ setSize(mainUI);
+ }
+ try {
+ ui.setVisible(true);
+ } finally {
+ if (mainUI != null) {
+ mainUI.removeComponentListener(listener);
+ }
+ }
+ }
+
+ protected void setLocation(Component mainUI) {
+ Component component = getContext().getBodyUI();
+ Component status = getContext().getStatusUI();
+ int width = component == null ? 0 : component.getWidth();
+ int height = component == null ? 0 : component.getHeight() + status.getHeight();
+
+ int x;
+ int y;
+ if (height == 0) {
+ x = mainUI.getX() + 5;
+ y = mainUI.getY() + 15;
+ } else {
+ x = mainUI.getX() + (mainUI.getWidth() - width);
+ y = mainUI.getY() + (mainUI.getHeight() - height);
+ }
+ ui.setLocation(x, y);
+ }
+
+ protected void setSize(Component mainUI) {
+ // Better to let his own size to the action progress bar
+ // see http://forge.codelutin.com/issues/3263
+// Container component = mainUI.getBody();
+// int width = component == null ? 0 : component.getWidth();
+
+ ui.pack();
+
+// if (width != 0 && ui.getWidth() < width) {
+// ui.setSize(width, ui.getHeight());
+// }
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUIHandler.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUIModel.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUIModel.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUIModel.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,75 @@
+package org.nuiton.jaxx.application.swing.action;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import com.google.common.base.Preconditions;
+import org.nuiton.jaxx.application.type.ApplicationProgressionModel;
+import org.jdesktop.beans.AbstractSerializableBean;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class ApplicationActionUIModel extends AbstractSerializableBean {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String PROPERTY_ACTION = "action";
+
+ public static final String PROPERTY_PROGRESSION_MODEL = "progressionModel";
+
+ protected AbstractApplicationAction action;
+
+ protected ApplicationProgressionModel progressionModel;
+
+ public ApplicationProgressionModel getProgressionModel() {
+ return progressionModel;
+ }
+
+ public void setProgressionModel(ApplicationProgressionModel progressionModel) {
+ Object oldValue = getProgressionModel();
+ this.progressionModel = progressionModel;
+ firePropertyChange(PROPERTY_PROGRESSION_MODEL, oldValue, progressionModel);
+ }
+
+ public AbstractApplicationAction getAction() {
+ return action;
+ }
+
+ public void setAction(AbstractApplicationAction action) {
+ Preconditions.checkNotNull(action, "action can not be null");
+ Object oldValue = getAction();
+ this.action = action;
+ firePropertyChange(PROPERTY_ACTION, oldValue, action);
+ }
+
+ public void clear() {
+ setProgressionModel(null);
+
+ Object oldValue = getAction();
+ action = null;
+ firePropertyChange(PROPERTY_ACTION, oldValue, null);
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationActionUIModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationUIAction.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationUIAction.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationUIAction.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,228 @@
+package org.nuiton.jaxx.application.swing.action;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.TimeLog;
+
+import javax.swing.AbstractAction;
+import javax.swing.AbstractButton;
+import javax.swing.Icon;
+import javax.swing.SwingUtilities;
+import java.awt.event.ActionEvent;
+import java.util.concurrent.CancellationException;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+/**
+ * Abstract tutti ui action which launch a {@link AbstractApplicationAction}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8.2
+ */
+public class ApplicationUIAction<A extends AbstractApplicationAction> extends AbstractAction {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(ApplicationUIAction.class);
+
+ private static final TimeLog TIME_LOG = new TimeLog(ApplicationUIAction.class);
+
+ public static final ExecutorService waitingThread =
+ Executors.newSingleThreadExecutor();
+
+ private static final String LOGIC_ACTION = "logicAction";
+
+ private final Object lock = new Object();
+
+ private boolean wait;
+
+ private long t0;
+
+ public ApplicationUIAction(AbstractButton button, A action) {
+
+ putValue(LOGIC_ACTION, action);
+
+ // fill the ui action from the button
+ setActionKey(action.getClass().getName());
+ if (button != null) {
+ setActionIcon(button.getIcon());
+ setActionName(button.getText());
+ setActionDescription(button.getToolTipText());
+ setActionMnemonic(button.getMnemonic());
+ }
+ }
+
+ public void launchActionAndWait() {
+ wait = true;
+ actionPerformed(null);
+ lock();
+ }
+
+
+ @Override
+ public final void actionPerformed(final ActionEvent event) {
+
+ t0 = TimeLog.getTime();
+
+ if (log.isInfoEnabled()) {
+ log.info("Task [" + getLogicAction().getClass().getSimpleName() + "] starting");
+ }
+
+ // prepare action
+ boolean doAction;
+
+ A action = getLogicAction();
+
+ // reset status message
+ action.sendMessage("");
+
+ try {
+ doAction = action.prepareAction();
+ } catch (Exception e) {
+ action.releaseAction();
+ throw ApplicationActionException.propagateError(action, e);
+ }
+
+ if (doAction) {
+
+ final ApplicationActionSwingWorker<A> worker =
+ new ApplicationActionSwingWorker<A>(action);
+
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+
+ // make ui busy
+ worker.updateBusyState(true);
+
+ }
+ });
+
+ if (log.isDebugEnabled()) {
+ log.debug("Before execute of action " + action);
+ }
+
+ // perform and release action
+ worker.execute();
+
+ // wait until action is done
+ waitingThread.execute(
+ new Runnable() {
+ @Override
+ public void run() {
+
+ A action = getLogicAction();
+ try {
+ try {
+ worker.get();
+ } catch (ExecutionException e) {
+ // don't care .
+ } catch (CancellationException e) {
+ // dont care ?
+ } catch (InterruptedException e) {
+ // don't care ?
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("After execute of action " + action + " (worker done? " + worker.isDone() + ")");
+ }
+
+ if (worker.isFailed()) {
+
+ throw ApplicationActionException.propagateError(action, worker.getError());
+ }
+ } finally {
+ unlock();
+ }
+ }
+ }
+ );
+
+ } else {
+
+ try {
+ // release action
+ action.releaseAction();
+
+ } finally {
+ unlock();
+ }
+ }
+ }
+
+ public void setActionIcon(Icon actionIcon) {
+ putValue(SMALL_ICON, actionIcon);
+ putValue(LARGE_ICON_KEY, actionIcon);
+ }
+
+ public void setActionKey(String actionKey) {
+ putValue(ACTION_COMMAND_KEY, actionKey);
+ }
+
+ public void setActionName(String actionName) {
+ putValue(NAME, actionName);
+ }
+
+ public void setActionDescription(String actionDescription) {
+ putValue(SHORT_DESCRIPTION, actionDescription);
+ getLogicAction().setActionDescription(actionDescription);
+ }
+
+ public void setActionMnemonic(int key) {
+ putValue(MNEMONIC_KEY, key);
+ }
+
+ public A getLogicAction() {
+ return (A) getValue(LOGIC_ACTION);
+ }
+
+ protected void lock() {
+ if (wait) {
+ synchronized (lock) {
+ try {
+
+ lock.wait();
+
+ } catch (InterruptedException e) {
+ throw ApplicationActionException.propagateError(getLogicAction(), e);
+ } finally {
+ wait = false;
+ }
+ }
+ }
+ }
+
+ protected void unlock() {
+ TIME_LOG.log(t0, "Task [" + getLogicAction().getClass().getSimpleName() + "] End");
+ if (wait) {
+ synchronized (lock) {
+ lock.notifyAll();
+ }
+ }
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/action/ApplicationUIAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/ApplicationAction.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/ApplicationAction.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/ApplicationAction.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,60 @@
+package org.nuiton.jaxx.application.swing.actionng;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+/**
+ * Contract of an application action.
+ * <p/>
+ * Created on 11/23/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public interface ApplicationAction {
+
+ /**
+ * Hook to
+ *
+ * @return {@code true} if action can be execute, {@code false} otherwise.
+ */
+ boolean prepare();
+
+ /**
+ * Real action code.
+ */
+ void action();
+
+ /**
+ * Executed when action ended with success.
+ */
+ void done();
+
+ /**
+ * Executed when action failed.
+ *
+ * @param error failure exception
+ */
+ void fail(Exception error);
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/ApplicationAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/ApplicationActionEngine.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/ApplicationActionEngine.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/ApplicationActionEngine.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,103 @@
+package org.nuiton.jaxx.application.swing.actionng;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import javax.swing.event.EventListenerList;
+
+/**
+ * Engine what consumes incoming actions.
+ * <p/>
+ * Created on 11/23/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class ApplicationActionEngine {
+
+ private final EventListenerList eventList;
+
+ public ApplicationActionEngine() {
+ eventList = new EventListenerList();
+ }
+
+ public void addAction(ApplicationAction action) {
+
+ }
+
+ //------------------------------------------------------------------------//
+ //--- ApplicationActionListener API ---//
+ //------------------------------------------------------------------------//
+
+ public void addApplicationEventListener(ApplicationActionListener listener) {
+ eventList.add(ApplicationActionListener.class, listener);
+ }
+
+ public void removeApplicationEventListener(ApplicationActionListener listener) {
+ eventList.remove(ApplicationActionListener.class, listener);
+ }
+
+ protected void fireInit(ApplicationAction action) {
+ ApplicationActionEvent event = new ApplicationActionEvent(action, ApplicationActionEvent.EventType.INIT);
+
+ ApplicationActionListener[] listeners = eventList.getListeners(ApplicationActionListener.class);
+ for (ApplicationActionListener listener : listeners) {
+ listener.actionStarted(event);
+ }
+ }
+
+ protected void fireStart(ApplicationAction action) {
+ ApplicationActionEvent event = new ApplicationActionEvent(action, ApplicationActionEvent.EventType.START);
+
+ ApplicationActionListener[] listeners = eventList.getListeners(ApplicationActionListener.class);
+ for (ApplicationActionListener listener : listeners) {
+ listener.actionStarted(event);
+ }
+ }
+
+ protected void fireDone(ApplicationAction action) {
+ ApplicationActionEvent event = new ApplicationActionEvent(action, ApplicationActionEvent.EventType.DONE);
+ ApplicationActionListener[] listeners = eventList.getListeners(ApplicationActionListener.class);
+ for (ApplicationActionListener listener : listeners) {
+ listener.actionDone(event);
+ }
+ }
+
+ protected void fireFail(ApplicationAction action, Exception error) {
+ ApplicationActionEvent event = new ApplicationActionEvent(action, ApplicationActionEvent.EventType.FAIL);
+ event.setError(error);
+ ApplicationActionListener[] listeners = eventList.getListeners(ApplicationActionListener.class);
+ for (ApplicationActionListener listener : listeners) {
+ listener.actionFailed(event);
+ }
+ }
+
+ protected void fireProgressionChange(ApplicationAction action) {
+ ApplicationActionEvent event = new ApplicationActionEvent(action, ApplicationActionEvent.EventType.PROGRESSION_CHANGE);
+ ApplicationActionListener[] listeners = eventList.getListeners(ApplicationActionListener.class);
+ for (ApplicationActionListener listener : listeners) {
+ listener.actionProgressionChanged(event);
+ }
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/ApplicationActionEngine.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/ApplicationActionEvent.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/ApplicationActionEvent.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/ApplicationActionEvent.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,97 @@
+package org.nuiton.jaxx.application.swing.actionng;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import java.util.EventObject;
+
+/**
+ * Events...
+ *
+ * Created on 11/23/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class ApplicationActionEvent extends EventObject {
+
+ private static final long serialVersionUID = 1L;
+
+ public enum EventType {
+ /**
+ * Before starting action.
+ */
+ INIT,
+ /**
+ * When action is started.
+ */
+ START,
+ /**
+ * When action end with succes.
+ */
+ DONE,
+ /**
+ * When action failed.
+ */
+ FAIL,
+ /**
+ * When progression changed.
+ */
+ PROGRESSION_CHANGE
+ }
+
+ private Exception error;
+
+ private final EventType eventType;
+
+ /**
+ * Constructs a prototypical Event.
+ *
+ * @param source The object on which the Event initially occurred.
+ * @param eventType The type of event
+ * @throws IllegalArgumentException if source is null.
+ */
+ public ApplicationActionEvent(ApplicationAction source,
+ EventType eventType) {
+ super(source);
+ this.eventType = eventType;
+ }
+
+ @Override
+ public ApplicationAction getSource() {
+ return (ApplicationAction) super.getSource();
+ }
+
+ public Exception getError() {
+ return error;
+ }
+
+ public void setError(Exception error) {
+ this.error = error;
+ }
+
+ public EventType getEventType() {
+ return eventType;
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/ApplicationActionEvent.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/ApplicationActionListener.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/ApplicationActionListener.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/ApplicationActionListener.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,49 @@
+package org.nuiton.jaxx.application.swing.actionng;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import java.util.EventListener;
+
+/**
+ * To listen {@link ApplicationActionEngine} events.
+ * <p/>
+ * Created on 11/23/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public interface ApplicationActionListener extends EventListener {
+
+ void actionInit(ApplicationActionEvent event);
+
+ void actionStarted(ApplicationActionEvent event);
+
+ void actionProgressionChanged(ApplicationActionEvent event);
+
+ void actionDone(ApplicationActionEvent event);
+
+ void actionFailed(ApplicationActionEvent event);
+
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/actionng/ApplicationActionListener.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/CustomTab.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/CustomTab.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/CustomTab.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,126 @@
+package org.nuiton.jaxx.application.swing.tab;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import jaxx.runtime.SwingUtil;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.beans.BeanUtil;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.UIManager;
+import java.awt.Color;
+import java.awt.Font;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * Custom tab component which adds a * in the end of the title
+ * when the content is modified.
+ *
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since 2.8
+ */
+public class CustomTab extends JPanel {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Log log = LogFactory.getLog(CustomTab.class);
+
+ protected TabContentModel model;
+
+ protected JLabel title = new JLabel();
+
+ public TabContentModel getModel() {
+ return model;
+ }
+
+ public CustomTab(TabContentModel model) {
+ this.model = model;
+ try {
+ BeanUtil.addPropertyChangeListener(
+ new PropertyChangeListener() {
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ updateTitle();
+ }
+ }, this.model);
+
+ } catch (Exception ex) {
+ log.error("Error while adding the listener to the model modifications", ex);
+ }
+
+ setBackground(null);
+
+ updateTitle();
+ String actionIcon = model.getIcon();
+ if (actionIcon != null) {
+ title.setIcon(SwingUtil.createActionIcon(actionIcon));
+ }
+ add(title);
+ }
+
+ @Override
+ public void setBackground(Color bg) {
+ if (bg == null) {
+ bg = new Color(0, 0, 0, 0);
+ }
+ super.setBackground(bg);
+ revalidate();
+ }
+
+ @Override
+ public void setForeground(Color fg) {
+ super.setForeground(fg);
+ if (title != null) {
+ title.setForeground(fg);
+ }
+ }
+
+ protected void updateTitle() {
+ Font f = UIManager.getDefaults().getFont("Label.font");
+ String titleValue = _(model.getTitle());
+
+ int style;
+ if (model.isModify()) {
+ style = Font.BOLD;
+ titleValue += "*";
+
+ } else if (model.isEmpty()) {
+ style = Font.ITALIC;
+
+ } else {
+ style = Font.PLAIN;
+ }
+
+ title.setText(titleValue);
+ title.setFont(f.deriveFont(style));
+ }
+
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/CustomTab.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/DelegateTabContainerHandler.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/DelegateTabContainerHandler.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/DelegateTabContainerHandler.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,112 @@
+package org.nuiton.jaxx.application.swing.tab;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import org.nuiton.jaxx.application.swing.AbstractApplicationUIHandler;
+import org.nuiton.jaxx.application.swing.ApplicationUI;
+
+import javax.swing.DefaultSingleSelectionModel;
+import javax.swing.JTabbedPane;
+import java.awt.Component;
+
+/**
+ * Created on 11/25/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class DelegateTabContainerHandler implements TabContainerHandler {
+
+ final JTabbedPane tabbedPane;
+
+ public DelegateTabContainerHandler(JTabbedPane tabbedPane) {
+ this.tabbedPane = tabbedPane;
+ }
+
+ @Override
+ public JTabbedPane getTabPanel() {
+ return tabbedPane;
+ }
+
+ @Override
+ public void init() {
+
+ getTabPanel().setModel(new DefaultSingleSelectionModel() {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void setSelectedIndex(int index) {
+ int currentIndex = getTabPanel().getSelectedIndex();
+ boolean mustChangeTab = onTabChanged(currentIndex, index);
+
+ if (mustChangeTab) {
+ super.setSelectedIndex(index);
+ }
+ }
+
+ });
+ }
+
+
+ @Override
+ public boolean onTabChanged(int currentIndex, int newIndex) {
+ boolean result = true;
+ if (currentIndex != newIndex) {
+ TabHandler handler = getTabHandler(currentIndex);
+ if (handler != null) {
+ result = handler.onHideTab(currentIndex, newIndex);
+ }
+
+ handler = getTabHandler(newIndex);
+ if (handler != null) {
+ handler.onShowTab(currentIndex, newIndex);
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public TabHandler getTabHandler(int index) {
+ TabHandler tabHandler = null;
+ JTabbedPane tabPanel = getTabPanel();
+ if (index >= 0 && index < tabPanel.getTabCount()) {
+ Component tab = tabPanel.getComponentAt(index);
+ if (ApplicationUI.class.isInstance(tab)) {
+ ApplicationUI tuttiTab = (ApplicationUI) tabPanel.getComponentAt(index);
+ AbstractApplicationUIHandler handler = tuttiTab.getHandler();
+ if (TabHandler.class.isInstance(handler)) {
+ tabHandler = (TabHandler) handler;
+ }
+ }
+ }
+ return tabHandler;
+ }
+
+ @Override
+ public void setCustomTab(int index, TabContentModel model) {
+ getTabPanel().setTabComponentAt(index, new CustomTab(model));
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/DelegateTabContainerHandler.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/TabContainerHandler.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/TabContainerHandler.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/TabContainerHandler.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,68 @@
+package org.nuiton.jaxx.application.swing.tab;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import javax.swing.JTabbedPane;
+
+/**
+ * Created on 11/25/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public interface TabContainerHandler {
+
+ JTabbedPane getTabPanel();
+
+ void init();
+
+ /**
+ * Method called when the user selects a tab.
+ *
+ * @param currentIndex
+ * @param newIndex
+ * @return <code>false</code> if you want to prevent the tab change,
+ * <code>true</code> otherwise
+ */
+ boolean onTabChanged(int currentIndex, int newIndex);
+
+ /**
+ * Returns the tab handler of the tab i.
+ *
+ * @param index the index of the tab
+ * @return the tab handler of the index i if the handler implements
+ * the {@link TabHandler} interface,
+ * <code>null</code> otherwise
+ */
+ TabHandler getTabHandler(int index);
+
+ /**
+ * Sets a {@link CustomTab} as tab component.
+ *
+ * @param index
+ * @param model
+ */
+ void setCustomTab(int index, TabContentModel model);
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/TabContainerHandler.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/TabContentModel.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/TabContentModel.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/TabContentModel.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,44 @@
+package org.nuiton.jaxx.application.swing.tab;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+/**
+ * Interface defining the models of the tab content UIs.
+ *
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since 2.8
+ */
+public interface TabContentModel {
+
+ boolean isEmpty();
+
+ boolean isValid();
+
+ boolean isModify();
+
+ String getTitle();
+
+ String getIcon();
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/TabContentModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/TabHandler.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/TabHandler.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/TabHandler.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,52 @@
+package org.nuiton.jaxx.application.swing.tab;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+/**
+ * Interface describing UI contained in a tab.
+ *
+ * @author kmorin <kmorin(a)codelutin.com>
+ * @since 2.8
+ */
+public interface TabHandler {
+
+ /**
+ * Method called when the tab is hidden
+ *
+ * @param currentIndex
+ * @param newIndex
+ * @return <code>false</code> to prevent the tab to be hidden,
+ * <code>true</code> otherwise.
+ */
+ boolean onHideTab(int currentIndex, int newIndex);
+
+ /**
+ * Method called when the tab is shown
+ *
+ * @param currentIndex
+ * @param newIndex
+ */
+ void onShowTab(int currentIndex, int newIndex);
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/tab/TabHandler.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/AbstractApplicationTableModel.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/AbstractApplicationTableModel.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/AbstractApplicationTableModel.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,303 @@
+package org.nuiton.jaxx.application.swing.table;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+import jaxx.runtime.SwingUtil;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.swingx.table.TableColumnModelExt;
+
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.TableColumn;
+import java.io.Serializable;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Abstract model of a table.
+ *
+ * @param <R> type of a row.
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public abstract class AbstractApplicationTableModel<R extends Serializable> extends AbstractTableModel {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(AbstractApplicationTableModel.class);
+
+ /**
+ * Data in the model.
+ *
+ * @since 0.2
+ */
+ protected List<R> rows;
+
+ /**
+ * Set of non editable columns.
+ *
+ * @since 0.2
+ */
+ protected Set<ColumnIdentifier<?>> noneEditableCols;
+
+ /**
+ * Creates a new row when moving to next editable cell / row ?
+ *
+ * @since 0.3
+ */
+ protected final boolean createNewRow;
+
+ /**
+ * Creates a first empty row when setting a null or empty list of rows ?
+ *
+ * @since 0.3
+ */
+ protected final boolean createEmptyRowIsEmpty;
+
+ /**
+ * Identifiers of columns (in initial order).
+ *
+ * @since 1.1
+ */
+ protected final List<ColumnIdentifier<R>> identifiers;
+
+ public abstract R createNewRow();
+
+ protected AbstractApplicationTableModel(TableColumnModelExt columnModel,
+ boolean createNewRow,
+ boolean createEmptyRowIsEmpty) {
+ this.identifiers = Lists.newArrayListWithCapacity(columnModel.getColumnCount());
+ for (TableColumn tc : columnModel.getColumns(true)) {
+ this.identifiers.add((ColumnIdentifier<R>) tc.getIdentifier());
+ }
+ this.createNewRow = createNewRow;
+ this.createEmptyRowIsEmpty = createEmptyRowIsEmpty;
+ }
+
+ public final List<R> getRows() {
+ return rows;
+ }
+
+ public final void setRows(List<R> data) {
+
+ // can't accept a empty data list
+ Preconditions.checkNotNull(data, "Data list can not be null.");
+
+ this.rows = null;
+ if (createEmptyRowIsEmpty && data.isEmpty()) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Creates a first empty row on tableModel " + this);
+ }
+ // add a first edit line
+ data.add(createNewRow());
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("Set " + data.size() + " row(s) in table model " + this);
+ }
+ this.rows = data;
+ onRowsChanged(data);
+ fireTableDataChanged();
+ }
+
+ public boolean isCreateNewRow() {
+ return createNewRow;
+ }
+
+ public boolean isCreateEmptyRowIsEmpty() {
+ return createEmptyRowIsEmpty;
+ }
+
+ public final void addNewRow() {
+ R newValue = createNewRow();
+ addNewRow(newValue);
+ }
+
+ public final void addNewRow(R newValue) {
+
+ addNewRow(getRowCount(), newValue);
+ }
+
+ public final void addNewRow(int rowIndex, R newValue) {
+
+ Preconditions.checkNotNull(newValue, "Row can not be null.");
+
+ List<R> data = getRows();
+ Preconditions.checkNotNull(data, "Data list can not be null.");
+
+ data.add(rowIndex, newValue);
+
+ onRowAdded(rowIndex, newValue);
+ fireTableRowsInserted(rowIndex, rowIndex);
+ }
+
+ public final void fireTableRowsInserted(R newValue) {
+
+ Preconditions.checkNotNull(newValue, "Row can not be null.");
+
+ int rowIndex = getRowIndex(newValue);
+ fireTableRowsInserted(rowIndex, rowIndex);
+ }
+
+ public final int updateRow(R row) {
+ Preconditions.checkNotNull(row, "Row can not be null.");
+
+ List<R> data = getRows();
+ Preconditions.checkNotNull(data, "Data list can not be null.");
+
+ int rowIndex = data.indexOf(row);
+
+ fireTableRowsUpdated(rowIndex, rowIndex);
+ return rowIndex;
+ }
+
+ public final R removeRow(int rowIndex) {
+ SwingUtil.ensureRowIndex(this, rowIndex);
+
+ List<R> data = getRows();
+
+ R result = data.remove(rowIndex);
+
+ fireTableRowsDeleted(rowIndex, rowIndex);
+ return result;
+ }
+
+ protected void onRowsChanged(List<R> data) {
+ // by default do nothing
+ }
+
+ protected void onRowAdded(int rowIndex, R newValue) {
+ // by default do nothing
+ }
+
+ public final int getRowIndex(R row) {
+ int result = rows == null ? -1 : rows.indexOf(row);
+ return result;
+ }
+
+ public final R getEntry(int rowIndex) {
+ SwingUtil.ensureRowIndex(this, rowIndex);
+ List<R> data = getRows();
+ R result = data == null ? null : data.get(rowIndex);
+ return result;
+ }
+
+ public final void setNoneEditableCols(ColumnIdentifier<?>... noneEditableCols) {
+ this.noneEditableCols = Sets.newHashSet(noneEditableCols);
+ }
+
+ @Override
+ public final int getRowCount() {
+ return rows == null ? 0 : rows.size();
+ }
+
+ @Override
+ public final int getColumnCount() {
+ return identifiers.size();
+ }
+
+ @Override
+ public final Object getValueAt(int rowIndex, int columnIndex) {
+ R entry = getEntry(rowIndex);
+ ColumnIdentifier<R> identifier = getIdentifier(columnIndex);
+ if (log.isDebugEnabled()) {
+ log.debug("columnIndex: " + columnIndex + " :: " + identifier.getPropertyName());
+ }
+ Object result = identifier.getValue(entry);
+ return result;
+ }
+
+ @Override
+ public final void setValueAt(Object aValue, int rowIndex, int columnIndex) {
+ if (log.isDebugEnabled()) {
+ log.debug("setValueAt " + aValue);
+ }
+ R entry = getEntry(rowIndex);
+ ColumnIdentifier<R> identifier = getIdentifier(columnIndex);
+ setValueAt(aValue, rowIndex, columnIndex, identifier, entry);
+ }
+
+ @Override
+ public final boolean isCellEditable(int rowIndex, int columnIndex) {
+ ColumnIdentifier<R> identifier = getIdentifier(columnIndex);
+ boolean result = isCellEditable(rowIndex, columnIndex, identifier);
+ return result;
+ }
+
+ protected void setValueAt(Object aValue,
+ int rowIndex,
+ int columnIndex,
+ ColumnIdentifier<R> propertyName,
+ R entry) {
+ if (log.isDebugEnabled()) {
+ log.debug("setValueAt " + aValue);
+ }
+ propertyName.setValue(entry, aValue);
+ }
+
+ protected boolean isCellEditable(int rowIndex,
+ int columnIndex,
+ ColumnIdentifier<R> propertyName) {
+ boolean result = !noneEditableCols.contains(propertyName);
+ return result;
+ }
+
+ public final void fireTableCellUpdated(int rowIndex,
+ ColumnIdentifier<R>... identifiers) {
+ for (ColumnIdentifier<R> identifier : identifiers) {
+ int columnIndex = this.identifiers.indexOf(identifier);
+ fireTableCellUpdated(rowIndex, columnIndex);
+ }
+ }
+
+ public final void fireTableRowUpdatedShell(Set<R> shell) {
+
+ int minRowIndex1 = getColumnCount();
+ int maxRowIndex1 = 0;
+
+ for (R r : shell) {
+ int rowIndex1 = getRowIndex(r);
+ minRowIndex1 = Math.min(minRowIndex1, rowIndex1);
+ maxRowIndex1 = Math.max(maxRowIndex1, rowIndex1);
+ }
+ fireTableRowsUpdated(minRowIndex1, maxRowIndex1);
+ }
+
+ protected void collectShell(R row, Set<R> collectedRows) {
+
+ // by default just add the incoming row
+ collectedRows.add(row);
+ }
+
+ protected ColumnIdentifier<R> getIdentifier(int columnIndex) {
+ ColumnIdentifier<R> identifier = identifiers.get(columnIndex);
+ return identifier;
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/AbstractApplicationTableModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/AbstractSelectTableAction.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/AbstractSelectTableAction.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/AbstractSelectTableAction.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,102 @@
+package org.nuiton.jaxx.application.swing.table;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import org.nuiton.jaxx.application.swing.util.ApplicationUIUtil;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.swing.AbstractAction;
+import javax.swing.JTable;
+
+/**
+ * Abstract action to select a cell in a table.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public abstract class AbstractSelectTableAction<M extends AbstractApplicationTableModel> extends AbstractAction {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(AbstractSelectTableAction.class);
+
+ private final M model;
+
+ private final JTable table;
+
+ public AbstractSelectTableAction(M model, JTable table) {
+ this.model = model;
+ this.table = table;
+ }
+
+ protected void doSelectCell(int rowIndex, int columnIndex) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Will select cell at " +
+ getCellCoordinate(rowIndex, columnIndex));
+ }
+ ApplicationUIUtil.doSelectCell(table, rowIndex, columnIndex);
+ }
+
+ protected int getSelectedRow() {
+ int result = table.getSelectedRow();
+ return result;
+ }
+
+ protected int getSelectedColumn() {
+ int result = table.getSelectedColumn();
+ return result;
+ }
+
+ protected int getRowCount() {
+ return table.getRowCount();
+ }
+
+ protected int getColumnCount() {
+ return table.getColumnCount();
+ }
+
+ protected boolean isCellEditable(int rowIndex, int columnIndex) {
+ boolean result;
+ result = rowIndex > -1 && columnIndex > -1 &&
+ table.isCellEditable(rowIndex, columnIndex);
+ return result;
+ }
+
+ protected boolean isCreateNewRow() {
+ return model.isCreateNewRow();
+ }
+
+ protected String getCellCoordinate(int rowIndex, int columnIndex) {
+ return " [" + rowIndex + ", " + columnIndex + "]";
+ }
+
+ protected void addNewRow() {
+ model.addNewRow();
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/AbstractSelectTableAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/ColumnIdentifier.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/ColumnIdentifier.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/ColumnIdentifier.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,105 @@
+package org.nuiton.jaxx.application.swing.table;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import org.nuiton.jaxx.application.ApplicationDataUtil;
+
+import java.io.Serializable;
+
+/**
+ * To represent a column of a table.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class ColumnIdentifier<R> implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private final String propertyName;
+
+ private final String headerI18nKey;
+
+ private final String headerTipI18nKey;
+
+ public static <R> ColumnIdentifier<R> newId(String propertyName,
+ String headerI18nKey,
+ String headerTipI18nKey) {
+ return new ColumnIdentifier<R>(propertyName,
+ headerI18nKey,
+ headerTipI18nKey);
+ }
+
+ public static <R> ColumnIdentifier<R> newReadOnlyId(String propertyName,
+ String headerI18nKey,
+ String headerTipI18nKey) {
+ return new ColumnIdentifier<R>(propertyName,
+ headerI18nKey,
+ headerTipI18nKey) {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public void setValue(R entry, Object value) {
+ // no set
+ }
+ };
+ }
+
+ protected ColumnIdentifier(String propertyName,
+ String headerI18nKey,
+ String headerTipI18nKey) {
+ this.propertyName = propertyName;
+ this.headerI18nKey = headerI18nKey;
+ this.headerTipI18nKey = headerTipI18nKey;
+ }
+
+ public String getPropertyName() {
+ return propertyName;
+ }
+
+ public String getHeaderI18nKey() {
+ return headerI18nKey;
+ }
+
+ public String getHeaderTipI18nKey() {
+ return headerTipI18nKey;
+ }
+
+ public Object getValue(R entry) {
+ Object result = null;
+ if (propertyName != null && entry != null) {
+ result = ApplicationDataUtil.getProperty(entry, propertyName);
+ }
+ return result;
+ }
+
+ public void setValue(R entry, Object value) {
+ if (propertyName != null) {
+ ApplicationDataUtil.setProperty(entry, propertyName, value);
+ }
+ }
+
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/ColumnIdentifier.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/MoveToNextEditableCellAction.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/MoveToNextEditableCellAction.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/MoveToNextEditableCellAction.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,102 @@
+package org.nuiton.jaxx.application.swing.table;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.swing.JTable;
+import java.awt.event.ActionEvent;
+
+/**
+ * Action to select next editable cell in a table.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class MoveToNextEditableCellAction<M extends AbstractApplicationTableModel> extends AbstractSelectTableAction<M> {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(MoveToNextEditableCellAction.class);
+
+ public static <M extends AbstractApplicationTableModel> MoveToNextEditableCellAction<M> newAction(M model, JTable table) {
+ return new MoveToNextEditableCellAction<M>(model, table);
+ }
+
+ protected MoveToNextEditableCellAction(M model, JTable table) {
+ super(model, table);
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+
+ int currentRow = getSelectedRow();
+ int currentColumn = getSelectedColumn();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Move to previous editable cell " +
+ getCellCoordinate(currentRow, currentColumn));
+ }
+
+ int columnCount = getColumnCount();
+
+ int rowCount = getRowCount();
+
+ if (currentRow <= rowCount || currentColumn <= columnCount) {
+
+ // go to next cell
+ currentColumn++;
+ boolean canSelect = true;
+
+ // select next cell
+ if (currentColumn >= columnCount) {
+
+ // no more cell, so will move to next editable column on next row
+ currentColumn = 0;
+ currentRow++;
+
+ if (currentRow == rowCount) {
+
+ if (isCreateNewRow()) {
+
+ // create a new row in model
+ addNewRow();
+ } else {
+
+ // can not create new row, so do nothing
+ canSelect = false;
+ }
+ }
+ }
+
+ if (canSelect) {
+ doSelectCell(currentRow, currentColumn);
+ }
+ }
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/MoveToNextEditableCellAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/MoveToNextEditableRowAction.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/MoveToNextEditableRowAction.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/MoveToNextEditableRowAction.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,93 @@
+package org.nuiton.jaxx.application.swing.table;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.swing.JTable;
+import java.awt.event.ActionEvent;
+
+/**
+ * Action to select next editable row in a table.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class MoveToNextEditableRowAction<M extends AbstractApplicationTableModel> extends AbstractSelectTableAction<M> {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(MoveToNextEditableRowAction.class);
+
+ public static <M extends AbstractApplicationTableModel> MoveToNextEditableRowAction<M> newAction(M model, JTable table) {
+ return new MoveToNextEditableRowAction<M>(model, table);
+ }
+
+ protected MoveToNextEditableRowAction(M model, JTable table) {
+ super(model, table);
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ int currentRow = getSelectedRow();
+ int currentColumn = getSelectedColumn();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Move to next row editable cell " +
+ getCellCoordinate(currentRow, currentColumn));
+ }
+
+ int rowCount = getRowCount();
+
+ if (currentRow < rowCount) {
+ // go to next cell
+ currentRow++;
+ boolean canSelect = true;
+
+ // select next cell
+ if (currentRow >= rowCount) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("No next row");
+ }
+ if (isCreateNewRow()) {
+
+ // create a new row in model
+ addNewRow();
+
+ } else {
+ canSelect = false;
+ }
+ }
+
+ if (canSelect) {
+ doSelectCell(currentRow, currentColumn);
+ }
+ }
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/MoveToNextEditableRowAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/MoveToPreviousEditableCellAction.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/MoveToPreviousEditableCellAction.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/MoveToPreviousEditableCellAction.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,82 @@
+package org.nuiton.jaxx.application.swing.table;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.swing.JTable;
+import java.awt.event.ActionEvent;
+
+/**
+ * Action to select previous editable cell in a table.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class MoveToPreviousEditableCellAction<M extends AbstractApplicationTableModel> extends AbstractSelectTableAction<M> {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(MoveToPreviousEditableCellAction.class);
+
+ public static <M extends AbstractApplicationTableModel> MoveToPreviousEditableCellAction<M> newAction(M model, JTable table) {
+ return new MoveToPreviousEditableCellAction<M>(model, table);
+ }
+
+ protected MoveToPreviousEditableCellAction(M model, JTable table) {
+ super(model, table);
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ int currentRow = getSelectedRow();
+ int currentColumn = getSelectedColumn();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Move to previous editable cell, " +
+ getCellCoordinate(currentRow, currentColumn));
+ }
+
+ int columnCount = getColumnCount();
+
+ if (currentRow > 0 || currentColumn > 0) {
+
+ // go to next cell
+ currentColumn--;
+
+ // select next cell
+ if (currentColumn < 0) {
+
+ currentColumn = columnCount - 1;
+ currentRow--;
+ }
+
+ doSelectCell(currentRow, currentColumn);
+ }
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/MoveToPreviousEditableCellAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/MoveToPreviousEditableRowAction.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/MoveToPreviousEditableRowAction.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/MoveToPreviousEditableRowAction.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,73 @@
+package org.nuiton.jaxx.application.swing.table;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.swing.JTable;
+import java.awt.event.ActionEvent;
+
+/**
+ * Action to select previous editable row in a table.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class MoveToPreviousEditableRowAction<M extends AbstractApplicationTableModel> extends AbstractSelectTableAction<M> {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(MoveToPreviousEditableRowAction.class);
+
+ public static <M extends AbstractApplicationTableModel> MoveToPreviousEditableRowAction<M> newAction(M model, JTable table) {
+ return new MoveToPreviousEditableRowAction<M>(model, table);
+ }
+
+ protected MoveToPreviousEditableRowAction(M model, JTable table) {
+ super(model, table);
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+
+ int currentRow = getSelectedRow();
+ int currentColumn = getSelectedColumn();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Move to previous row editable cell " +
+ getCellCoordinate(currentRow, currentColumn));
+ }
+
+ if (currentRow > 0) {
+
+ // go to next cell
+ currentRow--;
+ doSelectCell(currentRow, currentColumn);
+ }
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/table/MoveToPreviousEditableRowAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ActionListCellRenderer.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ActionListCellRenderer.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ActionListCellRenderer.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,61 @@
+package org.nuiton.jaxx.application.swing.util;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import javax.swing.Action;
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.Icon;
+import javax.swing.JButton;
+import javax.swing.JList;
+import javax.swing.border.EmptyBorder;
+import java.awt.Component;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class ActionListCellRenderer extends DefaultListCellRenderer {
+
+ private static final long serialVersionUID = 1L;
+
+ protected final EmptyBorder border = new EmptyBorder(4, 8, 4, 8);
+
+ @Override
+ public Component getListCellRendererComponent(JList list,
+ Object value,
+ int index,
+ boolean isSelected,
+ boolean cellHasFocus) {
+
+ Component result = super.getListCellRendererComponent(
+ list, value, index, isSelected, cellHasFocus);
+ Action action = ((JButton) value).getAction();
+ setIcon((Icon) action.getValue(Action.LARGE_ICON_KEY));
+ setText((String) action.getValue(Action.NAME));
+ setToolTipText((String) action.getValue(Action.SHORT_DESCRIPTION));
+ setBorder(border);
+ return result;
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ActionListCellRenderer.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationColorHighlighter.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationColorHighlighter.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationColorHighlighter.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,66 @@
+package org.nuiton.jaxx.application.swing.util;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import org.jdesktop.swingx.decorator.AbstractHighlighter;
+import org.jdesktop.swingx.decorator.ComponentAdapter;
+import org.jdesktop.swingx.decorator.HighlightPredicate;
+import org.jdesktop.swingx.util.PaintUtils;
+
+import java.awt.Color;
+import java.awt.Component;
+
+/**
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class ApplicationColorHighlighter extends AbstractHighlighter {
+
+ protected Color color;
+
+ protected boolean foreground;
+
+ public ApplicationColorHighlighter(HighlightPredicate predicate, Color color, boolean foreground) {
+ super(predicate);
+ this.color = color;
+ this.foreground = foreground;
+ }
+
+ @Override
+ protected Component doHighlight(Component component, ComponentAdapter adapter) {
+
+ if (foreground) {
+ component.setForeground(color);
+
+ } else {
+ component.setBackground(color);
+ if (adapter.isSelected()) {
+ component.setForeground(PaintUtils.computeForeground(color));
+ }
+ }
+
+ return component;
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationColorHighlighter.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationErrorHelper.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationErrorHelper.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationErrorHelper.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,113 @@
+package org.nuiton.jaxx.application.swing.util;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import org.nuiton.jaxx.application.ApplicationBusinessException;
+import org.nuiton.jaxx.application.swing.ApplicationUIContext;
+import org.jdesktop.swingx.JXErrorPane;
+import org.jdesktop.swingx.error.ErrorInfo;
+import org.jdesktop.swingx.error.ErrorReporter;
+import org.nuiton.csv.ImportRuntimeException;
+
+import javax.swing.JOptionPane;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * Helper to display errors.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class ApplicationErrorHelper implements ErrorReporter {
+
+ protected ApplicationUIContext context;
+
+ public ApplicationErrorHelper(ApplicationUIContext context) {
+ this.context = context;
+ }
+
+ /**
+ * Display a user friendly error frame.
+ *
+ * @param message message for user
+ * @param cause exception cause
+ */
+ public void showErrorDialog(String message, Throwable cause) {
+
+ if (cause == null) {
+ JOptionPane.showMessageDialog(context.getMainUI(), "<html><body>" + message + "</body></html>",
+ _("jaxx.application.error.ui.business.error"),
+ JOptionPane.ERROR_MESSAGE);
+ } else if (cause instanceof ApplicationBusinessException) {
+ JOptionPane.showMessageDialog(context.getMainUI(), "<html><body>" + cause.getMessage() + "</body></html>",
+ _("jaxx.application.error.ui.business.error"),
+ JOptionPane.ERROR_MESSAGE);
+ } else if (cause instanceof ImportRuntimeException) {
+ JOptionPane.showMessageDialog(context.getMainUI(), cause.getMessage(),
+ _("jaxx.application.error.ui.business.error"),
+ JOptionPane.ERROR_MESSAGE);
+ } else {
+
+ JXErrorPane pane = new JXErrorPane();
+ ErrorInfo info = new ErrorInfo(_("jaxx.application.error.ui.other.error"),
+ _("jaxx.application.error.errorpane.htmlmessage", message), null, null,
+ cause, null, null);
+ pane.setErrorInfo(info);
+ pane.setErrorReporter(this);
+ JXErrorPane.showDialog(context.getActionUI(), pane);
+ }
+
+ }
+
+ /**
+ * Display a user friendly error frame.
+ *
+ * @param message message for user
+ */
+ public void showErrorDialog(String message) {
+ showErrorDialog(message, null);
+ }
+
+ @Override
+ public void reportError(ErrorInfo errorInfo) throws NullPointerException {
+
+ showErrorDialog(errorInfo.getBasicErrorMessage(), errorInfo.getErrorException());
+ }
+
+ /**
+ * Display a user friendly warning frame.
+ *
+ * @param message message for user
+ */
+ public void showWarningDialog(String message) {
+
+ JOptionPane.showMessageDialog(context.getMainUI(), "<html><body>" + message + "</body></html>",
+ _("jaxx.application.error.ui.business.warning"),
+ JOptionPane.WARNING_MESSAGE);
+
+ }
+
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationErrorHelper.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationExceptionHandler.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationExceptionHandler.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationExceptionHandler.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,91 @@
+package org.nuiton.jaxx.application.swing.util;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import org.nuiton.jaxx.application.ApplicationTechnicalException;
+import jaxx.runtime.swing.JAXXRuntimeException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Global exception handler.
+ * <p/>
+ * Catch all application uncaught and display it in a custom JoptionPane
+ * or JXErrorPane.
+ * <p/>
+ * See http://stackoverflow.com/a/4448569/1165234 for details.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class ApplicationExceptionHandler implements Thread.UncaughtExceptionHandler {
+
+ private static final Log log =
+ LogFactory.getLog(ApplicationExceptionHandler.class);
+
+ final ApplicationErrorHelper errorHelper;
+
+ public ApplicationExceptionHandler(ApplicationErrorHelper errorHelper) {
+ this.errorHelper = errorHelper;
+ }
+
+ @Override
+ public void uncaughtException(Thread t, Throwable ex) {
+ handleException(t.getName(), ex);
+ }
+
+ public void handle(Throwable thrown) {
+ // for EDT exceptions
+ handleException(Thread.currentThread().getName(), thrown);
+ }
+
+ protected void handleException(String tname, Throwable ex) {
+ if (log.isErrorEnabled()) {
+ log.error("Global application exception [" + tname + "]", ex);
+ }
+
+ Throwable cause = getCause(ex);
+
+ showErrorDialog(cause.getMessage(), cause);
+ }
+
+ protected Throwable getCause(Throwable ex) {
+
+ Throwable cause = ex;
+
+ if (cause instanceof ApplicationTechnicalException) {
+ cause = cause.getCause();
+ }
+
+ if (cause instanceof JAXXRuntimeException) {
+ cause = cause.getCause();
+ }
+ return cause;
+ }
+
+ public void showErrorDialog(String message, Throwable cause) {
+ errorHelper.showErrorDialog(message, cause);
+ }
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationExceptionHandler.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationUIUtil.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationUIUtil.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationUIUtil.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,226 @@
+package org.nuiton.jaxx.application.swing.util;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+import org.nuiton.jaxx.application.ApplicationTechnicalException;
+import org.nuiton.jaxx.application.swing.ApplicationUIContext;
+import jaxx.runtime.JAXXObject;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jdesktop.swingx.JXTable;
+import org.jdesktop.swingx.decorator.HighlightPredicate;
+import org.jdesktop.swingx.decorator.Highlighter;
+
+import javax.swing.JTable;
+import java.awt.Color;
+import java.awt.Desktop;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import static org.nuiton.i18n.I18n._;
+
+/**
+ * Useful ui methods.
+ * <p/>
+ * Created on 11/23/13.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public class ApplicationUIUtil {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(ApplicationUIUtil.class);
+
+ protected ApplicationUIUtil() {
+ // avoid instanciate util class
+ }
+
+ public static void setApplicationContext(JAXXObject ui, ApplicationUIContext context) {
+ ui.setContextValue(context, "applicationContext");
+ }
+
+ public static ApplicationUIContext getApplicationContext(JAXXObject ui) {
+ return ui.getContextValue(ApplicationUIContext.class, "applicationContext");
+ }
+
+ public static Highlighter newBackgroundColorHighlighter(HighlightPredicate predicate, Color color) {
+ return new ApplicationColorHighlighter(predicate, color, false);
+ }
+
+ public static Highlighter newForegroundColorHighlighter(HighlightPredicate predicate, Color color) {
+ return new ApplicationColorHighlighter(predicate, color, true);
+ }
+
+ public static void openLink(URL url) {
+ try {
+ openLink(url.toURI());
+ } catch (URISyntaxException e) {
+ throw new ApplicationTechnicalException(_("jaxx.application.error.cannot.open.link", url), e);
+ }
+ }
+
+ public static Desktop getDesktopForBrowse() {
+
+ if (!Desktop.isDesktopSupported()) {
+ throw new ApplicationTechnicalException(
+ _("jaxx.application.error.desktop.not.supported"));
+ }
+
+ Desktop desktop = Desktop.getDesktop();
+
+ if (!desktop.isSupported(Desktop.Action.BROWSE)) {
+
+ throw new ApplicationTechnicalException(
+ _("jaxx.application.error.desktop.browse.not.supported"));
+ }
+
+ return desktop;
+ }
+
+ public static void openLink(URI uri) {
+
+ Desktop desktop = getDesktopForBrowse();
+
+ try {
+
+ desktop.browse(uri);
+ } catch (Exception e) {
+
+ throw new ApplicationTechnicalException(
+ _("jaxx.application.error.cannot.open.link", uri), e);
+ }
+ }
+
+ public static Desktop getDesktopForMail() {
+
+ if (!Desktop.isDesktopSupported()) {
+ throw new ApplicationTechnicalException(
+ _("jaxx.application.error.desktop.not.supported"));
+ }
+
+ Desktop desktop = Desktop.getDesktop();
+
+ if (!desktop.isSupported(Desktop.Action.MAIL)) {
+
+ throw new ApplicationTechnicalException(
+ _("jaxx.application.error.desktop.mail.not.supported"));
+ }
+
+ return desktop;
+ }
+
+ public static void mail(String subject, String body) {
+
+ Desktop desktop = getDesktopForMail();
+
+ try {
+ URI mailtoURI = new URI("mailto", null, null, "subject=" + subject + "&body=" + body, null);
+ desktop.mail(mailtoURI);
+
+ } catch (Exception e) {
+
+ throw new ApplicationTechnicalException(
+ _("jaxx.application.error.cannot.mail"), e);
+ }
+ }
+
+ public static void selectFirstCellOnFirstRowAndStopEditing(JXTable table) {
+
+ // select first cell
+ doSelectCell(table, 0, 0);
+
+ if (table.isEditing()) {
+
+ // but no edit it
+ table.getCellEditor().stopCellEditing();
+ }
+ }
+
+ public static void selectFirstCellOnLastRow(JXTable table) {
+
+ // select first cell
+ doSelectCell(table, table.getRowCount() - 1, 0);
+ }
+
+ public static void selectFirstCellOnRow(JXTable table, int row, boolean stopEdit) {
+
+ // select first cell
+ doSelectCell(table, row, 0);
+
+ if (stopEdit && table.isEditing()) {
+
+ table.getCellEditor().stopCellEditing();
+ }
+ }
+
+ public static void doSelectCell(JTable table,
+ int rowIndex,
+ int columnIndex) {
+
+ int rowCount = table.getRowCount();
+ if (rowCount == 0) {
+
+ // no row, can not selected any cell
+ if (log.isWarnEnabled()) {
+ log.warn("No row in table, can not select any cell");
+ }
+ return;
+ }
+ int columnCount = table.getColumnCount();
+ if (columnCount == 0) {
+
+ // no column, can not selected any cell
+ if (log.isWarnEnabled()) {
+ log.warn("No column in table, can not select any cell");
+ }
+ return;
+ }
+ if (columnIndex > columnCount) {
+ if (log.isWarnEnabled()) {
+ log.warn(String.format("ColumnIndex: %s is more than columnCount %s", columnIndex, columnCount));
+ }
+ columnIndex = columnCount - 1;
+ }
+ if (columnIndex < 0) {
+ columnIndex = 0;
+ }
+ if (rowIndex >= rowCount) {
+ if (log.isWarnEnabled()) {
+ log.warn(String.format("RowIndex: %s is more than rowCount %s", rowIndex, rowCount));
+ }
+ rowIndex = rowCount - 1;
+ }
+ if (rowIndex < 0) {
+ rowIndex = 0;
+ }
+
+ table.setColumnSelectionInterval(columnIndex, columnIndex);
+ table.setRowSelectionInterval(rowIndex, rowIndex);
+ table.editCellAt(rowIndex, columnIndex);
+ }
+
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/ApplicationUIUtil.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/Cancelable.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/Cancelable.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/Cancelable.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,36 @@
+package org.nuiton.jaxx.application.swing.util;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+/**
+ * To cancel contract.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public interface Cancelable {
+
+ void cancel();
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/Cancelable.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/CloseableUI.java
===================================================================
--- trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/CloseableUI.java (rev 0)
+++ trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/CloseableUI.java 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,44 @@
+package org.nuiton.jaxx.application.swing.util;
+
+/*
+ * #%L
+ * JAXX :: Application Swing
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 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%
+ */
+
+/**
+ * Place this contract on any handler of ui that need some check before closing.
+ *
+ * Contract to close an ui.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 2.8
+ */
+public interface CloseableUI {
+
+ /**
+ * Try to quit UI.
+ *
+ * @return {@code true} if ui is safe to quit, {@code false} otherwise
+ * (means must stay on it).
+ */
+ boolean quitUI();
+}
Property changes on: trunk/jaxx-application-swing/src/main/java/org/nuiton/jaxx/application/swing/util/CloseableUI.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Property changes on: trunk/jaxx-application-swing/src/main/resources
___________________________________________________________________
Added: svn:ignore
+ target
.idea
*.ipr
*.iws
*.iml
Property changes on: trunk/jaxx-application-swing/src/main/resources/i18n
___________________________________________________________________
Added: svn:ignore
+ target
.idea
*.ipr
*.iws
*.iml
Added: trunk/jaxx-application-swing/src/main/resources/i18n/jaxx-application-swing_en_GB.properties
===================================================================
--- trunk/jaxx-application-swing/src/main/resources/i18n/jaxx-application-swing_en_GB.properties (rev 0)
+++ trunk/jaxx-application-swing/src/main/resources/i18n/jaxx-application-swing_en_GB.properties 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,21 @@
+jaxx.application.action.create.error=
+jaxx.application.common.askBeforeDelete.help=
+jaxx.application.common.askCancelEditBeforeLeaving.help=
+jaxx.application.common.askCancelEditBeforeLeaving.title=
+jaxx.application.common.askOverwriteFile.help=
+jaxx.application.common.askOverwriteFile.message=
+jaxx.application.common.askOverwriteFile.title=
+jaxx.application.common.askSaveBeforeLeaving.help=
+jaxx.application.common.askSaveBeforeLeaving.title=
+jaxx.application.common.datefield.tip=
+jaxx.application.error.cannot.mail=
+jaxx.application.error.cannot.open.link=
+jaxx.application.error.desktop.browse.not.supported=
+jaxx.application.error.desktop.mail.not.supported=
+jaxx.application.error.desktop.not.supported=
+jaxx.application.error.errorpane.htmlmessage=
+jaxx.application.error.ui.business.error=
+jaxx.application.error.ui.business.warning=
+jaxx.application.error.ui.other.error=
+jaxx.application.message.action.running=
+jaxx.application.title.actionUI=
Property changes on: trunk/jaxx-application-swing/src/main/resources/i18n/jaxx-application-swing_en_GB.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/resources/i18n/jaxx-application-swing_es_ES.properties
===================================================================
--- trunk/jaxx-application-swing/src/main/resources/i18n/jaxx-application-swing_es_ES.properties (rev 0)
+++ trunk/jaxx-application-swing/src/main/resources/i18n/jaxx-application-swing_es_ES.properties 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,21 @@
+jaxx.application.action.create.error=
+jaxx.application.common.askBeforeDelete.help=
+jaxx.application.common.askCancelEditBeforeLeaving.help=
+jaxx.application.common.askCancelEditBeforeLeaving.title=
+jaxx.application.common.askOverwriteFile.help=
+jaxx.application.common.askOverwriteFile.message=
+jaxx.application.common.askOverwriteFile.title=
+jaxx.application.common.askSaveBeforeLeaving.help=
+jaxx.application.common.askSaveBeforeLeaving.title=
+jaxx.application.common.datefield.tip=
+jaxx.application.error.cannot.mail=
+jaxx.application.error.cannot.open.link=
+jaxx.application.error.desktop.browse.not.supported=
+jaxx.application.error.desktop.mail.not.supported=
+jaxx.application.error.desktop.not.supported=
+jaxx.application.error.errorpane.htmlmessage=
+jaxx.application.error.ui.business.error=
+jaxx.application.error.ui.business.warning=
+jaxx.application.error.ui.other.error=
+jaxx.application.message.action.running=
+jaxx.application.title.actionUI=
Property changes on: trunk/jaxx-application-swing/src/main/resources/i18n/jaxx-application-swing_es_ES.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/jaxx-application-swing/src/main/resources/i18n/jaxx-application-swing_fr_FR.properties
===================================================================
--- trunk/jaxx-application-swing/src/main/resources/i18n/jaxx-application-swing_fr_FR.properties (rev 0)
+++ trunk/jaxx-application-swing/src/main/resources/i18n/jaxx-application-swing_fr_FR.properties 2014-01-31 10:50:51 UTC (rev 2779)
@@ -0,0 +1,21 @@
+jaxx.application.action.create.error=Erreur à l'instanciation de l'action %s
+jaxx.application.common.askBeforeDelete.help=Que voulez-vous faire ?<ul><li><strong>Annuler</strong> pour ne pas supprimer</li><li><strong>OK</strong> pour supprimer l'objet en question</li></ul>
+jaxx.application.common.askCancelEditBeforeLeaving.help=Que voulez-vous faire ?<ul><li><strong>Annuler</strong> pour rester sur cet écran</li><li><strong>OK</strong> pour quitter l'écran en abandonnant les modifications</li></ul>
+jaxx.application.common.askCancelEditBeforeLeaving.title=Modifications non enregistrées mais invalides
+jaxx.application.common.askOverwriteFile.help=Que voulez-vous faire ?<ul><li><strong>Annuler</strong> pour ne pas écraser le fichier et annuler l'opération</li><li><strong>Oui</strong> pour écraser le fichier et continuer l'opération</li></ul>
+jaxx.application.common.askOverwriteFile.message=Le fichier %s existe déjà, confirmer pour l'écraser
+jaxx.application.common.askOverwriteFile.title=Confirmer l'écrasement d'un fichier...
+jaxx.application.common.askSaveBeforeLeaving.help=Que voulez-vous faire?<ul><li><strong>Annuler</strong> pour rester sur cet écran</li><li><strong>Non</strong> pour quitter l'écran en abandonnant les modifications en cours</li><li><strong>Oui</strong> pour quitter l'écran après enregistrement des modifications</li></ul>
+jaxx.application.common.askSaveBeforeLeaving.title=Modifications non enregistrées
+jaxx.application.common.datefield.tip=Format attendu \: %s
+jaxx.application.error.cannot.mail=Erreur lors de l'ouverture du client mail
+jaxx.application.error.cannot.open.link=Impossible d'ouvrir le fichier %s
+jaxx.application.error.desktop.browse.not.supported=Le navigateur n'a pas pu être ouvert. Vérifiez que vous avez défini un navigateur par défaut dans votre système
+jaxx.application.error.desktop.mail.not.supported=Le client mail n'a pas pu être ouvert. Vérifiez que vous avez défini un client mail par défaut dans votre système
+jaxx.application.error.desktop.not.supported=Votre système ne permet pas d'ouvrir des liens ou fichiers en dehors de l'application
+jaxx.application.error.errorpane.htmlmessage=<html><body><b>Une erreur s'est produite</b>\:<br/>%s</body></html>
+jaxx.application.error.ui.business.error=Erreur
+jaxx.application.error.ui.business.warning=Avertissement
+jaxx.application.error.ui.other.error=Erreur
+jaxx.application.message.action.running=<html>Action <strong>%s</strong> en cours d'exécution...</html>
+jaxx.application.title.actionUI=%s - v %s [%s]
Property changes on: trunk/jaxx-application-swing/src/main/resources/i18n/jaxx-application-swing_fr_FR.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/jaxx-demo/src/main/resources/jaxxdemo-help-fr.properties
===================================================================
--- trunk/jaxx-demo/src/main/resources/jaxxdemo-help-fr.properties 2014-01-31 09:27:15 UTC (rev 2778)
+++ trunk/jaxx-demo/src/main/resources/jaxxdemo-help-fr.properties 2014-01-31 10:50:51 UTC (rev 2779)
@@ -1,3 +1,26 @@
+###
+# #%L
+# JAXX :: Demo
+# $Id$
+# $HeadURL:$
+# %%
+# Copyright (C) 2008 - 2014 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%
+###
#Generated by org.nuiton.jaxx.plugin.GenerateHelpIdsMojo
#Fri Jan 10 13:44:01 CET 2014
ui.component.swing.buttons.JButtonDemo=
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-01-31 09:27:15 UTC (rev 2778)
+++ trunk/pom.xml 2014-01-31 10:50:51 UTC (rev 2779)
@@ -43,6 +43,8 @@
<module>jaxx-maven-plugin</module>
<module>jaxx-widgets</module>
<module>jaxx-config</module>
+ <module>jaxx-application-api</module>
+ <module>jaxx-application-swing</module>
</modules>
<developers>
@@ -118,6 +120,7 @@
<nuitonConfigVersion>3.0-alpha-1</nuitonConfigVersion>
<nuitonDecoratorVersion>3.0-alpha-2</nuitonDecoratorVersion>
<nuitonI18nVersion>2.5.2</nuitonI18nVersion>
+ <nuitonCsvVersion>3.0-alpha-1</nuitonCsvVersion>
<eugeneVersion>2.7.3</eugeneVersion>
<jxLayerVersion>3.0.4</jxLayerVersion>
<javaHelpVersion>2.0.05</javaHelpVersion>
@@ -190,6 +193,12 @@
</dependency>
<dependency>
+ <groupId>org.nuiton</groupId>
+ <artifactId>nuiton-csv</artifactId>
+ <version>${nuitonCsvVersion}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.nuiton.eugene</groupId>
<artifactId>eugene</artifactId>
<version>${eugeneVersion}</version>
@@ -262,6 +271,22 @@
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-vfs2</artifactId>
+ <version>2.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.maven.scm</groupId>
+ <artifactId>maven-scm-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.maven.scm</groupId>
+ <artifactId>maven-scm-provider-svnexe</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
<!-- sun dependencies -->
<dependency>
<groupId>com.sun</groupId>
1
0
r2778 - in trunk/jaxx-demo/src/main/java/jaxx/demo: . component/swing
by tchemit@users.nuiton.org 31 Jan '14
by tchemit@users.nuiton.org 31 Jan '14
31 Jan '14
Author: tchemit
Date: 2014-01-31 10:27:15 +0100 (Fri, 31 Jan 2014)
New Revision: 2778
Url: http://nuiton.org/projects/jaxx/repository/revisions/2778
Log:
fix license headers
Modified:
trunk/jaxx-demo/src/main/java/jaxx/demo/DemoApplicationContext.java
trunk/jaxx-demo/src/main/java/jaxx/demo/DemoHelpBroker.java
trunk/jaxx-demo/src/main/java/jaxx/demo/DemoSources.css
trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JButtonDemo.css
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoApplicationContext.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoApplicationContext.java 2014-01-31 09:26:24 UTC (rev 2777)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoApplicationContext.java 2014-01-31 09:27:15 UTC (rev 2778)
@@ -1,5 +1,29 @@
package jaxx.demo;
+/*
+ * #%L
+ * JAXX :: Demo
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2008 - 2014 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%
+ */
+
import jaxx.runtime.JAXXContext;
import jaxx.runtime.JAXXUtil;
import jaxx.runtime.context.DefaultApplicationContext;
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoHelpBroker.java
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoHelpBroker.java 2014-01-31 09:26:24 UTC (rev 2777)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoHelpBroker.java 2014-01-31 09:27:15 UTC (rev 2778)
@@ -9,18 +9,18 @@
* Copyright (C) 2012 - 2013 Ifremer
* %%
* This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
+ * 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 Public License for more details.
+ * GNU General Lesser Public License for more details.
*
- * You should have received a copy of the GNU General Public
+ * 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/gpl-3.0.html>.
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L%
*/
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/DemoSources.css
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/DemoSources.css 2014-01-31 09:26:24 UTC (rev 2777)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/DemoSources.css 2014-01-31 09:27:15 UTC (rev 2778)
@@ -1,3 +1,26 @@
+/*
+ * #%L
+ * JAXX :: Demo
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2008 - 2014 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%
+ */
#editorPaneHeader {
_help:{"ui.main.sources.toolbar"};
}
Modified: trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JButtonDemo.css
===================================================================
--- trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JButtonDemo.css 2014-01-31 09:26:24 UTC (rev 2777)
+++ trunk/jaxx-demo/src/main/java/jaxx/demo/component/swing/JButtonDemo.css 2014-01-31 09:27:15 UTC (rev 2778)
@@ -1,3 +1,26 @@
+/*
+ * #%L
+ * JAXX :: Demo
+ * $Id$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2008 - 2014 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%
+ */
#topDemoPanel {
_help:{"ui.component.swing.buttons.JButtonDemo"};
}
1
0
Author: tchemit
Date: 2014-01-31 10:26:24 +0100 (Fri, 31 Jan 2014)
New Revision: 2777
Url: http://nuiton.org/projects/jaxx/repository/revisions/2777
Log:
fixes #3016: Remove jaxx-swing-action moduel from svn
Removed:
trunk/jaxx-swing-action/
1
0
See <http://ci-ng.nuiton.org/jenkins/job/jaxx/1/>
------------------------------------------
[...truncated 2066 lines...]
Running jaxx.runtime.swing.editor.gis.DmdCoordinateConverterTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in jaxx.runtime.swing.editor.gis.DmdCoordinateConverterTest
Running jaxx.runtime.swing.editor.gis.DmdCoordinateTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec - in jaxx.runtime.swing.editor.gis.DmdCoordinateTest
Results :
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0
[JENKINS] Recording test results
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ jaxx-widgets ---
[INFO] Building jar: <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-widgets/target/jaxx-…>
[INFO]
[INFO] --- maven-site-plugin:3.3:attach-descriptor (attach-descriptor) @ jaxx-widgets ---
[JENKINS] Archiving disabled
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building JAXX :: Config 2.8-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ jaxx-config ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ jaxx-config ---
[INFO]
[INFO] --- jaxx-maven-plugin:2.8-SNAPSHOT:generate (default) @ jaxx-config ---
[INFO] Detects 3 modified jaxx file(s).
[INFO] Generated 3 file(s) in 178.816ms
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:parserJava (default) @ jaxx-config ---
[INFO] start entry basedir:<http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-config/target/genera…,> includes:[**/*.java]
[INFO] 3 file(s) to process (among 3 files)
[INFO] start entry basedir:<http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-config/src/main/java,> includes:[**/*.java]
[INFO] 16 file(s) to process (among 16 files)
[INFO] Parsing is done. [treated file(s) : 7/19](total time:5.187ms) ( ~ 273024ns / file)
[INFO]
[INFO] >>> i18n-maven-plugin:2.5.2:gen (default) @ jaxx-config >>>
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:get (get) @ jaxx-config ---
[INFO] config - basedir : <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-config/target/genera…>
[INFO] config - locales : [fr_FR, en_GB, es_ES]
[INFO] import getter java.getter in 124863ns
[INFO] Copying jaxx-config.properties to <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-config/target/genera…>
[INFO] Copying jaxx-config.properties to <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-config/target/genera…>
[INFO] Copying jaxx-config.properties to <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-config/target/genera…>
[INFO]
[INFO] <<< i18n-maven-plugin:2.5.2:gen (default) @ jaxx-config <<<
[INFO]
[INFO] --- i18n-maven-plugin:2.5.2:gen (default) @ jaxx-config ---
[INFO] config - src basedir : <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-config/src/main/reso…>
[INFO] config - out basedir : <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-config/target/genera…>
[INFO] config - locales : [fr_FR, en_GB, es_ES]
[INFO] prepare bundle for locale fr_FR
[INFO] merge bundle fr_FR to out
[INFO] copy bundle fr_FR to src
[INFO] prepare bundle for locale en_GB
[INFO] merge bundle en_GB to out
[INFO] copy bundle en_GB to src
[INFO] prepare bundle for locale es_ES
[INFO] merge bundle es_ES to out
[WARNING] bundle es_ES contains 2/35 empty entries! (use -Di18n.showEmpty to see these entries)
[INFO] copy bundle es_ES to src
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jaxx-config ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 7 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ jaxx-config ---
[INFO] Compiling 19 source files to <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-config/target/classes>
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[WARNING] <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-config/src/main/java…>: Some input files use unchecked or unsafe operations.
[WARNING] <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-config/src/main/java…>: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-antrun-plugin:1.7:run (generate-surefire-workdir) @ jaxx-config ---
[INFO] Executing tasks
main:
[mkdir] Created dir: <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-config/target/surefi…>
[INFO] Executed tasks
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ jaxx-config ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ jaxx-config ---
[INFO] Compiling 4 source files to <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-config/target/test-c…>
[WARNING] bootstrap class path not set in conjunction with -source 1.6
[WARNING] <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-config/src/test/java…>:[290,16] addOption(org.nuiton.config.ConfigOptionDef,java.lang.String) in jaxx.runtime.swing.config.model.ConfigUIModelBuilder has been deprecated
[WARNING] <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-config/src/test/java…>:[302,16] addOption(org.nuiton.config.ConfigOptionDef,java.lang.String) in jaxx.runtime.swing.config.model.ConfigUIModelBuilder has been deprecated
[INFO]
[INFO] --- maven-surefire-plugin:2.16:test (default-test) @ jaxx-config ---
[INFO] Surefire report directory: <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-config/target/surefi…>
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running jaxx.runtime.swing.config.model.MyInheritedConfigTest
WARN [main] (I18n.java:501) getDefaultInitializer -
I18n was not initialized! will init it with default initializer and default locale, it might not translate anything for you...
Please use the method I18n.init(I18nInitializer, Locale) before any calling to a translation...
Tests run: 33, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.395 sec - in jaxx.runtime.swing.config.model.MyInheritedConfigTest
Running jaxx.runtime.swing.config.model.MyDelegateConfigTest
Tests run: 30, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 sec - in jaxx.runtime.swing.config.model.MyDelegateConfigTest
Results :
Tests run: 63, Failures: 0, Errors: 0, Skipped: 0
[JENKINS] Recording test results
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ jaxx-config ---
[INFO] Building jar: <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/jaxx-config/target/jaxx-c…>
[INFO]
[INFO] --- maven-site-plugin:3.3:attach-descriptor (attach-descriptor) @ jaxx-config ---
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[JENKINS] Archiving disabled
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] JAXX .............................................. SUCCESS [2.234s]
[INFO] JAXX :: Runtime ................................... SUCCESS [6.041s]
[INFO] JAXX :: Validator ................................. SUCCESS [1.896s]
[INFO] JAXX :: Compiler .................................. SUCCESS [5.073s]
[INFO] JAXX :: Maven plugin .............................. SUCCESS [9.013s]
[INFO] JAXX :: Widgets ................................... SUCCESS [6.156s]
[INFO] JAXX :: Config .................................... SUCCESS [1.692s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33.910s
[INFO] Finished at: Sun Jan 26 00:46:18 CET 2014
[JENKINS] Archiving disabled
[INFO] Final Memory: 80M/1449M
[INFO] ------------------------------------------------------------------------
channel stopped
[trunk] $ /opt/maven3/bin/mvn -f pom.xml -s /var/local/forge/data/nuiton.org/maven/settings.xml -e clean deploy -DperformRelease
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] JAXX
[INFO] JAXX :: Runtime
[INFO] JAXX :: Validator
[INFO] JAXX :: Compiler
[INFO] JAXX :: Maven plugin
[INFO] JAXX :: Widgets
[INFO] JAXX :: Config
[INFO] JAXX :: Demo
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building JAXX 2.8-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ jaxx ---
[INFO] Deleting <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/target>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (ensure-no-container-api) @ jaxx ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:check-auto-container (check-central-safe) @ jaxx ---
[INFO] Will use repository http://repo1.maven.org/maven2/
[INFO] Will use repository http://maven.nuiton.org/central-releases
[INFO] 14 dependencies to check.
[INFO] 14 artifact(s) resolved by repository http://repo1.maven.org/maven2/ in 2.533s
[INFO] All dependencies are safe.
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (check-project-files) @ jaxx ---
[INFO]
[INFO] --- helper-maven-plugin:2.1:share-server-secret (get-redmine-login) @ jaxx ---
[INFO] Exporting server [redmine-nuiton.org] username in ${redmine.username}
[INFO] Exporting server [redmine-nuiton.org] privateKey in ${redmine.apiKey}
[INFO]
[INFO] --- license-maven-plugin:1.5:update-project-license (attach-licenses) @ jaxx ---
[INFO] Will create or update license file [lgpl_v3] to <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/LICENSE.txt>
[INFO]
[INFO] --- license-maven-plugin:1.5:add-third-party (attach-licenses) @ jaxx ---
[WARNING] The goal is skip due to packaging 'pom'
[INFO]
[INFO] --- license-maven-plugin:1.5:update-file-header (update-file-header) @ jaxx ---
[INFO] Will search files to update from root <http://ci-ng.nuiton.org/jenkins/job/jaxx/ws/trunk/src>
[INFO] Scan 30 files header done in 73.039ms.
[INFO] All files are up-to-date.
[INFO]
[INFO] --- animal-sniffer-maven-plugin:1.9:check (default) @ jaxx ---
[INFO] Checking unresolved references to org.codehaus.mojo.signature:java16:1.1
[INFO]
[INFO] --- jredmine-maven-plugin:1.6:generate-changes (jredmine-generate-changes) @ jaxx ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] JAXX .............................................. FAILURE [5.655s]
[INFO] JAXX :: Runtime ................................... SKIPPED
[INFO] JAXX :: Validator ................................. SKIPPED
[INFO] JAXX :: Compiler .................................. SKIPPED
[INFO] JAXX :: Maven plugin .............................. SKIPPED
[INFO] JAXX :: Widgets ................................... SKIPPED
[INFO] JAXX :: Config .................................... SKIPPED
[INFO] JAXX :: Demo ...................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.444s
[INFO] Finished at: Sun Jan 26 00:46:26 CET 2014
[INFO] Final Memory: 30M/429M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.nuiton.jredmine:jredmine-maven-plugin:1.6:generate-changes (jredmine-generate-changes) on project jaxx: the version '2.8' could not be retrieve from redmine server. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.nuiton.jredmine:jredmine-maven-plugin:1.6:generate-changes (jredmine-generate-changes) on project jaxx: the version '2.8' could not be retrieve from redmine server.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: the version '2.8' could not be retrieve from redmine server.
at org.nuiton.jredmine.plugin.AbstractRedmineMojo.failIfSafe(AbstractRedmineMojo.java:396)
at org.nuiton.jredmine.plugin.AbstractRedmineMojoWithProjectAndVersion.init(AbstractRedmineMojoWithProjectAndVersion.java:119)
at org.nuiton.jredmine.plugin.GenerateChangesMojo.init(GenerateChangesMojo.java:348)
at org.nuiton.plugin.AbstractPlugin.execute(AbstractPlugin.java:106)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Build step 'Invoke top-level Maven targets' marked build as failure
1
5