KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > internal > preferences > PrefsMessages


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM - Initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.internal.preferences;
12
13 import java.util.Date JavaDoc;
14 import org.eclipse.osgi.util.NLS;
15
16 // Runtime plugin message catalog
17
public class PrefsMessages extends NLS {
18     /**
19      * The unique identifier constant of this plug-in.
20      */

21     public static final String JavaDoc OWNER_NAME = "org.eclipse.equinox.preferences"; //$NON-NLS-1$
22

23     private static final String JavaDoc BUNDLE_NAME = "org.eclipse.core.internal.preferences.messages"; //$NON-NLS-1$
24

25     // Preferences
26
public static String JavaDoc preferences_applyProblems;
27     public static String JavaDoc preferences_classCastScope;
28     public static String JavaDoc preferences_classCastListener;
29     public static String JavaDoc preferences_classCastFilterEntry;
30     public static String JavaDoc preferences_errorWriting;
31     public static String JavaDoc preferences_exportProblems;
32     public static String JavaDoc preferences_failedDelete;
33     public static String JavaDoc preferences_fileNotFound;
34     public static String JavaDoc preferences_importProblems;
35     public static String JavaDoc preferences_incompatible;
36     public static String JavaDoc preferences_invalidExtensionSuperclass;
37     public static String JavaDoc preferences_invalidFileFormat;
38     public static String JavaDoc preferences_loadException;
39     public static String JavaDoc preferences_matching;
40     public static String JavaDoc preferences_missingClassAttribute;
41     public static String JavaDoc preferences_missingScopeAttribute;
42     public static String JavaDoc noRegistry;
43     public static String JavaDoc preferences_removedNode;
44     public static String JavaDoc preferences_saveException;
45     public static String JavaDoc preferences_saveProblems;
46     public static String JavaDoc preferences_validate;
47     public static String JavaDoc preferences_validationException;
48
49     static {
50         // load message values from bundle file
51
reloadMessages();
52     }
53
54     public static void reloadMessages() {
55         NLS.initializeMessages(BUNDLE_NAME, PrefsMessages.class);
56     }
57
58     /**
59      * Print a debug message to the console.
60      * Pre-pend the message with the current date and the name of the current thread.
61      */

62     public static void message(String JavaDoc message) {
63         StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
64         buffer.append(new Date JavaDoc(System.currentTimeMillis()));
65         buffer.append(" - ["); //$NON-NLS-1$
66
buffer.append(Thread.currentThread().getName());
67         buffer.append("] "); //$NON-NLS-1$
68
buffer.append(message);
69         System.out.println(buffer.toString());
70     }
71 }
72
Popular Tags