|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ui.console.AbstractConsole
org.eclipse.ui.console.TextConsole
An abstract text console that supports regular expression matching and hyperlinks.
Pattern match listeners can be registered with a console programmatically
or via the org.eclipse.ui.console.consolePatternMatchListeners
extension point.
Clients may subclass this class. Subclasses must provide a document partitioner.
Constructor Summary | |
---|---|
TextConsole(String name,
String consoleType,
ImageDescriptor imageDescriptor,
boolean autoLifecycle)
Constructs a console with the given name, image descriptor, and lifecycle |
Method Summary | |
---|---|
void |
addHyperlink(IHyperlink hyperlink,
int offset,
int length)
Adds a hyperlink to this console. |
void |
addPatternMatchListener(IPatternMatchListener listener)
Adds the given pattern match listener to this console. |
void |
clearConsole()
Clears the console. |
IPageBookViewPage |
createPage(IConsoleView view)
Creates and returns a new page for this console. |
protected void |
dispose()
Called when this console is removed from the console manager. |
Object |
getAttribute(String key)
Returns the attribue associated with the specified key. |
int |
getConsoleWidth()
Returns the current width of this console. |
IDocument |
getDocument()
Returns this console's document. |
Font |
getFont()
Returns the font used by this console. |
IHyperlink |
getHyperlink(int offset)
Returns the hyperlink at the given offset of null if none. |
IHyperlink[] |
getHyperlinks()
Returns all hyperlinks in this console. |
protected abstract IConsoleDocumentPartitioner |
getPartitioner()
Returns the console's document partitioner. |
IRegion |
getRegion(IHyperlink link)
Returns the region assocaited with the given hyperlink. |
ISchedulingRule |
getSchedulingRule()
Returns a scheduling rule which can be used to prevent jobs from running while this console's pattern matcher is active. |
int |
getTabWidth()
Returns the tab width used in this console. |
void |
matcherFinished()
Called by this console's pattern matcher when matching is complete. |
void |
partitionerFinished()
This console's partitioner should call this method when it is not expecting any new data to be appended to the document. |
void |
removePatternMatchListener(IPatternMatchListener listener)
Removes the given pattern match listener from this console. |
void |
setAttribute(String key,
Object value)
Sets an attribute value. |
void |
setConsoleWidth(int width)
Sets the width of this console in characters. |
void |
setFont(Font newFont)
Sets the font used by this console. |
void |
setTabWidth(int newTabWidth)
Sets the tab width used in this console. |
Methods inherited from class org.eclipse.ui.console.AbstractConsole |
---|
activate, addPropertyChangeListener, destroy, firePropertyChange, 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 |
public TextConsole(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 managerMethod Detail |
protected void dispose()
AbstractConsole
Since 3.1, this methods is only called automatically if this console was created with an automatic lifecycle.
dispose
in class AbstractConsole
public IPageBookViewPage createPage(IConsoleView view)
IConsole
view
- the view in which the page is to be created
public IDocument getDocument()
Note that a console may or may not support direct manipulation of its document. For example, an I/O console document and its partitions are produced from the streams connected to it, and clients are not intended to modify the document's contents.
public int getConsoleWidth()
public void setConsoleWidth(int width)
width
- the width to make this console. Values of 0 or less imply
the console does not have any fixed width.public void setTabWidth(int newTabWidth)
newTabWidth
- the tab widthpublic int getTabWidth()
public Font getFont()
public void setFont(Font newFont)
null
to use
the default text font.
newFont
- font, or null
to indicate the default fontpublic void clearConsole()
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.
protected abstract IConsoleDocumentPartitioner getPartitioner()
public IHyperlink[] getHyperlinks()
public IHyperlink getHyperlink(int offset)
null
if none.
offset
- offset for which a hyperlink is requested
null
if nonepublic void addPatternMatchListener(IPatternMatchListener listener)
listener
- the listener to addpublic void removePatternMatchListener(IPatternMatchListener listener)
listener
- the pattern match listener to removepublic ISchedulingRule getSchedulingRule()
public void partitionerFinished()
public void matcherFinished()
Clients should not call this method.
public void addHyperlink(IHyperlink hyperlink, int offset, int length) throws BadLocationException
hyperlink
- the hyperlink to addoffset
- the offset in the console document at which the hyperlink should be addedlength
- the length of the text which should be hyperlinked
BadLocationException
- if the specified location is not valid.public IRegion getRegion(IHyperlink link)
link
- hyperlink
public Object getAttribute(String key)
key
- attribute key
public void setAttribute(String key, Object value)
key
- attribute keyvalue
- attribute value
|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.