Logo Search packages:      
Sourcecode: jedit version File versions  Download package

org::gjt::sp::jedit::Buffer Class Reference

Inheritance diagram for org::gjt::sp::jedit::Buffer:

org::gjt::sp::jedit::buffer::JEditBuffer

List of all members.


Detailed Description

A Buffer represents the contents of an open text file as it is maintained in the computer's memory (as opposed to how it may be stored on a disk).

In a BeanShell script, you can obtain the current buffer instance from the buffer variable.

This class does not have a public constructor. Buffers can be opened and closed using methods in the jEdit class.

This class is partially thread-safe, however you must pay attention to two very important guidelines:

Author:
Slava Pestov
Version:
Id
Buffer.java 16444 2009-11-05 12:50:10Z shlomy

Definition at line 89 of file Buffer.java.


Public Member Functions

void addBufferChangeListener (BufferChangeListener listener)
void addBufferChangeListener (BufferChangeListener listener, int priority)
void addBufferListener (BufferListener listener)
void addBufferListener (BufferListener listener, int priority)
void addBufferUndoListener (BufferUndoListener listener)
void addMarker (char shortcut, int pos)
void addOrRemoveMarker (char shortcut, int pos)
void autosave ()
void beginCompoundEdit ()
boolean canRedo ()
boolean canUndo ()
int checkFileStatus (View view)
Position createPosition (int offset)
void editSyntaxStyle (JEditTextArea textArea)
void endCompoundEdit ()
boolean getAutoReload ()
boolean getAutoReloadDialog ()
File getAutosaveFile ()
boolean getBooleanProperty (String name, boolean def)
boolean getBooleanProperty (String name)
BufferListener[] getBufferListeners ()
String getContextSensitiveProperty (int offset, String name)
int getCurrentIndentForLine (int lineIndex, int[] whitespaceChars)
Object getDefaultProperty (String name)
String getDirectory ()
File getFile ()
int[] getFoldAtLine (int line)
FoldHandler getFoldHandler ()
int getFoldLevel (int line)
Icon getIcon ()
int getIdealIndentForLine (int lineIndex)
int getIndentSize ()
int getIndex ()
int getIntegerProperty (String name, int defaultValue)
KeywordMap getKeywordMapAtOffset (int offset)
long getLastModified ()
int getLength ()
int getLineCount ()
int getLineEndOffset (int line)
int getLineLength (int line)
int getLineOfOffset (int offset)
CharSequence getLineSegment (int line)
int getLineStartOffset (int line)
void getLineText (int line, Segment segment)
String getLineText (int line)
Marker getMarker (char shortcut)
Marker getMarkerAtLine (int line)
Marker getMarkerInRange (int start, int end)
String getMarkerNameString ()
Vector< MarkergetMarkers ()
String getMarkersPath (VFS vfs)
String getMarkerStatusPrompt (String action)
Mode getMode ()
String getName ()
Buffer getNext ()
int getOffsetOfVirtualColumn (int line, int column, int[] totalVirtualWidth)
String getPath (Boolean shortVersion)
String getPath ()
Pattern getPatternProperty (String name, int flags)
Buffer getPrev ()
int getPriorNonEmptyLine (int lineIndex)
Object getProperty (Object name)
ParserRuleSet getRuleSetAtOffset (int offset)
CharSequence getSegment (int start, int length)
String getStringProperty (String name)
String getSymlinkPath ()
int getTabSize ()
void getText (int start, int length, Segment seg)
String getText (int start, int length)
TokenMarker getTokenMarker ()
Object getUndoId ()
VFS getVFS ()
int getVirtualWidth (int line, int column)
boolean indentLine (int lineIndex, boolean canDecreaseIndent)
boolean indentLine (int lineIndex, boolean canIncreaseIndent, boolean canDecreaseIndent)
void indentLines (int[] lines)
void indentLines (int start, int end)
void insert (int offset, Segment seg)
void insert (int offset, String str)
void insertAtColumn (int line, int col, String str)
boolean insertFile (View view, String path)
int insertIndented (int offset, String text)
void insertString (int offset, String str, AttributeSet attr)
boolean insideCompoundEdit ()
void invalidateCachedFoldLevels ()
boolean isClosed ()
boolean isDirty ()
boolean isEditable ()
boolean isElectricKey (char ch, int line)
boolean isElectricKey (char ch)
boolean isFoldEnd (int line)
boolean isFoldStart (int line)
boolean isLoaded ()
boolean isLoading ()
boolean isNewFile ()
boolean isPerformingIO ()
boolean isReadOnly ()
boolean isTemporary ()
boolean isTransactionInProgress ()
boolean isUndoInProgress ()
boolean isUntitled ()
boolean load (final View view, final boolean reload)
boolean markersChanged ()
void markTokens (int lineIndex, TokenHandler tokenHandler)
TokenList markTokens (int lineIndex)
void propertiesChanged ()
void putBooleanProperty (String name, boolean value)
void putProperty (Object name, Object value)
void readLock ()
void readUnlock ()
void redo (TextArea textArea)
void reload (View view)
void remove (int offset, int length)
void removeAllMarkers ()
void removeAutosaveFile ()
void removeBufferChangeListener (BufferChangeListener listener)
void removeBufferListener (BufferListener listener)
void removeBufferUndoListener (BufferUndoListener listener)
void removeMarker (int line)
void removeTrailingWhiteSpace (int[] lines)
void resetCachedProperties ()
boolean save (final View view, String path, final boolean rename, boolean disableFileStatusCheck)
boolean save (View view, String path, boolean rename)
boolean save (View view, String path)
boolean saveAs (View view, boolean rename)
void setAutoReload (boolean value)
void setAutoReloadDialog (boolean value)
void setBooleanProperty (String name, boolean value)
void setDefaultProperty (String name, Object value)
void setDirty (boolean d)
void setFoldHandler (FoldHandler foldHandler)
void setIntegerProperty (String name, int value)
void setLastModified (long modTime)
void setLoading (boolean loading)
void setMarkersChanged (boolean changed)
void setMode (Mode mode)
void setMode (String mode)
void setMode ()
void setNewFile (boolean newFile)
void setPerformingIO (boolean io)
void setProperty (String name, Object value)
void setReadOnly (boolean readOnly)
void setStringProperty (String name, String value)
void setTokenMarker (TokenMarker tokenMarker)
void setUndoLimit (int limit)
void setWaitSocket (Socket waitSocket)
void shiftIndentLeft (int[] lines)
void shiftIndentRight (int[] lines)
void toggleLineSeparator (View view)
void toggleWordWrap (View view)
String toString ()
void undo (TextArea textArea)
void unsetProperty (String name)
boolean updateMarkersFile (View view)
void writeLock ()
void writeUnlock ()

