01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.console;
11:
12: import org.eclipse.jface.resource.ImageDescriptor;
13: import org.eclipse.jface.util.IPropertyChangeListener;
14: import org.eclipse.ui.part.IPageBookViewPage;
15:
16: /**
17: * A console. A console is commonly used to display messages such as the output
18: * streams of a system process. A console can be displayed in one or more console
19: * views.
20: * <p>
21: * The console implementations provided by this plug-in are textual
22: * (<code>TextConsole</code>, <code>MessageConsole</code> and <code>IOConsole</code>).
23: * However a client can provide alternate presentations since a console implementation
24: * is responsible for providing is page for the page book views in which consoles are
25: * displayed.
26: * </p>
27: * <p>
28: * This interface is not intended to be implemented directly by clients.
29: * Subclass <code>AbstractConsole</code> instead.
30: * </p>
31: * @since 3.0
32: */
33: public interface IConsole {
34:
35: /**
36: * Returns the name of this console.
37: *
38: * @return the name of this console
39: */
40: public String getName();
41:
42: /**
43: * Returns an image descriptor for this console, or <code>null</code>
44: * if none.
45: *
46: * @return an image descriptor for this console, or <code>null</code>
47: * if none
48: */
49: public ImageDescriptor getImageDescriptor();
50:
51: /**
52: * Creates and returns a new page for this console. The page is displayed
53: * for this console in the console given view.
54: *
55: * @param view the view in which the page is to be created
56: * @return a page book view page representation of this console
57: */
58: public IPageBookViewPage createPage(IConsoleView view);
59:
60: /**
61: * Adds a listener for changes to properties of this console.
62: * Has no effect if an identical listener is already registered.
63: * <p>
64: * The changes supported by the console view are as follows:
65: * <ul>
66: * <li><code>IBasicPropertyConstants.P_TEXT</code> - indicates the name
67: * of a console has changed</li>
68: * <li><code>IBasicPropertyConstants.P_IMAGE</code> - indicates the image
69: * of a console has changed</li>
70: * </ul>
71: * </p>
72: * <p>
73: * Consoles may define additional properties as required.
74: * </p>
75: *
76: * @param listener a property change listener
77: */
78: public void addPropertyChangeListener(
79: IPropertyChangeListener listener);
80:
81: /**
82: * Removes the given property listener from this console page.
83: * Has no effect if an identical listener is not already registered.
84: *
85: * @param listener a property listener
86: */
87: public void removePropertyChangeListener(
88: IPropertyChangeListener listener);
89:
90: /**
91: * Returns a unique identifier for this console's type, or <code>null</code>
92: * if unspecified.
93: *
94: * @return a unique identifier for this console's type, or <code>null</code>
95: * @since 3.1
96: */
97: public String getType();
98:
99: }
|