|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.borland.primetime.ide.Message
The Message class represents a single message line in the MessageView. The MessageView displays the text of the Message object using the font, background, and foreground settings in the message object (defaults if none are set).
When a message is single-clicked on (or the user scrolls to it with the keyboard) the selectAction() method is called (subclasses can override this). The default behavior of the selectAction method is to call the actionPerformed method of the selectAction (ActionListener) property. Use the selectAction to drive a view of the 'current' message if you want one.
When a message is double-clicked on (or the user hits ENTER on it), the messageAction() method is called (subclasses can override this). The default behavior of the messageAction method is to call the actionPerformed method of the messageAction (ActionListener) property. This is the event that is the effective 'trigger' of the message.
When a user hits F1 with focus on a message in the MessageView, the helpAction method is called. The default behavior of the helpAction method is to call the actionPerformed method of the helpAction (ActionListener) property.
When the user right-clicks on the MessageView, a context JPopupMenu is displayed. The 'contextAction' property holds the ActionGroup of actions to be displayed in the context popup.
MessageView
,
MessageCategory
,
ActionGroup
Field Summary | |
protected java.awt.event.ActionEvent |
actionEvent
Internal cache for default Action created when needed to use instead of supplied selectAction or messageAction. |
protected java.awt.Color |
background
The background color to use when drawing this message with the default TreeCellRenderer. |
protected javax.swing.Action |
contextAction
The Action to use for the message popup or null to use the default. |
protected java.awt.Font |
font
The font to use when drawing this message with the default TreeCellRenderer. |
protected java.awt.Color |
foreground
The foreground color to use when drawing this message with the default TreeCellRenderer. |
protected javax.swing.Action |
helpAction
Override of default Action on help event or null for default. |
protected javax.swing.Icon |
icon
The Message icon or null if one is not defined. |
protected boolean |
lazyFetchChildren
True if not to fetch any children of this message until its tree node is expanded. |
protected java.awt.event.ActionListener |
messageAction
Override of default Action on action event or null for default. |
protected javax.swing.tree.TreeCellRenderer |
renderer
The renderer to use when drawing this message or null to use the default. |
protected java.awt.event.ActionListener |
selectAction
Override of default Action on select event or null for default. |
protected java.lang.String |
text
The Message text. |
protected java.lang.String |
toolTipText
The text to use when displaying a tooltip. |
Constructor Summary | |
Message()
Constructs a new Message object with all default property settings. |
|
Message(java.lang.String text)
Constructs a new Message object with the 'text' property set to the passed value. |
|
Message(java.lang.String text,
java.awt.event.ActionListener messageAction)
Constructs a new Message object with the 'text' and 'messageAction' properties set to the passed values. |
|
Message(java.lang.String text,
javax.swing.Icon icon)
Constructs a new Message object with the 'text' and 'icon' properties set to the passed values. |
|
Message(java.lang.String text,
javax.swing.Icon icon,
java.awt.event.ActionListener messageAction)
Constructs a new Message object with the 'text', 'icon', and 'messageAction' properties set to the passed values. |
|
Message(java.lang.String text,
javax.swing.Icon icon,
java.lang.String toolTipText)
Constructs a new Message object with the 'text', 'icon', and 'toolTipText' properties set to the passed values. |
|
Message(java.lang.String text,
javax.swing.Icon icon,
java.lang.String toolTipText,
java.awt.event.ActionListener messageAction)
Constructs a new Message object with the 'text', 'icon', 'toolTipText', and 'messageAction' properties set to the passed values. |
Method Summary | |
void |
fetchChildren(Browser browser)
Subclasses should override this method if they wish to add a single parent Message to the MessageView and display it as expandable (with a "+" box). |
java.awt.Color |
getBackground()
The 'background' property is the background color for the message item. |
javax.swing.tree.TreeCellRenderer |
getCellRenderer()
The 'cellRenderer' property stores the optional cell renderer to do the actual drawing of the message item. |
javax.swing.Action |
getContextAction()
The 'contextAction' is the Action (or ActionGroup) that defines a popup menu that is displayed when a user right-clicks on a message item in the MessageView. |
java.awt.Font |
getFont()
The 'font' property is the font used for this message item in the MessageView. |
java.awt.Color |
getForeground()
The 'foreground' property is the foreground color for the message item. |
javax.swing.Action |
getHelpAction()
The 'helpAction' property is the Action whose actionPerformed method gets called when the user hits F1 or selects help on a particular messageItem. |
javax.swing.Icon |
getIcon()
The 'icon' property is the icon to be displayed with the message in the MessageView. |
java.awt.event.ActionListener |
getMessageAction()
The 'messageAction' is the ActionListener whose actionPerformed method gets called when the message item is double-clicked or ENTER is hit on the item. |
java.awt.event.ActionListener |
getSelectAction()
The 'selectAction' property is the ActionListener whose actionPerformed method gets called when the user hits selects a particular messageItem (first click with the mouse or scrolls to it using the keyboard). |
java.lang.String |
getText()
The 'text' property is the String to be displayed as a message in the MessageView. |
java.lang.String |
getToolTipText()
The 'toolTipText' property is the additional text that is displayed when the mouse is floated over this message item. |
boolean |
isLazyFetchChildren()
The 'lazyFetchChildren' property allows hierarchical message structures to "lazy load" their children when the user clicks on the "+" by the message item in the MessageView. |
void |
messageAction(Browser browser)
Subclasses should override this method to add custom functionality when the message item is double-clicked or if the user hits ENTER. |
void |
selectAction(Browser browser)
Subclasses should override this method to add custom functionality when the message item is single-clicked on or if the user scrolls to the particular message item. |
void |
setBackground(java.awt.Color background)
The 'background' property is the background color for the message item. |
void |
setCellRenderer(javax.swing.tree.TreeCellRenderer renderer)
The 'cellRenderer' property stores the optional cell renderer to do the actual drawing of the message item. |
void |
setContextAction(javax.swing.Action contextAction)
The 'contextAction' is the Action (or ActionGroup) that defines a popup menu that is displayed when a user right-clicks on a message item in the MessageView. |
void |
setFont(java.awt.Font font)
The 'font' property is the font used for this message item in the MessageView. |
void |
setForeground(java.awt.Color foreground)
The 'foreground' property is the foreground color for the message item. |
void |
setHelpAction(javax.swing.Action helpAction)
The 'helpAction' property is the Action whose actionPerformed method gets called when the user hits F1 or selects help on a particular messageItem. |
void |
setIcon(javax.swing.Icon icon)
The 'icon' property is the icon to be displayed with the message in the MessageView. |
void |
setLazyFetchChildren(boolean lazyFetch)
The 'lazyFetchChildren' property allows hierarchical message structures to "lazy load" their children when the user clicks on the "+" by the message item in the MessageView. |
void |
setMessageAction(java.awt.event.ActionListener messageAction)
The 'messageAction' is the ActionListener whose actionPerformed method gets called when the message item is double-clicked or ENTER is hit on the item. |
void |
setSelectAction(java.awt.event.ActionListener selectAction)
The 'selectAction' property is the ActionListener whose actionPerformed method gets called when the user hits selects a particular messageItem (first click with the mouse or scrolls to it using the keyboard). |
void |
setText(java.lang.String text)
The 'text' property is the String to be displayed as a message in the MessageView. |
void |
setToolTipText(java.lang.String toolTipText)
The 'toolTipText' property is the additional text that is displayed when the mouse is floated over this message item. |
java.lang.String |
toString()
Override to show message text. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String text
protected javax.swing.Icon icon
protected java.awt.Color background
protected java.awt.Color foreground
protected java.awt.Font font
protected java.lang.String toolTipText
protected javax.swing.tree.TreeCellRenderer renderer
protected boolean lazyFetchChildren
protected javax.swing.Action contextAction
protected java.awt.event.ActionEvent actionEvent
protected java.awt.event.ActionListener selectAction
protected java.awt.event.ActionListener messageAction
protected javax.swing.Action helpAction
Constructor Detail |
public Message()
public Message(java.lang.String text)
text
- Text to display.public Message(java.lang.String text, javax.swing.Icon icon)
text
- Text to display.icon
- Icon to use or null.public Message(java.lang.String text, javax.swing.Icon icon, java.lang.String toolTipText)
text
- Text to display.icon
- Icon to use or null.toolTipText
- Tooltip text to display.public Message(java.lang.String text, java.awt.event.ActionListener messageAction)
text
- Text to display.messageAction
- Double-click action to invoke or null.public Message(java.lang.String text, javax.swing.Icon icon, java.awt.event.ActionListener messageAction)
text
- Text to display.icon
- Icon to use or null.messageAction
- Double-click action to invoke or null.public Message(java.lang.String text, javax.swing.Icon icon, java.lang.String toolTipText, java.awt.event.ActionListener messageAction)
text
- Text to display.icon
- Icon to use or null.toolTipText
- Tooltip text to display.messageAction
- Double-click action to invoke or null.Method Detail |
public void setText(java.lang.String text)
text
- The text to display.public java.lang.String getText()
public void setIcon(javax.swing.Icon icon)
icon
- The icon to use or null.public javax.swing.Icon getIcon()
public void setBackground(java.awt.Color background)
background
- The background color to use.public java.awt.Color getBackground()
public void setForeground(java.awt.Color foreground)
foreground
- The foreground color to use.public java.awt.Color getForeground()
public void setFont(java.awt.Font font)
font
- The font to use.public java.awt.Font getFont()
public void setToolTipText(java.lang.String toolTipText)
tooltipText
- The tooltip text to use.public java.lang.String getToolTipText()
public void setCellRenderer(javax.swing.tree.TreeCellRenderer renderer)
renderer
- The renderer to use.public javax.swing.tree.TreeCellRenderer getCellRenderer()
public void setContextAction(javax.swing.Action contextAction)
The 'contextAction' is the Action (or ActionGroup) that defines a popup menu that is displayed when a user right-clicks on a message item in the MessageView.
By default, there is no contextAction for the individual message items, but a short list of context actions for the MessageView itself. If a contextAction (or ActionGroup) is provided, the context items for the messageView will be displayed before the contextAction (with a separator).
contextAction
- The Action or ActionGroup or null to use for a popup.public javax.swing.Action getContextAction()
The 'contextAction' is the Action (or ActionGroup) that defines a popup menu that is displayed when a user right-clicks on a message item in the MessageView.
By default, there is no contextAction for the individual message items, but a short list of context actions for the MessageView itself. If a contextAction (or ActionGroup) is provided, the context items for the messageView will be displayed before the contextAction (with a separator).
public void setSelectAction(java.awt.event.ActionListener selectAction)
The 'selectAction' property is the ActionListener whose actionPerformed method gets called when the user hits selects a particular messageItem (first click with the mouse or scrolls to it using the keyboard).
selectAction
- The Action to invoke on a simple navigation or null.public java.awt.event.ActionListener getSelectAction()
The 'selectAction' property is the ActionListener whose actionPerformed method gets called when the user hits selects a particular messageItem (first click with the mouse or scrolls to it using the keyboard).
public void setMessageAction(java.awt.event.ActionListener messageAction)
The 'messageAction' is the ActionListener whose actionPerformed method gets called when the message item is double-clicked or ENTER is hit on the item.
An example messageAction would be for a compiler error message to respond to a messageAction by loading the appropriate file into the browser, displaying it in the editor, and highlighting the appropriate error line.
messageAction
- The Action to invoke when user activates.public java.awt.event.ActionListener getMessageAction()
The 'messageAction' is the ActionListener whose actionPerformed method gets called when the message item is double-clicked or ENTER is hit on the item.
An example messageAction would be for a compiler error message to respond to a messageAction by loading the appropriate file into the browser, displaying it in the editor, and highlighting the appropriate error line.
public void setHelpAction(javax.swing.Action helpAction)
helpAction
- The Action or null to invoke on help.public javax.swing.Action getHelpAction()
public void setLazyFetchChildren(boolean lazyFetch)
The 'lazyFetchChildren' property allows hierarchical message structures to "lazy load" their children when the user clicks on the "+" by the message item in the MessageView. When the "+" is first clicked on, the fetchChildren() method is called on the message object, which is expected to populate the MessageView with new child messages parented by this Message object.
By default, Messages are not set to lazy fetch their children.
lazyFetch
- True is want lazy fetch.public boolean isLazyFetchChildren()
The 'lazyFetchChildren' property allows hierarchical message structures to "lazy load" their children when the user clicks on the "+" by the message item in the MessageView. When the "+" is first clicked on, the fetchChildren() method is called on the message object, which is expected to populate the MessageView with new child messages parented by this Message object.
By default, Messages are not set to lazy fetch their children.
public void fetchChildren(Browser browser)
Subclasses should override this method if they wish to add a single parent Message to the MessageView and display it as expandable (with a "+" box). When the message is expanded the first time, this method is called. The message is expected to then add child messages to this parent message via the passed Browser's MessageView.
NOTE: The boolean 'lazyFetchChildren' property MUST be set to true for this method to ever be called.
browser
- The Browser owning the MessageView.public void selectAction(Browser browser)
browser
- The Browser owning the MessageView.public void messageAction(Browser browser)
browser
- The Browser owning the MessageView.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |