|
|||||||||
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
|
protected java.awt.Color |
background
|
protected javax.swing.Action |
contextAction
|
protected java.awt.Font |
font
|
protected java.awt.Color |
foreground
|
protected javax.swing.Action |
helpAction
|
protected javax.swing.Icon |
icon
|
protected boolean |
lazyFetchChildren
|
protected java.awt.event.ActionListener |
messageAction
|
protected javax.swing.tree.TreeCellRenderer |
renderer
|
protected java.awt.event.ActionListener |
selectAction
|
protected java.lang.String |
text
|
protected java.lang.String |
toolTipText
|
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()
|
javax.swing.tree.TreeCellRenderer |
getCellRenderer()
|
javax.swing.Action |
getContextAction()
|
java.awt.Font |
getFont()
|
java.awt.Color |
getForeground()
|
javax.swing.Action |
getHelpAction()
|
javax.swing.Icon |
getIcon()
|
java.awt.event.ActionListener |
getMessageAction()
|
java.awt.event.ActionListener |
getSelectAction()
|
java.lang.String |
getText()
|
java.lang.String |
getToolTipText()
|
boolean |
isLazyFetchChildren()
|
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()
|
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)
public Message(java.lang.String text, javax.swing.Icon icon)
public Message(java.lang.String text, javax.swing.Icon icon, java.lang.String toolTipText)
public Message(java.lang.String text, java.awt.event.ActionListener messageAction)
public Message(java.lang.String text, javax.swing.Icon icon, java.awt.event.ActionListener messageAction)
public Message(java.lang.String text, javax.swing.Icon icon, java.lang.String toolTipText, java.awt.event.ActionListener messageAction)
Method Detail |
public void setText(java.lang.String text)
public java.lang.String getText()
public void setIcon(javax.swing.Icon icon)
public javax.swing.Icon getIcon()
public void setBackground(java.awt.Color background)
public java.awt.Color getBackground()
public void setForeground(java.awt.Color foreground)
public java.awt.Color getForeground()
public void setFont(java.awt.Font font)
public java.awt.Font getFont()
public void setToolTipText(java.lang.String toolTipText)
public java.lang.String getToolTipText()
public void setCellRenderer(javax.swing.tree.TreeCellRenderer renderer)
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).
public javax.swing.Action getContextAction()
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).
This is typically used to show context help (or something) while the user scrolls though messages.
public java.awt.event.ActionListener getSelectAction()
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.
public java.awt.event.ActionListener getMessageAction()
public void setHelpAction(javax.swing.Action helpAction)
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.
public boolean isLazyFetchChildren()
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.
public void selectAction(Browser browser)
public void messageAction(Browser browser)
public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |