diff options
Diffstat (limited to 'org.eclipse.core.variables/src/org/eclipse/core/internal')
5 files changed, 54 insertions, 48 deletions
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java index fcd0c2943..10e192e0b 100644 --- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java +++ b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java @@ -36,7 +36,7 @@ public class DynamicVariable extends StringVariable implements IDynamicVariable if (!supportsArgument()) { // check for an argument - not supported if (argument != null && argument.length() > 0) { - throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, MessageFormat.format(VariablesMessages.getString("DynamicVariable.0"), new String[]{argument, getName()}), null)); //$NON-NLS-1$ + throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, MessageFormat.format(VariablesMessages.DynamicVariable_0, new String[]{argument, getName()}), null)); //$NON-NLS-1$ } } if (fResolver == null) { diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringSubstitutionEngine.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringSubstitutionEngine.java index 3fa365049..9a8e5df44 100644 --- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringSubstitutionEngine.java +++ b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringSubstitutionEngine.java @@ -103,7 +103,7 @@ public class StringSubstitutionEngine { problemVariableList.append(", "); //$NON-NLS-1$ } problemVariableList.setLength(problemVariableList.length()-2); //truncate the last ", " - throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.REFERENCE_CYCLE_ERROR, MessageFormat.format(VariablesMessages.getString("StringSubstitutionEngine.4"), new String[]{problemVariableList.toString()}), null)); //$NON-NLS-1$ + throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.REFERENCE_CYCLE_ERROR, MessageFormat.format(VariablesMessages.StringSubstitutionEngine_4, new String[]{problemVariableList.toString()}), null)); //$NON-NLS-1$ } } @@ -256,7 +256,7 @@ public class StringSubstitutionEngine { if (dynamicVariable == null) { // no variables with the given name if (reportUndefinedVariables) { - throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, MessageFormat.format(VariablesMessages.getString("StringSubstitutionEngine.3"), new String[]{name}), null)); //$NON-NLS-1$ + throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, MessageFormat.format(VariablesMessages.StringSubstitutionEngine_3, new String[]{name}), null)); //$NON-NLS-1$ } // leave as is return getOriginalVarText(var); @@ -279,7 +279,7 @@ public class StringSubstitutionEngine { return getOriginalVarText(var); } // error - an argument specified for a value variable - throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, MessageFormat.format(VariablesMessages.getString("StringSubstitutionEngine.4"), new String[]{valueVariable.getName()}), null)); //$NON-NLS-1$ + throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, MessageFormat.format(VariablesMessages.StringSubstitutionEngine_4, new String[]{valueVariable.getName()}), null)); //$NON-NLS-1$ } private String getOriginalVarText(VariableReference var) { diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java index ad3b4a9bb..cf3698ce1 100644 --- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java +++ b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java @@ -360,11 +360,11 @@ public class StringVariableManager implements IStringVariableManager { */ public void addVariables(IValueVariable[] variables) throws CoreException { initialize(); - MultiStatus status = new MultiStatus(VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, VariablesMessages.getString("StringVariableManager.26"), null); //$NON-NLS-1$ + MultiStatus status = new MultiStatus(VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, VariablesMessages.StringVariableManager_26, null); //$NON-NLS-1$ for (int i = 0; i < variables.length; i++) { IValueVariable variable = variables[i]; if (getValueVariable(variable.getName()) != null) { - status.add(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, MessageFormat.format(VariablesMessages.getString("StringVariableManager.27"), new String[]{variable.getName()}), null)); //$NON-NLS-1$ + status.add(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, MessageFormat.format(VariablesMessages.StringVariableManager_27, new String[]{variable.getName()}), null)); //$NON-NLS-1$ } } if (status.isOK()) { diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.java index f47427a4a..488596f4a 100644 --- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.java +++ b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.java @@ -1,33 +1,39 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html +/********************************************************************** + * Copyright (c) 2005 IBM Corporation and others. All rights reserved. This + * program and the accompanying materials are made available under the terms of + * the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ + * Contributors: + * IBM - Initial API and implementation + **********************************************************************/ package org.eclipse.core.internal.variables; -import java.util.MissingResourceException; -import java.util.ResourceBundle; +import org.eclipse.osgi.util.NLS; -public class VariablesMessages { +public class VariablesMessages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.core.internal.variables.VariablesMessages";//$NON-NLS-1$ + // + // Copyright (c) 2000, 2005 IBM Corporation and others. + // All rights reserved. This program and the accompanying materials + // are made available under the terms of the Eclipse Public License v1.0 + // which accompanies this distribution, and is available at + // http://www.eclipse.org/legal/epl-v10.html + // + // Contributors: + // IBM Corporation - initial API and implementation + // - private static final String BUNDLE_NAME = "org.eclipse.core.internal.variables.VariablesMessages"; //$NON-NLS-1$ + public static String StringSubstitutionEngine_3; + public static String StringSubstitutionEngine_4; - private static final ResourceBundle RESOURCE_BUNDLE = - ResourceBundle.getBundle(BUNDLE_NAME); + public static String StringVariableManager_26; + public static String StringVariableManager_27; - private VariablesMessages() { - } + public static String DynamicVariable_0; - public static String getString(String key) { - try { - return RESOURCE_BUNDLE.getString(key); - } catch (MissingResourceException e) { - return '!' + key + '!'; - } + static { + // load message values from bundle file + NLS.initializeMessages(BUNDLE_NAME, VariablesMessages.class); } -} +}
\ No newline at end of file diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.properties b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.properties index 79b608aeb..af64c6ee7 100644 --- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.properties +++ b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.properties @@ -1,18 +1,18 @@ -############################################################################### -# Copyright (c) 2000, 2005 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### - -StringSubstitutionEngine.3=Reference to undefined variable {0} -StringSubstitutionEngine.4=Variable {0} does not accept arguments - -StringVariableManager.26=Variables with the specified names are already registered. -StringVariableManager.27=Variable named {0} already registered - -DynamicVariable.0=Unsupported argument {0} specified for variable {1} +###############################################################################
+# Copyright (c) 2000, 2005 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+
+StringSubstitutionEngine_3=Reference to undefined variable {0}
+StringSubstitutionEngine_4=Variable {0} does not accept arguments
+
+StringVariableManager_26=Variables with the specified names are already registered.
+StringVariableManager_27=Variable named {0} already registered
+
+DynamicVariable_0=Unsupported argument {0} specified for variable {1}
|