| author | Antje Fuhrmann | 2012-11-06 03:50:36 (EST) |
|---|---|---|
| committer | Sven Rottstock | 2012-11-06 03:50:36 (EST) |
| commit | 8d4c33a06f6ab7306b6507a731adf037b3b208b3 (patch) (side-by-side diff) | |
| tree | 4fbbc35d25cb06c6ad220aa52cda0fd26914bf31 | |
| parent | 6741c542ca3ff14aba8d6a3041def75f2cfd7605 (diff) | |
| download | org.eclipse.stardust.ide-8d4c33a06f6ab7306b6507a731adf037b3b208b3.zip org.eclipse.stardust.ide-8d4c33a06f6ab7306b6507a731adf037b3b208b3.tar.gz org.eclipse.stardust.ide-8d4c33a06f6ab7306b6507a731adf037b3b208b3.tar.bz2 | |
Jira-ID: CRNT-26711
All dialogs displayed when deploying model to the engine are not provided with Japanese translation (in 6.0.3, Japaense translation was provided, but not in 7.0.0)
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@60594 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
9 files changed, 109 insertions, 13 deletions
diff --git a/modeling/org.eclipse.stardust.modeling.common.projectnature/plugin.xml b/modeling/org.eclipse.stardust.modeling.common.projectnature/plugin.xml index f0a3e10..f2ffc4c 100644 --- a/modeling/org.eclipse.stardust.modeling.common.projectnature/plugin.xml +++ b/modeling/org.eclipse.stardust.modeling.common.projectnature/plugin.xml @@ -68,6 +68,10 @@ <classpathProvider class="org.eclipse.stardust.modeling.common.projectnature.classpath.CarnotToolClasspathProvider" id="org.eclipse.stardust.modeling.common.projectnature.carnotToolClasspathProvider"/> + <classpathProvider + class="org.eclipse.stardust.modeling.common.projectnature.classpath.DeployModelClasspathProvider" + id="org.eclipse.stardust.modeling.common.projectnature.deployModelClasspathProvider"> + </classpathProvider> </extension> </plugin> diff --git a/modeling/org.eclipse.stardust.modeling.common.projectnature/src/org/eclipse/stardust/modeling/common/projectnature/ModelingCoreActivator.java b/modeling/org.eclipse.stardust.modeling.common.projectnature/src/org/eclipse/stardust/modeling/common/projectnature/ModelingCoreActivator.java index f782cfd..f19a687 100644 --- a/modeling/org.eclipse.stardust.modeling.common.projectnature/src/org/eclipse/stardust/modeling/common/projectnature/ModelingCoreActivator.java +++ b/modeling/org.eclipse.stardust.modeling.common.projectnature/src/org/eclipse/stardust/modeling/common/projectnature/ModelingCoreActivator.java @@ -34,6 +34,8 @@ public class ModelingCoreActivator extends Plugin public static final String ID_CARNOT_TOOL_CP_PROVIDER = PLUGIN_ID + ".carnotToolClasspathProvider"; //$NON-NLS-1$ + public static final String ID_DEPLOY_MODEL_CP_PROVIDER = PLUGIN_ID + ".deployModelClasspathProvider"; //$NON-NLS-1$ + // The shared instance private static ModelingCoreActivator plugin; diff --git a/modeling/org.eclipse.stardust.modeling.common.projectnature/src/org/eclipse/stardust/modeling/common/projectnature/classpath/DeployModelClasspathProvider.java b/modeling/org.eclipse.stardust.modeling.common.projectnature/src/org/eclipse/stardust/modeling/common/projectnature/classpath/DeployModelClasspathProvider.java new file mode 100644 index 0000000..baa7821 --- a/dev/null +++ b/modeling/org.eclipse.stardust.modeling.common.projectnature/src/org/eclipse/stardust/modeling/common/projectnature/classpath/DeployModelClasspathProvider.java @@ -0,0 +1,49 @@ +package org.eclipse.stardust.modeling.common.projectnature.classpath;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.URIUtil;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.osgi.framework.Bundle;
+
+/**
+ * The ModelDeploymentTool is started within eclipse as an java application containing its
+ * own classpath. To provide internationalization of message property bundles containing
+ * in fragments of plugin org.eclipse.stardust.modeling.deploy.nl the src folders of
+ * these fragments have to be added to classpath.
+ *
+ */
+public class DeployModelClasspathProvider extends CarnotToolClasspathProvider
+{
+ private static final String SRC_FOLDER = "src";
+
+ private static final String MODELING_DEPLOY_NL_PLUGIN = "org.eclipse.stardust.modeling.deploy";
+
+ @Override
+ public IRuntimeClasspathEntry[] computeUnresolvedClasspath(
+ ILaunchConfiguration configuration) throws CoreException
+ {
+ Bundle deployBundle = Platform.getBundle(MODELING_DEPLOY_NL_PLUGIN);
+ List<IRuntimeClasspathEntry> entries = new ArrayList<IRuntimeClasspathEntry>(
+ Arrays.asList(super.computeUnresolvedClasspath(configuration)));
+ Bundle[] fragments = Platform.getFragments(deployBundle);
+ for (int i = 0; i < fragments.length; i++)
+ {
+ URI location = URI.create(fragments[i].getLocation() + SRC_FOLDER);
+ String schemeSpecificPart = location.getSchemeSpecificPart();
+ location = URI.create(schemeSpecificPart);
+ Path path = new Path(URIUtil.toFile(location).getAbsolutePath());
+ IRuntimeClasspathEntry entry = JavaRuntime.newArchiveRuntimeClasspathEntry(path);
+ entries.add(entry);
+ }
+ return (IRuntimeClasspathEntry[]) entries.toArray(new IRuntimeClasspathEntry[0]);
+ }
+}
diff --git a/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/DeployModelDialog.java b/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/DeployModelDialog.java index 119b95d..86a4b5d 100644 --- a/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/DeployModelDialog.java +++ b/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/DeployModelDialog.java @@ -241,4 +241,12 @@ public class DeployModelDialog extends AbstractDialog implements ActionListener showDialog(Deploy_Messages.getString("DIALOG_Model"), instance, parent); //$NON-NLS-1$
return instance.wasDeployed; } +
+ protected JPanel createButtonPanel()
+ {
+ JPanel buttonPanel = super.createButtonPanel();
+ okButton.setText(Deploy_Messages.getString("BUT_TXT_OK"));
+ cancelButton.setText(Deploy_Messages.getString("BUT_TXT_CANCEL"));
+ return buttonPanel;
+ }
}
\ No newline at end of file diff --git a/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/DeployUtil.java b/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/DeployUtil.java index 7c5158e..dd4358f 100644 --- a/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/DeployUtil.java +++ b/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/DeployUtil.java @@ -13,26 +13,31 @@ package org.eclipse.stardust.modeling.deploy; import java.io.UnsupportedEncodingException;
import java.text.MessageFormat;
import java.util.List; +import java.util.Locale;
+import java.util.StringTokenizer;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status; import org.eclipse.debug.core.*;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; +import org.eclipse.stardust.common.Base64;
+import org.eclipse.stardust.common.StringUtils;
+import org.eclipse.stardust.engine.core.model.xpdl.XpdlUtils;
import org.eclipse.stardust.modeling.common.projectnature.BpmProjectNature; import org.eclipse.stardust.modeling.common.projectnature.ModelingCoreActivator; import org.eclipse.stardust.modeling.common.projectnature.classpath.BpmCoreLibrariesClasspathContainer; import org.eclipse.stardust.modeling.common.projectnature.classpath.CarnotToolClasspathProvider; import org.eclipse.ui.PlatformUI; -import org.eclipse.stardust.common.Base64;
-import org.eclipse.stardust.common.StringUtils;
-import org.eclipse.stardust.engine.core.model.xpdl.XpdlUtils;
-
public class DeployUtil { + private static final String DUSER_REGION_ARG = " -Duser.region=";
+ private static final String DUSER_LANGUAGE_ARG = " -Duser.language=";
+
public static boolean deployModel(List<IResource> resources, String carnotHome, String carnotWork) { boolean deployed = false; @@ -42,7 +47,6 @@ public class DeployUtil try { IProject project = getCommonProject(resources); - ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); ILaunchConfigurationType type = manager .getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION); @@ -51,7 +55,7 @@ public class DeployUtil wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, project .getName()); wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, - ModelingCoreActivator.ID_CARNOT_TOOL_CP_PROVIDER); + ModelingCoreActivator.ID_DEPLOY_MODEL_CP_PROVIDER);
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, ModelDeploymentTool.class.getName()); // Activate if debugging deployment is needed. @@ -60,9 +64,9 @@ public class DeployUtil // String debug = // " -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000"; wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, - "-Xms50m -Xmx256m"); //$NON-NLS-1$
+ "-Xms50m -Xmx256m" + getLocaleArgs()); //$NON-NLS-1$
// "-Xms50m -Xmx256m" + debug); - +
boolean version = PlatformUI.getPreferenceStore().getBoolean(BpmProjectNature.PREFERENCE_DEPLOY_version); String realm = PlatformUI.getPreferenceStore().getString(BpmProjectNature.PREFERENCE_DEPLOY_realm); @@ -143,6 +147,31 @@ public class DeployUtil return deployed; } + private static String getLocaleArgs()
+ {
+ String nl = Platform.getNL();
+ StringBuilder localeJVMArg = new StringBuilder();
+ StringTokenizer tokenizer = new StringTokenizer(nl, "_"); //$NON-NLS-1$
+ int token = tokenizer.countTokens();
+ String language = Locale.getDefault().getLanguage();
+ String country = Locale.getDefault().getCountry();
+ if (token > 0)
+ {
+ language = tokenizer.nextToken();
+ country = tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null;
+ }
+
+ localeJVMArg.append(DUSER_LANGUAGE_ARG);
+ localeJVMArg.append(language);
+ if (StringUtils.isNotEmpty(country))
+ {
+ localeJVMArg.append(DUSER_REGION_ARG);
+ localeJVMArg.append(country);
+ }
+
+ return localeJVMArg.toString();
+ }
+
private static void addArgument(StringBuilder programAttributes, String name, String value, boolean encode, boolean separator) { @@ -184,4 +213,6 @@ public class DeployUtil } return project; } +
+
}
\ No newline at end of file diff --git a/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/Deploy_Messages.java b/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/Deploy_Messages.java index de7c088..273e665 100644 --- a/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/Deploy_Messages.java +++ b/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/Deploy_Messages.java @@ -17,18 +17,14 @@ public class Deploy_Messages {
private static final String BUNDLE_NAME = "org.eclipse.stardust.modeling.deploy.deploy-messages"; //$NON-NLS-1$
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
-
private Deploy_Messages()
{}
public static String getString(String key)
{
- // TODO Auto-generated method stub
try
{
- return RESOURCE_BUNDLE.getString(key);
+ return ResourceBundle.getBundle(BUNDLE_NAME).getString(key);
}
catch (MissingResourceException e)
{
diff --git a/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/ProgressDialog.java b/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/ProgressDialog.java index fbf7cc8..39dbf07 100644 --- a/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/ProgressDialog.java +++ b/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/ProgressDialog.java @@ -72,8 +72,10 @@ public class ProgressDialog extends AbstractDialog implements ActionListener if (null != okButton) { + okButton.setText(Deploy_Messages.getString("BUT_TXT_OK"));
okButton.setEnabled(false); } + cancelButton.setText(Deploy_Messages.getString("BUT_TXT_CANCEL"));
return buttonPanel; } diff --git a/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/deploy-messages.properties b/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/deploy-messages.properties index ef00bb0..70e052b 100644 --- a/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/deploy-messages.properties +++ b/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/deploy-messages.properties @@ -33,3 +33,5 @@ LBL_REALM=Realm: TITLE_LOGIN=Login
MSG_FIELD_NOT_EMPTY=Field must not be empty.
LBL_VALID_FROM=Valid from:
+BUT_TXT_OK=OK
+BUT_TXT_CANCEL=Cancel
diff --git a/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/deploy-messages_en.properties b/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/deploy-messages_en.properties index f051f95..82eaf2a 100644 --- a/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/deploy-messages_en.properties +++ b/modeling/org.eclipse.stardust.modeling.deploy/src/org/eclipse/stardust/modeling/deploy/deploy-messages_en.properties @@ -68,3 +68,5 @@ MSG_FIELD_NOT_EMPTY=Field must not be empty. # MSG_FIELD_NOT_EMPTY_en=Field must not be empty.
LBL_VALID_FROM=Valid from:
# LBL_VALID_FROM_en=Valid from:
+BUT_TXT_OK=OK
+BUT_TXT_CANCEL=Cancel
|

