JIDE 3.5.15

com.jidesoft.editor.caret
Class CaretEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.jidesoft.editor.caret.CaretEvent
All Implemented Interfaces:
Serializable

public class CaretEvent
extends EventObject

The event to represent a caret position change.

See Also:
Serialized Form

Field Summary
static int MODEL_POSITION
           
static int VIEW_POSITION
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CaretEvent(CodeEditor editor, CaretPosition oldPosition, CaretPosition newPosition)
          Creates CaretEvent that represents a caret position change.
CaretEvent(CodeEditor editor, int type, CaretPosition oldPosition, CaretPosition newPosition)
          Creates CaretEvent that represents a caret position change.
 
Method Summary
 CodeEditor getCodeEditor()
          Gets the CodeEditor associated with this CarentEvent.
 CaretPosition getNewPosition()
          Gets the new caret position.
 CaretPosition getOldPosition()
          Gets the old caret position.
 int getType()
          Gets the type of the caret event.
 String toString()
           
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MODEL_POSITION

public static final int MODEL_POSITION
See Also:
Constant Field Values

VIEW_POSITION

public static final int VIEW_POSITION
See Also:
Constant Field Values
Constructor Detail

CaretEvent

public CaretEvent(CodeEditor editor,
                  CaretPosition oldPosition,
                  CaretPosition newPosition)
Creates CaretEvent that represents a caret position change. Please note, both positions are the caret model position, not caret view position.

Parameters:
editor - the CodeEditor.
oldPosition - the old caret position.
newPosition - the new caret position.

CaretEvent

public CaretEvent(CodeEditor editor,
                  int type,
                  CaretPosition oldPosition,
                  CaretPosition newPosition)
Creates CaretEvent that represents a caret position change. Please note, both positions are the caret model position, not caret view position.

Parameters:
editor - the CodeEditor.
type - the event type to indicate the event is for the MODEL_POSITION or for the VIEW_POSITION.
oldPosition - the old caret position.
newPosition - the new caret position.
Method Detail

getCodeEditor

public CodeEditor getCodeEditor()
Gets the CodeEditor associated with this CarentEvent.

Returns:
the CodeEditor.

getOldPosition

public CaretPosition getOldPosition()
Gets the old caret position.

Returns:
the old caret position.

getNewPosition

public CaretPosition getNewPosition()
Gets the new caret position.

Returns:
the new caret position.

getType

public int getType()
Gets the type of the caret event. It could be either MODEL_POSITION or VIEW_POSITION.

Returns:
MODEL_POSITION or VIEW_POSITION.

toString

public String toString()
Overrides:
toString in class EventObject

JIDE 3.5.15