|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.ui.util.MessageViewer
Displays a set of messages, and optionally additional message detail.
MessageViewer
allows you to do the following:
AS400Message
objects
MessageViewer
accepts as input on creation:
Frame
or PanelManager
to be modal to.
import com.ibm.as400.ui.framework.java.*; MessageViewer mv = new MessageViewer("Sample Messages"); mv.addMessage("Test error message number one", "ID 1", "Detail information about error message number one. Something is very bad."); mv.addMessage("Test error message number two", "ID 2", "Detail information about error message number two. Something is very very bad."); mv.setStyle(MessageViewer.STYLE_OKCANCEL_DUAL); mv.setButtonText( MessageViewer.OK_DUAL_BUTTON, "Accept"); mv.setButtonText( MessageViewer.CANCEL_BUTTON, "Reject"); mv.setInstructionText("This is sample Instruction Text. Press a button, any button"); mv.setExitOnClose(true); mv.setVisible(true);
AS400Message
objects. MessageViewer
is designed to accept an AS400Message
object or array as input.
Detailed help for AS400 messages requires an AS400 object be provided using the setSystem
method.
import com.ibm.as400.access.*; AS400 system = new AS400("RCHASP04"); MessageViewer mv = new MessageViewer("Test Message Viewer Title",owner); mv.setSystem(system);
Field Summary | |
static java.lang.String |
ACTION_BUTTON
Button identifier for the Action button. |
static java.lang.String |
CANCEL_BUTTON
Button identifier for the Cancel button. |
static java.lang.String |
COPY_BUTTON
Button identifier for the Copy button. |
static java.lang.String |
DETAILS_BUTTON
Button identifier for the Details button. |
static java.lang.String |
OK_DUAL_BUTTON
Button identifier for the dual OK button. |
static java.lang.String |
OK_SINGLE_BUTTON
Button identifier for the single OK button. |
static int |
STYLE_OK_SINGLE
Style which displays a single OK button, which can be relabelled. |
static int |
STYLE_OKCANCEL_DUAL
Style which displays dual buttons, an OK and a Cancel, which can be relabelled, if desired. |
Constructor Summary | |
MessageViewer(java.lang.String strTitle)
Constructs a modeless MessageViewer panel. |
|
MessageViewer(java.lang.String strTitle,
java.awt.Frame owner)
Constructs a MessageViewer panel modal to a Frame . |
|
MessageViewer(java.lang.String strTitle,
PanelManager modalPanelManager)
Constructs a MessageViewer panel modal to a PanelManager . |
Method Summary | |
void |
addActionListenerButtonAction(java.awt.event.ActionListener listener)
Sets the listener of the Action button. |
void |
addActionListenerButtonCancel(java.awt.event.ActionListener listener)
Adds an ActionListener to the CANCEL button of the STYLE_OKCANCEL_DUAL style |
void |
addActionListenerButtonDetails(java.awt.event.ActionListener listener)
Sets the listener of the Details button. |
void |
addActionListenerButtonOKDual(java.awt.event.ActionListener listener)
Adds an ActionListener to the OK button of the STYLE_OKCANCEL_DUAL style |
void |
addActionListenerButtonOKSingle(java.awt.event.ActionListener listener)
Adds an ActionListener to the OK button of the STYLE_OK_SINGLE style |
void |
addMessage(AS400Message AS400msg)
Adds a message to be displayed. |
void |
addMessage(java.lang.String strMessage)
Adds a simple message to be displayed. |
void |
addMessage(java.lang.String strMessage,
java.lang.String strID,
java.lang.String strDetail)
Adds a message to be displayed. |
void |
addMessage(java.lang.String strMessage,
java.lang.String strID,
java.lang.String strHTMLDetail,
java.lang.String strAnchor)
Adds a message to be displayed and provides HTML details. |
void |
addMessage(java.lang.String strMessage,
java.lang.String strID,
java.net.URL urlDetails)
Adds a message to be displayed and provides a URL for details. |
void |
addMessages(AS400Message[] AS400msgList)
Adds messages to be displayed. |
void |
addMessages(java.lang.String[] strMessages,
java.lang.String[] strIDs,
java.lang.String[] strDetails)
Adds messages to be displayed. |
java.lang.String |
getButtonFlyoverText(java.lang.String buttonID)
Gets the button flyover text of a button on MessageViewer. |
java.lang.String |
getButtonText(java.lang.String buttonID)
Returns the button text of a MessageViewer button. |
java.lang.String |
getButtonTextCancel()
Returns the button text of the CANCEL button in the STYLE_OKCANCEL_DUAL style. |
java.lang.String |
getButtonTextOKDual()
Returns the label text of the OK button in the STYLE_OKCANCEL_DUAL style. |
java.lang.String |
getButtonTextOKSingle()
Returns the button text of the OK button in the STYLE_OK_SINGLE style. |
boolean |
getExitOnClose()
Determines whether the application exits when this panel is closed. |
java.lang.String |
getHelpSet()
Gets current JavaHelp helpset name for HTML messages. |
java.lang.String |
getIconName()
Returns the name of the icon used for this panel. |
java.lang.String |
getInstructionText()
Returns the panel instruction text. |
int |
getStyle()
Determines the display style of the panel. |
AS400 |
getSystem()
Gets the AS400 system being used for help detail. |
java.lang.String |
getTitle()
Returns the panel's title. |
void |
setButtonFlyoverText(java.lang.String buttonID,
java.lang.String strFlyoverText)
Sets the button flyover text of a button on MessageViewer. |
void |
setButtonText(java.lang.String buttonID,
java.lang.String strButtonText)
Sets the button text of a button on MessageViewer. |
void |
setButtonTextCancel(java.lang.String strButtonText)
Sets the label text of the CANCEL button in the STYLE_OKCANCEL_DUAL style. |
void |
setButtonTextOKDual(java.lang.String strButtonText)
Sets the label text of the OK button in the STYLE_OKCANCEL_DUAL style. |
void |
setButtonTextOKSingle(java.lang.String strButtonText)
Sets the label text of the OK button in the STYLE_OK_SINGLE style. |
void |
setExitOnClose(boolean bExit)
Controls whether the application exits when the panel is closed, based on the value of parameter bExit . |
void |
setHelpSet(java.lang.String helpSet)
Sets the JavaHelp helpset used for any messages shown as HTML help. |
void |
setIconName(java.lang.String fileName)
Overrides the name of the icon to use for this panel if a Frame is used. |
void |
setInstructionText(java.lang.String strInstruction)
Changes the panel instruction text. |
void |
setStyle(int iStyle)
Changes style settings, such as the display of the OK button, on a MessageViewer panel. |
void |
setSystem(AS400 as400)
Sets the AS400 system used for help detail. |
void |
setTitle(java.lang.String strTitle)
Overrides the panel title defined at the creation of the panel. |
void |
setVisible(boolean bVisible)
Shows or hides the panel, depending on the value of bVisible . |
static void |
showMessage(java.lang.String strTitle,
AS400Message[] as400messages,
AS400 system,
java.lang.String strInstructionText,
java.awt.Frame owner)
Convenience method which prepares and displays a single AS400 message. |
static void |
showMessage(java.lang.String strTitle,
java.lang.String strMessage,
java.lang.String strID,
java.lang.String strDetails,
java.lang.String strInstructionText,
java.awt.Frame owner)
Convenience method which prepares and displays a single message. |
static void |
showMessage(java.lang.String strTitle,
java.lang.String strMessage,
java.lang.String strID,
java.lang.String strHTMLDetails,
java.lang.String strAnchor,
java.lang.String strInstructionText,
java.awt.Frame owner)
Convenience method which prepares and displays a single message with HTML details. |
void |
valueChanged(javax.swing.event.ListSelectionEvent event)
Implementation for ListSelectionListener interface |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int STYLE_OK_SINGLE
getStyle()
,
setStyle(int)
public static final int STYLE_OKCANCEL_DUAL
getStyle()
,
setStyle(int)
public static final java.lang.String DETAILS_BUTTON
public static final java.lang.String OK_SINGLE_BUTTON
public static final java.lang.String OK_DUAL_BUTTON
public static final java.lang.String CANCEL_BUTTON
public static final java.lang.String ACTION_BUTTON
public static final java.lang.String COPY_BUTTON
Constructor Detail |
public MessageViewer(java.lang.String strTitle)
MessageViewer
panel.strTitle
- the Title to be displayed with the messages. If none given, defaults to "Display Messages"public MessageViewer(java.lang.String strTitle, java.awt.Frame owner)
MessageViewer
panel modal to a Frame
.strTitle
- the Title to be displayed with the messages. If none given, defaults to "Display Messages"owner
- the owning framepublic MessageViewer(java.lang.String strTitle, PanelManager modalPanelManager)
MessageViewer
panel modal to a PanelManager
.strTitle
- the Title to be displayed with the messages. If none given, defaults to "Display Messages"modalPanelManager
- PanelManager
object that controls the modalityMethod Detail |
public void setVisible(boolean bVisible)
bVisible
.bVisible
- "true" causes the panel to display, "false" causes it to be hiddenpublic void setStyle(int iStyle)
MessageViewer
panel.
iStyle
- the style to applypublic int getStyle()
setStyle(int)
public void setExitOnClose(boolean bExit)
bExit
.
The default value is false
.
This method has no effect if it is called after this panel is made visible, or if the application supplied the container to be managed.
bExit
- If true, exit the application; otherwise, just hide the panel.getExitOnClose()
public boolean getExitOnClose()
setExitOnClose(boolean)
public void setTitle(java.lang.String strTitle)
strTitle
- The title which should appear in the panel's title bar.getTitle()
public java.lang.String getTitle()
setTitle(java.lang.String)
public void setInstructionText(java.lang.String strInstruction)
The default instruction text is blank.
strInstruction
- The intruction text which should appear on the panel above the OK or YES/NO buttons.getInstructionText()
public java.lang.String getInstructionText()
setInstructionText(java.lang.String)
public void addActionListenerButtonOKDual(java.awt.event.ActionListener listener)
listener
- the listener to be added.addActionListenerButtonOKSingle(java.awt.event.ActionListener)
,
addActionListenerButtonCancel(java.awt.event.ActionListener)
public void addActionListenerButtonCancel(java.awt.event.ActionListener listener)
listener
- the listener to be added.addActionListenerButtonOKSingle(java.awt.event.ActionListener)
,
addActionListenerButtonOKDual(java.awt.event.ActionListener)
public void addActionListenerButtonOKSingle(java.awt.event.ActionListener listener)
listener
- the listener to be added.addActionListenerButtonOKDual(java.awt.event.ActionListener)
,
addActionListenerButtonCancel(java.awt.event.ActionListener)
public java.lang.String getButtonTextOKDual()
getButtonText(java.lang.String)
,
setButtonText(java.lang.String, java.lang.String)
,
setButtonTextOKDual(java.lang.String)
public java.lang.String getButtonTextOKSingle()
getButtonText(java.lang.String)
,
setButtonText(java.lang.String, java.lang.String)
,
setButtonTextOKSingle(java.lang.String)
public java.lang.String getButtonTextCancel()
getButtonText(java.lang.String)
,
setButtonText(java.lang.String, java.lang.String)
,
setButtonTextCancel(java.lang.String)
public void setButtonTextOKDual(java.lang.String strButtonText)
strButtonText
- the button textsetButtonText(java.lang.String, java.lang.String)
,
getButtonText(java.lang.String)
,
getButtonTextOKDual()
public void setButtonTextOKSingle(java.lang.String strButtonText)
strButtonText
- the button textsetButtonText(java.lang.String, java.lang.String)
,
getButtonText(java.lang.String)
,
getButtonTextOKSingle()
public void setButtonTextCancel(java.lang.String strButtonText)
strButtonText
- the button textsetButtonText(java.lang.String, java.lang.String)
,
getButtonText(java.lang.String)
,
getButtonTextCancel()
public java.lang.String getButtonText(java.lang.String buttonID)
buttonID
- the string identifier of the buttonsetButtonText(java.lang.String, java.lang.String)
public void setButtonText(java.lang.String buttonID, java.lang.String strButtonText)
buttonID
- the string identifier of the buttonstrButtonText
- the text to display on the buttongetButtonText(java.lang.String)
public void setButtonFlyoverText(java.lang.String buttonID, java.lang.String strFlyoverText)
buttonID
- the string identifier of the buttonstrFlyoverText
- the flyover text to displaygetButtonFlyoverText(java.lang.String)
public java.lang.String getButtonFlyoverText(java.lang.String buttonID)
buttonID
- the string identifier of the buttonsetButtonFlyoverText(java.lang.String, java.lang.String)
public void addActionListenerButtonDetails(java.awt.event.ActionListener listener)
The Details button is visible if one of more of the messages has detail.
public void addActionListenerButtonAction(java.awt.event.ActionListener listener)
listener
- the ActionListener
to be added.public void valueChanged(javax.swing.event.ListSelectionEvent event)
valueChanged
in interface javax.swing.event.ListSelectionListener
event
- the ListSelectionEvent
that has occurred.public void addMessage(java.lang.String strMessage, java.lang.String strID, java.lang.String strDetail)
If strDetail has a value, the Details button will be enabled.
strMessage
- the short message to be displayed in the MessageViewer
strID
- an identifier for the message. Displayed on the MessageDetail
panel.strDetail
- detail information about the message. Displayed on the MessageDetail
panel.public void addMessage(java.lang.String strMessage, java.lang.String strID, java.lang.String strHTMLDetail, java.lang.String strAnchor)
If strHTMLDetail has a value, the Details button will be enabled.
strMessage
- the short message to be displayed in the MessageViewer
strID
- an identifier for the message. Displayed on the MessageDetail
panel.strHTMLDetail
- detail information about the message in HTML format. Displayed in HelpViewer
.strAnchor
- an anchor within the HTML to position to.public void addMessage(java.lang.String strMessage, java.lang.String strID, java.net.URL urlDetails)
If strDetail has a value, the Details button will be enabled.
strMessage
- the short message to be displayed in the MessageViewer
strID
- an identifier for the message. Displayed on the MessageDetail
panel.urlDetails
- a URL where detail information exists. Displayed in HelpViewer
.public void addMessage(java.lang.String strMessage)
Messages added with this method have no detail. The Details button remains disabled.
strMessage
- the short message to be displayed in the MessageViewer
public void addMessage(AS400Message AS400msg)
setSystem.
AS400msg
- an AS400 message objectsetSystem(com.ibm.as400.access.AS400)
public void addMessages(AS400Message[] AS400msgList)
setSystem.
AS400msgList
- an array AS400 message objectssetSystem(com.ibm.as400.access.AS400)
public void addMessages(java.lang.String[] strMessages, java.lang.String[] strIDs, java.lang.String[] strDetails)
null
, or an empty String.
strMessages
- array of short messages to be displayed in the MessageViewer
strIDs
- array of message identifiers. Displayed on the MessageDetail
panel.strDetails
- array of matching detail information for each message. Displayed on the MessageDetail
panel.public static void showMessage(java.lang.String strTitle, java.lang.String strMessage, java.lang.String strID, java.lang.String strDetails, java.lang.String strInstructionText, java.awt.Frame owner)
strTitle
- the title of the message boxstrMessage
- the short message to be displayed in the MessageViewer
strID
- an identifier for the message. Displayed on the MessageDetail
panel.strDetail
- detail information about the message. Displayed on the MessageDetail
panel.strInstructionText
- instruction text for the userowner
- the owning frame, may be nullpublic static void showMessage(java.lang.String strTitle, java.lang.String strMessage, java.lang.String strID, java.lang.String strHTMLDetails, java.lang.String strAnchor, java.lang.String strInstructionText, java.awt.Frame owner)
strTitle
- the title of the message boxstrMessage
- the short message to be displayed in the MessageViewer
strID
- an identifier for the message. Displayed on the MessageDetail
panel.strHTMLDetails
- HTML information which should be displayed as Detail. Displayed in a HelpViewer
window. Takes precedence over standard Detail information.strAnchor
- Optional anchor withing the HTML information to scroll to.strInstructionText
- instruction text for the userowner
- the owning frame, may be nullpublic static void showMessage(java.lang.String strTitle, AS400Message[] as400messages, AS400 system, java.lang.String strInstructionText, java.awt.Frame owner)
strTitle
- the title of the message boxas400messages
- an array of AS400Message objects to displaysystem
- the AS400 object to get the detail information fromstrInstructionText
- instruction text for the userowner
- the owning frame, may be nullpublic void setSystem(AS400 as400)
as400
- An AS400 object.public AS400 getSystem()
public void setIconName(java.lang.String fileName)
fileName
- The filename of the icon to search for in the classpath.getIconName()
public java.lang.String getIconName()
getIconName()
public void setHelpSet(java.lang.String helpSet)
helpSet
- name of the help setpublic java.lang.String getHelpSet()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |