public class ConsoleWindow extends Object
Constructor and Description |
---|
ConsoleWindow(Desktop desktop)
constructs a console window that calls against the given desktop.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the first console window if there is an open console.
|
void |
close(int consoleWindowIndex)
Closes the specified console window.
|
void |
close(ItemIdentifier windowIdentifier)
Closes the specified console window.
|
void |
close(String consoleWindowCaption)
Closes the specified console window.
|
void |
closeAll()
Closes all open console windows.
|
void |
closeAll(String consoleWindowCaption)
Closes all open console windows that match the specified caption.
|
String |
getContents()
Retrieves the contents of the first console window as a string.
|
String |
getContents(int consoleWindowIndex)
Retrieves the contents of the specified console window as a string.
|
String |
getContents(ItemIdentifier windowIdentifier)
Retrieves the contents of the specified console window as a string.
|
String |
getContents(String consoleWindowCaption)
Retrieves the contents of the specified console window as a string.
|
void |
open()
Opens a new console window.
|
void |
open(String consoleWindowCaption)
Opens a new console window with a specific caption.
|
void |
typeKeys(String keys)
Types the specified keys into the first console window.
|
void |
typeKeys(String keys,
int consoleWindowIndex)
Types the specified keys into the specified console window.
|
void |
typeKeys(String keys,
ItemIdentifier windowIdentifier)
Types the specified keys into the specified console window.
|
void |
typeKeys(String keys,
String consoleWindowCaption)
Types the specified keys into the specified console window.
|
public ConsoleWindow(Desktop desktop)
desktop
- the desktop to use
public void typeKeys(String keys)
Types the specified keys into the first console window. If no console window is open, a console is launched.
Sample UsageFor example, the following code executes the dir
command to list the files and directories of the current directory:
consoleWindow.typeKeys ("dir<Enter>");
keys
- the keys to type
public void typeKeys(String keys, String consoleWindowCaption)
Types the specified keys into the specified console window.
Sample UsageFor example, the following code executes the dir
command to list the files and directories of the current directory in a specific console window:
consoleWindow.typeKeys ("dir<Enter>", "my console window caption");
keys
- the keys to typeconsoleWindowCaption
- the caption of the console
public void typeKeys(String keys, int consoleWindowIndex)
Types the specified keys into the specified console window.
Sample UsageFor example, the following code executes the dir
command to list the files and directories of the current directory in the third console window:
consoleWindow.typeKeys ("dir<Enter>", 2);
keys
- the keys to typeconsoleWindowIndex
- the index of the console. The first console has index 0.
public void typeKeys(String keys, ItemIdentifier windowIdentifier)
keys
- the keys to typewindowIdentifier
- identifies the console
public String getContents()
public String getContents(String consoleWindowCaption)
consoleWindowCaption
- the caption of the consolepublic String getContents(int consoleWindowIndex)
consoleWindowIndex
- the index of the console. The first console has index 0.public String getContents(ItemIdentifier windowIdentifier)
windowIdentifier
- identifies the consolepublic void close()
public void close(String consoleWindowCaption)
consoleWindowCaption
- the caption of the console
public void close(int consoleWindowIndex)
consoleWindowIndex
- the index of the console. The first console has index 0.
public void close(ItemIdentifier windowIdentifier)
windowIdentifier
- identifies the console
public void open()
public void open(String consoleWindowCaption)
consoleWindowCaption
- the caption of the console window
public void closeAll()
public void closeAll(String consoleWindowCaption)
consoleWindowCaption
- The caption to search for.
Copyright 2009-2012 Micro Focus. All Rights Reserved.