159
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2000, 2008 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 Corporation - initial API and implementation
|
|
10 * Port to the D programming language:
|
|
11 * Frank Benoit <benoit@tionex.de>
|
|
12 *******************************************************************************/
|
|
13 module dwtx.core.runtime.ILog;
|
|
14
|
|
15 import dwt.dwthelper.utils;
|
|
16 import dwtx.core.runtime.ILogListener;
|
|
17 import dwtx.core.runtime.IStatus;
|
|
18
|
|
19 // import org.osgi.framework.Bundle;
|
|
20
|
|
21 /**
|
|
22 * A log to which status events can be written. Logs appear on individual
|
|
23 * plug-ins and on the platform itself. Clients can register log listeners which
|
|
24 * will receive notification of all log events as they come in.
|
|
25 * <p>
|
|
26 * XXX Need to create a new log interface on common plugin. That interface should be a super interface of this ILog.
|
|
27 * getBundle() would stay here. In the super interface we would have getName()
|
|
28 * </p>
|
|
29 *
|
|
30 * @noimplement This interface is not intended to be implemented by clients.
|
|
31 */
|
|
32 public interface ILog {
|
|
33 /**
|
|
34 * Adds the given log listener to this log. Subsequently the log listener will
|
|
35 * receive notification of all log events passing through this log.
|
|
36 * This method has no affect if the identical listener is already registered on this log.
|
|
37 *
|
|
38 * @param listener the listener to add to this log
|
|
39 * @see Platform#addLogListener(ILogListener)
|
|
40 */
|
|
41 public void addLogListener(ILogListener listener);
|
|
42
|
|
43 /**
|
|
44 * Returns the plug-in with which this log is associated.
|
|
45 *
|
|
46 * @return the plug-in with which this log is associated
|
|
47 * @since 3.0
|
|
48 */
|
|
49 // public Bundle getBundle();
|
|
50 // DWT FIXME: Bundle not yet included
|
|
51
|
|
52 /**
|
|
53 * Logs the given status. The status is distributed to the log listeners
|
|
54 * installed on this log and then to the log listeners installed on the platform.
|
|
55 *
|
|
56 * @param status the status to log
|
|
57 */
|
|
58 public void log(IStatus status);
|
|
59
|
|
60 /**
|
|
61 * Removes the given log listener to this log. Subsequently the log listener will
|
|
62 * no longer receive notification of log events passing through this log.
|
|
63 * This method has no affect if the identical listener is not registered on this log.
|
|
64 *
|
|
65 * @param listener the listener to remove
|
|
66 * @see Platform#removeLogListener(ILogListener)
|
|
67 */
|
|
68 public void removeLogListener(ILogListener listener);
|
|
69 }
|