diff options
author | Dani Megert | 2005-04-17 18:35:11 +0000 |
---|---|---|
committer | Dani Megert | 2005-04-17 18:35:11 +0000 |
commit | bb6002cb86cc05835cafe11b31a7f7c43f65598b (patch) | |
tree | 85d182c02408e56e3cf4272cd655cbf073c71d4a /org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.java | |
parent | 02f220b0dee5d52d2e38bafa8832fafb5551603d (diff) | |
download | eclipse.platform.text-bb6002cb86cc05835cafe11b31a7f7c43f65598b.tar.gz eclipse.platform.text-bb6002cb86cc05835cafe11b31a7f7c43f65598b.tar.xz eclipse.platform.text-bb6002cb86cc05835cafe11b31a7f7c43f65598b.zip |
Temporary fix for problem with new Eclipse NLS approach
Diffstat (limited to 'org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.java')
-rw-r--r-- | org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.java | 98 |
1 files changed, 48 insertions, 50 deletions
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.java index e29dde193af..dc63ac6f208 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2004 IBM Corporation and others. + * 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 @@ -10,62 +10,60 @@ *******************************************************************************/ package org.eclipse.ui.editors.text; -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; +import org.eclipse.osgi.util.NLS; /** * Helper class to get NLSed messages. */ -class TextEditorMessages { +final class TextEditorMessages extends NLS { - private static final String RESOURCE_BUNDLE= "org.eclipse.ui.editors.text.TextEditorMessages";//$NON-NLS-1$ - - private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); + private static final String BUNDLE_NAME= TextEditorMessages.class.getName(); private TextEditorMessages() { + // Do not instantiate } - /** - * Gets a string from the resource bundle. - * - * @param key the string used to get the bundle value, must not be <code>null</code> - * @return the string from the resource bundle - */ - public static String getString(String key) { - try { - return fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$ - } - } - - /** - * Gets a string from the resource bundle and formats it with the given argument. - * - * @param key the string used to get the bundle value, must not be null - * @param arg the argument used to format the string - * @return the formatted string - * @since 3.0 - */ - public static String getFormattedString(String key, Object arg) { - String format= null; - try { - format= fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$ - } - if (arg == null) - arg= ""; //$NON-NLS-1$ - return MessageFormat.format(format, new Object[] { arg }); - } - - /** - * Returns a resource bundle. - * - * @return the resource bundle - */ - public static ResourceBundle getResourceBundle() { - return fgResourceBundle; + public static String PreferencePage_description; + public static String PreferencePage_fontEditor; + public static String FileDocumentProvider_createElementInfo; + public static String FileDocumentProvider_error_out_of_sync; + public static String FileDocumentProvider_task_saving; + public static String FileDocumentProvider_resetDocument; + public static String FileDocumentProvider_getPersistedEncoding; + public static String StorageDocumentProvider_updateCache; + public static String StorageDocumentProvider_isReadOnly; + public static String StorageDocumentProvider_isModifiable; + public static String StorageDocumentProvider_getContentDescriptionFor; + public static String StorageDocumentProvider_getContentDescription; + public static String TextFileDocumentProvider_beginTask_saving; + public static String TextFileDocumentProvider_error_doesNotExist; + public static String TextFileDocumentProvider_saveAsTargetOpenInEditor; + public static String Editor_error_save_message; + public static String Editor_error_save_title; + public static String Editor_warning_save_delete; + public static String Editor_error_unreadable_encoding_header; + public static String Editor_error_unreadable_encoding_banner; + public static String Editor_error_unreadable_encoding_message_arg; + public static String Editor_error_unreadable_encoding_message; + public static String Editor_error_unsupported_encoding_header; + public static String Editor_error_unsupported_encoding_banner; + public static String Editor_error_unsupported_encoding_message_arg; + public static String Editor_error_unsupported_encoding_message; + public static String Editor_ConvertEncoding_submenu_label; + public static String Editor_ConvertEncoding_Custom_dialog_title; + public static String Editor_ConvertEncoding_Custom_dialog_message; + public static String NullProvider_error; + public static String FileBufferOperationAction_collectionFiles_label; + public static String FileBufferOperationHandler_collectionFiles_label; + public static String ResourceInfo_fileContentEncodingFormat; + public static String ResourceInfo_fileContainerEncodingFormat; + public static String WorkbenchPreference_encoding_BOM_UTF_8; + public static String WorkbenchPreference_encoding_BOM_UTF_16BE; + public static String WorkbenchPreference_encoding_BOM_UTF_16LE; + public static String DocumentInputStream_error_read; + public static String DocumentInputStream_error_streamClosed; + + static { + NLS.initializeMessages(BUNDLE_NAME, TextEditorMessages.class); } -} +}
\ No newline at end of file |