Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

oracle.javatools.editor.gutter
Class LineGutterPlugin.Column

java.lang.Object
  extended by oracle.javatools.editor.gutter.LineGutterPlugin.Column
All Implemented Interfaces:
GutterColumn
Direct Known Subclasses:
CodeEditorGutter.CEColumn
Enclosing class:
LineGutterPlugin

public class LineGutterPlugin.Column
extends java.lang.Object
implements GutterColumn

This is our implementation of the GutterColumn interface that acts as a container for GutterMarks.


Nested Class Summary
 class LineGutterPlugin.Column.Mark
          This is our implementation of the GutterMark interface.
 
Field Summary
protected  GutterColumnListener _columnListener
          The listener for notifications.
protected  java.lang.String _columnName
          The name of the column.
protected  java.lang.String _layoutColumn
          The name of the layout constraint column, or null if none.
protected  int _layoutConstraint
          The layout constraint.
protected  java.util.List<LineGutterPlugin.Column.Mark> _marksList
          The list of marks for this column.
protected  int _reservedWidth
          The reserved width of this column.
protected  java.util.List<LineGutterPlugin.Column> group
          The columns with which this column merges reserved widths, bidirectionally and recursively.
protected  int groupIndex
          The maximum reserved width of the columns with which this column merges reserved widths.
 
Fields inherited from interface oracle.javatools.editor.gutter.GutterColumn
LAYOUT_MERGE_RESERVED_WIDTHS, LAYOUT_OVERLAY, LAYOUT_UNCONSTRAINED
 
Constructor Summary
protected LineGutterPlugin.Column(java.lang.String columnName, GutterColumnListener columnListener)
          Constructs a new Column.
 
Method Summary
 GutterMark addGutterMark(int line, javax.swing.Icon icon, HighlightStyle highlightStyle, int markOrder, int markOptions)
          Adds a new GutterMark to this column for the given line.
 void attributeUpdate(int attribute)
          Provides notification regarding a change to one of the buffer attributes.
 void beginBlockAdd()
          Begins a block add.
protected  void discardAllGutterMarks()
          Utility routine which discards all of the gutter marks.
 void endBlockAdd()
          Ends a block add.
protected  void fireMarkClicked(java.awt.event.MouseEvent event, GutterMark mark, int line)
          Utility routine to fire the click notification for the given mark.
protected  void getAllMarks(java.util.Collection<LineGutterPlugin.Column.Mark> collection)
          Fetch all the marks in this column, adding it to the specified collection.
 java.lang.String getColumnName()
          Fetch the name of this column.
 Gutter getGutter()
          Fetch the Gutter instance that this column is associated with.
protected  java.lang.String getLayoutColumn()
          Gets the column referenced by the layout constraint on this column, or null if LAYOUT_UNCONSTRAINED.
protected  int getLayoutConstraint()
          Gets the layout constraint on this column, either GutterColumn.LAYOUT_UNCONSTRAINED, GutterColumn.LAYOUT_MERGE_RESERVED_WIDTHS, or GutterColumn.LAYOUT_OVERLAY.
protected  int getMarkCount()
          Fetch the number of marks in this column.
protected  void getMarks(java.util.Collection<LineGutterPlugin.Column.Mark> collection, int line)
          Fetch all the marks in this column that are on the given line, adding it to the specified collection.
protected  boolean getMarkSupportsClicks(GutterMark gutterMark)
          Fetch whether the specified GutterMark supports click behavior.
 java.lang.String getMarkToolTip(GutterMark mark, java.awt.event.MouseEvent event)
          Fetch the tooltip associated with the given GutterMark.
protected  int getReservedWidth()
          Gets the width to reserve in the gutter for this column.
protected  void insertUpdate(javax.swing.event.DocumentEvent event)
          Gives notification that there was an insert into the document.
 GutterMark[] lookupGutterMarks(int line)
          Fetch the GutterMark instances contained within this column for the specified line (if any).
 void removeAllGutterMarks()
          Removes all marks from this column.
