From: Bruno Sinou Date: Tue, 27 Mar 2012 15:05:09 +0000 (+0000) Subject: Move internationalization Demo to sandbox (a svn branch has been created before the... X-Git-Tag: argeo-commons-2.1.30~953 X-Git-Url: http://git.argeo.org/?p=lgpl%2Fargeo-commons.git;a=commitdiff_plain;h=720a273bacf7f64e9a3ac46449614a64b6da7c17 Move internationalization Demo to sandbox (a svn branch has been created before the delete). git-svn-id: https://svn.argeo.org/commons/trunk@5246 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/demo/argeo_demo_rcp.properties b/demo/argeo_demo_rcp.properties deleted file mode 100644 index 583449a1f..000000000 --- a/demo/argeo_demo_rcp.properties +++ /dev/null @@ -1,15 +0,0 @@ -argeo.osgi.start=\ -org.springframework.osgi.extender,\ -org.argeo.node.repofactory.jackrabbit,\ -org.argeo.node.repo.jackrabbit,\ -org.argeo.security.dao.jackrabbit,\ -org.argeo.security.services,\ -org.argeo.security.equinox,\ -org.argeo.demo.i18n,\ - -#org.argeo.security.ui.initialPerspective=org.argeo.osgi.ui.explorer.perspective -org.argeo.security.ui.initialPerspective=org.argeo.demo.i18n.perspective - -log4j.configuration=file:../../log4j-demo.properties - -eclipse.application=org.argeo.security.ui.rcp.secureUi diff --git a/demo/argeo_demo_web.properties b/demo/argeo_demo_web.properties deleted file mode 100644 index 0be4dce77..000000000 --- a/demo/argeo_demo_web.properties +++ /dev/null @@ -1,31 +0,0 @@ -argeo.osgi.start=\ -org.springframework.osgi.extender,\ -org.argeo.node.repofactory.jackrabbit,\ -org.argeo.node.repo.jackrabbit,\ -org.argeo.security.dao.ldap,\ -org.argeo.security.services,\ -org.argeo.security.equinox,\ -org.eclipse.core.runtime,\ -org.eclipse.equinox.common,\ -org.eclipse.equinox.http.registry,\ -org.eclipse.equinox.launcher,\ -org.argeo.dep.osgi.catalina.start,\ -org.argeo.jackrabbit.webapp,\ -org.argeo.server.rap.webapp,\ -org.argeo.server.ads.server,\ -org.argeo.demo.i18n,\ -org.springframework.osgi.web.extender,\ - - -#Choose initial perspective -org.argeo.security.ui.initialPerspective=org.argeo.demo.i18n.perspective - -log4j.configuration=file:../../log4j-demo.properties - -## important to enable internationalization of plugin.xml labels. -## Note that enabling this reduce server performances; see -## bug 244468 for details : https://bugs.eclipse.org/bugs/show_bug.cgi?id=244468 -eclipse.registry.MultiLanguage=true - -# Note default URL to access the webapp -# http://localhost:7070/org.argeo.rap.webapp/node \ No newline at end of file diff --git a/demo/log4j-demo.properties b/demo/log4j-demo.properties deleted file mode 100644 index 9acc10388..000000000 --- a/demo/log4j-demo.properties +++ /dev/null @@ -1,22 +0,0 @@ -log4j.rootLogger=WARN, development - -## Levels -log4j.logger.org.argeo=DEBUG - -log4j.logger.org.apache.catalina=INFO -log4j.logger.org.apache.coyote=INFO -log4j.logger.org.apache.directory.server=ERROR -log4j.logger.org.apache.jackrabbit.core.query.lucene=ERROR - -## Appenders -# console is set to be a ConsoleAppender. -log4j.appender.console=org.apache.log4j.ConsoleAppender - -# console uses PatternLayout. -log4j.appender.console.layout=org.apache.log4j.PatternLayout -log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c - [%t]%n - -# development appender (slow!) -log4j.appender.development=org.apache.log4j.ConsoleAppender -log4j.appender.development.layout=org.apache.log4j.PatternLayout -log4j.appender.development.layout.ConversionPattern=%d{HH:mm:ss} [%16.16t] %5p %m (%F:%L) %c%n \ No newline at end of file diff --git a/demo/plugins/org.argeo.demo.i18n.rap/.classpath b/demo/plugins/org.argeo.demo.i18n.rap/.classpath deleted file mode 100644 index f01837b06..000000000 --- a/demo/plugins/org.argeo.demo.i18n.rap/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/demo/plugins/org.argeo.demo.i18n.rap/.project b/demo/plugins/org.argeo.demo.i18n.rap/.project deleted file mode 100644 index d89b85e06..000000000 --- a/demo/plugins/org.argeo.demo.i18n.rap/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.argeo.demo.i18n.rap - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - \ No newline at end of file diff --git a/demo/plugins/org.argeo.demo.i18n.rap/META-INF/MANIFEST.MF b/demo/plugins/org.argeo.demo.i18n.rap/META-INF/MANIFEST.MF deleted file mode 100644 index 7be0eb33d..000000000 --- a/demo/plugins/org.argeo.demo.i18n.rap/META-INF/MANIFEST.MF +++ /dev/null @@ -1,16 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Fragment-Host: org.argeo.demo.i18n -Bundle-Version: 0.3.5.SNAPSHOT -Bundle-SymbolicName: org.argeo.demo.i18n.rap -Bundle-Vendor: Argeo -Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Require-Bundle: org.eclipse.rap.ui;resolution:=optional, - org.eclipse.rap.ui.workbench;resolution:=optional -Import-Package: org.apache.commons.io, - org.apache.commons.logging, - org.argeo, - org.argeo.eclipse.spring, - org.argeo.eclipse.ui, - org.argeo.demo.i18n -Export-Package: org.argeo.demo.i18n.specific;uses:="org.eclipse.rwt" diff --git a/demo/plugins/org.argeo.demo.i18n.rap/build.properties b/demo/plugins/org.argeo.demo.i18n.rap/build.properties deleted file mode 100644 index bbafbf84c..000000000 --- a/demo/plugins/org.argeo.demo.i18n.rap/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/main/java/,\ -output.. = target/classes/ -bin.includes = META-INF/,\ - . diff --git a/demo/plugins/org.argeo.demo.i18n.rap/pom.xml b/demo/plugins/org.argeo.demo.i18n.rap/pom.xml deleted file mode 100644 index dba5364a5..000000000 --- a/demo/plugins/org.argeo.demo.i18n.rap/pom.xml +++ /dev/null @@ -1,28 +0,0 @@ - - 4.0.0 - - org.argeo.commons.demo - 0.3.5-SNAPSHOT - plugins - .. - - org.argeo.demo.i18n.rap - Commons Internationalization Demo RAP - - - org.argeo.commons.demo - org.argeo.demo.i18n - 0.3.5-SNAPSHOT - - - org.argeo.commons.eclipse - org.argeo.eclipse.ui.rap - 0.3.5-SNAPSHOT - - - org.argeo.commons.eclipse - org.argeo.eclipse.dep.rap - 0.3.5-SNAPSHOT - - - diff --git a/demo/plugins/org.argeo.demo.i18n.rap/src/main/java/org/argeo/demo/i18n/specific/NLSHelperImpl.java b/demo/plugins/org.argeo.demo.i18n.rap/src/main/java/org/argeo/demo/i18n/specific/NLSHelperImpl.java deleted file mode 100644 index e9f85358c..000000000 --- a/demo/plugins/org.argeo.demo.i18n.rap/src/main/java/org/argeo/demo/i18n/specific/NLSHelperImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2007-2012 Mathieu Baudier - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.argeo.demo.i18n.specific; - -import org.argeo.demo.i18n.NLSHelper; -import org.eclipse.rwt.RWT; - -/** - * Implements access to internationalized property using the RAP specific - * implementation of NLS. Thanks to {@link http - * ://eclipsesource.com/en/info/rcp-rap-single-sourcing-guideline/} - */ -public class NLSHelperImpl extends NLSHelper { - - protected Object internalGetMessages(String bundleName, - @SuppressWarnings("rawtypes") Class clazz) { - return RWT.NLS.getUTF8Encoded(bundleName, clazz); - } -} diff --git a/demo/plugins/org.argeo.demo.i18n.rcp/.classpath b/demo/plugins/org.argeo.demo.i18n.rcp/.classpath deleted file mode 100644 index f01837b06..000000000 --- a/demo/plugins/org.argeo.demo.i18n.rcp/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/demo/plugins/org.argeo.demo.i18n.rcp/.project b/demo/plugins/org.argeo.demo.i18n.rcp/.project deleted file mode 100644 index a9fb824f7..000000000 --- a/demo/plugins/org.argeo.demo.i18n.rcp/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.argeo.demo.i18n.rcp - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - \ No newline at end of file diff --git a/demo/plugins/org.argeo.demo.i18n.rcp/META-INF/MANIFEST.MF b/demo/plugins/org.argeo.demo.i18n.rcp/META-INF/MANIFEST.MF deleted file mode 100644 index 5edf06a3f..000000000 --- a/demo/plugins/org.argeo.demo.i18n.rcp/META-INF/MANIFEST.MF +++ /dev/null @@ -1,16 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Fragment-Host: org.argeo.demo.i18n -Bundle-SymbolicName: org.argeo.demo.i18n.rcp -Bundle-Version: 0.3.5.SNAPSHOT -Bundle-Vendor: Argeo -Require-Bundle: org.eclipse.ui;resolution:=optional, - org.eclipse.core.runtime;resolution:=optional -Export-Package: org.argeo.demo.i18n.specific -Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Import-Package: org.apache.commons.io, - org.apache.commons.logging, - org.argeo, - org.argeo.demo.i18n, - org.argeo.eclipse.spring, - org.argeo.eclipse.ui diff --git a/demo/plugins/org.argeo.demo.i18n.rcp/build.properties b/demo/plugins/org.argeo.demo.i18n.rcp/build.properties deleted file mode 100644 index 803371402..000000000 --- a/demo/plugins/org.argeo.demo.i18n.rcp/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/main/java/,\ -output.. = target/classes/ -bin.includes = META-INF/,\ - . \ No newline at end of file diff --git a/demo/plugins/org.argeo.demo.i18n.rcp/pom.xml b/demo/plugins/org.argeo.demo.i18n.rcp/pom.xml deleted file mode 100644 index 40a6c3ddb..000000000 --- a/demo/plugins/org.argeo.demo.i18n.rcp/pom.xml +++ /dev/null @@ -1,28 +0,0 @@ - - 4.0.0 - - org.argeo.commons.demo - 0.3.5-SNAPSHOT - plugins - .. - - org.argeo.demo.i18n.rcp - Commons Internationalization Demo RCP - - - org.argeo.commons.demo - org.argeo.demo.i18n - 0.3.5-SNAPSHOT - - - org.argeo.commons.eclipse - org.argeo.eclipse.ui.rcp - 0.3.5-SNAPSHOT - - - org.argeo.commons.eclipse - org.argeo.eclipse.dep.rcp - 0.3.5-SNAPSHOT - - - \ No newline at end of file diff --git a/demo/plugins/org.argeo.demo.i18n.rcp/src/main/java/org/argeo/demo/i18n/specific/NLSHelperImpl.java b/demo/plugins/org.argeo.demo.i18n.rcp/src/main/java/org/argeo/demo/i18n/specific/NLSHelperImpl.java deleted file mode 100644 index 091d5cdf8..000000000 --- a/demo/plugins/org.argeo.demo.i18n.rcp/src/main/java/org/argeo/demo/i18n/specific/NLSHelperImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2007-2012 Mathieu Baudier - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.argeo.demo.i18n.specific; - -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.argeo.demo.i18n.NLSHelper; - -public class NLSHelperImpl extends NLSHelper { - - protected Object internalGetMessages(String bundleName, Class clazz) { - - ClassLoader loader = clazz.getClassLoader(); - // test - // Locale currentLocale = new Locale("fr"); - // ResourceBundle bundle = ResourceBundle.getBundle(bundleName, - // currentLocale, loader); - // test end - ResourceBundle bundle = ResourceBundle.getBundle(bundleName, - Locale.getDefault(), loader); - return internalGet(bundle, clazz); - } - - private Object internalGet(ResourceBundle bundle, Class clazz) { - - Object result; - try { - Constructor constructor = clazz.getDeclaredConstructor(null); - constructor.setAccessible(true); - result = constructor.newInstance(null); - } catch (final Exception ex) { - throw new IllegalStateException(ex.getMessage()); - } - final Field[] fieldArray = clazz.getDeclaredFields(); - for (int i = 0; i < fieldArray.length; i++) { - try { - int modifiers = fieldArray[i].getModifiers(); - if (String.class.isAssignableFrom(fieldArray[i].getType()) - && Modifier.isPublic(modifiers) - && !Modifier.isStatic(modifiers)) { - try { - String value = bundle - .getString(fieldArray[i].getName()); - byte[] bytes = value.getBytes(); - String forcedValue = new String(bytes, "UTF8"); - if (value != null) { - fieldArray[i].setAccessible(true); - fieldArray[i].set(result, forcedValue); - } - } catch (final MissingResourceException mre) { - fieldArray[i].setAccessible(true); - fieldArray[i].set(result, ""); - mre.printStackTrace(); - } - } - } catch (final Exception ex) { - ex.printStackTrace(); - } - } - return result; - } -} diff --git a/demo/plugins/org.argeo.demo.i18n/.classpath b/demo/plugins/org.argeo.demo.i18n/.classpath deleted file mode 100644 index cf1efe7e4..000000000 --- a/demo/plugins/org.argeo.demo.i18n/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - >> - - - - - diff --git a/demo/plugins/org.argeo.demo.i18n/.project b/demo/plugins/org.argeo.demo.i18n/.project deleted file mode 100644 index acaddb77f..000000000 --- a/demo/plugins/org.argeo.demo.i18n/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.argeo.demo.i18n - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - \ No newline at end of file diff --git a/demo/plugins/org.argeo.demo.i18n/.settings/org.eclipse.core.resources.prefs b/demo/plugins/org.argeo.demo.i18n/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index c1ac5c5fc..000000000 --- a/demo/plugins/org.argeo.demo.i18n/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Wed Sep 28 17:41:20 CEST 2011 -eclipse.preferences.version=1 -encoding//src/main/resources/org/argeo/demo/i18n/messages.properties=UTF-8 -encoding//src/main/resources/org/argeo/demo/i18n/messages_fr.properties=UTF-8 diff --git a/demo/plugins/org.argeo.demo.i18n/META-INF/MANIFEST.MF b/demo/plugins/org.argeo.demo.i18n/META-INF/MANIFEST.MF deleted file mode 100644 index 7b1b9dde0..000000000 --- a/demo/plugins/org.argeo.demo.i18n/META-INF/MANIFEST.MF +++ /dev/null @@ -1,27 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Internationalization Demo -Bundle-SymbolicName: org.argeo.demo.i18n;singleton:=true -Bundle-Version: 0.3.5.SNAPSHOT -Bundle-Activator: org.argeo.demo.i18n.I18nDemoPlugin -Bundle-Localization: properties/plugin -Bundle-Vendor: Argeo -Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Bundle-ActivationPolicy: lazy -Export-Package: org.argeo.demo.i18n -Require-Bundle: org.eclipse.ui;resolution:=optional, - org.eclipse.core.runtime;resolution:=optional, - org.eclipse.rap.ui;resolution:=optional, - org.eclipse.rap.ui.workbench;resolution:=optional -Import-Package: javax.jcr;version="2.0.0", - org.apache.commons.io, - org.apache.commons.logging, - org.argeo, - org.argeo.eclipse.spring, - org.argeo.eclipse.ui, - org.argeo.eclipse.ui.jcr, - org.argeo.eclipse.ui.utils, - org.argeo.jcr.spring, - org.eclipse.ui.forms, - org.eclipse.ui.forms.editor, - org.eclipse.ui.forms.widgets diff --git a/demo/plugins/org.argeo.demo.i18n/META-INF/spring/commands.xml b/demo/plugins/org.argeo.demo.i18n/META-INF/spring/commands.xml deleted file mode 100644 index 30335db6e..000000000 --- a/demo/plugins/org.argeo.demo.i18n/META-INF/spring/commands.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/demo/plugins/org.argeo.demo.i18n/META-INF/spring/editors.xml b/demo/plugins/org.argeo.demo.i18n/META-INF/spring/editors.xml deleted file mode 100644 index 12c9c3b99..000000000 --- a/demo/plugins/org.argeo.demo.i18n/META-INF/spring/editors.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - diff --git a/demo/plugins/org.argeo.demo.i18n/META-INF/spring/jcr.xml b/demo/plugins/org.argeo.demo.i18n/META-INF/spring/jcr.xml deleted file mode 100644 index 11986aa3d..000000000 --- a/demo/plugins/org.argeo.demo.i18n/META-INF/spring/jcr.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/demo/plugins/org.argeo.demo.i18n/META-INF/spring/osgi.xml b/demo/plugins/org.argeo.demo.i18n/META-INF/spring/osgi.xml deleted file mode 100644 index 14ce7af5e..000000000 --- a/demo/plugins/org.argeo.demo.i18n/META-INF/spring/osgi.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/demo/plugins/org.argeo.demo.i18n/META-INF/spring/views.xml b/demo/plugins/org.argeo.demo.i18n/META-INF/spring/views.xml deleted file mode 100644 index 056b7f1ca..000000000 --- a/demo/plugins/org.argeo.demo.i18n/META-INF/spring/views.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - diff --git a/demo/plugins/org.argeo.demo.i18n/build.properties b/demo/plugins/org.argeo.demo.i18n/build.properties deleted file mode 100644 index ac1c67974..000000000 --- a/demo/plugins/org.argeo.demo.i18n/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -source.. = src/main/java/,\ - src/main/resources -output.. = target/classes/ -bin.includes = META-INF/,\ - properties/,\ - .,\ - plugin.xml diff --git a/demo/plugins/org.argeo.demo.i18n/icons/browser.gif b/demo/plugins/org.argeo.demo.i18n/icons/browser.gif deleted file mode 100644 index 6c7320c69..000000000 Binary files a/demo/plugins/org.argeo.demo.i18n/icons/browser.gif and /dev/null differ diff --git a/demo/plugins/org.argeo.demo.i18n/icons/i18n.gif b/demo/plugins/org.argeo.demo.i18n/icons/i18n.gif deleted file mode 100644 index e6517f3d5..000000000 Binary files a/demo/plugins/org.argeo.demo.i18n/icons/i18n.gif and /dev/null differ diff --git a/demo/plugins/org.argeo.demo.i18n/plugin.xml b/demo/plugins/org.argeo.demo.i18n/plugin.xml deleted file mode 100644 index 47d343e1b..000000000 --- a/demo/plugins/org.argeo.demo.i18n/plugin.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/demo/plugins/org.argeo.demo.i18n/pom.xml b/demo/plugins/org.argeo.demo.i18n/pom.xml deleted file mode 100644 index 292a14067..000000000 --- a/demo/plugins/org.argeo.demo.i18n/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - 4.0.0 - - org.argeo.commons.demo - 0.3.5-SNAPSHOT - plugins - .. - - org.argeo.demo.i18n - Commons Internationalization Demo - - - org.argeo.commons.eclipse - org.argeo.eclipse.dep.common - 0.3.5-SNAPSHOT - - - - org.argeo.commons.eclipse - org.argeo.eclipse.ui - 0.3.5-SNAPSHOT - - - - - org.argeo.commons.eclipse - org.argeo.eclipse.ui.rap - 0.3.5-SNAPSHOT - provided - - - org.argeo.commons.eclipse - org.argeo.eclipse.dep.rap - 0.3.5-SNAPSHOT - provided - - - - - - diff --git a/demo/plugins/org.argeo.demo.i18n/properties/plugin.properties b/demo/plugins/org.argeo.demo.i18n/properties/plugin.properties deleted file mode 100644 index 359fa2593..000000000 --- a/demo/plugins/org.argeo.demo.i18n/properties/plugin.properties +++ /dev/null @@ -1,9 +0,0 @@ - -## commands label -OpenDialog_Label=Open a dialog box - -## View, perspective and editor labels -I18nDemoPerspective_Name=Demo Internationalization -SimpleTreeView_Name=Simple tree view -SimpleMultitabEditor_Name=Simple multi-tab editor -LocaleSettingsPage_Title=Manage localization settings \ No newline at end of file diff --git a/demo/plugins/org.argeo.demo.i18n/properties/plugin_fr.properties b/demo/plugins/org.argeo.demo.i18n/properties/plugin_fr.properties deleted file mode 100644 index 2842f134e..000000000 --- a/demo/plugins/org.argeo.demo.i18n/properties/plugin_fr.properties +++ /dev/null @@ -1,9 +0,0 @@ - -## commands label -OpenDialog_Label=Ouvrir une fenêtre de dialogue - -## View, perspective and editor labels -I18nDemoPerspective_Name=Demo - Internationalisation -SimpleTreeView_Name=Simple vue en arbre -SimpleMultitabEditor_Name=Simple editeur à onglets multiples. -LocaleSettingsPage_Title=Gérer les informations de localisation \ No newline at end of file diff --git a/demo/plugins/org.argeo.demo.i18n/src/main/java/org/argeo/demo/i18n/I18nDemoConstants.java b/demo/plugins/org.argeo.demo.i18n/src/main/java/org/argeo/demo/i18n/I18nDemoConstants.java deleted file mode 100644 index 50cff5836..000000000 --- a/demo/plugins/org.argeo.demo.i18n/src/main/java/org/argeo/demo/i18n/I18nDemoConstants.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2007-2012 Mathieu Baudier - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.argeo.demo.i18n; - -/** Constants used across the application. */ -public interface I18nDemoConstants { - public final static String PARAM_REPOSITORY_URI = "org.argeo.jcr.ui.explorer.repositoryUri"; - - /* - * MISCEALLENEOUS - */ - public final static String DATE_TIME_FORMAT = "dd/MM/yyyy, HH:mm"; - - public final static String PARAM_PATH = "org.argeo.jcr.ui.explorer.nodePath"; - -} diff --git a/demo/plugins/org.argeo.demo.i18n/src/main/java/org/argeo/demo/i18n/I18nDemoMessages.java b/demo/plugins/org.argeo.demo.i18n/src/main/java/org/argeo/demo/i18n/I18nDemoMessages.java deleted file mode 100644 index a04a8b2fb..000000000 --- a/demo/plugins/org.argeo.demo.i18n/src/main/java/org/argeo/demo/i18n/I18nDemoMessages.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2007-2012 Mathieu Baudier - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.argeo.demo.i18n; - -import org.eclipse.osgi.util.NLS; - -/** - * Centralizes all internationalized labels accross current application. - * Supports both RAP and RCP thanks to the NLSHelper. NOTE that the - * corresponding NLSHelperImpl must be available. - * - * thanks to {@link http - * ://eclipsesource.com/en/info/rcp-rap-single-sourcing-guideline/} - */ -public class I18nDemoMessages extends NLS { - - private static final String BUNDLENAME = I18nDemoPlugin.ID + ".messages"; // $NON-NLS−1$ - - // Errors & warnings - public String OpenDialog_Title; - public String OpenDialog_Message; - - // Commands - - // Editor - public String SimpleMultitabEditor_MultiSectionPageTitle; - public String SimpleMultitabEditor_SimplePageTitle; - - // Pages - public String MultiSectionPage_DescriptionSectionTitle; - public String MultiSectionPage_DescriptionSectionTxt; - public String MultiSectionPage_DetailsSectionTitle; - public String MultiSectionPage_PopupTitle; - public String MultiSectionPage_PopupText; - public String SimplePage_DescriptionTxt; - - // Buttons - public String MultiSectionPage_Btn1Lbl; - public String MultiSectionPage_Btn2Lbl; - public String MultiSectionPage_Btn3Lbl; - - // Code that enable handling of concurrent multi sessions locales - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLENAME, I18nDemoMessages.class); - } - - private I18nDemoMessages() { - } - - public static I18nDemoMessages get() { - return (I18nDemoMessages) NLSHelper.getMessages(BUNDLENAME, - I18nDemoMessages.class); - } -} diff --git a/demo/plugins/org.argeo.demo.i18n/src/main/java/org/argeo/demo/i18n/I18nDemoPerspective.java b/demo/plugins/org.argeo.demo.i18n/src/main/java/org/argeo/demo/i18n/I18nDemoPerspective.java deleted file mode 100644 index a058c33eb..000000000 --- a/demo/plugins/org.argeo.demo.i18n/src/main/java/org/argeo/demo/i18n/I18nDemoPerspective.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2007-2012 Mathieu Baudier - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.argeo.demo.i18n; - -import org.argeo.demo.i18n.views.SimpleTreeView; -import org.eclipse.ui.IFolderLayout; -import org.eclipse.ui.IPageLayout; -import org.eclipse.ui.IPerspectiveFactory; - -/** Base perspective for JcrExplorer browser */ -public class I18nDemoPerspective implements IPerspectiveFactory { - - public void createInitialLayout(IPageLayout layout) { - layout.setEditorAreaVisible(true); - - IFolderLayout upperLeft = layout.createFolder(I18nDemoPlugin.ID - + ".upperLeft", IPageLayout.LEFT, 0.4f, layout.getEditorArea()); - upperLeft.addView(SimpleTreeView.ID); - } -} diff --git a/demo/plugins/org.argeo.demo.i18n/src/main/java/org/argeo/demo/i18n/I18nDemoPlugin.java b/demo/plugins/org.argeo.demo.i18n/src/main/java/org/argeo/demo/i18n/I18nDemoPlugin.java deleted file mode 100644 index 849fdc1c4..000000000 --- a/demo/plugins/org.argeo.demo.i18n/src/main/java/org/argeo/demo/i18n/I18nDemoPlugin.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2007-2012 Mathieu Baudier - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.argeo.demo.i18n; - -import java.util.ResourceBundle; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class I18nDemoPlugin extends AbstractUIPlugin { - private final static Log log = LogFactory.getLog(I18nDemoPlugin.class); - private ResourceBundle messages; - - // The plug-in ID - public static final String ID = "org.argeo.demo.i18n"; //$NON-NLS-1$ - - // The shared instance - private static I18nDemoPlugin plugin; - - /** - * The constructor - */ - public I18nDemoPlugin() { - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext - * ) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - messages = ResourceBundle.getBundle(ID + ".messages"); - // messages = ResourceBundle.getBundle(ID + ".messages", currentLocale); - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext - * ) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static I18nDemoPlugin getDefault() { - return plugin; - } - - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(ID, path); - } - - /** Returns the internationalized label for the given key */ - public static String getMessage(String key) { - try { - return getDefault().messages.getString(key); - } catch (NullPointerException npe) { - log.warn(key + " not found."); - return key; - } - } - - /** - * Gives access to the internationalization message bundle. Returns null in - * case the ClientUiPlugin is not started (for JUnit tests, by instance) - */ - public static ResourceBundle getMessagesBundle() { - if (getDefault() != null) - // To avoid NPE - return getDefault().messages; - else - return null; - } -} \ No newline at end of file diff --git a/demo/plugins/org.argeo.demo.i18n/src/main/java/org/argeo/demo/i18n/ImplementationLoader.java b/demo/plugins/org.argeo.demo.i18n/src/main/java/org/argeo/demo/i18n/ImplementationLoader.java deleted file mode 100644 index dc3083026..000000000 --- a/demo/plugins/org.argeo.demo.i18n/src/main/java/org/argeo/demo/i18n/ImplementationLoader.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2007-2012 Mathieu Baudier - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.argeo.demo.i18n; - -import java.text.MessageFormat; - -/** - * This class enable single sourcing between RAP and RCP. For this to run - * correctly, following conventions must be respected: - *