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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateControl(Composite parent) Creates the status viewer's widget hierarchy.protected abstract SourceViewercreateSourceViewer(Composite parent) Hook to create the source viewer used to present the textual context information.Returns the status context viewer's SWT control.protected SourceViewerReturns the internal source viewer.protected voidSets the input of the source viewer to the given document and reveals the region determined by the given parameter region.protected voidupdateTitle(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, waitMethods 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
nullif 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 theIWorkbenchAdapterfor the given element. If the element doen't provide aIWorkbenchAdapteror if the element isnullthe image is reset and a default label is shown.- Parameters:
element- the element providing the image and label for the title. Can benullto 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:IStatusContextViewerCreates the status viewer's widget hierarchy. This method is only called once. MethodgetControl()should be used to retrieve the widget hierarchy.- Specified by:
createControlin interfaceIStatusContextViewer- Parameters:
parent- the parent for the widget hierarchy- See Also:
-
getControl
Description copied from interface:IStatusContextViewerReturns the status context viewer's SWT control.- Specified by:
getControlin interfaceIStatusContextViewer- Returns:
- the status context viewer's SWT control or
nullis the widget hierarchy hasn't been created yet
-