+++ /dev/null
-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
+++ /dev/null
-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
+++ /dev/null
-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
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con"
- path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6/>
- <classpathentry kind="con"
- path="org.eclipse.pde.core.requiredPlugins" />
- <classpathentry kind="src" path="src/main/java" />
- <classpathentry kind="output" path="target/classes" />
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.demo.i18n.rap</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
\ No newline at end of file
+++ /dev/null
-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"
+++ /dev/null
-source.. = src/main/java/,\
-output.. = target/classes/
-bin.includes = META-INF/,\
- .
+++ /dev/null
-<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/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.commons.demo</groupId>
- <version>0.3.5-SNAPSHOT</version>
- <artifactId>plugins</artifactId>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.demo.i18n.rap</artifactId>
- <name>Commons Internationalization Demo RAP</name>
- <dependencies>
- <dependency>
- <groupId>org.argeo.commons.demo</groupId>
- <artifactId>org.argeo.demo.i18n</artifactId>
- <version>0.3.5-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.argeo.commons.eclipse</groupId>
- <artifactId>org.argeo.eclipse.ui.rap</artifactId>
- <version>0.3.5-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.argeo.commons.eclipse</groupId>
- <artifactId>org.argeo.eclipse.dep.rap</artifactId>
- <version>0.3.5-SNAPSHOT</version>
- </dependency>
- </dependencies>
-</project>
+++ /dev/null
-/*
- * 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);
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con"
- path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6/>
- <classpathentry kind="con"
- path="org.eclipse.pde.core.requiredPlugins" />
- <classpathentry kind="src" path="src/main/java" />
- <classpathentry kind="output" path="target/classes" />
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.demo.i18n.rcp</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
\ No newline at end of file
+++ /dev/null
-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
+++ /dev/null
-source.. = src/main/java/,\
-output.. = target/classes/
-bin.includes = META-INF/,\
- .
\ No newline at end of file
+++ /dev/null
-<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/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.commons.demo</groupId>
- <version>0.3.5-SNAPSHOT</version>
- <artifactId>plugins</artifactId>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.demo.i18n.rcp</artifactId>
- <name>Commons Internationalization Demo RCP</name>
- <dependencies>
- <dependency>
- <groupId>org.argeo.commons.demo</groupId>
- <artifactId>org.argeo.demo.i18n</artifactId>
- <version>0.3.5-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.argeo.commons.eclipse</groupId>
- <artifactId>org.argeo.eclipse.ui.rcp</artifactId>
- <version>0.3.5-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.argeo.commons.eclipse</groupId>
- <artifactId>org.argeo.eclipse.dep.rcp</artifactId>
- <version>0.3.5-SNAPSHOT</version>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
+++ /dev/null
-/*
- * 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;
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>>>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/main/resources"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.demo.i18n</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
\ No newline at end of file
+++ /dev/null
-#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
+++ /dev/null
-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
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd">
-</beans>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
- xmlns:p="http://www.springframework.org/schema/p"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
-
- <bean id="simpleMultitabEditor" class="org.argeo.demo.i18n.editors.SimpleMultitabEditor"
- scope="prototype">
- </bean>
-
- <!-- Preferences -->
- <bean id="localeSettingsPage" class="org.argeo.demo.i18n.preferences.LocaleSettingsPage"
- scope="prototype">
- <!-- TODO: internationalize -->
- <property name="description"
- value="A demonstration of a preference page implementation" />
- <property name="preferenceStore" ref="jcrPreferenceStore" />
- </bean>
-
-</beans>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
- xmlns:p="http://www.springframework.org/schema/p"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
-
- <bean id="nodeSession" class="org.argeo.jcr.spring.ThreadBoundSession">
- <property name="repository" ref="nodeRepository" />
- </bean>
-
- <bean id="jcrPreferenceStore" init-method="init"
- class="org.argeo.eclipse.ui.jcr.JcrPreferenceStore" scope="prototype">
- <property name="session" ref="nodeSession" />
- <property name="bundleContext" ref="bundleContext" />
- </bean>
-
- <!-- <bean id="jcrKeyring" class="org.argeo.jcr.security.JcrKeyring"> -->
- <!-- <property name="session" ref="nodeSession" /> -->
- <!-- <property name="defaultCallbackHandler" ref="defaultCallbackHandler"
- /> -->
- <!-- </bean> -->
-
-</beans>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
- xmlns:osgi="http://www.springframework.org/schema/osgi"\r
- xsi:schemaLocation="http://www.springframework.org/schema/osgi \r
- http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
- http://www.springframework.org/schema/beans \r
- http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"\r
- osgi:default-timeout="30000">\r
-\r
- <reference id="nodeRepository" interface="javax.jcr.Repository"\r
- filter="(argeo.jcr.repository.alias=node)" />\r
-\r
-</beans:beans>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd">
- <!-- Views -->
- <bean id="simpleTreeView" class="org.argeo.demo.i18n.views.SimpleTreeView"
- scope="prototype">
- </bean>
-</beans>
+++ /dev/null
-source.. = src/main/java/,\
- src/main/resources
-output.. = target/classes/
-bin.includes = META-INF/,\
- properties/,\
- .,\
- plugin.xml
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <!-- Perspectives -->
- <extension
- point="org.eclipse.ui.perspectives">
- <perspective
- class="org.argeo.demo.i18n.I18nDemoPerspective"
- icon="icons/i18n.gif"
- id="org.argeo.demo.i18n.perspective"
- name="%I18nDemoPerspective_Name">
- </perspective>
- </extension>
- <!-- Views -->
- <extension
- point="org.eclipse.ui.views">
- <view
- class="org.argeo.eclipse.spring.SpringExtensionFactory"
- icon="icons/browser.gif"
- id="org.argeo.demo.i18n.simpleTreeView"
- name="%SimpleTreeView_Name">
- </view>
- </extension>
- <!-- Editors -->
- <extension
- point="org.eclipse.ui.editors">
- <editor
- class="org.argeo.eclipse.spring.SpringExtensionFactory"
- id="org.argeo.demo.i18n.simpleMultitabEditor"
- name="%SimpleMultitabEditor_Name"
- icon="icons/i18n.gif"
- default="false">
- </editor>
- </extension>
- <!-- Commands -->
- <extension
- point="org.eclipse.ui.commands">
- <command
- defaultHandler="org.argeo.demo.i18n.commands.OpenDialog"
- id="org.argeo.demo.i18n.openDialog"
- name="This name should not be displayed - check plugin.xml">
- </command>
- </extension>
-
- <!-- Menus -->
- <extension point="org.eclipse.ui.menus">
- <menuContribution
- locationURI="popup:org.argeo.demo.i18n.simpleTreeView">
- <command
- commandId="org.argeo.demo.i18n.openDialog"
- style="push"
- label="%OpenDialog_Label">
- </command>
- </menuContribution>
- </extension>
-
- <!-- Core expression definition -->
- <extension
- point="org.eclipse.core.expressions.definitions">
- <definition
- id="expression.onlyOneItemSelected">
- <with
- variable="activeMenuSelection">
- <count
- value="1">
- </count>
- </with>
- </definition>
- </extension>
- <!-- Preferences -->
- <extension
- point="org.eclipse.ui.preferencePages">
- <page
- class="org.argeo.eclipse.spring.SpringExtensionFactory"
- id="org.argeo.demo.i18n.localeSettingsPage"
- name="%LocaleSettingsPage_Title">
- </page>
- </extension>
- <!-- Activities -->
- <extension
- point="org.eclipse.ui.activities">
- <activity
- description="Only for admins"
- id="org.argeo.jcr.ui.explorer.adminActivity"
- name="Admin">
- <enabledWhen>
- <with variable="roles">
- <iterate ifEmpty="false" operator="or">
- <equals value="ROLE_ADMIN" />
- </iterate>
- </with>
- </enabledWhen>
- </activity>
- <!-- TODO: find a way to exclude everything -->
- <activityPatternBinding
- activityId="org.argeo.jcr.ui.explorer.adminActivity"
- isEqualityPattern="true"
- pattern="org.argeo.jcr.ui.explorer/org.argeo.jcr.ui.explorer.perspective">
- </activityPatternBinding>
- </extension>
-</plugin>
+++ /dev/null
-<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/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.commons.demo</groupId>
- <version>0.3.5-SNAPSHOT</version>
- <artifactId>plugins</artifactId>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.demo.i18n</artifactId>
- <name>Commons Internationalization Demo</name>
- <dependencies>
- <dependency>
- <groupId>org.argeo.commons.eclipse</groupId>
- <artifactId>org.argeo.eclipse.dep.common</artifactId>
- <version>0.3.5-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.argeo.commons.eclipse</groupId>
- <artifactId>org.argeo.eclipse.ui</artifactId>
- <version>0.3.5-SNAPSHOT</version>
- </dependency>
-
- <!-- Eclipse - Only used at compile time. so that it is compatible with
- RCP runtime -->
- <dependency>
- <groupId>org.argeo.commons.eclipse</groupId>
- <artifactId>org.argeo.eclipse.ui.rap</artifactId>
- <version>0.3.5-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.argeo.commons.eclipse</groupId>
- <artifactId>org.argeo.eclipse.dep.rap</artifactId>
- <version>0.3.5-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- RCP only dependency, needed at compile time -->
- <!-- <dependency> <groupId>org.argeo.commons.eclipse</groupId> <artifactId>org.argeo.eclipse.dep.rcp</artifactId>
- <version>0.3.4-SNAPSHOT</version> <scope>provided</scope> </dependency> <dependency>
- <groupId>org.argeo.commons.eclipse</groupId> <artifactId>org.argeo.eclipse.ui.rcp</artifactId>
- <version>0.3.4-SNAPSHOT</version> <scope>provided</scope> </dependency> -->
- </dependencies>
-</project>
+++ /dev/null
-
-## 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
+++ /dev/null
-
-## 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
+++ /dev/null
-/*
- * 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";
-
-}
+++ /dev/null
-/*
- * 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);
- }
-}
+++ /dev/null
-/*
- * 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);
- }
-}
+++ /dev/null
-/*
- * 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
+++ /dev/null
-/*
- * 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:
- * <ul>
- * <li>Given the fact that a common interface named Xxx is defined in package
- * aa.bb.cc, corresponding implementation named XxxImpl must be found in package
- * aa.bb.cc.specific of both RAP and RCP UI bundles.
- *
- * thanks to {@link http
- * ://eclipsesource.com/en/info/rcp-rap-single-sourcing-guideline/}, chapter 7
- */
-
-public class ImplementationLoader {
- // private final static Log log = LogFactory
- // .getLog(ImplementationLoader.class);
-
- public static Object newInstance(
- @SuppressWarnings("rawtypes") final Class type) {
- String name = type.getName();
- // manually construct the implementation name for the given interface,
- // assuming that convention have been respected.
- String cName = type.getCanonicalName();
- String pName = cName.substring(0, cName.lastIndexOf('.') + 1);
- String sName = cName.substring(cName.lastIndexOf('.') + 1);
- String implName = pName + "specific." + sName + "Impl";
- // String implName = cName + "Impl";
- Object result = null;
- try {
- result = type.getClassLoader().loadClass(implName).newInstance();
- } catch (Throwable throwable) {
- String txt = "Could not load implementation for {0}";
- String msg = MessageFormat.format(txt, new Object[] { name });
- throw new RuntimeException(msg, throwable);
- }
- return result;
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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;
-
-/**
- * thanks to {@link http
- * ://eclipsesource.com/en/info/rcp-rap-single-sourcing-guideline/}
- */
-public abstract class NLSHelper {
- private final static NLSHelper IMPL;
-
- static {
- IMPL = (NLSHelper) ImplementationLoader.newInstance(NLSHelper.class);
- }
-
- public static NLS getMessages(String bundleName,
- @SuppressWarnings("rawtypes") Class clazz) {
- return (NLS) IMPL.internalGetMessages(bundleName, clazz);
- }
-
- protected abstract Object internalGetMessages(String bundleName,
- @SuppressWarnings("rawtypes") Class clazz);
-}
+++ /dev/null
-/*
- * 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.commands;
-
-import org.argeo.demo.i18n.I18nDemoMessages;
-import org.argeo.demo.i18n.I18nDemoPlugin;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.MessageBox;
-
-/**
- * Open a dummy dialog box with internationalized messages.
- */
-public class OpenDialog extends AbstractHandler {
-
- public final static String ID = I18nDemoPlugin.ID + ".openDialog";
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
-
- MessageBox mb = new MessageBox(I18nDemoPlugin.getDefault()
- .getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.OK
- | SWT.CANCEL);
-
- // Title
- mb.setText(I18nDemoMessages.get().OpenDialog_Title);
-
- // Message
- mb.setMessage(I18nDemoMessages.get().OpenDialog_Message);
- mb.open();
-
- return null;
- }
-}
+++ /dev/null
-/*
- * 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.editors;
-
-import org.argeo.demo.i18n.I18nDemoMessages;
-import org.argeo.demo.i18n.I18nDemoPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.MessageBox;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.AbstractFormPart;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.forms.widgets.TableWrapData;
-
-/**
- * Offers two main sections : one to display a text area with a summary of all
- * variations between a version and its predecessor and one tree view that
- * enable browsing
- * */
-public class MultiSectionPage extends FormPage {
- // private final static Log log = LogFactory.getLog(MultiSectionPage.class);
-
- // this page UI components
- private FormToolkit tk;
-
- public MultiSectionPage(FormEditor editor, String title) {
- super(editor, "MultiSectionPage", title);
- }
-
- protected void createFormContent(IManagedForm managedForm) {
- ScrolledForm form = managedForm.getForm();
- tk = managedForm.getToolkit();
- GridLayout twt = new GridLayout(1, false);
- twt.marginWidth = twt.marginHeight = 5;
- Composite body = form.getBody();
- body.setLayout(twt);
-
- createDetailsSection(form.getBody());
- createDescriptionSection(form.getBody());
- }
-
- protected void createDescriptionSection(Composite parent) {
- // Section Layout & MetaData
- Section section = tk.createSection(parent, Section.TWISTIE);
- section.setLayoutData(new GridData(GridData.FILL_BOTH));
- section.setText(I18nDemoMessages.get().MultiSectionPage_DescriptionSectionTitle);
-
- // Section Body
- Composite body = tk.createComposite(section, SWT.FILL);
- // WARNING : 2 following lines are compulsory or body won't be
- // displayed.
- body.setLayout(new GridLayout());
- section.setClient(body);
-
- body.setLayoutData(new GridData(GridData.FILL_BOTH));
- section.setExpanded(true);
-
- // button line
- Button b1 = new Button(body, SWT.PUSH | SWT.FILL);
- b1.setText(I18nDemoMessages.get().MultiSectionPage_Btn1Lbl);
- Button b2 = new Button(body, SWT.PUSH | SWT.FILL);
- b2.setText(I18nDemoMessages.get().MultiSectionPage_Btn2Lbl);
- Button b3 = new Button(body, SWT.PUSH | SWT.FILL);
- b3.setText(I18nDemoMessages.get().MultiSectionPage_Btn3Lbl);
-
- addAListener(b1);
- addAListener(b2);
- addAListener(b3);
- }
-
- private void addAListener(Button b) {
- b.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- MessageBox mb = new MessageBox(I18nDemoPlugin.getDefault()
- .getWorkbench().getActiveWorkbenchWindow().getShell(),
- SWT.OK);
- // Title
- mb.setText(I18nDemoMessages.get().MultiSectionPage_PopupTitle);
- // Message
- mb.setMessage(I18nDemoMessages.get().MultiSectionPage_PopupText);
- mb.open();
- }
- });
- }
-
- protected void createDetailsSection(Composite parent) {
-
- // Section Layout
- Section section = tk.createSection(parent, Section.TWISTIE);
- section.setLayoutData(new GridData(TableWrapData.FILL_GRAB));
- GridLayout gd = new GridLayout();
- section.setLayout(gd);
-
- // Set title of the section
- section.setText(I18nDemoMessages.get().MultiSectionPage_DetailsSectionTitle);
-
- final Text styledText = tk.createText(section, "", SWT.FULL_SELECTION
- | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
- styledText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- styledText.setEditable(false);
- styledText
- .setText(I18nDemoMessages.get().MultiSectionPage_DescriptionSectionTxt);
- section.setExpanded(false);
-
- section.setClient(styledText);
-
- AbstractFormPart part = new AbstractFormPart() {
- public void commit(boolean onSave) {
- }
-
- public void refresh() {
- super.refresh();
- }
- };
- getManagedForm().addPart(part);
- }
-
- @Override
- public void setActive(boolean active) {
- super.setActive(active);
- }
-}
+++ /dev/null
-/*
- * 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.editors;
-
-import org.argeo.ArgeoException;
-import org.argeo.demo.i18n.I18nDemoMessages;
-import org.argeo.demo.i18n.I18nDemoPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.forms.editor.FormEditor;
-
-/**
- *
- * Container for the node editor page. At creation time, it takes a JCR Node
- * that cannot be changed afterwards.
- *
- */
-public class SimpleMultitabEditor extends FormEditor {
-
- // private final static Log log = LogFactory
- // .getLog(SimpleMultitabEditor.class);
- public final static String ID = I18nDemoPlugin.ID + ".simpleMultitabEditor";
-
- private SimplePage simplePage;
- private MultiSectionPage multiSectionPage;
-
- public void init(IEditorSite site, IEditorInput input)
- throws PartInitException {
- super.init(site, input);
- // this.setPartName("Internationalized editor part name");
- }
-
- @Override
- protected void addPages() {
- try {
- simplePage = new SimplePage(this,
- I18nDemoMessages.get().SimpleMultitabEditor_SimplePageTitle);
- addPage(simplePage);
-
- multiSectionPage = new MultiSectionPage(
- this,
- I18nDemoMessages.get().SimpleMultitabEditor_MultiSectionPageTitle);
- addPage(multiSectionPage);
-
- } catch (PartInitException e) {
- throw new ArgeoException("Not able to add an empty page ", e);
- }
- }
-
- @Override
- public void doSaveAs() {
- // unused compulsory method
- }
-
- @Override
- public void doSave(IProgressMonitor monitor) {
- try {
- // Automatically commit all pages of the editor
- commitPages(true);
- firePropertyChange(PROP_DIRTY);
- } catch (Exception e) {
- throw new ArgeoException("Error while saving node", e);
- }
-
- }
-
- @Override
- public boolean isSaveAsAllowed() {
- return true;
- }
-}
+++ /dev/null
-/*
- * 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.editors;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPersistableElement;
-
-/**
- * An editor input based the object name.
- * */
-
-public class SimpleMultitabEditorInput implements IEditorInput {
-
- private final String name;
-
- public SimpleMultitabEditorInput(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
- return null;
- }
-
- public boolean exists() {
- return true;
- }
-
- public ImageDescriptor getImageDescriptor() {
- return null;
- }
-
- public IPersistableElement getPersistable() {
- return null;
- }
-
- /**
- * equals method based on the name
- */
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
-
- SimpleMultitabEditorInput other = (SimpleMultitabEditorInput) obj;
- if (!getName().equals(other.getName()))
- return false;
- return true;
- }
-
- @Override
- public String getToolTipText() {
- return name;
- }
-}
+++ /dev/null
-/*
- * 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.editors;
-
-import org.argeo.demo.i18n.I18nDemoMessages;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.forms.AbstractFormPart;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-
-/**
- * Main node editor page. Lists all properties of the current node and enable
- * access and editing for some of them.
- */
-
-public class SimplePage extends FormPage {
- // private final static Log log = LogFactory.getLog(SimplePage.class);
-
- // Utils
- // protected DateFormat timeFormatter = new
- // SimpleDateFormat(DATE_TIME_FORMAT);
-
- // This page widgets
- private FormToolkit tk;
-
- // private List<Control> modifyableProperties = new ArrayList<Control>();
-
- public SimplePage(FormEditor editor, String title) {
- super(editor, "id", title);
- }
-
- protected void createFormContent(IManagedForm managedForm) {
- tk = managedForm.getToolkit();
- ScrolledForm form = managedForm.getForm();
- GridLayout twt = new GridLayout(3, false);
- twt.marginWidth = twt.marginHeight = 5;
-
- form.getBody().setLayout(twt);
- createPropertiesPart(form.getBody());
- }
-
- private void createPropertiesPart(Composite parent) {
- // Initializes form part
- tk.createLabel(parent, I18nDemoMessages.get().SimplePage_DescriptionTxt);
- AbstractFormPart part = new AbstractFormPart() {
- public void commit(boolean onSave) {
- if (onSave) {
-
- // We only commit when onSave = true,
- // thus it is still possible to save after a tab
- // change.
- super.commit(onSave);
- }
- }
- };
-
- getManagedForm().addPart(part);
-
- }
-
- //
- // LISTENERS
- //
- /*
- * UNUSED FOR THE TIME BEING private class ModifiedFieldListener implements
- * ModifyListener {
- *
- * private AbstractFormPart formPart;
- *
- * public ModifiedFieldListener(AbstractFormPart generalPart) {
- * this.formPart = generalPart; }
- *
- * public void modifyText(ModifyEvent e) { formPart.markDirty(); } }
- */
-}
+++ /dev/null
-/*
- * 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.model;
-
-import org.argeo.eclipse.ui.TreeParent;
-
-public class Place extends TreeParent {
-
- private String description;
- private String address;
-
- public Place(String name, String description, String address) {
- super(name);
- this.description = description;
- this.address = address;
- }
-
- public void setAddress(String adress) {
- this.address = adress;
- }
-
- public String getAdress() {
- return address;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getDescription() {
- return description;
- }
-}
+++ /dev/null
-/*
- * 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.preferences;
-
-import org.eclipse.jface.preference.BooleanFieldEditor;
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.RadioGroupFieldEditor;
-import org.eclipse.jface.preference.StringFieldEditor;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-
-public class LocaleSettingsPage extends FieldEditorPreferencePage implements
- IWorkbenchPreferencePage {
-
- public LocaleSettingsPage() {
- super(GRID);
- }
-
- public void createFieldEditors() {
- addField(new BooleanFieldEditor("BOOLEAN_VALUE",
- "&An example of a boolean preference", getFieldEditorParent()));
-
- addField(new RadioGroupFieldEditor("CHOICE",
- "An example of a multiple-choice preference", 1,
- new String[][] { { "&Choice 1", "choice1" },
- { "C&hoice 2", "choice2" } }, getFieldEditorParent()));
- addField(new StringFieldEditor("locale", "Chosen locale",
- getFieldEditorParent()));
- addField(new StringFieldEditor("MySTRING2", "A &text preference:",
- getFieldEditorParent()));
- }
-
- @Override
- public void init(IWorkbench workbench) {
- }
-
-}
+++ /dev/null
-/*
- * 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.providers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.argeo.demo.i18n.model.Place;
-import org.argeo.eclipse.ui.TreeParent;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Implementation of the {@code ITreeContentProvider} to display multiple
- * repository environment in a tree like structure
- *
- */
-public class SimpleContentProvider implements ITreeContentProvider {
- // private final static Log log =
- // LogFactory.getLog(SimpleContentProvider.class);
-
- public SimpleContentProvider() {
- }
-
- /**
- * Sends back the first level of the Tree. Independent from inputElement
- * that can be null. Values are hard coded here.
- */
- public Object[] getElements(Object inputElement) {
- List<Object> objs = new ArrayList<Object>();
- objs.add(new Place("Home", "My house, my family",
- "12 rue du bac, Paris"));
- objs.add(new Place("Office", "Where I work",
- "100 av des champs Elysées"));
- objs.add(new Place("School",
- "The place where the children spend their days",
- "103 Avenue montaigne, Paris"));
- return objs.toArray();
- }
-
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof TreeParent)
- return ((TreeParent) parentElement).getChildren();
- else {
- return new Object[0];
- }
- }
-
- public Object getParent(Object element) {
- if (element instanceof TreeParent) {
- return ((TreeParent) element).getParent();
- } else
- return null;
- }
-
- public boolean hasChildren(Object element) {
- if (element instanceof TreeParent) {
- TreeParent tp = (TreeParent) element;
- return tp.hasChildren();
- }
- return false;
- }
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-}
+++ /dev/null
-/*
- * 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.providers;
-
-import org.argeo.demo.i18n.model.Place;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-public class SimpleLabelProvider extends ColumnLabelProvider {
- public String getText(Object element) {
- if (element instanceof Place) {
- Place place = (Place) element;
- return place.getName();
- } else
- return element.toString();
- }
-
- @Override
- public Image getImage(Object element) {
- return null;
- }
-}
+++ /dev/null
-/*
- * 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.utils;
-
-import org.argeo.ArgeoException;
-import org.argeo.demo.i18n.I18nDemoPlugin;
-import org.argeo.demo.i18n.editors.SimpleMultitabEditor;
-import org.argeo.demo.i18n.editors.SimpleMultitabEditorInput;
-import org.argeo.eclipse.ui.TreeParent;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.ui.PartInitException;
-
-/**
- * Centralizes the management of double click on a NodeTreeViewer
- */
-public class GenericDoubleClickListener implements IDoubleClickListener {
-
- // private final static Log log = LogFactory
- // .getLog(GenericDoubleClickListener.class);
-
- // private TreeViewer treeViewer;
-
- public GenericDoubleClickListener(TreeViewer treeViewer) {
- // this.treeViewer = treeViewer;
- }
-
- public void doubleClick(DoubleClickEvent event) {
- Object obj = ((IStructuredSelection) event.getSelection())
- .getFirstElement();
- if (obj instanceof TreeParent) {
- try {
- TreeParent tp = (TreeParent) obj;
- // open an editor
- SimpleMultitabEditorInput smei = new SimpleMultitabEditorInput(
- tp.getName());
- I18nDemoPlugin.getDefault().getWorkbench()
- .getActiveWorkbenchWindow().getActivePage()
- .openEditor(smei, SimpleMultitabEditor.ID);
- } catch (PartInitException pie) {
- throw new ArgeoException(
- "Unexpected exception while opening node editor", pie);
- }
- }
- // else do nothing
- }
-}
+++ /dev/null
-/*
- * 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.views;
-
-import org.argeo.demo.i18n.I18nDemoPlugin;
-import org.argeo.demo.i18n.providers.SimpleContentProvider;
-import org.argeo.demo.i18n.providers.SimpleLabelProvider;
-import org.argeo.demo.i18n.utils.GenericDoubleClickListener;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.part.ViewPart;
-
-/**
- * Basic View to display a tree with internationalized labels
- */
-
-public class SimpleTreeView extends ViewPart {
- // private final static Log log = LogFactory.getLog(SimpleTreeView.class);
- public final static String ID = I18nDemoPlugin.ID + ".simpleTreeView";
-
- // This page widgets
- private TreeViewer treeViewer;
- private SimpleContentProvider treeContentProvider;
-
- @Override
- public void createPartControl(Composite parent) {
- parent.setLayout(new FillLayout());
-
- // Creates the tree
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout gl = new GridLayout(1, false);
- composite.setLayout(gl);
-
- // tree viewer
- treeContentProvider = new SimpleContentProvider();
- treeViewer = createTreeViewer(composite, treeContentProvider);
-
- // context menu : it is completely defined in the plugin.xml file.
- MenuManager menuManager = new MenuManager();
- Menu menu = menuManager.createContextMenu(treeViewer.getTree());
- treeViewer.getTree().setMenu(menu);
- getSite().registerContextMenu(menuManager, treeViewer);
-
- getSite().setSelectionProvider(treeViewer);
-
- treeViewer.setInput(getViewSite());
- }
-
- protected TreeViewer createTreeViewer(Composite parent,
- final ITreeContentProvider treeContentProvider) {
-
- final TreeViewer tmpTreeViewer = new TreeViewer(parent, SWT.MULTI);
-
- tmpTreeViewer.getTree().setLayoutData(
- new GridData(SWT.FILL, SWT.FILL, true, true));
-
- tmpTreeViewer.setContentProvider(treeContentProvider);
- tmpTreeViewer.setLabelProvider(new SimpleLabelProvider());
- tmpTreeViewer
- .addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- // something can be done here
- }
- });
-
- tmpTreeViewer.addDoubleClickListener(new GenericDoubleClickListener(
- tmpTreeViewer));
- return tmpTreeViewer;
- }
-
- @Override
- public void setFocus() {
- // Do nothing for the time being.
- }
-}
+++ /dev/null
-## English_US labels for Argeo Internationalization demo application
-
-## Generic labels
-
-## Errors & warnings
-OpenDialog_Title=Dialog Popup
-OpenDialog_Message=This pop-up shows an internationalized message to the end user.
-
-## Commands
-
-## Editor
-SimpleMultitabEditor_MultiSectionPageTitle=More information
-SimpleMultitabEditor_SimplePageTitle=Base information
-
-## Pages
-MultiSectionPage_DescriptionSectionTitle=Description
-MultiSectionPage_DescriptionSectionTxt=This section displays an internationalized text description.
-MultiSectionPage_DetailsSectionTitle=Details
-MultiSectionPage_PopupTitle=Popup Title
-MultiSectionPage_PopupText=Current window has been open thanks to a button.
-
-SimplePage_DescriptionTxt=This editor does nothing. It's just here to present all widgets' Ui that can be internationalized with i18n mecanisms.
-
-## Buttons
-MultiSectionPage_Btn1Lbl=First button
-MultiSectionPage_Btn2Lbl=Second button
-MultiSectionPage_Btn3Lbl=Third button
-
-## Dummy ones
-testLbl=Internationalizations of messages seems to work properly.
+++ /dev/null
-## French_FR labels for Argeo Internationalization demo application
-
-## Generic labels
-
-## Errors & warnings
-OpenDialog_Title=Pop-up de dialogue
-OpenDialog_Message=Cette fenêtre montre un message internationalisé.
-
-## Commands
-
-## Editor
-SimpleMultitabEditor_MultiSectionPageTitle=Plus d'informations
-SimpleMultitabEditor_SimplePageTitle=Informations de base
-## Pages
-MultiSectionPage_DescriptionSectionTitle=Description
-MultiSectionPage_DescriptionSectionTxt=Cette section contient une description internationalisée.
-MultiSectionPage_DetailsSectionTitle=Détails
-MultiSectionPage_PopupTitle=Titre de la fenêtre
-MultiSectionPage_PopupText=Cette fenêtre a été ouverte par un bouton
-
-SimplePage_DescriptionTxt=Cet éditeur ne fait rien, il permet juste de présenter l'ensemble des éléments d'UI internationalisable via les mécanisme i18n d'Eclipse.
-
-
-## Buttons
-MultiSectionPage_Btn1Lbl=Premier bouton
-MultiSectionPage_Btn2Lbl=Deuxième bouton
-MultiSectionPage_Btn3Lbl=Troisième bouton
-
-## Dummy ones
-testLbl=L'internationnalisation des messages semble fonctionner correctement.
+++ /dev/null
-<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/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.commons</groupId>
- <version>0.3.5-SNAPSHOT</version>
- <artifactId>demo</artifactId>
- <relativePath>..</relativePath>
- </parent>
- <groupId>org.argeo.commons.demo</groupId>
- <artifactId>plugins</artifactId>
- <name>Commons Demo Eclipse Plugins</name>
- <packaging>pom</packaging>
- <modules>
- <module>org.argeo.demo.i18n</module>
- <module>org.argeo.demo.i18n.rap</module>
- <module>org.argeo.demo.i18n.rcp</module>
- </modules>
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <directory>.</directory>
- <includes>
- <include>plugin.xml</include>
- <include>META-INF/**</include>
- <include>icons/**</include>
- </includes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <configuration>
- <!-- Prevents source jars to contain misleading data -->
- <excludes>
- <exclude>plugin.xml</exclude>
- <exclude>META-INF/MANIFEST.MF</exclude>
- </excludes>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-</project>
<artifactId>demo</artifactId>
<name>Commons Demo</name>
<packaging>pom</packaging>
- <modules>
+<!-- <modules>
<module>plugins</module>
- </modules>
+ </modules> -->
</project>
\ No newline at end of file