Static Public Member Functions

static String getMarkersPath (VFS vfs, String path)

Static Public Attributes

static final String BACKED_UP = "Buffer__backedUp"
static final String CARET = "Buffer__caret"
static final String CARET_POSITIONED = "Buffer__caretPositioned"
static final String ENCODING = "encoding"
static final String ENCODING_AUTODETECT = "encodingAutodetect"
static final int FILE_CHANGED = 1
static final int FILE_DELETED = 2
static final int FILE_NOT_CHANGED = 0
static final String GZIPPED = "gzipped"
static final int HIGH_PRIORITY = 1
static final String LINESEP = "lineSeparator"
static final int NORMAL_PRIORITY = 0
static final String SCROLL_HORIZ = "Buffer__scrollHoriz"
static final String SCROLL_VERT = "Buffer__scrollVert"
static final String SELECTION = "Buffer__selection"
static final String TRAILING_EOL = "trailingEOL"

Protected Member Functions

void fireBeginRedo ()
void fireBeginUndo ()
void fireBufferLoaded ()
void fireContentInserted (int startLine, int offset, int numLines, int length)
void fireContentRemoved (int startLine, int offset, int numLines, int length)
void fireEndRedo ()
void fireEndUndo ()
void fireFoldHandlerChanged ()
void fireFoldLevelChanged (int start, int end)
void firePreContentInserted (int startLine, int offset, int numLines, int length)
void firePreContentRemoved (int startLine, int offset, int numLines, int length)
void fireTransactionComplete ()
void invalidateFoldLevels ()
boolean isFileReadOnly ()
void loadText (Segment seg, IntegerArray endOffsets)
void parseBufferLocalProperties ()
void setFileReadOnly (boolean readOnly)

Protected Attributes

Mode mode
boolean textMode
UndoManager undoMgr

Package Functions

 Buffer (String path, boolean newFile, boolean temp, Map props)
void close ()
void commitTemporary ()

Package Attributes

Buffer next
Buffer prev

Private Member Functions

byte[] calculateHash ()
boolean checkFileForLoad (View view, VFS vfs, String path)
void finishLoading ()
void finishSaving (View view, String oldPath, String oldSymlinkPath, String path, boolean rename, boolean error)
boolean getFlag (int flag)
boolean recoverAutosave (final View view)
void setFlag (int flag, boolean value)
void setPath (final String path)
void updateHash ()

Static Private Member Functions

static boolean checkFileForSave (View view, VFS vfs, String path)

Private Attributes

File autosaveFile
String directory
File file
int flags
int initialLength
final Vector< Markermarkers
byte[] md5hash
long modTime
String name
String path
String symlinkPath
Socket waitSocket

Static Private Attributes

static final int AUTORELOAD = 6
static final int AUTORELOAD_DIALOG = 7
static final int AUTOSAVE_DIRTY = 5
static final int CLOSED = 0
static final int MARKERS_CHANGED = 12
static final int NEW_FILE = 3
static final int TEMPORARY = 10
static final int UNTITLED = 4

Classes

class  TokenList

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index