com.borland.primetime.ide
Class MessageView

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.borland.primetime.ide.MessageView

public class MessageView
extends javax.swing.JPanel

The MessageView (one instance per Browser) is a display mechanism for user messages. The MessageView displays com.borland.primetime.ide.Message objects on different tabs in a tree hierarchy. The tabs are defined by MessageCategory objects.

Custom UI can be displayed in the MessageView using the addCustomTab method, and passing custom UI.

See Also:
MessageCategory, Message, Serialized Form

Inner Class Summary
protected static class MessageView.ClipboardObserver
           
 
Inner classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
 UpdateAction ACTION_CopyContent
           
static BrowserAction ACTION_ExpandMessage
           
static BrowserAction ACTION_NextMessage
           
static BrowserAction ACTION_PriorMessage
           
static BrowserAction ACTION_TestMessageView
           
static BrowserAction ACTION_TestMessageView1
           
static BrowserAction ACTION_TestMessageView2
           
static BrowserAction ACTION_TestMessageView3
           
static MessageCategory CATEGORY_COMPILER
           
static MessageCategory CATEGORY_DEBUG
           
static MessageCategory CATEGORY_ERROR
           
static MessageCategory CATEGORY_EXCEPTION
           
static MessageCategory CATEGORY_LOG
           
static MessageCategory CATEGORY_TEST
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Method Summary
 void addCustomTab(MessageCategory category, javax.swing.JComponent component)
          Adds a tab to this MessageView.
 Message addMessage(MessageCategory category, Message message)
          Adds a Message object to the specified tab in this MessageView.
 Message addMessage(MessageCategory category, Message message, boolean autoScroll)
          Adds a Message object to the specified tab in this MessageView.
 Message addMessage(MessageCategory category, Message parent, Message message)
          Adds a Message object as a child under the passed parent Message object on the specified tab.
 Message addMessage(MessageCategory category, Message parent, Message message, boolean autoScroll)
          Adds a Message object as a child under the passed parent Message object on the specified tab.
 Message addMessage(MessageCategory category, java.lang.String text)
          Adds a new Message object using the specified text to the specified tab in this MessageView.
 Message addMessage(MessageCategory category, java.lang.String text, java.awt.event.ActionListener messageAction)
          Adds a new Message object using the specified text and messageAction to the specified tab in this MessageView.
 Message addMessage(MessageCategory category, java.lang.String text, javax.swing.Icon icon)
          Adds a new Message object using the specified text and icon to the specified tab in this MessageView.
 Message addMessage(MessageCategory category, java.lang.String text, javax.swing.Icon icon, java.awt.event.ActionListener messageAction)
          Adds a new Message object using the specified text, icon, and messageAction to the specified tab in this MessageView.
 void addTab(MessageCategory category)
          Adds a tab to this MessageView.
 void clearMessages(MessageCategory category)
          Clears the Message objects from the passed category.
 void collapseMessage(MessageCategory category, Message parent)
           
 void expandMessage(MessageCategory category, Message parent)
           
 void expandSelectedMessage()
          Expands the message currently selected in the MessageView.
 MessageCategory getActiveTab()
          Returns the current MessageCategory in this MessageView.
 java.awt.Dimension getMinimumSize()
           
 int getTabCount()
          Returns the count of tabs currently displayed in this MessageView.
 MessageCategory[] getTabs()
          Returns a MessageCategory array representing the existing tabs in this MessageView.
 boolean hasMessages(MessageCategory category)
           
 void removeChildren(MessageCategory category, Message parent)
          Removes a Message object's children in the passed category.
 void removeMessage(MessageCategory category, Message message)
          Removes a Message object (and its children) from the passed category.
 void removeTab(MessageCategory category)
          Removes the specified tab from the MessageView.
 void selectMessage(MessageCategory category, Message message)
           
 void selectNextMessage()
          Selects the next message in the MessageView.
 void selectPriorMessage()
          Selects the prior message in the MessageView.
 void showTab(MessageCategory category)
          Shows (moves to front, or 'current') the specified tab in this MessageView.
 void updateUI()
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setCursor, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CATEGORY_LOG

