122
|
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 * Port to the D programming language:
|
|
10 * Frank Benoit <benoit@tionex.de>
|
|
11 **********************************************************************/
|
|
12 module dwtx.core.internal.jobs.JobMessages;
|
|
13
|
|
14 import tango.core.Thread;
|
|
15 import tango.io.Stdout;
|
|
16 import tango.time.WallClock;
|
|
17 import tango.text.convert.TimeStamp;
|
|
18
|
|
19 import dwt.dwthelper.utils;
|
|
20
|
|
21 import dwtx.osgi.util.NLS;
|
|
22
|
|
23 /**
|
|
24 * Job plugin message catalog
|
|
25 */
|
|
26 public class JobMessages : NLS {
|
|
27 private static const String BUNDLE_NAME = "dwtx.core.internal.jobs.messages"; //$NON-NLS-1$
|
|
28
|
|
29 // Job Manager and Locks
|
|
30 public static String jobs_blocked0 = "The user operation is waiting for background work to complete.";
|
|
31 public static String jobs_blocked1 = "The user operation is waiting for \"{0}\" to complete.";
|
|
32 public static String jobs_internalError = "An internal error occured during: \"{0}\".";
|
|
33 public static String jobs_waitFamSub = "{0} work item(s) left.";
|
|
34
|
|
35 // metadata
|
|
36 public static String meta_pluginProblems = "Problems occured when invoking code from plug-in: \"{0}\".";
|
|
37
|
|
38 // static this() {
|
|
39 // // load message values from bundle file
|
|
40 // reloadMessages();
|
|
41 // }
|
|
42
|
|
43 public static void reloadMessages() {
|
|
44 // NLS.initializeMessages(BUNDLE_NAME, import(BUNDLE_NAME~".properties"));
|
|
45 }
|
|
46
|
|
47 /**
|
|
48 * Print a debug message to the console.
|
|
49 * Pre-pend the message with the current date and the name of the current thread.
|
|
50 */
|
|
51 public static void message(String message) {
|
|
52 StringBuffer buffer = new StringBuffer();
|
|
53 char[30] buf;
|
|
54 buffer.append(tango.text.convert.TimeStamp.format( buf, WallClock.now()));
|
|
55 buffer.append(" - ["); //$NON-NLS-1$
|
|
56 buffer.append(Thread.getThis().name());
|
|
57 buffer.append("] "); //$NON-NLS-1$
|
|
58 buffer.append(message);
|
|
59 Stdout.formatln(buffer.toString());
|
|
60 }
|
|
61 }
|