Package org.eclipse.ltk.ui.refactoring
Class TextStatusContextViewer
java.lang.Object
org.eclipse.ltk.ui.refactoring.TextStatusContextViewer
- All Implemented Interfaces:
IStatusContextViewer
An abstract base implementation of a status context viewer that presents
textual context information.
Subclasses need to implement createSourceViewer(Composite)
to create
the correct source viewer. They should use the method updateTitle(IAdaptable)
and setInput(IDocument, IRegion)
to set the title text and image and to
populate the source viewer.
- Since:
- 3.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createControl
(Composite parent) Creates the status viewer's widget hierarchy.protected abstract SourceViewer
createSourceViewer
(Composite parent) Hook to create the source viewer used to present the textual context information.Returns the status context viewer's SWT control.protected SourceViewer
Returns the internal source viewer.protected void
Sets the input of the source viewer to the given document and reveals the region determined by the given parameter region.protected void
updateTitle
(IAdaptable element) Updates the title image and text of the pane surrounding the source viewer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.ltk.ui.refactoring.IStatusContextViewer
setInput
-
Constructor Details
-
TextStatusContextViewer
public TextStatusContextViewer()
-
-
Method Details
-
getSourceViewer
Returns the internal source viewer.- Returns:
- the internal source viewer or
null
if the source viewer hasn't been created yet
-
createSourceViewer
Hook to create the source viewer used to present the textual context information.- Parameters:
parent
- the composite to be used as the source viewer's parent- Returns:
- the source viewer to be used
-
updateTitle
Updates the title image and text of the pane surrounding the source viewer. The image and text is determined by retrieving theIWorkbenchAdapter
for the given element. If the element doen't provide aIWorkbenchAdapter
or if the element isnull
the image is reset and a default label is shown.- Parameters:
element
- the element providing the image and label for the title. Can benull
to reset the image and text
-
setInput
Sets the input of the source viewer to the given document and reveals the region determined by the given parameter region.- Parameters:
document
- the document to presentregion
- the region to reveal.
-
createControl
Description copied from interface:IStatusContextViewer
Creates the status viewer's widget hierarchy. This method is only called once. MethodgetControl()
should be used to retrieve the widget hierarchy.- Specified by:
createControl
in interfaceIStatusContextViewer
- Parameters:
parent
- the parent for the widget hierarchy- See Also:
-
getControl
Description copied from interface:IStatusContextViewer
Returns the status context viewer's SWT control.- Specified by:
getControl
in interfaceIStatusContextViewer
- Returns:
- the status context viewer's SWT control or
null
is the widget hierarchy hasn't been created yet
-