protected  int removeAllGutterMarksImpl()
          Removes all marks from this column without generating a repaint.
 void removeGutterMark(GutterMark mark)
          Removes the mark from this column.
 void removeUpdate(javax.swing.event.DocumentEvent event)
          Gives notification that a portion of the document has been removed.
 void setLayoutConstraint(java.lang.String columnName, int constraint)
          Sets a layout constraint on this column.
 void setReservedWidth(int width)
          Sets the width reserved in the gutter for this column when no icon is displayed.
 java.lang.String toString()
           
protected  void updateAllMarkHighlights()
          Utility routine to update all of the highlights for all of the marks for our column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_columnName

protected java.lang.String _columnName
The name of the column.


_columnListener

protected GutterColumnListener _columnListener
The listener for notifications.


_reservedWidth

protected int _reservedWidth
The reserved width of this column.


_layoutColumn

protected java.lang.String _layoutColumn
The name of the layout constraint column, or null if none.


_layoutConstraint

protected int _layoutConstraint
The layout constraint.


_marksList

protected java.util.List<LineGutterPlugin.Column.Mark> _marksList
The list of marks for this column.


group

protected java.util.List<LineGutterPlugin.Column> group
The columns with which this column merges reserved widths, bidirectionally and recursively.


groupIndex

protected int groupIndex
The maximum reserved width of the columns with which this column merges reserved widths.

Constructor Detail

LineGutterPlugin.Column

protected LineGutterPlugin.Column(java.lang.String columnName,
                                  GutterColumnListener columnListener)
Constructs a new Column.

Method Detail

setReservedWidth

public void setReservedWidth(int width)
Sets the width reserved in the gutter for this column when no icon is displayed. By default, the reserved width is 0.

Specified by:
setReservedWidth in interface GutterColumn
Parameters:
width - the width to reserve when no icon is displayed.

getReservedWidth

protected int getReservedWidth()
Gets the width to reserve in the gutter for this column.


setLayoutConstraint

public void setLayoutConstraint(java.lang.String columnName,
                                int constraint)
Sets a layout constraint on this column. The default is GutterColumn.LAYOUT_UNCONSTRAINED.

Specified by:
setLayoutConstraint in interface GutterColumn
Parameters:
columnName - the name of the column referenced by the constraint.
constraint - the constraint to establish, either GutterColumn.LAYOUT_UNCONSTRAINED, GutterColumn.LAYOUT_MERGE_RESERVED_WIDTHS, or GutterColumn.LAYOUT_OVERLAY.

getLayoutColumn

protected java.lang.String getLayoutColumn()
Gets the column referenced by the layout constraint on this column, or null if LAYOUT_UNCONSTRAINED.


getLayoutConstraint

protected int getLayoutConstraint()
Gets the layout constraint on this column, either GutterColumn.LAYOUT_UNCONSTRAINED, GutterColumn.LAYOUT_MERGE_RESERVED_WIDTHS, or GutterColumn.LAYOUT_OVERLAY.


updateAllMarkHighlights

protected void updateAllMarkHighlights()
Utility routine to update all of the highlights for all of the marks for our column. Potentially this may be expensive, however we don't expect very many marks in the gutter.


discardAllGutterMarks

protected void discardAllGutterMarks()
Utility routine which discards all of the gutter marks. This will generate removal notification for the marks removed, since it is not client initiated.


getMarkCount

protected int getMarkCount()
Fetch the number of marks in this column.

Returns:
the number of marks in this column

getAllMarks

protected void getAllMarks(java.util.Collection<LineGutterPlugin.Column.Mark> collection)
Fetch all the marks in this column, adding it to the specified collection.

Parameters:
collection - the collection to add our marks to

getMarks

protected void getMarks(java.util.Collection<LineGutterPlugin.Column.Mark> collection,
                        int line)
Fetch all the marks in this column that are on the given line, adding it to the specified collection.

Parameters:
collection - the collection to add our marks to
line - the line that we are interested in

removeAllGutterMarksImpl

