Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2007-02-13 02:23:27 -0500
committerslewis2007-02-13 02:23:27 -0500
commitcade43d084e89596bf0dd95bdcbe11ba7c0f887c (patch)
tree9c68c4f0c30d9da445970f9e707754380874df9a /framework/bundles/org.eclipse.ecf.identity/src
parentcbbb5a3c3b0cd46090737f64253539b24f3d9fc2 (diff)
downloadorg.eclipse.ecf-cade43d084e89596bf0dd95bdcbe11ba7c0f887c.tar.gz
org.eclipse.ecf-cade43d084e89596bf0dd95bdcbe11ba7c0f887c.tar.xz
org.eclipse.ecf-cade43d084e89596bf0dd95bdcbe11ba7c0f887c.zip
Externalized strings
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.identity/src')
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/BaseID.java4
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/GUID.java15
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IDFactory.java47
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/LongID.java4
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/Namespace.java13
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/NamespacePermission.java10
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/StringID.java8
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/Base64.java8
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/ECFException.java2
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/Trace.java11
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Activator.java50
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Messages.java46
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/messages.properties18
13 files changed, 155 insertions, 81 deletions
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/BaseID.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/BaseID.java
index a480a4a30..851fb8ebb 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/BaseID.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/BaseID.java
@@ -28,7 +28,7 @@ public abstract class BaseID implements ID {
}
protected BaseID(Namespace namespace) {
- Assert.isNotNull(namespace, "namespace cannot be null");
+ Assert.isNotNull(namespace, "namespace cannot be null"); //$NON-NLS-1$
this.namespace = namespace;
}
@@ -39,7 +39,7 @@ public abstract class BaseID implements ID {
*/
public int compareTo(Object o) {
Assert.isTrue(o != null && o instanceof BaseID,
- "incompatible types for compare");
+ "incompatible types for compare"); //$NON-NLS-1$
return namespace.getCompareToForObject(this, (BaseID) o);
}
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/GUID.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/GUID.java
index 042c761ec..afafc6c53 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/GUID.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/GUID.java
@@ -11,6 +11,7 @@ package org.eclipse.ecf.core.identity;
import java.security.SecureRandom;
import org.eclipse.ecf.core.util.Base64;
+import org.eclipse.ecf.internal.core.identity.Messages;
/**
* Globally unique ID implementation class. Uses
@@ -25,7 +26,7 @@ public class GUID extends StringID {
private static final long serialVersionUID = -8546568877571886386L;
public GUIDNamespace() {
- super(GUID.class.getName(), "GUID Namespace");
+ super(GUID.class.getName(), Messages.GUID_GUID_Namespace_Description_Default);
}
public ID createInstance(Object[] args) throws IDCreateException {
@@ -73,12 +74,12 @@ public class GUID extends StringID {
*/
protected GUID(Namespace n, String algo, String provider, int byteLength)
throws IDCreateException {
- super(n, "");
+ super(n, ""); //$NON-NLS-1$
// Get SecureRandom instance for class
try {
getRandom(algo, provider);
} catch (Exception e) {
- throw new IDCreateException("GUID creation failure: "
+ throw new IDCreateException(Messages.GUID_GUID_Creation_Failure
+ e.getMessage());
}
// make sure we have reasonable byteLength
@@ -126,9 +127,9 @@ public class GUID extends StringID {
if (provider == null) {
if (algo == null) {
try {
- random = SecureRandom.getInstance("IBMSECURERANDOM");
+ random = SecureRandom.getInstance(Messages.GUID_IBM_SECURE_RANDOM);
} catch (Exception e) {
- random = SecureRandom.getInstance("SHA1PRNG");
+ random = SecureRandom.getInstance(Messages.GUID_SHA1);
}
} else
random = SecureRandom.getInstance(algo);
@@ -138,8 +139,8 @@ public class GUID extends StringID {
}
public String toString() {
- StringBuffer sb = new StringBuffer("GUID[");
- sb.append(value).append("]");
+ StringBuffer sb = new StringBuffer("GUID["); //$NON-NLS-1$
+ sb.append(value).append("]"); //$NON-NLS-1$
return sb.toString();
}
} \ No newline at end of file
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IDFactory.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IDFactory.java
index 6a3abbb89..32ef13465 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IDFactory.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/IDFactory.java
@@ -18,6 +18,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.ecf.core.util.Trace;
import org.eclipse.ecf.internal.core.identity.Activator;
import org.eclipse.ecf.internal.core.identity.IdentityDebugOptions;
+import org.eclipse.ecf.internal.core.identity.Messages;
/**
* A factory class for creating ID instances. This is the factory for plugins to
@@ -26,7 +27,7 @@ import org.eclipse.ecf.internal.core.identity.IdentityDebugOptions;
*/
public class IDFactory implements IIDFactory {
public static final String SECURITY_PROPERTY = IDFactory.class.getName()
- + ".security";
+ + ".security"; //$NON-NLS-1$
private static final int IDENTITY_CREATION_ERRORCODE = 2001;
@@ -60,13 +61,13 @@ public class IDFactory implements IIDFactory {
return null;
Trace.entering(Activator.getDefault(),
IdentityDebugOptions.METHODS_ENTERING, IDFactory.class,
- "addNamespace", namespace);
+ "addNamespace", namespace); //$NON-NLS-1$
checkPermission(new NamespacePermission(namespace.toString(),
NamespacePermission.ADD_NAMESPACE));
Namespace result = addNamespace0(namespace);
Trace.exiting(Activator.getDefault(),
IdentityDebugOptions.METHODS_EXITING, IDFactory.class,
- "addNamespace", result);
+ "addNamespace", result); //$NON-NLS-1$
return result;
}
@@ -91,7 +92,7 @@ public class IDFactory implements IIDFactory {
throws SecurityException {
Trace.entering(Activator.getDefault(),
IdentityDebugOptions.METHODS_ENTERING, IDFactory.class,
- "containsNamespace", namespace);
+ "containsNamespace", namespace); //$NON-NLS-1$
if (namespace == null)
return false;
checkPermission(new NamespacePermission(namespace.toString(),
@@ -99,7 +100,7 @@ public class IDFactory implements IIDFactory {
boolean result = containsNamespace0(namespace);
Trace.exiting(Activator.getDefault(),
IdentityDebugOptions.METHODS_EXITING, IDFactory.class,
- "containsNamespace", new Boolean(result));
+ "containsNamespace", new Boolean(result)); //$NON-NLS-1$
return result;
}
@@ -111,7 +112,7 @@ public class IDFactory implements IIDFactory {
public List getNamespaces() {
Trace.entering(Activator.getDefault(),
IdentityDebugOptions.METHODS_ENTERING, IDFactory.class,
- "getNamespaces");
+ "getNamespaces"); //$NON-NLS-1$
return new ArrayList(namespaces.values());
}
@@ -129,7 +130,7 @@ public class IDFactory implements IIDFactory {
public Namespace getNamespace(Namespace namespace) throws SecurityException {
Trace.entering(Activator.getDefault(),
IdentityDebugOptions.METHODS_ENTERING, IDFactory.class,
- "getNamespace", namespace);
+ "getNamespace", namespace); //$NON-NLS-1$
if (namespace == null)
return null;
checkPermission(new NamespacePermission(namespace.toString(),
@@ -137,7 +138,7 @@ public class IDFactory implements IIDFactory {
Namespace result = getNamespace0(namespace);
Trace.exiting(Activator.getDefault(),
IdentityDebugOptions.METHODS_EXITING, IDFactory.class,
- "getNamespace", result);
+ "getNamespace", result); //$NON-NLS-1$
return result;
}
@@ -149,11 +150,11 @@ public class IDFactory implements IIDFactory {
public Namespace getNamespaceByName(String name) throws SecurityException {
Trace.entering(Activator.getDefault(),
IdentityDebugOptions.METHODS_ENTERING, IDFactory.class,
- "getNamespaceByName", name);
+ "getNamespaceByName", name); //$NON-NLS-1$
Namespace result = getNamespace0(name);
Trace.exiting(Activator.getDefault(),
IdentityDebugOptions.METHODS_EXITING, IDFactory.class,
- "getNamespaceByName", result);
+ "getNamespaceByName", result); //$NON-NLS-1$
return result;
}
@@ -187,12 +188,12 @@ public class IDFactory implements IIDFactory {
public ID createGUID(int length) throws IDCreateException {
Trace.entering(Activator.getDefault(),
IdentityDebugOptions.METHODS_ENTERING, IDFactory.class,
- "createGUID", new Integer(length));
+ "createGUID", new Integer(length)); //$NON-NLS-1$
Namespace namespace = new GUID.GUIDNamespace();
ID result = createID(namespace, new Integer[] { new Integer(length) });
Trace.exiting(Activator.getDefault(),
IdentityDebugOptions.METHODS_EXITING, IDFactory.class,
- "createGUID", result);
+ "createGUID", result); //$NON-NLS-1$
return result;
}
@@ -200,14 +201,14 @@ public class IDFactory implements IIDFactory {
throws IDCreateException {
IDCreateException e = null;
if (t != null) {
- e = new IDCreateException(s + ": " + t.getClass().getName() + ": "
+ e = new IDCreateException(s + ": " + t.getClass().getName() + ": " //$NON-NLS-1$ //$NON-NLS-2$
+ t.getMessage(), t);
} else {
e = new IDCreateException(s);
}
Trace.throwing(Activator.getDefault(),
IdentityDebugOptions.EXCEPTIONS_THROWING, IDFactory.class,
- "logAndThrow", e);
+ "logAndThrow", e); //$NON-NLS-1$
Activator.getDefault().getLog().log(
new Status(IStatus.ERROR, Activator.PLUGIN_ID,
IDENTITY_CREATION_ERRORCODE, s, e));
@@ -223,22 +224,22 @@ public class IDFactory implements IIDFactory {
public ID createID(Namespace n, Object[] args) throws IDCreateException {
Trace.entering(Activator.getDefault(),
IdentityDebugOptions.METHODS_ENTERING, IDFactory.class,
- "createID", new Object[] { n, Trace.getArgumentsString(args) });
+ "createID", new Object[] { n, Trace.getArgumentsString(args) }); //$NON-NLS-1$
// Verify namespace is non-null
if (n == null)
- logAndThrow("Namespace cannot be null", null);
+ logAndThrow(Messages.IDFactory_Namespace_Not_Null, null);
// Make sure that namespace is in table of known namespace. If not,
// throw...we don't create any instances that we don't know about!
Namespace ns = getNamespace0(n);
if (ns == null)
- logAndThrow("Namespace '" + n.getName() + "' not found", null);
+ logAndThrow(Messages.IDFactory_0 + n.getName() + Messages.IDFactory_1, null);
// We're OK, go ahead and setup array of classes for call to
// instantiator
// Ask instantiator to actually create instance
ID result = ns.createInstance(args);
Trace.exiting(Activator.getDefault(),
IdentityDebugOptions.METHODS_EXITING, IDFactory.class,
- "createID", result);
+ "createID", result); //$NON-NLS-1$
return result;
}
@@ -252,8 +253,8 @@ public class IDFactory implements IIDFactory {
throws IDCreateException {
Namespace n = getNamespaceByName(namespacename);
if (n == null)
- throw new IDCreateException("Namespace named " + namespacename
- + " not found");
+ throw new IDCreateException(Messages.IDFactory_2 + namespacename
+ + Messages.IDFactory_3);
return createID(n, args);
}
@@ -273,7 +274,7 @@ public class IDFactory implements IIDFactory {
*/
public ID createStringID(String idstring) throws IDCreateException {
if (idstring == null)
- throw new IDCreateException("String cannot be null");
+ throw new IDCreateException(Messages.IDFactory_StringID_Not_Null);
Namespace n = new StringID.StringIDNamespace();
return createID(n, new String[] { idstring });
}
@@ -296,7 +297,7 @@ public class IDFactory implements IIDFactory {
public Namespace removeNamespace(Namespace n) throws SecurityException {
Trace.entering(Activator.getDefault(),
IdentityDebugOptions.METHODS_ENTERING, IDFactory.class,
- "removeNamespace", n);
+ "removeNamespace", n); //$NON-NLS-1$
if (n == null)
return null;
checkPermission(new NamespacePermission(n.toString(),
@@ -304,7 +305,7 @@ public class IDFactory implements IIDFactory {
Namespace result = removeNamespace0(n);
Trace.exiting(Activator.getDefault(),
IdentityDebugOptions.METHODS_EXITING, IDFactory.class,
- "removeNamespace", result);
+ "removeNamespace", result); //$NON-NLS-1$
return result;
}
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/LongID.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/LongID.java
index d980c3af3..97193076a 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/LongID.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/LongID.java
@@ -8,6 +8,8 @@
******************************************************************************/
package org.eclipse.ecf.core.identity;
+import org.eclipse.ecf.internal.core.identity.Messages;
+
/**
* A unique ID class based upon Long/long
*
@@ -21,7 +23,7 @@ public class LongID extends BaseID {
private static final long serialVersionUID = -1580533392719331665L;
public LongNamespace() {
- super(LongID.class.getName(), "Long Namespace");
+ super(LongID.class.getName(), Messages.LongID_LongID_Namespace_Description);
}
public ID createInstance(Object[] args) throws IDCreateException {
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/Namespace.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/Namespace.java
index e5bd5cf94..b413aae9f 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/Namespace.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/Namespace.java
@@ -13,6 +13,7 @@ import java.io.Serializable;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.ecf.internal.core.identity.Messages;
/**
* Namespace base class
@@ -45,7 +46,7 @@ public abstract class Namespace implements Serializable, IAdaptable {
private static final long serialVersionUID = 3976740272094720312L;
- public static final String SCHEME_SEPARATOR = ":";
+ public static final String SCHEME_SEPARATOR = ":"; //$NON-NLS-1$
private String name;
@@ -59,7 +60,7 @@ public abstract class Namespace implements Serializable, IAdaptable {
}
public final boolean initialize(String name, String desc) {
- Assert.isNotNull(name, "Namespace<init> name cannot be null");
+ Assert.isNotNull(name, Messages.Namespace_Namespace_Name_Not_Null);
if (!isInitialized) {
this.name = name;
this.description = desc;
@@ -239,10 +240,10 @@ public abstract class Namespace implements Serializable, IAdaptable {
}
public String toString() {
- StringBuffer b = new StringBuffer("Namespace[");
- b.append("name=").append(name).append(";");
- b.append("scheme=").append(getScheme()).append(";");
- b.append("description=").append("]");
+ StringBuffer b = new StringBuffer("Namespace["); //$NON-NLS-1$
+ b.append("name=").append(name).append(";"); //$NON-NLS-1$ //$NON-NLS-2$
+ b.append("scheme=").append(getScheme()).append(";"); //$NON-NLS-1$ //$NON-NLS-2$
+ b.append("description=").append("]"); //$NON-NLS-1$ //$NON-NLS-2$
return b.toString();
}
} \ No newline at end of file
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/NamespacePermission.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/NamespacePermission.java
index 35f4a34c6..13133a6f5 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/NamespacePermission.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/NamespacePermission.java
@@ -14,15 +14,15 @@ import java.security.Permission;
public class NamespacePermission extends BasicPermission {
private static final long serialVersionUID = 3257004371500806969L;
- public static final String ADD_NAMESPACE = "add";
+ public static final String ADD_NAMESPACE = "add"; //$NON-NLS-1$
- public static final String ALL_NAMESPACE = "all";
+ public static final String ALL_NAMESPACE = "all"; //$NON-NLS-1$
- public static final String CONTAINS_NAMESPACE = "contains";
+ public static final String CONTAINS_NAMESPACE = "contains"; //$NON-NLS-1$
- public static final String GET_NAMESPACE = "get";
+ public static final String GET_NAMESPACE = "get"; //$NON-NLS-1$
- public static final String REMOVE_NAMESPACE = "remove";
+ public static final String REMOVE_NAMESPACE = "remove"; //$NON-NLS-1$
protected String actions;
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/StringID.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/StringID.java
index ebc761135..0d5ce3e6a 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/StringID.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/identity/StringID.java
@@ -8,6 +8,8 @@
******************************************************************************/
package org.eclipse.ecf.core.identity;
+import org.eclipse.ecf.internal.core.identity.Messages;
+
/**
* A string-based identity
*
@@ -23,12 +25,12 @@ public class StringID extends BaseID {
}
public StringIDNamespace() {
- super(StringID.class.getName(), "StringID Namespace");
+ super(StringID.class.getName(), Messages.StringID_StringID_Namespace_Description);
}
public ID createInstance(Object[] parameters) throws IDCreateException {
if (parameters == null || parameters.length == 0) {
- throw new IDCreateException("StringID name cannot be null");
+ throw new IDCreateException(Messages.StringID_StringID_Name_Not_Null);
} else
return new StringID(this, (String) parameters[0]);
}
@@ -97,7 +99,7 @@ public class StringID extends BaseID {
setEmptyNamespace();
int strlen = value.length();
StringBuffer sb = new StringBuffer(strlen + 10);
- sb.insert(0, "StringID[").insert(9, value).insert(strlen + 9, ']');
+ sb.insert(0, "StringID[").insert(9, value).insert(strlen + 9, ']'); //$NON-NLS-1$
return sb.toString();
}
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/Base64.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/Base64.java
index 0e83257a5..3169716ca 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/Base64.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/Base64.java
@@ -8,6 +8,8 @@
******************************************************************************/
package org.eclipse.ecf.core.util;
+import org.eclipse.ecf.internal.core.identity.Messages;
+
/**
*
* Encode/decode byte arrays into base64 strings. Code originally acquired from
@@ -30,7 +32,7 @@ public final class Base64 {
*/
public static String encode(byte[] raw) {
if (raw == null)
- throw new NumberFormatException("Input data cannot be null");
+ throw new NumberFormatException(Messages.Base64_Input_Data_Not_Null);
StringBuffer encoded = new StringBuffer();
for (int i = 0; i < raw.length; i += 3) {
encoded.append(encodeBlock(raw, i));
@@ -118,7 +120,7 @@ public final class Base64 {
// modify to use '-' instead of '='
if (c == '-')
return 0;
- throw new NumberFormatException("Invalid value '" + c
- + "' in base64 string");
+ throw new NumberFormatException(Messages.Base64_Invalid_Value + c
+ + Messages.Base64_In_Base64);
}
} \ No newline at end of file
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/ECFException.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/ECFException.java
index 07d633371..74fdbef7f 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/ECFException.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/ECFException.java
@@ -42,7 +42,7 @@ public class ECFException extends CoreException {
*/
public ECFException(String message, Throwable cause) {
this(new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0,
- ((message == null) ? "" : message), cause));
+ ((message == null) ? "" : message), cause)); //$NON-NLS-1$
}
/**
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/Trace.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/Trace.java
index 3aeac7e9f..0b3e5d587 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/Trace.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/Trace.java
@@ -15,6 +15,7 @@ import java.util.Map;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
+import org.eclipse.ecf.internal.core.identity.Messages;
/**
* A utility for tracing debug information. Provides a simple interface for
@@ -177,7 +178,7 @@ public class Trace {
*/
public static String getArgumentString(Object argument) {
if (argument == null)
- return "null";
+ return "null"; //$NON-NLS-1$
if (argument.getClass().isArray())
return getArgumentsString((Object[]) argument);
else
@@ -194,8 +195,8 @@ public class Trace {
*/
public static String getArgumentsString(Object[] arguments) {
if (arguments == null)
- return "[]";
- StringBuffer buffer = new StringBuffer("[");
+ return "[]"; //$NON-NLS-1$
+ StringBuffer buffer = new StringBuffer("["); //$NON-NLS-1$
for (int i = 0; i < arguments.length; i++) {
buffer.append(getArgumentString(arguments[i]));
@@ -203,7 +204,7 @@ public class Trace {
if (i < arguments.length - 1)
buffer.append(SEPARATOR_PARAMETER);
}
- buffer.append("]");
+ buffer.append("]"); //$NON-NLS-1$
return buffer.toString();
}
@@ -228,7 +229,7 @@ public class Trace {
*/
protected static String getTimeString() {
Date d = new Date();
- SimpleDateFormat df = new SimpleDateFormat("[MM/dd/yy;HH:mm:ss:SSS]");
+ SimpleDateFormat df = new SimpleDateFormat(Messages.Trace_Date_Time_Format);
return df.format(d);
}
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Activator.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Activator.java
index 8836675a6..027fbe207 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Activator.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Activator.java
@@ -32,22 +32,22 @@ import org.osgi.framework.BundleContext;
public class Activator extends Plugin {
// The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.ecf.identity";
+ public static final String PLUGIN_ID = "org.eclipse.ecf.identity"; //$NON-NLS-1$
- protected static final String NAMESPACE_NAME = "namespace";
+ protected static final String NAMESPACE_NAME = "namespace"; //$NON-NLS-1$
- protected static final String NAMESPACE_EPOINT = PLUGIN_ID + "."
+ protected static final String NAMESPACE_EPOINT = PLUGIN_ID + "." //$NON-NLS-1$
+ NAMESPACE_NAME;
- protected static final String NAME_ATTRIBUTE = "name";
+ protected static final String NAME_ATTRIBUTE = "name"; //$NON-NLS-1$
- protected static final String CLASS_ATTRIBUTE = "class";
+ protected static final String CLASS_ATTRIBUTE = "class"; //$NON-NLS-1$
protected static final int REMOVE_NAMESPACE_ERRORCODE = 100;
protected static final int FACTORY_NAME_COLLISION_ERRORCODE = 200;
- protected static final String DESCRIPTION_ATTRIBUTE = "description";
+ protected static final String DESCRIPTION_ATTRIBUTE = "description"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
@@ -75,7 +75,7 @@ public class Activator extends Plugin {
Trace
.exiting(Activator.getDefault(),
IdentityDebugOptions.METHODS_ENTERING, Activator.class,
- "start");
+ "start"); //$NON-NLS-1$
}
protected class IdentityRegistryManager implements IRegistryChangeListener {
@@ -106,7 +106,7 @@ public class Activator extends Plugin {
protected void removeNamespaceExtensions(IConfigurationElement[] members) {
org.eclipse.ecf.core.util.Trace.entering(Activator.getDefault(),
IdentityDebugOptions.METHODS_ENTERING, Activator.class,
- "removeNamespaceExtensions", members);
+ "removeNamespaceExtensions", members); //$NON-NLS-1$
for (int m = 0; m < members.length; m++) {
IConfigurationElement member = members[m];
String name = null;
@@ -127,22 +127,22 @@ public class Activator extends Plugin {
org.eclipse.ecf.core.util.Trace
.trace(Activator.getDefault(),
IdentityDebugOptions.DEBUG,
- "removeNamespaceExtensions.removedNamespace("
- + n + ")");
+ "removeNamespaceExtensions.removedNamespace(" //$NON-NLS-1$
+ + n + ")"); //$NON-NLS-1$
} catch (Exception e) {
org.eclipse.ecf.core.util.Trace.catching(
Activator.getDefault(),
IdentityDebugOptions.EXCEPTIONS_CATCHING,
- Activator.class, "removeNamespaceExtensions", e);
+ Activator.class, "removeNamespaceExtensions", e); //$NON-NLS-1$
getDefault().getLog().log(
new Status(IStatus.ERROR, Activator.PLUGIN_ID,
REMOVE_NAMESPACE_ERRORCODE,
- "Exception removing namespace", e));
+ "Exception removing namespace", e)); //$NON-NLS-1$
}
}
org.eclipse.ecf.core.util.Trace.exiting(Activator.getDefault(),
IdentityDebugOptions.METHODS_EXITING, Activator.class,
- "removeNamespaceExtensions", members);
+ "removeNamespaceExtensions", members); //$NON-NLS-1$
}
/**
@@ -154,7 +154,7 @@ public class Activator extends Plugin {
protected void addNamespaceExtensions(IConfigurationElement[] members) {
org.eclipse.ecf.core.util.Trace.entering(Activator.getDefault(),
IdentityDebugOptions.METHODS_ENTERING, Activator.class,
- "addNamespaceExtensions", members);
+ "addNamespaceExtensions", members); //$NON-NLS-1$
String bundleName = getDefault().getBundle().getSymbolicName();
for (int m = 0; m < members.length; m++) {
IConfigurationElement member = members[m];
@@ -175,7 +175,7 @@ public class Activator extends Plugin {
ns.initialize(nsName, nsDescription);
org.eclipse.ecf.core.util.Trace.trace(Activator.getDefault(),
IdentityDebugOptions.DEBUG,
- "addNamespaceExtensions.createdNamespace(" + ns + ")");
+ "addNamespaceExtensions.createdNamespace(" + ns + ")"); //$NON-NLS-1$ //$NON-NLS-2$
// Check to see if we have a namespace name collision
if (IDFactory.getDefault().containsNamespace(ns))
throw new CoreException(
@@ -183,9 +183,9 @@ public class Activator extends Plugin {
Status.ERROR,
bundleName,
FACTORY_NAME_COLLISION_ERRORCODE,
- "name="
+ "name=" //$NON-NLS-1$
+ nsName
- + ";extension point id="
+ + ";extension point id=" //$NON-NLS-1$
+ extension
.getExtensionPointUniqueIdentifier(),
null));
@@ -193,14 +193,14 @@ public class Activator extends Plugin {
IDFactory.getDefault().addNamespace(ns);
org.eclipse.ecf.core.util.Trace.trace(Activator.getDefault(),
IdentityDebugOptions.DEBUG,
- "addNamespaceExtensions.addedNamespaceToFactory(" + ns
- + ")");
+ "addNamespaceExtensions.addedNamespaceToFactory(" + ns //$NON-NLS-1$
+ + ")"); //$NON-NLS-1$
} catch (CoreException e) {
getDefault().getLog().log(e.getStatus());
org.eclipse.ecf.core.util.Trace.catching(
Activator.getDefault(),
IdentityDebugOptions.EXCEPTIONS_CATCHING,
- Activator.class, "addNamespaceExtensions", e);
+ Activator.class, "addNamespaceExtensions", e); //$NON-NLS-1$
} catch (Exception e) {
getDefault()
.getLog()
@@ -209,21 +209,21 @@ public class Activator extends Plugin {
Status.ERROR,
bundleName,
FACTORY_NAME_COLLISION_ERRORCODE,
- "name="
+ "name=" //$NON-NLS-1$
+ nsName
- + ";extension point id="
+ + ";extension point id=" //$NON-NLS-1$
+ extension
.getExtensionPointUniqueIdentifier(),
null));
org.eclipse.ecf.core.util.Trace.catching(
Activator.getDefault(),
IdentityDebugOptions.EXCEPTIONS_CATCHING,
- Activator.class, "addNamespaceExtensions", e);
+ Activator.class, "addNamespaceExtensions", e); //$NON-NLS-1$
}
}
org.eclipse.ecf.core.util.Trace.exiting(Activator.getDefault(),
IdentityDebugOptions.METHODS_EXITING, Activator.class,
- "addNamespaceExtensions");
+ "addNamespaceExtensions"); //$NON-NLS-1$
}
/**
@@ -248,7 +248,7 @@ public class Activator extends Plugin {
*/
public void stop(BundleContext context) throws Exception {
Trace.entering(Activator.getDefault(),
- IdentityDebugOptions.METHODS_EXITING, Activator.class, "stop");
+ IdentityDebugOptions.METHODS_EXITING, Activator.class, "stop"); //$NON-NLS-1$
Platform.getExtensionRegistry().removeRegistryChangeListener(
registryManager);
registryManager = null;
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Messages.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Messages.java
new file mode 100644
index 000000000..bc443cab1
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/Messages.java
@@ -0,0 +1,46 @@
+/****************************************************************************
+ * Copyright (c) 2004 Composent, Inc. 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:
+ * Composent, Inc. - initial API and implementation
+ *****************************************************************************/
+
+package org.eclipse.ecf.internal.core.identity;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.ecf.internal.core.identity.messages"; //$NON-NLS-1$
+ public static String Base64_In_Base64;
+ public static String Base64_Input_Data_Not_Null;
+ public static String Base64_Invalid_Value;
+ public static String GUID_GUID_Creation_Failure;
+ public static String GUID_GUID_Namespace_Description_Default;
+ public static String GUID_IBM_SECURE_RANDOM;
+ public static String GUID_SHA1;
+ public static String IDFactory_0;
+ public static String IDFactory_1;
+ public static String IDFactory_2;
+ public static String IDFactory_3;
+ public static String IDFactory_Namespace_Not_Null;
+ public static String IDFactory_StringID_Not_Null;
+ public static String LongID_LongID_Namespace_Description;
+ public static String Namespace_Namespace_Name_Not_Null;
+ public static String StringID_StringID_Name_Not_Null;
+ public static String StringID_StringID_Namespace_Description;
+ public static String Trace_Date_Time_Format;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/messages.properties b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/messages.properties
new file mode 100644
index 000000000..74780446e
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/internal/core/identity/messages.properties
@@ -0,0 +1,18 @@
+IDFactory_Namespace_Not_Null=Namespace cannot be null
+IDFactory_StringID_Not_Null=StringID cannot be null
+Namespace_Namespace_Name_Not_Null=Namespace<init> name cannot be null
+GUID_GUID_Namespace_Description_Default=GUID Namespace
+GUID_IBM_SECURE_RANDOM=IBMSECURERANDOM
+GUID_SHA1=SHA1PRNG
+Trace_Date_Time_Format=[MM/dd/yy;HH:mm:ss:SSS]
+StringID_StringID_Namespace_Description=StringID Namespace
+StringID_StringID_Name_Not_Null=StringID name cannot be null
+Base64_Input_Data_Not_Null=Input data cannot be null
+Base64_Invalid_Value=Invalid value '
+Base64_In_Base64=' in base64 string
+GUID_GUID_Creation_Failure=GUID creation failure:
+LongID_LongID_Namespace_Description=LongID Namespace
+IDFactory_0=Namespace '
+IDFactory_1=' not found
+IDFactory_2=Namespace named
+IDFactory_3=\ not found

Back to the top