|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Editor
Represents an instance of the IDEA text editor.
EditorFactory.createEditor(Document),
EditorFactory.createViewer(Document)| Method Summary | |
|---|---|
void |
addEditorMouseListener(EditorMouseListener listener)
Adds a listener for receiving notifications about mouse clicks in the editor and the mouse entering/exiting the editor. |
void |
addEditorMouseMotionListener(EditorMouseMotionListener listener)
Adds a listener for receiving notifications about mouse movement in the editor. |
CaretModel |
getCaretModel()
Returns the caret model for the document, which can be used to move the caret and retrieve information about the caret position. |
EditorColorsScheme |
getColorsScheme()
Returns the editor color scheme for this editor instance. |
javax.swing.JComponent |
getComponent()
Returns the component for the entire editor including the scrollbars, error stripe, gutter and other decorations. |
javax.swing.JComponent |
getContentComponent()
Returns the component for the content area of the editor (the area displaying the document text). |
Document |
getDocument()
Returns the document edited or viewed in the editor. |
FoldingModel |
getFoldingModel()
Returns the folding model for the document, which can be used to add, remove, expand or collapse folded regions in the document. |
EditorGutter |
getGutter()
Returns the gutter instance for the editor, which can be used to draw custom text annotations in the gutter. |
int |
getLineHeight()
Returns the height of a single line of text in the current editor font. |
MarkupModel |
getMarkupModel()
Returns the markup model for the editor. |
EditorMouseEventArea |
getMouseEventArea(java.awt.event.MouseEvent e)
Returns the editor area (text, gutter, folding outline and so on) in which the specified mouse event occurred. |
Project |
getProject()
Returns the project to which the editor is related. |
ScrollingModel |
getScrollingModel()
Returns the scrolling model for the document, which can be used to scroll the document and retrieve information about the current position of the scrollbars. |
SelectionModel |
getSelectionModel()
Returns the selection model for the editor, which can be used to select ranges of text in the document and retrieve information about the selection. |
EditorSettings |
getSettings()
Returns the editor settings for this editor instance. |
boolean |
isColumnMode()
Returns the block selection mode for the editor. |
boolean |
isDisposed()
Checks if this editor instance has been disposed. |
boolean |
isInsertMode()
Returns the insert/overwrite mode for the editor. |
boolean |
isOneLineMode()
Checks if the current editor instance is a one-line editor (used in a dialog control, for example). |
boolean |
isViewer()
Returns the value indicating whether the editor operates in viewer mode, with all modification actions disabled. |
int |
logicalPositionToOffset(LogicalPosition pos)
Maps a logical position in the editor to the offset in the document. |
java.awt.Point |
logicalPositionToXY(LogicalPosition pos)
Maps a logical position in the editor to pixel coordinates. |
VisualPosition |
logicalToVisualPosition(LogicalPosition logicalPos)
Maps a logical position in the editor (the line and column ignoring folding) to a visual position (with folded lines and columns not included in the line and column count). |
LogicalPosition |
offsetToLogicalPosition(int offset)
Maps an offset in the document to a logical position. |
VisualPosition |
offsetToVisualPosition(int offset)
Maps an offset in the document to a visual position. |
void |
removeEditorMouseListener(EditorMouseListener listener)
Removes a listener for receiving notifications about mouse clicks in the editor and the mouse entering/exiting the editor. |
void |
removeEditorMouseMotionListener(EditorMouseMotionListener listener)
Removes a listener for receiving notifications about mouse movement in the editor. |
java.awt.Point |
visualPositionToXY(VisualPosition visible)
Maps a visual position in the editor to pixel coordinates. |
LogicalPosition |
visualToLogicalPosition(VisualPosition visiblePos)
Maps a visual position in the editor (with folded lines and columns not included in the line and column count) to a logical position (the line and column ignoring folding). |
LogicalPosition |
xyToLogicalPosition(java.awt.Point p)
Maps the pixel coordinates in the editor to a logical position. |
VisualPosition |
xyToVisualPosition(java.awt.Point p)
Maps the pixel coordinates in the editor to a visual position. |
| Methods inherited from interface com.intellij.openapi.util.UserDataHolder |
|---|
getUserData, putUserData |
| Method Detail |
|---|
@NotNull Document getDocument()
boolean isViewer()
@NotNull javax.swing.JComponent getComponent()
@NotNull javax.swing.JComponent getContentComponent()
@NotNull SelectionModel getSelectionModel()
@NotNull MarkupModel getMarkupModel()
Document.getMarkupModel(com.intellij.openapi.project.Project)@NotNull FoldingModel getFoldingModel()
@NotNull ScrollingModel getScrollingModel()
@NotNull CaretModel getCaretModel()
@NotNull EditorSettings getSettings()
@NotNull EditorColorsScheme getColorsScheme()
int getLineHeight()
@NotNull
java.awt.Point logicalPositionToXY(@NotNull
LogicalPosition pos)
pos - the logical position.
content component.
int logicalPositionToOffset(@NotNull
LogicalPosition pos)
pos - the logical position.
@NotNull
VisualPosition logicalToVisualPosition(@NotNull
LogicalPosition logicalPos)
logicalPos - the logical position.
@NotNull
java.awt.Point visualPositionToXY(@NotNull
VisualPosition visible)
visible - the visual position.
content component.
@NotNull
LogicalPosition visualToLogicalPosition(@NotNull
VisualPosition visiblePos)
visiblePos - the visual position.
@NotNull LogicalPosition offsetToLogicalPosition(int offset)
offset - the offset in the document.
@NotNull VisualPosition offsetToVisualPosition(int offset)
offset - the offset in the document.
@NotNull
LogicalPosition xyToLogicalPosition(@NotNull
java.awt.Point p)
p - the coordinates relative to the top left corner of the content component.
@NotNull
VisualPosition xyToVisualPosition(@NotNull
java.awt.Point p)
p - the coordinates relative to the top left corner of the content component.
void addEditorMouseListener(@NotNull
EditorMouseListener listener)
listener - the listener instance.
void removeEditorMouseListener(@NotNull
EditorMouseListener listener)
listener - the listener instance.
void addEditorMouseMotionListener(@NotNull
EditorMouseMotionListener listener)
listener - the listener instance.
void removeEditorMouseMotionListener(@NotNull
EditorMouseMotionListener listener)
listener - the listener instance.boolean isDisposed()
@Nullable Project getProject()
boolean isInsertMode()
boolean isColumnMode()
boolean isOneLineMode()
@NotNull EditorGutter getGutter()
@Nullable
EditorMouseEventArea getMouseEventArea(@NotNull
java.awt.event.MouseEvent e)
e - the mouse event for which the area is requested.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||