org.eclipse.cdt.internal.ui.dialogs
Class MessageLine

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by org.eclipse.swt.widgets.Canvas
                      extended by org.eclipse.swt.custom.CLabel
                          extended by org.eclipse.cdt.internal.ui.dialogs.MessageLine
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

public class MessageLine
extends org.eclipse.swt.custom.CLabel

A message line. It distinguishs between "normal" messages and errors. Setting an error message hides a currently displayed message until clearErrorMessage is called.


Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
MessageLine(org.eclipse.swt.widgets.Composite parent)
          Creates a new message line as a child of the given parent.
MessageLine(org.eclipse.swt.widgets.Composite parent, int style)
          Creates a new message line as a child of the parent and with the given SWT stylebits.
MessageLine(org.eclipse.swt.widgets.Composite parent, int style, org.eclipse.swt.graphics.RGB errorRGB)
          Creates a new message line as a child of the parent and with the given SWT stylebits.
 
Method Summary
 void clearErrorMessage()
          Clears the currently displayed error message and redisplayes the message which was active before the error message was set.
 void clearMessage()
          Clears the currently displayed message.
 java.lang.String getErrorMessage()
          Get the currently displayed error text.
 java.lang.String getMessage()
          Get the currently displayed message.
static void setErrorColor(org.eclipse.swt.graphics.RGB color)
          Sets the default error color used by all message lines.
 void setErrorMessage(java.lang.String message)
          Display the given error message.
 void setMessage(java.lang.String message)
          Set the message text.
 
Methods inherited from class org.eclipse.swt.custom.CLabel
computeSize, getAlignment, getImage, getStyle, getText, getToolTipText, setAlignment, setBackground, setBackground, setBackground, setBackground, setFont, setImage, setText, setToolTipText
 
Methods inherited from class org.eclipse.swt.widgets.Canvas
drawBackground, getCaret, scroll, setCaret
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, dispose, getData, getData, getDisplay, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MessageLine

public MessageLine(org.eclipse.swt.widgets.Composite parent,
                   int style,
                   org.eclipse.swt.graphics.RGB errorRGB)
Creates a new message line as a child of the parent and with the given SWT stylebits. Error message will be shown with in the given rgb color.


MessageLine

public MessageLine(org.eclipse.swt.widgets.Composite parent,
                   int style)
Creates a new message line as a child of the parent and with the given SWT stylebits. Error message will be shown with in the rgb color 200,0,0.


MessageLine

public MessageLine(org.eclipse.swt.widgets.Composite parent)
Creates a new message line as a child of the given parent. Error message will be shown with in the rgb color 200,0,0.

Method Detail

clearErrorMessage

public void clearErrorMessage()
Clears the currently displayed error message and redisplayes the message which was active before the error message was set.


clearMessage

public void clearMessage()
Clears the currently displayed message.


getErrorMessage

public java.lang.String getErrorMessage()
Get the currently displayed error text.

Returns:
The error message. If no error message is displayed null is returned.

getMessage

public java.lang.String getMessage()
Get the currently displayed message.

Returns:
The message. If no message is displayed null is returned.

setErrorColor

public static void setErrorColor(org.eclipse.swt.graphics.RGB color)
Sets the default error color used by all message lines. Note: a call to this method only affects newly created MessageLines not existing ones.


setErrorMessage

public void setErrorMessage(java.lang.String message)
Display the given error message. A currently displayed message is saved and will be redisplayed when the error message is cleared.


setMessage

public void setMessage(java.lang.String message)
Set the message text. If the message line currently displays an error, the message is stored and will be shown after a call to clearErrorMessage