com.borland.primetime.ide
Class MessageCategory

java.lang.Object
  |
  +--com.borland.primetime.ide.MessageCategory
All Implemented Interfaces:
javax.swing.Icon

public class MessageCategory
extends java.lang.Object
implements javax.swing.Icon

A MessageCategory defines a group of Message objects which form one tab in the panel that makes up the MessageView. Once a category is defined, messages added to the MessageView passing the same MessageCategory will appear on the same tab.

See Also:
MessageView, Message

Field Summary
static java.lang.String PROP_ICON
          The icon on a MessageView tab can be changed dynamically and a PropertyChangeEvent using this text is fired on setIcon().
static java.lang.String PROP_TITLE
          The text on a MessageView tab can be changed dynamically and a PropertyChangeEvent using this text is fired on setTitle().
static java.lang.String PROP_TOOLTIP
          The tooltip text for a MessageView tab can be changed dynamically and a PropertyChangeEvent using this text is fired on setToolTip().
 
Constructor Summary
MessageCategory(java.lang.String title)
          Constructor for a MessageCategory.
MessageCategory(java.lang.String title, javax.swing.Icon icon)
          Constructor for a MessageCategory.
MessageCategory(java.lang.String title, java.lang.String toolTip)
          Constructor for a MessageCategory.
MessageCategory(java.lang.String title, java.lang.String toolTip, javax.swing.Icon icon)
          Constructor for a MessageCategory.
MessageCategory(java.lang.String title, java.lang.String toolTip, javax.swing.Icon icon, java.lang.String params)
          Constructor for a MessageCategory.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          MessageView adds itself as a PropertyChangeListener.
 void categoryActivated()
          This is a notification that the category has been activated in the MessageView.
 void categoryClosing()
          This is a notification that the category is being removed from the MessageView.
 void categoryDeactivated()
          This is a notification that the category has been deactivated in the MessageView.
protected  void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          Notify MessageView when a property is changed.
 javax.swing.Icon getIcon()
          Icon for MessageView tab.
 int getIconHeight()
          Override so that can return height of any icon setting.
 int getIconWidth()
          Override so that can return width of any icon setting.
 java.lang.String getParams()
          Arbitrary string available for application specific usage.
 java.lang.String getTitle()
          Text for MessageView tab.
 java.lang.String getToolTip()
          Tooltip for MessageView tab.
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
          Override so that can paint any icon setting.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          MessageView removes itself as a PropertyChangeListener when tab is removed.
 void setIcon(javax.swing.Icon icon)
          Icon for MessageView tab.
 void setParams(java.lang.String params)
          Arbitrary string available for application specific usage.
 void setTitle(java.lang.String title)
          Text for MessageView tab.
 void setToolTip(java.lang.String text)
          Tooltip for MessageView tab.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_TITLE

public static final java.lang.String PROP_TITLE
The text on a MessageView tab can be changed dynamically and a PropertyChangeEvent using this text is fired on setTitle().

PROP_ICON

public static final java.lang.String PROP_ICON
The icon on a MessageView tab can be changed dynamically and a PropertyChangeEvent using this text is fired on setIcon().

PROP_TOOLTIP

public static final java.lang.String PROP_TOOLTIP
The tooltip text for a MessageView tab can be changed dynamically and a PropertyChangeEvent using this text is fired on setToolTip().
Constructor Detail

MessageCategory

public MessageCategory(java.lang.String title)
Constructor for a MessageCategory.
Parameters:
title - Text for the MessageView tab.

MessageCategory

public MessageCategory(java.lang.String title,
                       javax.swing.Icon icon)
Constructor for a MessageCategory.
Parameters:
title - Text for the MessageView tab.
icon - Icon for the MessageView tab or null.

MessageCategory

public MessageCategory(java.lang.String title,
                       java.lang.String toolTip)
Constructor for a MessageCategory.
Parameters:
title - Text for the MessageView tab.
toolTip - Text for the MessageView tab tooltip.

MessageCategory

public MessageCategory(java.lang.String title,
                       java.lang.String toolTip,
                       javax.swing.Icon icon)
Constructor for a MessageCategory.
Parameters:
title - Text for the MessageView tab.
toolTip - Text for the MessageView tab tooltip.
icon - Icon for the MessageView tab or null.

MessageCategory

public MessageCategory(java.lang.String title,
                       java.lang.String toolTip,
                       javax.swing.Icon icon,
                       java.lang.String params)
Constructor for a MessageCategory.
Parameters:
title - Text for the MessageView tab.
toolTip - Text for the MessageView tab tooltip.
icon - Icon for the MessageView tab or null.
params - Optional string for arbitrary usage.
Method Detail

setTitle

public void setTitle(java.lang.String title)
Text for MessageView tab.
Parameters:
title - Text for MessageView tab.

getTitle

public java.lang.String getTitle()
Text for MessageView tab.
Returns:
Text for MessageView tab.

setIcon

public void setIcon(javax.swing.Icon icon)
Icon for MessageView tab.
Parameters:
icon - Icon for MessageView tab or null.

getIcon

public javax.swing.Icon getIcon()
Icon for MessageView tab.
Returns:
Icon for MessageView tab or null.

setToolTip

public void setToolTip(java.lang.String text)
Tooltip for MessageView tab.
Parameters:
text - Tooltip text for MessageView tab.

getToolTip

public java.lang.String getToolTip()
Tooltip for MessageView tab.
Returns:
Tooltip text for MessageView tab.

getParams

public java.lang.String getParams()
Arbitrary string available for application specific usage.
Returns:
Arbitrary string.

setParams

public void setParams(java.lang.String params)
Arbitrary string available for application specific usage.
Parameters:
params - Arbitrary string.

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Override so that can paint any icon setting.
Specified by:
paintIcon in interface javax.swing.Icon

getIconWidth

public int getIconWidth()
Override so that can return width of any icon setting.
Specified by:
getIconWidth in interface javax.swing.Icon

getIconHeight

public int getIconHeight()
Override so that can return height of any icon setting.
Specified by:
getIconHeight in interface javax.swing.Icon

categoryActivated

public void categoryActivated()
This is a notification that the category has been activated in the MessageView.

categoryDeactivated

public void categoryDeactivated()
This is a notification that the category has been deactivated in the MessageView.

categoryClosing

public void categoryClosing()
                     throws VetoException
This is a notification that the category is being removed from the MessageView. A VetoException will prevent the tab from being removed.
Throws:
VetoException - When tab will not be closed.

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
MessageView adds itself as a PropertyChangeListener.
Parameters:
l - Listener to be registered.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
MessageView removes itself as a PropertyChangeListener when tab is removed.
Parameters:
l - Listener to be removed.

firePropertyChange

protected void firePropertyChange(java.lang.String propertyName,
                                  java.lang.Object oldValue,
                                  java.lang.Object newValue)
Notify MessageView when a property is changed.
Parameters:
propertyName - Name of the property which was changed.
oldValue - Prior value of property.
newValue - New value of property.