KickJava   Java API By Example, From Geeks To Geeks.

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


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.debug.core.model.IStreamMonitor;
16 import org.eclipse.debug.core.model.IStreamsProxy;
17 import org.eclipse.jface.text.IDocument;
18 import org.eclipse.jface.text.IRegion;
19 import org.eclipse.ui.console.IHyperlink;
20 import org.eclipse.ui.console.IOConsoleOutputStream;
21 import org.eclipse.ui.console.IPatternMatchListener;
22
23 /**
24  * A console that displays output and writes input to a process. Implementors of
25  * <code>IConsoleColorProvider</code> should connect streams to a console
26  * document when connected to.
27  * <p>
28  * Clients are <b>not</b> intended to implement this interface.
29  * </p>
30  * @see org.eclipse.debug.ui.console.IConsoleColorProvider
31  * @since 2.1
32  */

33 public interface IConsole {
34
35     /**
36      * Connects this console to the given streams proxy. This associates the
37      * standard in, out, and error streams with the console. Keyboard input will
38      * be written to the given proxy.
39      *
40      * @param streamsProxy
41      */

42     public void connect(IStreamsProxy streamsProxy);
43     
44     /**
45      * Connects this console to the given stream monitor, uniquely identified by
46      * the given identifier. This allows for more than the standard (in, out,
47      * error) streams to be connected to the console.
48      *
49      * @param streamMonitor
50      * @param streamIdentifer
51      */

52     public void connect(IStreamMonitor streamMonitor, String JavaDoc streamIdentifer);
53     
54     /**
55      * Adds the given hyperlink to this console. The link will be notified when
56      * entered, exited, and activated.
57      * <p>
58      * If the link's region (offset/length) is within the console's document
59      * current bounds, it is added immediately. Otherwise, the link is added
60      * when the console's document grows to contain the link's region.
61      * </p>
62      * @param link the hyperlink to add
63      * @param offset the character offset within the console document where the
64      * text associated with the hyperlink begins
65      * @param length the length of the associated hyperlink text
66      * @deprecated replaced with addLink(IHyperlink link, int offset, int length)
67      */

68     public void addLink(IConsoleHyperlink link, int offset, int length);
69
70     /**
71      * Adds the given hyperlink to this console. The link will be notified when
72      * entered, exited, and activated.
73      * <p>
74      * If the link's region (offset/length) is within the console's document
75      * current bounds, it is added immediately. Otherwise, the link is added
76      * when the console's document grows to contain the link's region.
77      * </p>
78      * @param link the hyperlink to add
79      * @param offset the character offset within the console document where the
80      * text associated with the hyperlink begins
81      * @param length the length of the associated hyperlink text
82      * @since 3.1
83      */

84     public void addLink(IHyperlink link, int offset, int length);
85     
86     /**
87      * Returns the region of text associated with the given hyperlink, or
88      * <code>null</code> if the given hyperlink is not contained in this
89      * console.
90      *
91      * @param link a console hyperlink
92      * @return region of text associated with the hyperlink, or <code>null</code>
93      * @deprecated replaced with getRegion(IHyperlink link) instead
94      */

95     public IRegion getRegion(IConsoleHyperlink link);
96
97     /**
98      * Returns the region of text associated with the given hyperlink, or
99      * <code>null</code> if the given hyperlink is not contained in this
100      * console.
101      *
102      * @param link a console hyperlink
103      * @return region of text associated with the hyperlink, or <code>null</code>
104      * @since 3.1
105      */

106     public IRegion getRegion(IHyperlink link);
107     
108     /**
109      * Returns the document associated with this console.
110      *
111      * @return document
112      */

113     public IDocument getDocument();
114     
115     /**
116      * Returns the process associated with this console.
117      *
118      * @return the process associated with this console
119      */

120     public IProcess getProcess();
121     
122     /**
123      * Adds the given pattern match listener to this console. The listener will
124      * be connected and receive match notifications.
125      * @param matchListener the listener to add
126      * @since 3.1
127      */

128     public void addPatternMatchListener(IPatternMatchListener matchListener);
129     
130     /**
131      * Removes the given pattern match listener from this console. The listener will be
132      * disconnected and will no longer receive match notifications.
133      * @param matchListener the pattern match listener to remove.
134      * @since 3.1
135      */

136     public void removePatternMatchListener(IPatternMatchListener matchListener);
137     
138     /**
139      * Returns the stream associated with the specified stream identifier.
140      * @param streamIdentifier Uniquely identifies the required stream
141      * @return The stream or <code>null</code> if none found with matching streamIdentifier
142      * @since 3.1
143      */

144     public IOConsoleOutputStream getStream(String JavaDoc streamIdentifier);
145 }
146
Popular Tags