All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.as400.ui.util.MessageViewer
java.lang.Object
|
+----com.ibm.as400.ui.util.MessageViewer
- public class MessageViewer
- extends Object
- implements ListSelectionListener
Displays a set of messages.
MessageViewer
allows you to do the following:
- Control the style of the display and the text of buttons
- Control the instruction text displayed
- Specify several messages for display
- Display the set of messages
- Display additional detail if the message has addition detail.
MessageViewer
accepts as input on creation:
Examples
The following code constructs a newly-defined panel, adds messages,
sets the style and instructional text, and displays the panel.
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(STYLE_OKCANCEL_DUAL);
mv.setButtonTextOKDual( "Accept");
mv.setButtonTextCancel( "Reject");
mv.setInstructionText("This is sample Instruction Text. Press a button, any button");
mv.setExitOnClose(true);
mv.setVisible(true);
-
STYLE_OK_SINGLE
- Style which displays dual buttons, an OK and a Cancel, which can be relabelled, if desired.
-
STYLE_OKCANCEL_DUAL
- Style which displays a single OK button, which can be relabelled.
-
MessageViewer(String)
- Constructs a
MessageViewer
panel.
-
MessageViewer(String, Frame)
- Constructs a
MessageViewer
panel.
-
MessageViewer(String, PanelManager)
- Constructs a
MessageViewer
panel.
-
addActionListenerButtonCancel(ActionListener)
- Adds an ActionListener to the CANCEL button of the STYLE_OKCANCEL_DUAL style
-
addActionListenerButtonOKDual(ActionListener)
- Adds an ActionListener to the OK button of the STYLE_OKCANCEL_DUAL style
-
addActionListenerButtonOKSingle(ActionListener)
- Adds an ActionListener to the OK button of the STYLE_OK_SINGLE style
-
addMessage(AS400Message)
- Adds a message to be displayed.
-
addMessage(String)
- Adds a simple message to be displayed.
-
addMessage(String, String, String)
- Adds a message to be displayed.
-
addMessages(AS400Message[])
- Adds a message to be displayed.
-
getButtonTextCancel()
- Returns the label text of the CANCEL button in the STYLE_OKCANCEL_DUAL style.
-
getButtonTextOKDual()
- Returns the label text of the OK button in the STYLE_OKCANCEL_DUAL style.
-
getButtonTextOKSingle()
- Returns the label text of the OK button in the STYLE_OK_SINGLE style.
-
getExitOnClose()
- Determines whether the application exits when this panel is closed.
-
getInstructionText()
- Returns the panel instruction text.
-
getStyle()
- Determines the display style of the panel.
-
getTitle()
- Returns the panel's title.
-
setButtonTextCancel(String)
- Sets the label text of the CANCEL button in the STYLE_OKCANCEL_DUAL style.
-
setButtonTextOKDual(String)
- Sets the label text of the OK button in the STYLE_OKCANCEL_DUAL style.
-
setButtonTextOKSingle(String)
- Sets the label text of the OK button in the STYLE_OK_SINGLE style.
-
setExitOnClose(boolean)
- Controls whether the application exits when the panel is closed, based on the value of parameter
bExit
.
-
setInstructionText(String)
- Changes the panel instruction text.
-
setStyle(int)
- Changes style settings, such as the display of the OK button, on a
MessageViewer
panel.
-
setTitle(String)
- Overrides the panel title defined at the creation of the panel.
-
setVisible(boolean)
- Shows or hides the panel, depending on the value of
bVisible<\code>.
-
valueChanged(ListSelectionEvent)
-
STYLE_OK_SINGLE
public static final int STYLE_OK_SINGLE
- Style which displays dual buttons, an OK and a Cancel, which can be relabelled, if desired. To be used when there is a need to make a choice based on the messages displayed.
- See Also:
- getStyle, setStyle
STYLE_OKCANCEL_DUAL
public static final int STYLE_OKCANCEL_DUAL
- Style which displays a single OK button, which can be relabelled. This is the default.
- See Also:
- getStyle, setStyle
MessageViewer
public MessageViewer(String strTitle)
- Constructs a
MessageViewer
panel.
- Parameters:
- strTitle - the Title to be displayed with the messages. If none given, defaults to "Display Messages"
MessageViewer
public MessageViewer(String strTitle,
Frame owner)
- Constructs a
MessageViewer
panel.
- Parameters:
- strTitle - the Title to be displayed with the messages. If none given, defaults to "Display Messages"
- owner - the owning frame
MessageViewer
public MessageViewer(String strTitle,
PanelManager modalPanelManager)
- Constructs a
MessageViewer
panel.
- Parameters:
- strTitle - the Title to be displayed with the messages. If none given, defaults to "Display Messages"
- modalPanelManager -
PanelManager
object that controls the modality
setVisible
public void setVisible(boolean bVisible)
- Shows or hides the panel, depending on the value of
bVisible<\code>.
- Parameters:
- bVisible - "true" causes the panel to display, "false" causes it to be hidden
setStyle
public void setStyle(int iStyle)
- Changes style settings, such as the display of the OK button, on a
MessageViewer
panel.
- STYLE_OKCANCEL_DUAL
- Displays dual buttons, an OK and a Cancel, which can be relabelled, if desired. To be used when there is a need to make a choice based on the messages displayed.
- STYLE_OK_SINGLE
- Displays a single OK button, which can be relabelled. This is the default.
- Parameters:
- iStyle - the style to apply
getStyle
public int getStyle()
- Determines the display style of the panel.
- Returns:
- the display style of the panel.
- See Also:
- setStyle
setExitOnClose
public void setExitOnClose(boolean bExit)
- Controls whether the application exits when the panel is closed, based on the value of parameter
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.
- Parameters:
- bExit - If true, exit the application; otherwise, just hide the panel.
- See Also:
- getExitOnClose
getExitOnClose
public boolean getExitOnClose()
- Determines whether the application exits when this panel is closed.
- Returns:
- true if the application will be exited; false otherwise.
- See Also:
- setExitOnClose
setTitle
public void setTitle(String strTitle)
- Overrides the panel title defined at the creation of the panel.
- Parameters:
- strTitle - The title which should appear in the panel's title bar.
- See Also:
- getTitle
getTitle
public String getTitle()
- Returns the panel's title.
- Returns:
- The title which appears in the panel's title bar.
- See Also:
- setTitle
setInstructionText
public void setInstructionText(String strInstruction)
- Changes the panel instruction text.
The default instruction text is blank.
- Parameters:
- strInstruction - The intruction text which should appear on the panel above the OK or YES/NO buttons.
- See Also:
- getInstructionText
getInstructionText
public String getInstructionText()
- Returns the panel instruction text.
- See Also:
- setInstructionText
addActionListenerButtonOKDual
public void addActionListenerButtonOKDual(ActionListener listener)
- Adds an ActionListener to the OK button of the STYLE_OKCANCEL_DUAL style
- Parameters:
- listener - the listener to be added.
- See Also:
- addActionListenerButtonOKSingle, addActionListenerButtonCancel
addActionListenerButtonCancel
public void addActionListenerButtonCancel(ActionListener listener)
- Adds an ActionListener to the CANCEL button of the STYLE_OKCANCEL_DUAL style
- Parameters:
- listener - the listener to be added.
- See Also:
- addActionListenerButtonOKSingle, addActionListenerButtonOKDual
addActionListenerButtonOKSingle
public void addActionListenerButtonOKSingle(ActionListener listener)
- Adds an ActionListener to the OK button of the STYLE_OK_SINGLE style
- Parameters:
- listener - the listener to be added.
- See Also:
- addActionListenerButtonOKDual, addActionListenerButtonCancel
getButtonTextOKDual
public String getButtonTextOKDual()
- Returns the label text of the OK button in the STYLE_OKCANCEL_DUAL style.
- See Also:
- getButtonTextOKSingle, getButtonTextCancel, setButtonTextOKDual, setButtonTextOKSingle, setButtonTextCancel
getButtonTextOKSingle
public String getButtonTextOKSingle()
- Returns the label text of the OK button in the STYLE_OK_SINGLE style.
- See Also:
- getButtonTextOKDual, getButtonTextCancel, setButtonTextOKDual, setButtonTextOKSingle, setButtonTextCancel
getButtonTextCancel
public String getButtonTextCancel()
- Returns the label text of the CANCEL button in the STYLE_OKCANCEL_DUAL style.
- See Also:
- getButtonTextOKDual, getButtonTextOKSingle, setButtonTextOKDual, setButtonTextOKSingle, setButtonTextCancel
setButtonTextOKDual
public void setButtonTextOKDual(String strButtonText)
- Sets the label text of the OK button in the STYLE_OKCANCEL_DUAL style.
- See Also:
- getButtonTextOKDual, getButtonTextOKSingle, getButtonTextCancel, setButtonTextOKSingle, setButtonTextCancel
setButtonTextOKSingle
public void setButtonTextOKSingle(String strButtonText)
- Sets the label text of the OK button in the STYLE_OK_SINGLE style.
- See Also:
- getButtonTextOKDual, getButtonTextOKSingle, getButtonTextCancel, setButtonTextOKDual, setButtonTextCancel
setButtonTextCancel
public void setButtonTextCancel(String strButtonText)
- Sets the label text of the CANCEL button in the STYLE_OKCANCEL_DUAL style.
- See Also:
- getButtonTextOKDual, getButtonTextOKSingle, getButtonTextCancel, setButtonTextOKDual, setButtonTextOKSingle
valueChanged
public void valueChanged(ListSelectionEvent e)
addMessage
public void addMessage(String strMessage,
String strID,
String strDetail)
- Adds a message to be displayed.
If strDetail has a value, the Details button will be enabled.
- Parameters:
- 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.
addMessage
public void addMessage(String strMessage)
- Adds a simple message to be displayed.
Messages added with this method have no detail. The Details button remains disabled.
- Parameters:
- strMessage - the short message to be displayed in the
MessageViewer
addMessage
public void addMessage(AS400Message AS400msg)
- Adds a message to be displayed.
- Parameters:
- AS400msg - an AS400 message object
addMessages
public void addMessages(AS400Message AS400msgList[])
- Adds a message to be displayed.
- Parameters:
- AS400msgList - an array AS400 message objects
All Packages Class Hierarchy This Package Previous Next Index