protected int removeAllGutterMarksImpl()
Removes all marks from this column without generating a repaint. There is no removal notification generated for these mark removals.

Returns:
the count of marks removed

getMarkSupportsClicks

protected boolean getMarkSupportsClicks(GutterMark gutterMark)
Fetch whether the specified GutterMark supports click behavior.


getMarkToolTip

public java.lang.String getMarkToolTip(GutterMark mark,
                                       java.awt.event.MouseEvent event)
Fetch the tooltip associated with the given GutterMark.


fireMarkClicked

protected void fireMarkClicked(java.awt.event.MouseEvent event,
                               GutterMark mark,
                               int line)
Utility routine to fire the click notification for the given mark.


insertUpdate

protected void insertUpdate(javax.swing.event.DocumentEvent event)
Gives notification that there was an insert into the document. The range given by the DocumentEvent bounds the freshly inserted region.

Parameters:
event - the document event

removeUpdate

public void removeUpdate(javax.swing.event.DocumentEvent event)
Gives notification that a portion of the document has been removed. The range is given in terms of what the view last saw (that is, before updating sticky positions).

Parameters:
event - the document event

attributeUpdate

public void attributeUpdate(int attribute)
Provides notification regarding a change to one of the buffer attributes. The possible attributes are defined in this interface.

Parameters:
attribute - the attribute that changed

getGutter

public Gutter getGutter()
Fetch the Gutter instance that this column is associated with.

Specified by:
getGutter in interface GutterColumn
Returns:
the gutter containing this column

getColumnName

public java.lang.String getColumnName()
Fetch the name of this column.

Specified by:
getColumnName in interface GutterColumn

beginBlockAdd

public void beginBlockAdd()
Description copied from interface: GutterColumn
Begins a block add. During a block add, display updates normally caused by adding a gutter mark are deferred until the endBlockAdd

Specified by:
beginBlockAdd in interface GutterColumn

endBlockAdd

public void endBlockAdd()
Description copied from interface: GutterColumn
Ends a block add. During a block add, display updates normally caused by adding a gutter mark are deferred until the endBlockAdd.

Specified by:
endBlockAdd in interface GutterColumn

addGutterMark

public GutterMark addGutterMark(int line,
                                javax.swing.Icon icon,
                                HighlightStyle highlightStyle,
                                int markOrder,
                                int markOptions)
Adds a new GutterMark to this column for the given line. The provided icon will be displayed visually, and the highlight used to highlight the entire line. If there is a GutterColumnListener associated with this column, then it will receive notifications when the mark is moved, removed, or clicked upon.

Specified by:
addGutterMark in interface GutterColumn
Parameters:
line - the line (1-based) on which to create the GutterMark
icon - the icon to display visually on the given line of the gutter
highlightStyle - the highlight style to use for highlighting the line, or null for no highlight
markOrder - the ordering to use for this mark (in relation to other marks on the same line) for left-to-right positioning
markOptions - to affect user interaction with the mark, such as GutterMark.MARK_OPTION_SUPPORTS_CLICKS
Returns:
the newly created GutterMark or null if the line is invalid

lookupGutterMarks

public GutterMark[] lookupGutterMarks(int line)
Fetch the GutterMark instances contained within this column for the specified line (if any).

Specified by:
lookupGutterMarks in interface GutterColumn
Parameters:
line - the line to lookup gutter marks for
Returns:
an array of marks (possibly zero-length) set for the given line of this column

removeGutterMark

public void removeGutterMark(GutterMark mark)
Removes the mark from this column. This will also remove the icon and any associated highlight. There is no removal notification generated for this mark removal.

Specified by:
removeGutterMark in interface GutterColumn
Parameters:
mark - the gutter mark to remove

removeAllGutterMarks

public void removeAllGutterMarks()
Removes all marks from this column. There is no removal notification generated for these mark removals.

Specified by:
removeAllGutterMarks in interface GutterColumn

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

Copyright © 1997, 2009, Oracle. All rights reserved.