Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 3cd80c8cec7e3f1a8b2d0ea8b90bf5d0b5c4c1d6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/*******************************************************************************
 * Copyright (c) 2000, 2013 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
 *******************************************************************************/
package org.eclipse.debug.ui.console;


import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.core.model.IStreamMonitor;
import org.eclipse.debug.core.model.IStreamsProxy;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.ui.console.IHyperlink;
import org.eclipse.ui.console.IOConsoleOutputStream;
import org.eclipse.ui.console.IPatternMatchListener;

/**
 * A console that displays output and writes input to a process. Implementors of
 * <code>IConsoleColorProvider</code> should connect streams to a console
 * document when connected to.
 * @see org.eclipse.debug.ui.console.IConsoleColorProvider
 * @since 2.1
 * @noimplement This interface is not intended to be implemented by clients.
 * @noextend This interface is not intended to be extended by clients.
 */
public interface IConsole {

	/**
	 * Connects this console to the given streams proxy. This associates the
	 * standard in, out, and error streams with the console. Keyboard input will
	 * be written to the given proxy.
	 *
	 * @param streamsProxy the proxy to connect this console to
	 */
	void connect(IStreamsProxy streamsProxy);

	/**
	 * Connects this console to the given stream monitor, uniquely identified by
	 * the given identifier. This allows for more than the standard (in, out,
	 * error) streams to be connected to the console.
	 *
	 * @param streamMonitor the monitor to connect this console to
	 * @param streamIdentifer the stream identifier to connect this console to
	 */
	void connect(IStreamMonitor streamMonitor, String streamIdentifer);

	/**
	 * Adds the given hyperlink to this console. The link will be notified when
	 * entered, exited, and activated.
	 * <p>
	 * If the link's region (offset/length) is within the console's document
	 * current bounds, it is added immediately. Otherwise, the link is added
	 * when the console's document grows to contain the link's region.
	 * </p>
	 * @param link the hyperlink to add
	 * @param offset the character offset within the console document where the
	 * text associated with the hyperlink begins
	 * @param length the length of the associated hyperlink text
	 * @deprecated replaced with addLink(IHyperlink link, int offset, int length)
	 */
	@Deprecated void addLink(IConsoleHyperlink link, int offset, int length);

	/**
	 * Adds the given hyperlink to this console. The link will be notified when
	 * entered, exited, and activated.
	 * <p>
	 * If the link's region (offset/length) is within the console's document
	 * current bounds, it is added immediately. Otherwise, the link is added
	 * when the console's document grows to contain the link's region.
	 * </p>
	 * @param link the hyperlink to add
	 * @param offset the character offset within the console document where the
	 * text associated with the hyperlink begins
	 * @param length the length of the associated hyperlink text
	 * @since 3.1
	 */
	void addLink(IHyperlink link, int offset, int length);

	/**
	 * Returns the region of text associated with the given hyperlink, or
	 * <code>null</code> if the given hyperlink is not contained in this
	 * console.
	 *
	 * @param link a console hyperlink
	 * @return region of text associated with the hyperlink, or <code>null</code>
	 * @deprecated replaced with getRegion(IHyperlink link) instead
	 */
	@Deprecated IRegion getRegion(IConsoleHyperlink link);

	/**
	 * Returns the region of text associated with the given hyperlink, or
	 * <code>null</code> if the given hyperlink is not contained in this
	 * console.
	 *
	 * @param link a console hyperlink
	 * @return region of text associated with the hyperlink, or <code>null</code>
	 * @since 3.1
	 */
	IRegion getRegion(IHyperlink link);

	/**
	 * Returns the document associated with this console.
	 *
	 * @return document
	 */
	IDocument getDocument();

	/**
	 * Returns the process associated with this console.
	 *
	 * @return the process associated with this console
	 */
	IProcess getProcess();

	/**
	 * Adds the given pattern match listener to this console. The listener will
     * be connected and receive match notifications.
	 * @param matchListener the listener to add
	 * @since 3.1
	 */
	void addPatternMatchListener(IPatternMatchListener matchListener);

    /**
     * Removes the given pattern match listener from this console. The listener will be
     * disconnected and will no longer receive match notifications.
     * @param matchListener the pattern match listener to remove.
     * @since 3.1
     */
	void removePatternMatchListener(IPatternMatchListener matchListener);

	/**
	 * Returns the stream associated with the specified stream identifier.
     * @param streamIdentifier Uniquely identifies the required stream
     * @return The stream or <code>null</code> if none found with matching streamIdentifier
     * @since 3.1
     */
	IOConsoleOutputStream getStream(String streamIdentifier);
}

Back to the top