站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

ExtCaret (Editor Library) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor.lib/1 1.14.0 3

org.netbeans.editor.ext
Class ExtCaret

java.lang.Object
  extended by org.netbeans.editor.BaseCaret
      extended by org.netbeans.editor.ext.ExtCaret
All Implemented Interfaces:
ActionListener, MouseListener, MouseMotionListener, PropertyChangeListener, EventListener, DocumentListener, Caret, FoldHierarchyListener, AtomicLockListener, SettingsChangeListener

public class ExtCaret
extends BaseCaret

Extended caret implementation


Field Summary
static String HIGHLIGHT_BRACE_LAYER_NAME
          Highlight matching brace draw layer name
static int HIGHLIGHT_BRACE_LAYER_VISIBILITY
          Highlight matching brace draw layer visibility
static String HIGHLIGHT_ROW_LAYER_NAME
          Deprecated. Please use Highlighting SPI instead, for details see Editor Library 2.
static int HIGHLIGHT_ROW_LAYER_VISIBILITY
          Deprecated. Please use Highlighting SPI instead, for details see Editor Library 2.
static int MATCH_BRACE_AFTER
          Highlight a brace matching character after (at) the caret
static int MATCH_BRACE_BEFORE
          Highlight a brace matching character before the caret
static int MATCH_BRACE_EITHER
          Highlight a brace matching character either before or after caret; the character before takes precedence.
 
Fields inherited from class org.netbeans.editor.BaseCaret
afterCaretFont, beforeCaretFont, BLOCK_CARET, changeEvent, component, dotChar, flasher, LINE_CARET, listenerList, textBackColor, textForeColor, THIN_LINE_CARET
 
Constructor Summary
ExtCaret()
           
 
Method Summary
 void deinstall(JTextComponent c)
          Called when UI is being removed from JTextComponent
 int getMatchBraceOffset()
          Fetch the match brace offset.
 void install(JTextComponent c)
          Called when UI is being installed into JTextComponent
protected  void modelChanged(BaseDocument oldDoc, BaseDocument newDoc)
           
 void mousePressed(MouseEvent evt)
           
 void mouseReleased(MouseEvent evt)
           
 void requestMatchBraceUpdateSync()
          Signal that the next matching brace update will be immediate without waiting for the brace timer to fire the action.
 void setMatchBraceOffset(int offset)
          Set the match brace offset.
 void settingsChange(SettingsChangeEvent evt)
          Called when settings were changed.
protected  void update(boolean scrollViewToCaret)
          Update the caret's visual position.
protected  void updateMatchBrace()
          Update the matching brace of the caret.
 
Methods inherited from class org.netbeans.editor.BaseCaret
actionPerformed, addChangeListener, atomicLock, atomicUnlock, changedUpdate, equals, fireStateChanged, foldHierarchyChanged, getBlinkRate, getDot, getEventComponent, getMagicCaretPosition, getMark, insertUpdate, isDragPossible, isSelectionVisible, isVisible, mapDragOperationFromModifiers, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, moveDot, moveDot, paint, paintCustomCaret, propertyChange, removeChangeListener, removeUpdate, setBlinkRate, setDot, setDot, setDot, setDot, setMagicCaretPosition, setSelectionVisible, setVisible, setVisibleImpl
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HIGHLIGHT_ROW_LAYER_NAME

public static final String HIGHLIGHT_ROW_LAYER_NAME
Deprecated. Please use Highlighting SPI instead, for details see Editor Library 2.
Highlight row draw layer name.

Using DrawLayers has been deprecated and this constant has no longer any meaning.

See Also:
Constant Field Values

HIGHLIGHT_ROW_LAYER_VISIBILITY

public static final int HIGHLIGHT_ROW_LAYER_VISIBILITY
Deprecated. Please use Highlighting SPI instead, for details see Editor Library 2.
Highlight row draw layer visibility.

Using DrawLayers has been deprecated and this constant has no longer any meaning.

See Also:
Constant Field Values

HIGHLIGHT_BRACE_LAYER_NAME

public static final String HIGHLIGHT_BRACE_LAYER_NAME
Highlight matching brace draw layer name

See Also:
Constant Field Values

HIGHLIGHT_BRACE_LAYER_VISIBILITY

public static final int HIGHLIGHT_BRACE_LAYER_VISIBILITY
Highlight matching brace draw layer visibility

See Also:
Constant Field Values

MATCH_BRACE_BEFORE

public static final int MATCH_BRACE_BEFORE
Highlight a brace matching character before the caret

See Also:
Constant Field Values

MATCH_BRACE_AFTER

public static final int MATCH_BRACE_AFTER
Highlight a brace matching character after (at) the caret

See Also:
Constant Field Values

MATCH_BRACE_EITHER

public static final int MATCH_BRACE_EITHER
Highlight a brace matching character either before or after caret; the character before takes precedence.

See Also:
Constant Field Values
Constructor Detail

ExtCaret

public ExtCaret()
Method Detail

modelChanged

protected void modelChanged(BaseDocument oldDoc,
                            BaseDocument newDoc)
Overrides:
modelChanged in class BaseCaret

settingsChange

public void settingsChange(SettingsChangeEvent evt)
Called when settings were changed. The method is called also in constructor, so the code must count with the evt being null.

Specified by:
settingsChange in interface SettingsChangeListener
Overrides:
settingsChange in class BaseCaret

install

public void install(JTextComponent c)
Description copied from class: BaseCaret
Called when UI is being installed into JTextComponent

Specified by:
install in interface Caret
Overrides:
install in class BaseCaret

deinstall

public void deinstall(JTextComponent c)
Description copied from class: BaseCaret
Called when UI is being removed from JTextComponent

Specified by:
deinstall in interface Caret
Overrides:
deinstall in class BaseCaret

setMatchBraceOffset

public void setMatchBraceOffset(int offset)
Set the match brace offset.

Parameters:
offset - One of MATCH_BRACE_BEFORE, MATCH_BRACE_AFTER * or MATCH_BRACE_EITHER.

getMatchBraceOffset

public int getMatchBraceOffset()
Fetch the match brace offset.


updateMatchBrace

protected void updateMatchBrace()
Update the matching brace of the caret. The document is read-locked while this method is called.


update

protected void update(boolean scrollViewToCaret)
Description copied from class: BaseCaret
Update the caret's visual position.
The document is read-locked while calling this method.

Overrides:
update in class BaseCaret
Parameters:
scrollViewToCaret - whether the view of the text component should be scrolled to the position of the caret.

requestMatchBraceUpdateSync

public void requestMatchBraceUpdateSync()
Signal that the next matching brace update will be immediate without waiting for the brace timer to fire the action. This is usually done for the key-typed action.


mousePressed

public void mousePressed(MouseEvent evt)
Specified by:
mousePressed in interface MouseListener
Overrides:
mousePressed in class BaseCaret

mouseReleased

public void mouseReleased(MouseEvent evt)
Specified by:
mouseReleased in interface MouseListener
Overrides:
mouseReleased in class BaseCaret

org.netbeans.modules.editor.lib/1 1.14.0 3

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.