diff options
Diffstat (limited to 'bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/Policy.java')
-rw-r--r-- | bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/Policy.java | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/Policy.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/Policy.java deleted file mode 100644 index f6eda9292..000000000 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/internal/Policy.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.eclipse.team.core.internal; - -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ - -import java.text.MessageFormat; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; - -public class Policy { - protected static ResourceBundle bundle = null; - - /** - * Creates a NLS catalog for the given locale. - */ - public static void localize(String bundleName) { - bundle = ResourceBundle.getBundle(bundleName); - } - - /** - * Lookup the message with the given ID in this catalog and bind its - * substitution locations with the given string. - */ - public static String bind(String id, String binding) { - return bind(id, new String[] { binding }); - } - - /** - * Lookup the message with the given ID in this catalog and bind its - * substitution locations with the given strings. - */ - public static String bind(String id, String binding1, String binding2) { - return bind(id, new String[] { binding1, binding2 }); - } - - /** - * Gets a string from the resource bundle. We don't want to crash because of a missing String. - * Returns the key if not found. - */ - public static String bind(String key) { - try { - return bundle.getString(key); - } catch (MissingResourceException e) { - return key; - } catch (NullPointerException e) { - return "!" + key + "!"; //$NON-NLS-1$ //$NON-NLS-2$ - } - } - - /** - * Gets a string from the resource bundle and binds it with the given arguments. If the key is - * not found, return the key. - */ - public static String bind(String key, Object[] args) { - try { - return MessageFormat.format(bind(key), args); - } catch (MissingResourceException e) { - return key; - } catch (NullPointerException e) { - return "!" + key + "!"; //$NON-NLS-1$ //$NON-NLS-2$ - } - } - - /** - * Progress monitor helpers - */ - public static void checkCanceled(IProgressMonitor monitor) { - if (monitor.isCanceled()) - throw new OperationCanceledException(); - } - public static IProgressMonitor monitorFor(IProgressMonitor monitor) { - if (monitor == null) - return new NullProgressMonitor(); - return monitor; - } -}
\ No newline at end of file |