public static final MessageCategory CATEGORY_LOG

CATEGORY_DEBUG

public static final MessageCategory CATEGORY_DEBUG

CATEGORY_ERROR

public static final MessageCategory CATEGORY_ERROR

CATEGORY_EXCEPTION

public static final MessageCategory CATEGORY_EXCEPTION

CATEGORY_COMPILER

public static final MessageCategory CATEGORY_COMPILER

CATEGORY_TEST

public static final MessageCategory CATEGORY_TEST

ACTION_ExpandMessage

public static BrowserAction ACTION_ExpandMessage

ACTION_NextMessage

public static BrowserAction ACTION_NextMessage

ACTION_PriorMessage

public static BrowserAction ACTION_PriorMessage

ACTION_TestMessageView

public static BrowserAction ACTION_TestMessageView

ACTION_TestMessageView1

public static BrowserAction ACTION_TestMessageView1

ACTION_TestMessageView2

public static BrowserAction ACTION_TestMessageView2

ACTION_TestMessageView3

public static BrowserAction ACTION_TestMessageView3

ACTION_CopyContent

public UpdateAction ACTION_CopyContent
Method Detail

selectMessage

public void selectMessage(MessageCategory category,
                          Message message)

addMessage

public Message addMessage(MessageCategory category,
                          Message parent,
                          Message message)
Adds a Message object as a child under the passed parent Message object on the specified tab. If the specified tab does not already exist in this MessageView, it will automatically be added. If the 'parent' parameter is null, or the parent message cannot be found on the specified tab in the MessageView, the passed message will be added as a root Message.
Parameters:
category - The message category to add the message to.
parent - The parent Message object to add this message as a child. If null, or if the specified parent cannot be found on the specified tab in the MessageView, the passed message will be added as a root.
message - The Message object to add to this MessageView.

addMessage

public Message addMessage(MessageCategory category,
                          Message parent,
                          Message message,
                          boolean autoScroll)
Adds a Message object as a child under the passed parent Message object on the specified tab. If the specified tab does not already exist in this MessageView, it will automatically be added. If the 'parent' parameter is null, or the parent message cannot be found on the specified tab in the MessageView, the passed message will be added as a root Message.
Parameters:
category - The message category to add the message to.
parent - The parent Message object to add this message as a child. If null, or if the specified parent cannot be found on the specified tab in the MessageView, the passed message will be added as a root.
message - The Message object to add to this MessageView.
autoScroll - True if the messageView should automatically scroll to the new message

addMessage

public Message addMessage(MessageCategory category,
                          Message message)
Adds a Message object to the specified tab in this MessageView. If the specified tab does not already exist in this MessageView, it will automatically be added.
Parameters:
category - The message category to add the message to.
message - The Message object to add to this MessageView.

addMessage

public Message addMessage(MessageCategory category,
                          Message message,
                          boolean autoScroll)
Adds a Message object to the specified tab in this MessageView. If the specified tab does not already exist in this MessageView, it will automatically be added.
Parameters:
category - The message category to add the message to.
message - The Message object to add to this MessageView.
autoScroll - True if the messageView should automatically scroll to the new message

addMessage

public Message addMessage(MessageCategory category,
                          java.lang.String text)
Adds a new Message object using the specified text to the specified tab in this MessageView. If the specified tab does not already exist in this MessageView, it will automatically be added.
Parameters:
category - The message category to add the message to.
text - The text to construct the Message object with that will be added to this MessageView.
Returns:
The constructed Message object that was added to this MessageView.

addMessage

public Message addMessage(MessageCategory category,
                          java.lang.String text,
                          javax.swing.Icon icon)
Adds a new Message object using the specified text and icon to the specified tab in this MessageView. If the specified tab does not already exist in this MessageView, it will automatically be added.
Parameters:
category - The message category to add the message to.
text - The text to construct the Message object with that will be added to this MessageView.
icon - The icon to construct the Message object with that will be added to this MessageView.
Returns:
The constructed Message object that was added to this MessageView.

addMessage

public Message addMessage(MessageCategory category,
                          java.lang.String text,
                          java.awt.event.ActionListener messageAction)
