|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 to control the editor's vertical ruler.
Clients may implement this interface from scratch, but the recommended way is to
subclass the abstract base class AbstractTextEditor
.
IDocumentProvider
,
IAnnotationModel
Field Summary |
Fields inherited from interface org.eclipse.ui.IEditorPart |
PROP_DIRTY, PROP_INPUT |
Fields inherited from interface org.eclipse.ui.IWorkbenchPart |
PROP_TITLE |
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. |
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. |
Methods inherited from interface org.eclipse.ui.IEditorPart |
doSave, doSaveAs, getEditorInput, getEditorSite, gotoMarker, init, isDirty, isSaveAsAllowed, isSaveOnCloseNeeded |
Methods inherited from interface org.eclipse.ui.IWorkbenchPart |
addPropertyListener, createPartControl, dispose, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setFocus |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
getAdapter |
Method Detail |
public IDocumentProvider getDocumentProvider()
public void close(boolean save)
save
- true
if unsaved changed should be saved, and
false
if unsaved changed should be discardedpublic boolean isEditable()
true
if it can be edited, and false
if it is read-onlypublic void doRevertToSaved()
public void setAction(String actionID, IAction action)
action
- the action, or null
to clear itgetAction(java.lang.String)
public IAction getAction(String actionId)
actionId
- the action id
null
if nonesetAction(java.lang.String, org.eclipse.jface.action.IAction)
public void setActionActivationCode(String actionId, char activationCharacter, int activationKeyCode, int activationStateMask)
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.
actionId
- the action idpublic void removeActionActivationCode(String actionId)
actionId
- the action idpublic boolean showsHighlightRangeOnly()
true
if only the highlighted range is shown, and
false
if this editor shows the entire text of the documentshowHighlightRangeOnly(boolean)
public void showHighlightRangeOnly(boolean showHighlightRangeOnly)
showHighlightRangeOnly
- true
if only the highlighted
range is shown, and false
if this editor shows the entire
text of the documentshowsHighlightRangeOnly()
public void setHighlightRange(int offset, int length, boolean moveCursor)
offset
- the offset of the highlighted rangelength
- the length of the highlighted rangemoveCursor
- true
if the cursor should be moved to
the start of the highlighted range, and false
to leave
the cursor unaffectedgetHighlightRange()
public IRegion getHighlightRange()
setHighlightRange(int, int, boolean)
public void resetHighlightRange()
public ISelectionProvider getSelectionProvider()
public void selectAndReveal(int offset, int length)
offset
- the offset of the selectionlength
- the length of the selection
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |