de.cau.cs.kieler.core.ui.views
Class TextViewer

java.lang.Object
  extended by org.eclipse.jface.viewers.Viewer
      extended by org.eclipse.jface.viewers.ContentViewer
          extended by de.cau.cs.kieler.core.ui.views.TextViewer
All Implemented Interfaces:
IInputProvider, IInputSelectionProvider, ISelectionProvider

public class TextViewer
extends ContentViewer

A Viewer for displaying some sort of text content.

Rating yellow
(2010-03-09) review by msp, soh

Field Summary
 
Fields inherited from class org.eclipse.jface.viewers.Viewer
WIDGET_DATA_KEY
 
Constructor Summary
TextViewer(Composite parent)
          Creates a new text viewer.
 
Method Summary
 void append(String s)
          Appends the given string to the currently displayed text.
 Control getControl()
           
 ISelection getSelection()
           
 void refresh()
           
 void setEnabled(boolean enabled)
          Enable/Disable the current textviewer.
 void setSelection(ISelection selection, boolean reveal)
           
 void setText(String s)
          Changes the displayed text to the given string.
 
Methods inherited from class org.eclipse.jface.viewers.ContentViewer
getContentProvider, getInput, getLabelProvider, handleDispose, handleLabelProviderChanged, hookControl, labelProviderChanged, setContentProvider, setInput, setLabelProvider
 
Methods inherited from class org.eclipse.jface.viewers.Viewer
addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, inputChanged, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextViewer

public TextViewer(Composite parent)
Creates a new text viewer.

Parameters:
parent - component that contains the text
Method Detail

getControl

public Control getControl()
Specified by:
getControl in class Viewer

getSelection

public ISelection getSelection()
Specified by:
getSelection in interface ISelectionProvider
Specified by:
getSelection in class Viewer

refresh

public void refresh()
Specified by:
refresh in class Viewer

setSelection

public void setSelection(ISelection selection,
                         boolean reveal)
Specified by:
setSelection in class Viewer

setText

public void setText(String s)
Changes the displayed text to the given string.

Parameters:
s - text to be displayed

append

public void append(String s)
Appends the given string to the currently displayed text.

Parameters:
s - text to be appended

setEnabled

public void setEnabled(boolean enabled)
Enable/Disable the current textviewer.

Parameters:
enabled - true to enable the viewer