|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The Gutter
interface describes a visual component that
is displayed vertically to the left of a BasicEditorPane. The
Gutter
tracks the BasicEditorPane such that they have
the same height and same number of lines. The Gutter
is used to display Icons associated with specific lines in the
editor pane.
The interface provides facilities for adding multiple columns of icons, tracking line changes, and responding to mouse clicks in the Gutter component. Note that all line-numbers are 1-based, unlike the underlying LineMap of the document - this is because this is a visual component for users, who naturally expect line numbers to start with 1.
Note that when creating columns, a advisory pixel width is specified. This may be used by the underlying implementation to lay out, and center the columns properly. For clients that know the widths of the icons to be placed in the columns, these values should be used. If not sure what width to set, use the DEFAULT_WIDTH constant provided.
GutterMark
,
GutterClickListener
,
GutterTrackingListener
Field Summary | |
static int |
DEFAULT_WIDTH
Public constant for some reasonable default width for a column. |
static int |
MAXIMUM_WIDTH
Public constant for the maximum width that a column can be constrained to be. |
static int |
MINIMUM_WIDTH
Public constant for the minimum width that a column can be constrained to be. |
Method Summary | |
boolean |
addColumn(java.lang.String columnName,
int pixelWidth,
boolean firstColumn)
Creates a new column that can contain GutterMarks
for displaying icons in the Gutter. |
boolean |
addColumn(java.lang.String columnName,
int pixelWidth,
java.lang.String existingColumn,
boolean insertBefore)
Creates a new column that can contain GutterMarks
for displaying icons in the Gutter. |
void |
addGutterClickListener(GutterClickListener listener)
Registers a GutterClickListener to receive
notifications of mouse clicks in this Gutter component. |
GutterMark |
addGutterMark(java.lang.String columnName,
int line,
javax.swing.Icon icon,
HighlightStyle highlightStyle,
GutterTrackingListener listener)
Adds a new GutterMark to the specified column for the specified line. |
void |
removeAllColumns()
Removes all existing columns from the Gutter. |
boolean |
removeColumn(java.lang.String columnName)
Removes an existing column from the Gutter and all its marks and icons. |
void |
removeGutterClickListener(GutterClickListener listener)
Deregisters a previously-registered GutterClickListener
so that it no longer receives notifications of mouse clicks in this
Gutter component. |
void |
removeGutterMark(GutterMark mark)
Removes the mark from the Gutter. |
Field Detail |
public static final int MINIMUM_WIDTH
public static final int DEFAULT_WIDTH
public static final int MAXIMUM_WIDTH
Method Detail |
public boolean addColumn(java.lang.String columnName, int pixelWidth, boolean firstColumn)
GutterMarks
for displaying icons in the Gutter. Returns true if the column was
created successfully, or false if there is already an existing
column with the same name.
columnName
- columnName the name of the column to createpixelWidth
- the requested width of the column in pixelsfirstColumn
- true to create the column as the left-most (first)
column, false to create the column as the right-most (last) column
public boolean addColumn(java.lang.String columnName, int pixelWidth, java.lang.String existingColumn, boolean insertBefore)
GutterMarks
for displaying icons in the Gutter. This will attempt to position
the column before or after an existing column. Returns true if
the column was created successfully, or false if the specified
existing column does not exist.
columnName
- columnName the name of the column to createpixelWidth
- the requested width of the column in pixelsexistingColumn
- the name of an existing column to place the
new column next toinsertBefore
- whether to insert the column before (true) the
existing column, or after (false)
public boolean removeColumn(java.lang.String columnName)
public void removeAllColumns()
public GutterMark addGutterMark(java.lang.String columnName, int line, javax.swing.Icon icon, HighlightStyle highlightStyle, GutterTrackingListener listener)
line
- the line on which to create the GutterMarkicon
- the icon to display visually for this line in the GutterhighlightStyle
- the highlight style to use for highlighting the
line, null for no highlightlistener
- the tracking listener to associate with this mark
for move or remove notifications (for tracking marks only)
public void removeGutterMark(GutterMark mark)
mark
- the GutterMark to removepublic void addGutterClickListener(GutterClickListener listener)
GutterClickListener
to receive
notifications of mouse clicks in this Gutter component.
listener
- the listener to registerpublic void removeGutterClickListener(GutterClickListener listener)
GutterClickListener
so that it no longer receives notifications of mouse clicks in this
Gutter component.
listener
- the listener to register
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.