public class ConsolePlugin extends org.freehep.application.studio.Plugin implements ConsoleService
Constructor and Description |
---|
ConsolePlugin() |
Modifier and Type | Method and Description |
---|---|
Console |
createConsole(String name,
Icon icon)
Create a new console.
|
Console |
createConsole(String name,
Icon icon,
org.freehep.swing.popup.HasPopupItems popupItems)
Create a new console, with extra popup items.
|
Console |
getConsole(String name)
Get a pointer to an existing console with a given name.
|
ConsoleOutputStream |
getConsoleOutputStream(String name,
Icon icon)
Creates an output stream associated to a named console area.
|
ConsoleOutputStream |
getConsoleOutputStream(String name,
Icon icon,
AttributeSet set)
Create an attributed output stream
|
org.freehep.application.mdi.PageContext |
getPageContextForConsole(Console console)
Gets the page context corresponding to a given console.
|
protected void |
init() |
void |
redirectStandardOutputOnThreadToConsole(Thread thread,
ConsoleOutputStream out)
Redirects output to System.out for a specific thread to a given console
|
void |
showConsole(Console console)
Requests that a given console be made visible
|
public Console getConsole(String name)
ConsoleService
getConsole
in interface ConsoleService
name
- The name to search fornull
if no console by this name
existspublic Console createConsole(String name, Icon icon)
ConsoleService
createConsole
in interface ConsoleService
name
- The name of the newly created consoleicon
- An icon to associate with the console, or null
for no icon.public Console createConsole(String name, Icon icon, org.freehep.swing.popup.HasPopupItems popupItems)
ConsoleService
createConsole
in interface ConsoleService
name
- The name of the newly created consoleicon
- An icon to associate with the console, or null
for no icon.popupItems
- Allows extra popup items to be attached to console.public ConsoleOutputStream getConsoleOutputStream(String name, Icon icon) throws IOException
ConsoleService
getConsoleOutputStream
in interface ConsoleService
name
- The name of the console.icon
- The Icon to be used if a new console is created,
or null
.IOException
- If an IO error occurspublic ConsoleOutputStream getConsoleOutputStream(String name, Icon icon, AttributeSet set) throws IOException
ConsoleService
getConsoleOutputStream
in interface ConsoleService
name
- The name of the Consoleicon
- The icon to use if a new console is created,
or null
set
- The attributes for text created using this outputstream,
or null
for default attributes.IOException
- If an IO error occursConsoleService.getConsoleOutputStream(String, Icon)
protected void init() throws SAXException, IOException
init
in class org.freehep.application.studio.Plugin
SAXException
IOException
public void redirectStandardOutputOnThreadToConsole(Thread thread, ConsoleOutputStream out)
ConsoleService
redirectStandardOutputOnThreadToConsole
in interface ConsoleService
thread
- The thread for which redirection should applyout
- The output stream to redirect topublic void showConsole(Console console)
ConsoleService
showConsole
in interface ConsoleService
console
- The console to be made visiblepublic org.freehep.application.mdi.PageContext getPageContextForConsole(Console console)
ConsoleService
getPageContextForConsole
in interface ConsoleService
console
- The consolenull
if the console has been closed).Copyright © 2014. All Rights Reserved.