KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > internal > jobs > JobMessages


1 /**********************************************************************
2  * Copyright (c) 2005, 2006 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.jobs;
11
12 import java.util.Date JavaDoc;
13 import org.eclipse.osgi.util.NLS;
14
15 /**
16  * Job plugin message catalog
17  */

18 public class JobMessages extends NLS {
19     private static final String JavaDoc BUNDLE_NAME = "org.eclipse.core.internal.jobs.messages"; //$NON-NLS-1$
20

21     // Job Manager and Locks
22
public static String JavaDoc jobs_blocked0;
23     public static String JavaDoc jobs_blocked1;
24     public static String JavaDoc jobs_internalError;
25     public static String JavaDoc jobs_waitFamSub;
26
27     // metadata
28
public static String JavaDoc meta_pluginProblems;
29
30     static {
31         // load message values from bundle file
32
reloadMessages();
33     }
34
35     public static void reloadMessages() {
36         NLS.initializeMessages(BUNDLE_NAME, JobMessages.class);
37     }
38
39     /**
40      * Print a debug message to the console.
41      * Pre-pend the message with the current date and the name of the current thread.
42      */

43     public static void message(String JavaDoc message) {
44         StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
45         buffer.append(new Date JavaDoc(System.currentTimeMillis()));
46         buffer.append(" - ["); //$NON-NLS-1$
47
buffer.append(Thread.currentThread().getName());
48         buffer.append("] "); //$NON-NLS-1$
49
buffer.append(message);
50         System.out.println(buffer.toString());
51     }
52 }
Popular Tags