Package org.eclipse.jface.text.link
Class LinkedModeUI
java.lang.Object
org.eclipse.jface.text.link.LinkedModeUI
- Direct Known Subclasses:
- EditorLinkedModeUI
The UI for linked mode. Detects events that influence behavior of the linked mode
 UI and acts upon them.
 
 LinkedModeUI relies on all added
 LinkedModeUITargets to provide implementations of
 ITextViewer that implement ITextViewerExtension,
 and the documents being edited to implement IDocumentExtension3.
 
Clients may instantiate and extend this class.
- Since:
- 3.0
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classExit flags returned if a custom exit policy wants to exit linked mode.static interfaceAn exit policy can be registered by a caller to get custom exit behavior.static interfaceListener that gets notified when the linked mode UI switches its focus position.static classA link target consists of a viewer and gets notified if the linked mode UI on it is being shown.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final ObjectConstant indicating that this UI should always cycle from the last position to the first and vice versa.static final ObjectConstant indicating that this UI should never cycle from the last position to the first and vice versa.static final ObjectConstant indicating that this UI should cycle from the last position to the first and vice versa if its model is not nested.
- 
Constructor SummaryConstructorsConstructorDescriptionLinkedModeUI(LinkedModeModel model, ITextViewer viewer) Convenience constructor for just one viewer.LinkedModeUI(LinkedModeModel model, ITextViewer[] viewers) Convenience constructor for multiple viewers.LinkedModeUI(LinkedModeModel model, LinkedModeUI.LinkedModeUITarget target) Convenience constructor for one target.LinkedModeUI(LinkedModeModel model, LinkedModeUI.LinkedModeUITarget[] targets) Creates a new UI on the given model and the set of viewers.
- 
Method SummaryModifier and TypeMethodDescriptionvoidenableColoredLabels(boolean isEnabled) Enables the support for colored labels in the proposal popup.voidenter()Starts this UI on the first position.Returns the currently selected region ornull.voidsetCyclingMode(Object mode) Sets the cycling mode to either ofCYCLING_ALWAYS,CYCLING_NEVER, orCYCLING_WHEN_NO_PARENT, which is the default.voidsetDoContextInfo(boolean doContextInfo) Sets the context info property.voidSets anIExitPolicyto customize the exit behavior of this linked mode UI.voidsetExitPosition(ITextViewer viewer, int offset, int length, int sequence) Sets the exit position to move the caret to when linked mode is exited.voidsetExitPosition(LinkedModeUI.LinkedModeUITarget target, int offset, int length, int sequence) Sets the exit position to move the caret to when linked mode mode is exited.protected voidSets the focus callback which will get informed when the focus of the linked mode UI changes.voidsetSimpleMode(boolean simple) Sets the "simple" mode of the receiver.
- 
Field Details- 
CYCLE_NEVERConstant indicating that this UI should never cycle from the last position to the first and vice versa.
- 
CYCLE_ALWAYSConstant indicating that this UI should always cycle from the last position to the first and vice versa.
- 
CYCLE_WHEN_NO_PARENTConstant indicating that this UI should cycle from the last position to the first and vice versa if its model is not nested.
 
- 
- 
Constructor Details- 
LinkedModeUICreates a new UI on the given model and the set of viewers. The model must provide a tab stop sequence with a non-empty list of tab stops.- Parameters:
- model- the linked mode model
- targets- the non-empty list of targets upon which the linked mode UI should act
 
- 
LinkedModeUIConvenience constructor for just one viewer.- Parameters:
- model- the linked mode model
- viewer- the viewer upon which the linked mode UI should act
 
- 
LinkedModeUIConvenience constructor for multiple viewers.- Parameters:
- model- the linked mode model
- viewers- the non-empty list of viewers upon which the linked mode UI should act
 
- 
LinkedModeUIConvenience constructor for one target.- Parameters:
- model- the linked mode model
- target- the target upon which the linked mode UI should act
 
 
- 
- 
Method Details- 
enterpublic void enter()Starts this UI on the first position.
- 
setExitPolicySets anIExitPolicyto customize the exit behavior of this linked mode UI.- Parameters:
- policy- the exit policy to use.
 
- 
setExitPositionpublic void setExitPosition(LinkedModeUI.LinkedModeUITarget target, int offset, int length, int sequence) throws BadLocationException Sets the exit position to move the caret to when linked mode mode is exited.- Parameters:
- target- the target where the exit position is located
- offset- the offset of the exit position
- length- the length of the exit position (in case there should be a selection)
- sequence- set to the tab stop position of the exit position, or- LinkedPositionGroup.NO_STOPif there should be no tab stop.
- Throws:
- BadLocationException- if the position is not valid in the viewer's document
 
- 
setExitPositionpublic void setExitPosition(ITextViewer viewer, int offset, int length, int sequence) throws BadLocationException Sets the exit position to move the caret to when linked mode is exited.- Parameters:
- viewer- the viewer where the exit position is located
- offset- the offset of the exit position
- length- the length of the exit position (in case there should be a selection)
- sequence- set to the tab stop position of the exit position, or- LinkedPositionGroup.NO_STOPif there should be no tab stop.
- Throws:
- BadLocationException- if the position is not valid in the viewer's document
 
- 
setCyclingModeSets the cycling mode to either ofCYCLING_ALWAYS,CYCLING_NEVER, orCYCLING_WHEN_NO_PARENT, which is the default.- Parameters:
- mode- the new cycling mode.
 
- 
getSelectedRegionReturns the currently selected region ornull.- Returns:
- the currently selected region or null
 
- 
setDoContextInfopublic void setDoContextInfo(boolean doContextInfo) Sets the context info property. If set totrue, context info will be invoked on the current target's viewer whenever a position is switched.- Parameters:
- doContextInfo-- trueif context information should be displayed
 
- 
setPositionListenerSets the focus callback which will get informed when the focus of the linked mode UI changes.If there is a listener installed already, it will be replaced. - Parameters:
- listener- the new listener, never- null.
 
- 
setSimpleModepublic void setSimpleMode(boolean simple) Sets the "simple" mode of the receiver. A linked mode UI in simple mode merely draws the exit position, but not the target, focus, and slave positions. Default isfalse. This method must be called before it is entered.- Parameters:
- simple-- trueif the UI should be in simple mode.
 
- 
enableColoredLabelspublic void enableColoredLabels(boolean isEnabled) Enables the support for colored labels in the proposal popup.Completion proposals can implement ICompletionProposalExtension6to provide colored proposal labels.- Parameters:
- isEnabled- if- truethe support for colored labels is enabled in the proposal popup
- Since:
- 3.4
 
 
-