From 544d1c6d4bc569a0c4c0870004b1550a2b5e0532 Mon Sep 17 00:00:00 2001 From: david_williams Date: Wed, 1 Oct 2008 22:56:28 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'v200810012256'. --- .../wst/validation/internal/ResourceHandler.java | 76 ---------------------- 1 file changed, 76 deletions(-) delete mode 100644 plugins/org.eclipse.wst.validation/validate/org/eclipse/wst/validation/internal/ResourceHandler.java (limited to 'plugins/org.eclipse.wst.validation/validate/org/eclipse/wst/validation/internal/ResourceHandler.java') diff --git a/plugins/org.eclipse.wst.validation/validate/org/eclipse/wst/validation/internal/ResourceHandler.java b/plugins/org.eclipse.wst.validation/validate/org/eclipse/wst/validation/internal/ResourceHandler.java deleted file mode 100644 index c3d2f7e16..000000000 --- a/plugins/org.eclipse.wst.validation/validate/org/eclipse/wst/validation/internal/ResourceHandler.java +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2008 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 - *******************************************************************************/ -package org.eclipse.wst.validation.internal; - -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.wst.validation.internal.plugin.ValidationPlugin; - - -/** - * This class retrieves the Strings from the .properties file appropriate for the machine's Locale. - */ -public class ResourceHandler { - //TODO Make this class final once the public ResourceHandler has been deleted. - private static ResourceBundle _bundle = null; - - protected ResourceHandler() { - //TODO Make this method private once the public ResourceHandler has been deleted. - super(); - } - - /** - * Return the resource bundle which contains the messages, as identified by - */ - public static ResourceBundle getBundle() { - if (_bundle == null) { - try { - _bundle = ResourceBundle.getBundle(ValidationPlugin.getBundlePropertyFileName()); - } catch (MissingResourceException exc) { - _bundle = null; - if (Tracing.isLogging()) { - Tracing.log("ResourceHandler-01", "Cannot find bundle " + ValidationPlugin.getBundlePropertyFileName()); //$NON-NLS-1$ //$NON-NLS-2$ - } - } - } - return _bundle; - } - - public static String getExternalizedMessage(String key) { - try { - ResourceBundle bundle = getBundle(); - if (bundle == null) { - Tracing.log("ResourceHandler-02: ", "Resource bundle is null"); //$NON-NLS-1$ //$NON-NLS-2$ - return key; - } - - return bundle.getString(key); - } catch (NullPointerException exc) { - Tracing.log("ResourceHandler-03: ", "Cannot find message id ", key); //$NON-NLS-1$ //$NON-NLS-2$ - } - return key; - } - - public static String getExternalizedMessage(String key, String[] parms) { - String res = ""; //$NON-NLS-1$ - try { - res = java.text.MessageFormat.format(getExternalizedMessage(key), (Object[])parms); - } catch (MissingResourceException exc) { - Tracing.log("ResourceHandler-04: ", "Cannot find message id ", key); //$NON-NLS-1$ //$NON-NLS-2$ - } catch (NullPointerException exc) { - if (Tracing.isLogging()) { - Tracing.log("ResourceHandler-05: Cannot format message id " + key + " with " + parms.length + " parameters."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - } - } - return res; - } -} -- cgit v1.2.3