KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > internal > content > ContentMessages


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

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

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

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

25     // Content type manager
26
public static String JavaDoc content_badInitializationData;
27     public static String JavaDoc content_errorReadingContents;
28     public static String JavaDoc content_errorLoadingSettings;
29     public static String JavaDoc content_errorSavingSettings;
30     public static String JavaDoc content_invalidContentDescriber;
31     public static String JavaDoc content_invalidProperty;
32     public static String JavaDoc content_missingIdentifier;
33     public static String JavaDoc content_missingName;
34     public static String JavaDoc content_parserConfiguration;
35
36     static {
37         // load message values from bundle file
38
reloadMessages();
39     }
40
41     public static void reloadMessages() {
42         NLS.initializeMessages(BUNDLE_NAME, ContentMessages.class);
43     }
44
45     /**
46      * Print a debug message to the console.
47      * Pre-pend the message with the current date and the name of the current thread.
48      */

49     public static void message(String JavaDoc message) {
50         StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
51         buffer.append(new Date JavaDoc(System.currentTimeMillis()));
52         buffer.append(" - ["); //$NON-NLS-1$
53
buffer.append(Thread.currentThread().getName());
54         buffer.append("] "); //$NON-NLS-1$
55
buffer.append(message);
56         System.out.println(buffer.toString());
57     }
58 }
Popular Tags