| org.eclipse.ui.texteditor.ITextEditor
All known Subclasses: org.eclipse.ui.texteditor.AbstractTextEditor,
ITextEditor | public interface ITextEditor extends IEditorPart(Code) | | Interface to a text editor. This interface defines functional extensions to
IEditorPart as well as the configuration capabilities of a
text editor.
Text editors are configured with an IDocumentProvider which
delivers a textual presentation (IDocument ) of the editor's
input. The editor works on the document and forwards all input element
related calls, such as save , to the document provider. The
provider also delivers the input's annotation model which is used by the
editor's vertical ruler.
Clients may implement this interface from scratch, but the recommended way is
to subclass the abstract base class AbstractTextEditor .
In order to provided backward compatibility for clients of
ITextEditor , extension interfaces are used to provide a means
of evolution. The following extension interfaces exist:
See Also: org.eclipse.ui.texteditor.IDocumentProvider See Also: org.eclipse.jface.text.source.IAnnotationModel See Also: org.eclipse.ui.texteditor.ITextEditorExtension See Also: org.eclipse.ui.texteditor.ITextEditorExtension2 See Also: org.eclipse.ui.texteditor.ITextEditorExtension3 |
Method Summary | |
void | close(boolean save) Closes this text editor after optionally saving changes. | void | doRevertToSaved() Abandons all modifications applied to this text editor's input element's
textual presentation since the last save operation. | IAction | getAction(String actionId) Returns the action installed under the given action id. | IDocumentProvider | getDocumentProvider() Returns this text editor's document provider.
the document provider or null if none, e.g. | IRegion | getHighlightRange() Returns the highlighted range of this text editor. | ISelectionProvider | getSelectionProvider() Returns this text editor's selection provider. | boolean | isEditable() Returns whether the text in this text editor can be changed by the user. | void | removeActionActivationCode(String actionId) Removes any installed activation code for the specified action. | void | resetHighlightRange() Resets the highlighted range of this text editor. | void | selectAndReveal(int offset, int length) Selects and reveals the specified range in this text editor. | void | setAction(String actionID, IAction action) Installs the given action under the given action id. | void | setActionActivationCode(String actionId, char activationCharacter, int activationKeyCode, int activationStateMask) Sets the given activation code for the specified action. | void | setHighlightRange(int offset, int length, boolean moveCursor) Sets the highlighted range of this text editor to the specified region. | void | showHighlightRangeOnly(boolean showHighlightRangeOnly) Configures this text editor to show only the highlighted range of the
text. | boolean | showsHighlightRangeOnly() Returns whether this text editor is configured to show only the
highlighted range of the text. |
close | void close(boolean save)(Code) | | Closes this text editor after optionally saving changes.
Parameters: save - true if unsaved changed should be saved, andfalse if unsaved changed should be discarded |
doRevertToSaved | void doRevertToSaved()(Code) | | Abandons all modifications applied to this text editor's input element's
textual presentation since the last save operation.
|
getDocumentProvider | IDocumentProvider getDocumentProvider()(Code) | | Returns this text editor's document provider.
the document provider or null if none, e.g. after closing the editor |
getSelectionProvider | ISelectionProvider getSelectionProvider()(Code) | | Returns this text editor's selection provider. Repeated calls to this
method return the same selection provider.
the selection provider |
isEditable | boolean isEditable()(Code) | | Returns whether the text in this text editor can be changed by the user.
true if it can be edited, and false if it is read-only |
removeActionActivationCode | void removeActionActivationCode(String actionId)(Code) | | Removes any installed activation code for the specified action.
If no activation code is installed, this method does not have
any effect.
Parameters: actionId - the action id |
resetHighlightRange | void resetHighlightRange()(Code) | | Resets the highlighted range of this text editor.
|
selectAndReveal | void selectAndReveal(int offset, int length)(Code) | | Selects and reveals the specified range in this text editor.
Parameters: offset - the offset of the selection Parameters: length - the length of the selection |
setAction | void setAction(String actionID, IAction action)(Code) | | Installs the given action under the given action id.
Parameters: actionID - the action id Parameters: action - the action, or null to clear it See Also: ITextEditor.getAction(String) |
setActionActivationCode | void setActionActivationCode(String actionId, char activationCharacter, int activationKeyCode, int activationStateMask)(Code) | | Sets the given activation code for the specified action. If
there is an activation code already registered, it is replaced.
The activation code consists of the same information as
a KeyEvent . If the activation code is triggered
and the associated action is enabled, the action is performed
and the triggering KeyEvent is considered consumed.
If the action is disabled, the KeyEvent is passed
on unmodified. Thus, action activation codes and action accelerators
differ in their model of event consumption. The key code parameter
can be -1 to indicate a wild card. The state mask
parameter can be SWT.DEFAULT to indicate a wild card.
Parameters: actionId - the action id Parameters: activationCharacter - the activation code character Parameters: activationKeyCode - the activation code key code or -1 for wild card Parameters: activationStateMask - the activation code state mask or SWT.DEFAULT for wild card |
setHighlightRange | void setHighlightRange(int offset, int length, boolean moveCursor)(Code) | | Sets the highlighted range of this text editor to the specified region.
Parameters: offset - the offset of the highlighted range Parameters: length - the length of the highlighted range Parameters: moveCursor - true if the cursor should be moved tothe start of the highlighted range, and false to leavethe cursor unaffected See Also: ITextEditor.getHighlightRange() |
showHighlightRangeOnly | void showHighlightRangeOnly(boolean showHighlightRangeOnly)(Code) | | Configures this text editor to show only the highlighted range of the
text.
Parameters: showHighlightRangeOnly - true if only the highlightedrange is shown, and false if this editor shows the entiretext of the document See Also: ITextEditor.showsHighlightRangeOnly() |
showsHighlightRangeOnly | boolean showsHighlightRangeOnly()(Code) | | Returns whether this text editor is configured to show only the
highlighted range of the text.
true if only the highlighted range is shown, andfalse if this editor shows the entire text of the document See Also: ITextEditor.showHighlightRangeOnly(boolean) |
|
|