public interface Buffer
Modifier and Type | Interface and Description |
---|---|
static class |
Buffer.Type
Buffer type.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(BufferImplementation.Listener listener)
Add a new listener.
|
String |
getDisplayName()
Return display name of buffer.
|
File |
getFile()
Return the buffer's associated file.
|
TextSource |
getTextSource()
Return the buffer's
TextSource . |
Buffer.Type |
getType()
Get the type of the buffer.
|
boolean |
isDirty()
Return whether the buffer's text has been changed since the last
save.
|
boolean |
isUpToDate()
Return whether the file has been independently modified since the
last save.
|
void |
load()
Update the text source from the file.
|
void |
save()
Update the buffer's file from the text source.
|
void |
save(File file)
Update a file from the text source and, if successful, associate
the buffer with the new file.
|
String |
toString()
Useful for debugging.
|
TextSource getTextSource()
TextSource
.void load() throws DisplayMessageConsoleException, EditorException
DisplayMessageConsoleException
- If the file could not
be read from.EditorException
- If an unexpected problem occurs.void save() throws DisplayMessageConsoleException, EditorException
DisplayMessageConsoleException
- If the file could not
be written to.EditorException
- If an unexpected problem occurs.void save(File file) throws DisplayMessageConsoleException
file
- The file.DisplayMessageConsoleException
- If the file could not
be written to.boolean isDirty()
true
=> the text has changed.File getFile()
null
if there is no associated file.boolean isUpToDate()
true
=> the file has changed independently
of the buffer.Buffer.Type getType()
String getDisplayName()
String toString()
void addListener(BufferImplementation.Listener listener)
listener
- The listener.Copyright © 2000-2014. All Rights Reserved.