public class IOConsole extends TextConsole
Clients may instantiate and subclass this class.
Constructor and Description |
---|
IOConsole(String name,
ImageDescriptor imageDescriptor)
Constructs a console with the given name and image.
|
IOConsole(String name,
String consoleType,
ImageDescriptor imageDescriptor)
Constructs a console with the given name, type, and image with the workbench's
default encoding.
|
IOConsole(String name,
String consoleType,
ImageDescriptor imageDescriptor,
boolean autoLifecycle)
Constructs a console with the given name, type, image, and lifecycle, with the
workbench's default encoding.
|
IOConsole(String name,
String consoleType,
ImageDescriptor imageDescriptor,
String encoding,
boolean autoLifecycle)
Constructs a console with the given name, type, image, encoding and lifecycle.
|
Modifier and Type | Method and Description |
---|---|
void |
clearConsole()
Clears the console.
|
IPageBookViewPage |
createPage(IConsoleView view)
Creates and returns a new page for this console.
|
protected void |
dispose()
Disposes this console.
|
String |
getEncoding()
Returns the encoding for this console, or
null to indicate
default encoding. |
int |
getHighWaterMark()
Returns the maximum number of characters that the console will display at
once.
|
IOConsoleInputStream |
getInputStream()
Returns the input stream connected to the keyboard.
|
int |
getLowWaterMark()
Returns the number of characters that will remain in this console
when its high water mark is exceeded.
|
protected IConsoleDocumentPartitioner |
getPartitioner()
Returns this console's document partitioner.
|
IOConsoleOutputStream |
newOutputStream()
Creates and returns a new output stream which may be used to write to this console.
|
void |
setInputStream(InputStream inputStream)
Sets the new input stream.
|
void |
setWaterMarks(int low,
int high)
Sets the text buffer size for this console.
|
addHyperlink, addPatternMatchListener, getAttribute, getBackground, getConsoleWidth, getDocument, getFont, getHyperlink, getHyperlinks, getRegion, getSchedulingRule, getTabWidth, matcherFinished, partitionerFinished, removePatternMatchListener, setAttribute, setBackgrond, setBackground, setConsoleWidth, setFont, setTabWidth
activate, addPropertyChangeListener, destroy, firePropertyChange, getHelpContextId, getImageDescriptor, getName, getType, init, initialize, removePropertyChangeListener, setImageDescriptor, setName, setType
public IOConsole(String name, String consoleType, ImageDescriptor imageDescriptor, boolean autoLifecycle)
name
- name to display for this consoleconsoleType
- console type identifier or null
imageDescriptor
- image to display for this console or null
autoLifecycle
- whether lifecycle methods should be called automatically
when this console is added/removed from the console managerpublic IOConsole(String name, String consoleType, ImageDescriptor imageDescriptor, String encoding, boolean autoLifecycle)
name
- name to display for this consoleconsoleType
- console type identifier or null
imageDescriptor
- image to display for this console or null
encoding
- the encoding that should be used to render the text, or null
if the system default encoding should be usedautoLifecycle
- whether lifecycle methods should be called automatically
when this console is added/removed from the console managerpublic IOConsole(String name, String consoleType, ImageDescriptor imageDescriptor)
name
- name to display for this consoleconsoleType
- console type identifier or null
imageDescriptor
- image to display for this console or null
public IOConsole(String name, ImageDescriptor imageDescriptor)
null
) type.name
- name to display for this consoleimageDescriptor
- image to display for this console or null
public IPageBookViewPage createPage(IConsoleView view)
IConsole
createPage
in interface IConsole
createPage
in class TextConsole
view
- the view in which the page is to be createdpublic IOConsoleOutputStream newOutputStream()
Clients should avoid writing large amounts of output to this stream in the UI thread. The console needs to process the output in the UI thread and if the client hogs the UI thread writing output to the console, the console will not be able to process the output.
public IOConsoleInputStream getInputStream()
public void setInputStream(InputStream inputStream)
inputStream
- the input streamprotected IConsoleDocumentPartitioner getPartitioner()
getPartitioner
in class TextConsole
public int getHighWaterMark()
public int getLowWaterMark()
public void setWaterMarks(int low, int high)
low
- the number of characters remaining in the buffer when the high
water mark is exceeded (if -1 the console does not limit output)high
- the maximum number of characters this console will cache in
its text buffer (if -1 the console does not limit output)IllegalArgumentException
- if low >= high & low != -1public void clearConsole()
TextConsole
Since a console may or may not support direct manipulation of its document's contents, this method should be called to clear a text console's document. The default implementation sets this console's document content to the empty string directly. Subclasses should override as required.
clearConsole
in class TextConsole
protected void dispose()
dispose
in class TextConsole
public String getEncoding()
null
to indicate
default encoding.null
to indicate
default encoding
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.