diff dwtx/core/runtime/ILog.d @ 159:7926b636c282

...
author Frank Benoit <benoit@tionex.de>
date Wed, 27 Aug 2008 01:57:58 +0200
parents
children 1a5b8f8129df
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dwtx/core/runtime/ILog.d	Wed Aug 27 01:57:58 2008 +0200
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
+ *******************************************************************************/
+module dwtx.core.runtime.ILog;
+
+import dwt.dwthelper.utils;
+import dwtx.core.runtime.ILogListener;
+import dwtx.core.runtime.IStatus;
+
+// import org.osgi.framework.Bundle;
+
+/**
+ * A log to which status events can be written.  Logs appear on individual
+ * plug-ins and on the platform itself.  Clients can register log listeners which
+ * will receive notification of all log events as they come in.
+ * <p>
+ * XXX Need to create a new log interface on common plugin. That interface should be a super interface of this ILog.
+ * getBundle() would stay here. In the super interface we would have getName()
+ * </p>
+ *
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface ILog {
+    /**
+     * Adds the given log listener to this log.  Subsequently the log listener will
+     * receive notification of all log events passing through this log.
+     * This method has no affect if the identical listener is already registered on this log.
+     *
+     * @param listener the listener to add to this log
+     * @see Platform#addLogListener(ILogListener)
+     */
+    public void addLogListener(ILogListener listener);
+
+    /**
+     * Returns the plug-in with which this log is associated.
+     *
+     * @return the plug-in with which this log is associated
+     * @since 3.0
+     */
+//     public Bundle getBundle();
+// DWT FIXME: Bundle not yet included
+
+    /**
+     * Logs the given status.  The status is distributed to the log listeners
+     * installed on this log and then to the log listeners installed on the platform.
+     *
+     * @param status the status to log
+     */
+    public void log(IStatus status);
+
+    /**
+     * Removes the given log listener to this log.  Subsequently the log listener will
+     * no longer receive notification of log events passing through this log.
+     * This method has no affect if the identical listener is not registered on this log.
+     *
+     * @param listener the listener to remove
+     * @see Platform#removeLogListener(ILogListener)
+     */
+    public void removeLogListener(ILogListener listener);
+}