A VMessageList object is a resource that represents a list of messages for use in AS400Panes. This is for message lists generated by command or program calls. The following methods return message lists:
To use a VMessageList, set the messageList property. Set this property by using a constructor or through the setMessageList() method. The VMessageList object is then "plugged" into the AS400Pane as the root, using the constructor or setRoot() method of the AS400Pane.
When AS400Pane and VMessageList objects are created, they are initialized to a default state. The list of messages is not loaded at creation time. To load the contents, the caller must explicitly call the load() method on either object.
At run-time, a user can perform actions on a message by right-clicking it to display the context menu. The message context menu can include an item called Properties that displays properties such as the severity, type, and date.
The caller can prevent the user from performing actions by using the setAllowActions() method on the pane.
The following example creates a VMessageList for the messages generated by a command call and presents it in an AS400DetailsPane:
// Create the VMessageList object. // Assume that "command" is a // CommandCall object created and run // elsewhere. VMessageList root = new VMessageList (command.getMessageList ()); // Create and load an AS400DetailsPane // object. AS400DetailsPane detailsPane = new AS400DetailsPane (root); detailsPane.load (); // Add the details pane to a frame. // Assume that "frame" is a JFrame // created elsewhere. frame.getContentPane ().add (detailsPane);Example
Present the list of messages generated by a command call using an AS400DetailsPane with a VMessageList object. Figure 1 shows the VMessageList graphical user interface component:
Figure 1: VMessageList GUI component