Adds a new Message object using the specified text and messageAction to the specified tab in this MessageView. If the specified tab does not already exist in this MessageView, it will automatically be added.
Parameters:
category - The message category to add the message to.
text - The text to construct the Message object with that will be added to this MessageView.
messageAction - The messageAction (ActionListener) to construct the Message object with that will be added to this MessageView.
Returns:
The constructed Message object that was added to this MessageView.

addMessage

public Message addMessage(MessageCategory category,
                          java.lang.String text,
                          javax.swing.Icon icon,
                          java.awt.event.ActionListener messageAction)
Adds a new Message object using the specified text, icon, and messageAction to the specified tab in this MessageView. If the specified tab does not already exist in this MessageView, it will automatically be added.
Parameters:
category - The message category to add the message to.
text - The text to construct the Message object with that will be added to this MessageView.
icon - The icon to construct the Message object with that will be added to this MessageView.
messageAction - The messageAction (ActionListener) to construct the Message object with that will be added to this MessageView.
Returns:
The constructed Message object that was added to this MessageView.

expandMessage

public void expandMessage(MessageCategory category,
                          Message parent)
Parameters:
category - The message category containing the message to expand
parent - The message to expand

collapseMessage

public void collapseMessage(MessageCategory category,
                            Message parent)
Parameters:
category - The message category containing the message to collapse
parent - The message to collapse

removeMessage

public void removeMessage(MessageCategory category,
                          Message message)
Removes a Message object (and its children) from the passed category.
Parameters:
category - The message category containing the message to remove
message - The message to remove

removeChildren

public void removeChildren(MessageCategory category,
                           Message parent)
Removes a Message object's children in the passed category.
Parameters:
category - The message category containing the message to remove children from
parent - The message to strip of children

clearMessages

public void clearMessages(MessageCategory category)
Clears the Message objects from the passed category.
Parameters:
category - The message category to be cleared of Message objects.

addTab

public void addTab(MessageCategory category)
Adds a tab to this MessageView. If the specified tab already exists in this MessageView, this method is ignored. It is not necessary to add new tabs to the MessageView using this method. Any addMessage(...) call that specifies a previously non-existing tab will trigger the addition of a new tab.
Parameters:
tab - The message category to be added to this MessageView.

addCustomTab

public void addCustomTab(MessageCategory category,
                         javax.swing.JComponent component)
Adds a tab to this MessageView. If the specified tab already exists in this MessageView, this method is ignored.
Parameters:
category - The message category to be added to this MessageView.
component - The custom JComponent to display on the tab.

getTabCount

public int getTabCount()
Returns the count of tabs currently displayed in this MessageView.
Returns:
An int representing the total number of tabs currently displayed in this MessageView.

getTabs

public MessageCategory[] getTabs()
Returns a MessageCategory array representing the existing tabs in this MessageView.
Returns:
A MessageCategory array representing the existing tabs in this MessageView.

getActiveTab

public MessageCategory getActiveTab()
Returns the current MessageCategory in this MessageView.
Returns:
A MessageCategory representing the current tab in this MessageView.

removeTab

public void removeTab(MessageCategory category)
               throws VetoException
Removes the specified tab from the MessageView. If the tab does not exist on the MessageView, this method is ignored.
Parameters:
category - The message category representing the tab to remove from this MessageView.

showTab

public void showTab(MessageCategory category)
Shows (moves to front, or 'current') the specified tab in this MessageView. If the specified tab does not exist in this MessageView, it will be ADDED and set as the 'current' tab.
Parameters:
category - A message category defining a tab to display in this MessageView.

expandSelectedMessage

public void expandSelectedMessage()
Expands the message currently selected in the MessageView.

selectNextMessage

public void selectNextMessage()
Selects the next message in the MessageView.

selectPriorMessage

public void selectPriorMessage()
Selects the prior message in the MessageView.

updateUI

public void updateUI()
Overrides:
updateUI in class javax.swing.JPanel

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class javax.swing.JComponent

hasMessages

public boolean hasMessages(MessageCategory category)