KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > ui > console > IConsoleColorProvider


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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  *******************************************************************************/

11 package org.eclipse.debug.ui.console;
12
13
14 import org.eclipse.debug.core.model.IProcess;
15 import org.eclipse.swt.graphics.Color;
16
17 /**
18  * Provides coloring for a console document. When a process is added to a
19  * registered launch the debug plug-in creates a console document for the
20  * process. By default, a document is created which is connected to the standard
21  * input, output, and error streams associated with the process. A client may
22  * override the default coloring by specifying a custom content provider for a
23  * process type. A process type is defined via the process attribute
24  * <code>IProcess. ATTR_PROCESS_TYPE</code>.
25  * <p>
26  * A console color provider extension is defined in <code>plugin.xml</code>.
27  * Following is an example definition of a console color
28  * provider extension.
29  * <pre>
30  * &lt;extension point="org.eclipse.debug.ui.consoleColorProviders"&gt;
31  * &lt;consoleColorProvider
32  * id="com.example.ExampleConsoleColorProvider"
33  * class="com.example.ExampleConsoleColorProviderClass"
34  * processType="ExampleProcessType"&gt;
35  * &lt;/consoleColorProvider&gt;
36  * &lt;/extension&gt;
37  * </pre>
38  * The attributes are specified as follows:
39  * <ul>
40  * <li><code>id</code> specifies a unique identifier for this color provider.</li>
41  * <li><code>class</code> specifies a fully qualified name of a Java class
42  * that implements <code>IConsoleColorProvider</code>.</li>
43  * <li><code>processType</code> specifies the identifier of the process type
44  * this content provider is associated with (which corresponds to the
45  * <code>ATTR_PROCESS_TYPE</code> attribute on a process).</li>
46  * </ul>
47  * </p>
48  * <p>
49  * Clients may implement this interface.
50  * </p>
51  * @since 2.1
52  */

53
54 public interface IConsoleColorProvider {
55
56     /**
57      * Returns whether the console associated with this color provider's
58      * process can currently accept keyboard input. This attribute is dynamic
59      * and may change over the lifetime of a process/document.
60      *
61      * @return whether the console associated with this color provider's
62      * process can currently accept keyboard input
63      */

64     public boolean isReadOnly();
65     
66     /**
67      * Returns the color to draw output associated with the given stream.
68      *
69      * @param streamIdentifer the identifier of the stream
70      * @return Color
71      */

72     public Color getColor(String JavaDoc streamIdentifer);
73     
74     /**
75      * Connects this color provider to the given process and console.
76      * This color provider should connect its streams to the given console
77      * document.
78      *
79      * @param process the process to connect this color provider to
80      * @param console the console to connect this color provider to
81      */

82     public void connect(IProcess process, IConsole console);
83     
84     /**
85      * Disconnects this color provider.
86      */

87     public void disconnect();
88 }
89
Popular Tags