|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent oracle.javatools.editor.gutter.LineGutterPlugin
The LineGutterPlugin
is a line gutter which also
implements the Gutter interface that provides clients with
the ability to add or remove icon marks in the gutter associated
with an editor pane. Refer to the Gutter
interface
for more details about its use.
Note that this Gutter implementation is not currently defined to handle the case where the document for the editor is changed after the line gutter has been installed. Unpredictable results WILL happen in such cases.
Gutter
,
Serialized FormNested Class Summary |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
static int |
SHARED_ICON_COLUMN_ALWAYS
Constant indicating that icons should always be displayed in a shared column, regardless of the editor/global property for shared icon column. |
static int |
SHARED_ICON_COLUMN_DEFAULT
Constant indicating that whether the icons are displayed in a shared or their own columns will follow the editor/global property for shared icon column. |
static int |
SHARED_ICON_COLUMN_NEVER
Constant indicating that icons should always be displayed in their own columns, regardless of the editor/global property for shared icon column. |
static int |
SHOW_LINE_NUMBERS_ALWAYS
Constant indicating that line numbers should always be visible, regardless of the editor/global property for show line numbers. |
static int |
SHOW_LINE_NUMBERS_DEFAULT
Constant indicating that this line gutter instance will just follow the editor/global property for show line numbers. |
static int |
SHOW_LINE_NUMBERS_NEVER
Constant indicating that line numbers should never be visible, regardless of the editor/global property for show line numbers. |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface oracle.javatools.editor.gutter.Gutter |
DEFAULT_WIDTH, MAXIMUM_WIDTH, MINIMUM_WIDTH |
Fields inherited from interface oracle.javatools.buffer.TextBufferListener |
EOL_TYPE_ATTRIBUTE, MODIFIED_ATTRIBUTE, READ_ONLY_ATTRIBUTE, RELOAD_END_ATTRIBUTE, RELOAD_START_ATTRIBUTE |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
LineGutterPlugin()
Constructs a new LineGutterPlugin . |
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. |
protected static oracle.javatools.editor.gutter.LineGutterPlugin.Mark[] |
allocMarkArray()
Utility routine to get a shared Mark[] scratch array. |
protected boolean |
allowDragging()
Utility routine to check whether click-dragging is enabled for making a selection in the editor. |
void |
attributeUpdate(int attribute)
Provides notification regarding a change to one of the buffer attributes. |
void |
changedUpdate(javax.swing.event.DocumentEvent event)
Gives notification that an attribute or set of attributes changed. |
protected static void |
clearMarkArray(oracle.javatools.editor.gutter.LineGutterPlugin.Mark[] arrayToClear)
Utility routine to clear a given Mark[] array. |
void |
deinstall(BasicEditorPane editor)
Called when the plugin is being removed from the BasicEditorPane (for example when the editor is closed.) This is used to notify plugins that they should unregister any listeners that were attached. |
protected void |
fireGutterClicked(java.awt.event.MouseEvent event)
Utility routine to handle firing a gutter click notification for the given mouse event. |
protected static void |
freeMarkArray(oracle.javatools.editor.gutter.LineGutterPlugin.Mark[] arrayToFree)
Utility routine to free a shared Mark[] scratch array. |
protected int |
getLineFromCoordinate(int x,
int y)
Private utility routine to calculate the line from a point. |
protected static void |
insertMarkForZOrder(oracle.javatools.editor.gutter.LineGutterPlugin.Mark[] markArray,
oracle.javatools.editor.gutter.LineGutterPlugin.Mark markToInsert)
Utility routine to insert a given mark into an array based on the priority level to use for Z-ordering. |
void |
insertUpdate(javax.swing.event.DocumentEvent event)
Gives notification that there was an insert into the document. |
void |
insertUpdate(int offset,
int count,
char[] insertedData)
Provides notification about an insertion into the text buffer. |
void |
install(BasicEditorPane editor)
Called when this plugin is being installed into the BasicEditorPane. |
void |
mouseClicked(java.awt.event.MouseEvent event)
Invoked when the mouse has been clicked on a component. |
void |
mouseDragged(java.awt.event.MouseEvent event)
Invoked when a mouse button is pressed on a component and then dragged. |
void |
mouseEntered(java.awt.event.MouseEvent event)
Invoked when the mouse enters a component. |
void |
mouseExited(java.awt.event.MouseEvent event)
Invoked when the mouse exits a component. |
void |
mouseMoved(java.awt.event.MouseEvent event)
Invoked when the mouse button has been moved on a component (with no buttons no down). |
void |
mousePressed(java.awt.event.MouseEvent event)
Invoked when a mouse button has been pressed on a component. |
void |
mouseReleased(java.awt.event.MouseEvent event)
Invoked when a mouse button has been released on a component. |
static int |
numDigits(int number)
Utility routine to compute the number of digits in the specified number. |
void |
paint(java.awt.Graphics graphics)
Paint the component. |
void |
propertyChange(java.beans.PropertyChangeEvent event)
This method gets called when a bound property is changed. |
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. |
void |
removeUpdate(javax.swing.event.DocumentEvent event)
Gives notification that a portion of the document has been removed. |
void |
removeUpdate(int offset,
int count,
char[] removedData)
Provides notification about a removal from the text buffer. |
void |
setSharedIconColumn(int sharedFlag)
Sets the "shared icon column" policy of this line gutter directly. |
void |
setShowLineNumbers(int showFlag)
Sets the "show line numbers" policy of this line gutter directly. |
protected void |
setUI(javax.swing.plaf.ComponentUI newUI)
Sets the look and feel delegate for this component. |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int SHOW_LINE_NUMBERS_ALWAYS
public static final int SHOW_LINE_NUMBERS_NEVER
public static final int SHOW_LINE_NUMBERS_DEFAULT
public static final int SHARED_ICON_COLUMN_ALWAYS
public static final int SHARED_ICON_COLUMN_NEVER
public static final int SHARED_ICON_COLUMN_DEFAULT
Constructor Detail |
public LineGutterPlugin()
LineGutterPlugin
.
Method Detail |
public void install(BasicEditorPane editor)
install
in interface EditorPlugin
editor
- the editor panepublic void deinstall(BasicEditorPane editor)
deinstall
in interface EditorPlugin
editor
- the editor panepublic void setShowLineNumbers(int showFlag)
showFlag
- the show line numbers policy for this line gutterpublic void setSharedIconColumn(int sharedFlag)
sharedFlag
- the shared icon column policy for this line gutterpublic void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
event
- A PropertyChangeEvent object describing the event source
and the property that has changed.protected static oracle.javatools.editor.gutter.LineGutterPlugin.Mark[] allocMarkArray()
protected static void freeMarkArray(oracle.javatools.editor.gutter.LineGutterPlugin.Mark[] arrayToFree)
arrayToFree
- the Mark[] array to free upprotected static void clearMarkArray(oracle.javatools.editor.gutter.LineGutterPlugin.Mark[] arrayToClear)
arrayToClear
- the array to clearprotected static void insertMarkForZOrder(oracle.javatools.editor.gutter.LineGutterPlugin.Mark[] markArray, oracle.javatools.editor.gutter.LineGutterPlugin.Mark markToInsert)
markArray
- the array to insert intomarkToInsert
- the mark to insertprotected void setUI(javax.swing.plaf.ComponentUI newUI)
newUI
- the component ui to setpublic void paint(java.awt.Graphics graphics)
graphics
- the graphics context to draw toprotected int getLineFromCoordinate(int x, int y)
x
- the x-coordinate to translatey
- the y-coordinate to translate
public static int numDigits(int number)
number
- the number to calculate the number of digits for
public void insertUpdate(javax.swing.event.DocumentEvent event)
insertUpdate
in interface javax.swing.event.DocumentListener
event
- the document eventpublic void removeUpdate(javax.swing.event.DocumentEvent event)
removeUpdate
in interface javax.swing.event.DocumentListener
event
- the document eventpublic void changedUpdate(javax.swing.event.DocumentEvent event)
changedUpdate
in interface javax.swing.event.DocumentListener
event
- the document eventpublic void insertUpdate(int offset, int count, char[] insertedData)
insertUpdate
in interface TextBufferListener
offset
- the offset where the insert took placecount
- the number of characters inserted (insertedData.length)insertedData
- the contents of the insertionpublic void removeUpdate(int offset, int count, char[] removedData)
removeUpdate
in interface TextBufferListener
offset
- the offset where the removal took placecount
- the number of characters removed (removedData.length)removedData
- the contents of the removalpublic void attributeUpdate(int attribute)
attributeUpdate
in interface TextBufferListener
attribute
- the attribute that changedpublic void mouseDragged(java.awt.event.MouseEvent event)
mouseDragged
in interface java.awt.event.MouseMotionListener
event
- the mouse eventpublic void mouseMoved(java.awt.event.MouseEvent event)
mouseMoved
in interface java.awt.event.MouseMotionListener
event
- the mouse eventprotected boolean allowDragging()
protected void fireGutterClicked(java.awt.event.MouseEvent event)
event
- the mouse eventpublic void mouseClicked(java.awt.event.MouseEvent event)
mouseClicked
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent event)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent event)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent event)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent event)
mouseExited
in interface java.awt.event.MouseListener
public boolean addColumn(java.lang.String columnName, int pixelWidth, boolean firstColumn)
GutterMarks
for displaying icons in the Gutter.
addColumn
in interface Gutter
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.
addColumn
in interface Gutter
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)
removeColumn
in interface Gutter
public void removeAllColumns()
removeAllColumns
in interface Gutter
public GutterMark addGutterMark(java.lang.String columnName, int line, javax.swing.Icon icon, HighlightStyle highlightStyle, GutterTrackingListener listener)
addGutterMark
in interface Gutter
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)
removeGutterMark
in interface Gutter
mark
- the GutterMark to removepublic void addGutterClickListener(GutterClickListener listener)
GutterClickListener
to receive
notifications of mouse clicks in this Gutter component.
addGutterClickListener
in interface Gutter
listener
- the listener to registerpublic void removeGutterClickListener(GutterClickListener listener)
GutterClickListener
so that it no longer receives notifications of mouse clicks in this
Gutter component.
removeGutterClickListener
in interface Gutter
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.