Class TdbKernelWindow
- All Implemented Interfaces:
com.tietoenator.trip.jxp.internal.utils.DOMSink
Kernel window buffers mirror the content of memory on the server, and are used to contain the results of output-generating commands. All such commands use the kernel's output formatter to create the content of the window buffers, and so the content is limited to the capabilities of that output formatter. For richer, more modern results, applications should make use of the data retrieval capabilities in the com.tietoenator.nxp.data.TdbRecord and com.tietoenator.nxp.data.TdbRecordSet classes and then transform the resulting information using XSLT for rich presentation.
-
Constructor Summary
ConstructorsConstructorDescriptionTdbKernelWindow
(TdbSession session) Constructor, doesn't create a server bufferTdbKernelWindow
(TdbSession session, TdbKernelWindowType type) Constructor, creates a new kernel window buffer on the server with dimensions 20x80TdbKernelWindow
(TdbSession session, TdbKernelWindowType type, int rows, int cols) Constructor, creates a new kernel window buffer on the server. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear the local buffervoid
close()
Close the kernel window, release any associated resources on both client and server.int
getId()
Retrieve the ID of the windowGet the current string used to render line breaks.getType()
Retrieve the type of the windowRetrieve the XML name of the windowhits()
Retrieve any hit points relevant to the current buffer.boolean
Check if the window is positioned at the "bottom" of the available outputboolean
isAtTop()
Check if the window is positioned at the "top" of the available outputboolean
Check if the window contains focus points (Show FOCus output)boolean
Retrieve information on the use of line feed for the current data in the window buffer.boolean
Check if the window is using scrolling output or replaced outputlines()
Retrieve the most recent update to the buffer.void
Scroll the buffer "down" a "page" at a time.void
Scroll the buffer "down" so that the next record after the last currently being displayed in the buffer is at the top of the buffer.void
Scroll the buffer "up" so that the previous record before the topmost currently being displayed in the buffer is at the top of the buffer.void
scrollUp()
Scroll the buffer "up" a "page" at a time.void
setLineBreak
(String lf) Get the current string used to render line breaks.toFormattedString
(String before, String after, String linebreak) Create a formatted string from the buffer's current contents.toString()
Overrides the default to provide the text content of the window buffer, lines delimited with newlines (if the NOLF filter is not used).Methods inherited from class com.tietoenator.trip.jxp.TdbMessageProvider
codeList, getLastCode, getLastMessage, hasMessages, messageList, resetMessages
Methods inherited from class com.tietoenator.trip.jxp.session.TdbSessionObject
cancel, getSession, isCancelable, setCancelable
-
Constructor Details
-
TdbKernelWindow
public TdbKernelWindow(TdbSession session, TdbKernelWindowType type, int rows, int cols) throws TdbException Constructor, creates a new kernel window buffer on the server.- Parameters:
session
- Active sessiontype
- Window typerows
- Vertical dimension of the buffer to createcols
- Horizontal dimension of the buffer to create- Throws:
TdbException
-
TdbKernelWindow
Constructor, creates a new kernel window buffer on the server with dimensions 20x80- Parameters:
session
- Active sessiontype
- Wndow type- Throws:
TdbException
-
TdbKernelWindow
Constructor, doesn't create a server buffer- Parameters:
session
- Active session- Throws:
TdbException
-
-
Method Details
-
getTypeName
Retrieve the XML name of the window- Returns:
- The name of the window in TRIPxpi protocol form
-
getType
Retrieve the type of the window- Returns:
- The type of the window
-
getId
public int getId()Retrieve the ID of the window- Returns:
- The window ID
-
isAtTop
public boolean isAtTop()Check if the window is positioned at the "top" of the available output- Returns:
- true if the window cannot be further scrolled up
-
isAtBottom
public boolean isAtBottom()Check if the window is positioned at the "bottom" of the available output- Returns:
- true if the window cannot be further scrolled down
-
isScrollingWindow
public boolean isScrollingWindow()Check if the window is using scrolling output or replaced output- Returns:
- true if the window is free-scrolling, false if it is paged
-
isFocused
public boolean isFocused()Check if the window contains focus points (Show FOCus output)- Returns:
- true if the window contains focus points
-
getLineBreak
Get the current string used to render line breaks.The default is carriage return and linefeed (CRLF)
This string will be used as linebreak in the toString() method, and in the toFormattedString() methods if null is passed as the line break argument.
- Returns:
- Linebreak string
-
setLineBreak
Get the current string used to render line breaks.The default is carriage return and linefeed (CRLF)
This string will be used as linebreak in the toString() method, and in the toFormattedString() methods if null is passed as the line break argument.
- Parameters:
lf
- String to use for line breaks
-
lines
Retrieve the most recent update to the buffer. This collection of "lines" is overwritten every time there is an operation on the kernel window.- Returns:
- The collection of kernel buffer "lines"
-
hits
Retrieve any hit points relevant to the current buffer. This collection of hit points is overwritten every time there is an operation on the kernel window.- Returns:
- The collection of hit points
-
isLinePlanned
public boolean isLinePlanned()Retrieve information on the use of line feed for the current data in the window buffer.This property is true unless the NOLF filter is used in the output format. Applications can check this method to determine how the lines in the window buffer should be delimited.
Note that for SHOW orders from clusters with mixed output formats where some databases use a NOLF filter and some do not, the linefeed behavior is undefined for window buffers that contain information from more than one database.
- Returns:
- True if lines should be delimited by a line feed or equivalent
-
clear
public void clear()Clear the local buffer -
scrollDown
Scroll the buffer "down" a "page" at a time. Invoking this method causes network I/O.- Throws:
TdbException
-
scrollUp
Scroll the buffer "up" a "page" at a time. Invoking this method causes network I/O.- Throws:
TdbException
-
scrollNext
Scroll the buffer "down" so that the next record after the last currently being displayed in the buffer is at the top of the buffer. Invoking this method causes network I/O.- Throws:
TdbException
-
scrollPrevious
Scroll the buffer "up" so that the previous record before the topmost currently being displayed in the buffer is at the top of the buffer. Invoking this method causes network I/O.- Throws:
TdbException
-
close
Close the kernel window, release any associated resources on both client and server. Invoking this method causes network I/O.- Throws:
TdbException
-
toFormattedString
Create a formatted string from the buffer's current contents. Could be used, for example, to create (very) simple HTML suitable for insertion within a <div>- Parameters:
before
- String to be inserted before hit termsafter
- String to be inserted after hit termslinebreak
- String to be inserted to delimit lines within the buffer, or null to use the default linebreak style- Returns:
- The formatted string
- Throws:
TdbException
-
toString
Overrides the default to provide the text content of the window buffer, lines delimited with newlines (if the NOLF filter is not used). Hit points are not marked up.
-