|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object palmed.edit.text.Text
public final class Text
This class handles the text.
Constructor Summary | |
---|---|
Text()
Create a text. |
Method Summary | |
---|---|
void |
clear()
Clear the text. |
void |
delete()
Delete any resource associated to the text. |
int |
getHeight()
Retrieve the height of the text. |
java.lang.String |
getLine(int y)
Retrieve a given line. |
void |
insert(Coordinate position,
char c)
Insert a character at a given position. |
void |
insertNewLine(Coordinate position)
Split a line in two lines. |
void |
marshall(java.io.OutputStream stream)
Write to an output stream. |
void |
read(java.io.InputStream stream)
Read the text from the given stream. |
void |
read(java.io.InputStream stream,
Coordinate from)
Insert a part of text from the given stream. |
void |
register(ITextView view)
Register a view to receive lines invalidation events. |
void |
remove(Coordinate from,
Coordinate to)
Remove the text between two positions. |
void |
setLineSeparator(java.lang.String separator)
Change the line separator. |
void |
unmarshall(java.io.InputStream stream)
Read from an input stream. |
void |
write(java.io.OutputStream stream)
Write the text to the given stream. |
void |
write(java.io.OutputStream stream,
Coordinate from,
Coordinate to)
Write a part of the text to the given stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Text()
Method Detail |
---|
public int getHeight()
getHeight
in interface IText
public java.lang.String getLine(int y)
getLine
in interface IText
y
- the number of the line to retrieve
public void insert(Coordinate position, char c)
insert
in interface IText
position
- the insertion pointc
- the characterpublic void insertNewLine(Coordinate position)
insertNewLine
in interface IText
position
- the insertion pointpublic void remove(Coordinate from, Coordinate to)
The two positions must be ordered properly.
remove
in interface IText
from
- the first positionto
- the second positionpublic void register(ITextView view)
register
in interface IText
view
- the view to registerpublic void clear()
clear
in interface IText
public void read(java.io.InputStream stream) throws java.io.IOException
read
in interface IText
stream
- the stream to read from
java.io.IOException
- an io exception occurspublic void write(java.io.OutputStream stream) throws java.io.IOException
write
in interface IText
stream
- the stream to write to
java.io.IOException
- an io exception occurspublic void write(java.io.OutputStream stream, Coordinate from, Coordinate to) throws java.io.IOException
write
in interface IText
stream
- the stream to write tofrom
- the starting pointto
- the ending point
java.io.IOException
- an io exception occurspublic void read(java.io.InputStream stream, Coordinate from) throws java.io.IOException
read
in interface IText
stream
- the stream to read fromfrom
- the insertion point
java.io.IOException
- an io exception occurspublic void unmarshall(java.io.InputStream stream) throws java.io.IOException
unmarshall
in interface ISerializable
stream
- the stream to read from
java.io.IOException
- an io exception occurspublic void marshall(java.io.OutputStream stream) throws java.io.IOException
marshall
in interface ISerializable
stream
- the stream to write to
java.io.IOException
- an io exception occurspublic void delete()
delete
in interface IText
public void setLineSeparator(java.lang.String separator)
To reset to the default mode preserving file format use null.
setLineSeparator
in interface IText
separator
- a string value or null to reset
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |