Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.ui.console
Class IOConsole


java.lang.Object
  extended by 

org.eclipse.ui.console.AbstractConsole
      extended by 

org.eclipse.ui.console.TextConsole
          extended by 
org.eclipse.ui.console.IOConsole
All Implemented Interfaces:
IConsole
Direct Known Subclasses:
MessageConsole

public class IOConsole
extends TextConsole

A console that displays text from I/O streams. An I/O console can have multiple output streams connected to it and provides one input stream connected to the keyboard.

Clients may instantiate and subclass this class.

Since:
3.1

Constructor Summary
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.
 
Method Summary
 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 setWaterMarks (int low, int high)
          Sets the text buffer size for this console.
 
Methods inherited from class org.eclipse.ui.console. TextConsole
addHyperlink, addPatternMatchListener, getAttribute, getBackground, getConsoleWidth, getDocument, getFont, getHyperlink, getHyperlinks, getRegion, getSchedulingRule, getTabWidth, matcherFinished, partitionerFinished, removePatternMatchListener, setAttribute, setBackgrond, setBackground, setConsoleWidth, setFont, setTabWidth
 
Methods inherited from class org.eclipse.ui.console. AbstractConsole
activate, addPropertyChangeListener, destroy, firePropertyChange, getHelpContextId, getImageDescriptor, getName, getType, init, initialize, removePropertyChangeListener, setImageDescriptor, setName, setType
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOConsole

public 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.

Parameters:
name - name to display for this console
consoleType - 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 manager

IOConsole

public IOConsole(
String name,
                 
String consoleType,
                 
ImageDescriptor imageDescriptor,
                 
String encoding,
                 boolean autoLifecycle)
Constructs a console with the given name, type, image, encoding and lifecycle.

Parameters:
name - name to display for this console
consoleType - 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 used
autoLifecycle - whether lifecycle methods should be called automatically when this console is added/removed from the console manager

IOConsole

public IOConsole(
String name,
                 
String consoleType,
                 
ImageDescriptor imageDescriptor)
Constructs a console with the given name, type, and image with the workbench's default encoding. Lifecycle methods will be called when this console is added/removed from the console manager.

Parameters:
name - name to display for this console
consoleType - console type identifier or null
imageDescriptor - image to display for this console or null

IOConsole

public IOConsole(
String name,
                 
ImageDescriptor imageDescriptor)
Constructs a console with the given name and image. Lifecycle methods will be called when this console is added/removed from the console manager. This console will have an unspecified (null) type.

Parameters:
name - name to display for this console
imageDescriptor - image to display for this console or null
Method Detail

createPage

public 
IPageBookViewPage createPage(
IConsoleView view)
Description copied from interface: IConsole
Creates and returns a new page for this console. The page is displayed for this console in the console given view.

Specified by:
createPage in interface IConsole
Overrides:
createPage in class TextConsole
Parameters:
view - the view in which the page is to be created
Returns:
a page book view page representation of this console

newOutputStream

public 
IOConsoleOutputStream newOutputStream()
Creates and returns a new output stream which may be used to write to this console. A console may be connected to more than one output stream at once. Clients are responsible for closing any output streams created on this console.

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.

Returns:
a new output stream connected to this console

getInputStream

public 
IOConsoleInputStream getInputStream()
Returns the input stream connected to the keyboard.

Returns:
the input stream connected to the keyboard.

getPartitioner

protected 
IConsoleDocumentPartitioner getPartitioner()
Returns this console's document partitioner.

Specified by:
getPartitioner in class TextConsole
Returns:
this console's document partitioner

getHighWaterMark

public int getHighWaterMark()
Returns the maximum number of characters that the console will display at once. This is analogous to the size of the text buffer this console maintains.

Returns:
the maximum number of characters that the console will display

getLowWaterMark

public int getLowWaterMark()
Returns the number of characters that will remain in this console when its high water mark is exceeded.

Returns:
the number of characters that will remain in this console when its high water mark is exceeded

setWaterMarks

public void setWaterMarks(int low,
                          int high)
Sets the text buffer size for this console. The high water mark indicates the maximum number of characters stored in the buffer. The low water mark indicates the number of characters remaining in the buffer when the high water mark is exceeded.

Parameters:
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)
Throws:
IllegalArgumentException - if low >= high & low != -1

clearConsole

public void clearConsole()
Description copied from class: TextConsole
Clears the console.

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.

Overrides:
clearConsole in class TextConsole

dispose

protected void dispose()
Disposes this console.

Overrides:
dispose in class TextConsole

getEncoding

public 
String getEncoding()
Returns the encoding for this console, or null to indicate default encoding.

Returns:
the encoding set for this console, or null to indicate default encoding
Since:
3.3

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire