palmed.edit.text
Interface IText

All Superinterfaces:
ISerializable
All Known Implementing Classes:
LargeText, Text

public interface IText
extends ISerializable

This interface defines text manipulations.

Version:
$Revision$ $Date$
Author:
Mathieu Champlon

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 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 for events notification.
 void remove(Coordinate from, Coordinate to)
          Remove the text between two positions.
 void setLineSeparator(java.lang.String separator)
          Change the line separator.
 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 interface palmed.io.ISerializable
marshall, unmarshall
 

Method Detail

getHeight

int getHeight()
Retrieve the height of the text.

Returns:
the number of lines

getLine

java.lang.String getLine(int y)
Retrieve a given line.

Parameters:
y - the number of the line to retrieve
Returns:
the content of the line or null

insert

void insert(Coordinate position,
            char c)
Insert a character at a given position.

Parameters:
position - the insertion point
c - the character

insertNewLine

void insertNewLine(Coordinate position)
Split a line in two lines.

Parameters:
position - the insertion point

remove

void remove(Coordinate from,
            Coordinate to)
Remove the text between two positions.

The two positions must be ordered properly.

Parameters:
from - the first position
to - the second position

register

void register(ITextView view)
Register a view for events notification.

Parameters:
view - the view to register

clear

void clear()
Clear the text.


write

void write(java.io.OutputStream stream)
           throws java.io.IOException
Write the text to the given stream.

Parameters:
stream - the stream to write to
Throws:
java.io.IOException - an io exception occurs

read

void read(java.io.InputStream stream)
          throws java.io.IOException
Read the text from the given stream.

Parameters:
stream - the stream to read from
Throws:
java.io.IOException - an io exception occurs

write

void write(java.io.OutputStream stream,
           Coordinate from,
           Coordinate to)
           throws java.io.IOException
Write a part of the text to the given stream.

Parameters:
stream - the stream to write to
from - the starting point
to - the ending point
Throws:
java.io.IOException - an io exception occurs

read

void read(java.io.InputStream stream,
          Coordinate from)
          throws java.io.IOException
Insert a part of text from the given stream.

Parameters:
stream - the stream to read from
from - the insertion point
Throws:
java.io.IOException - an io exception occurs

delete

void delete()
Delete any resource associated to the text.


setLineSeparator

void setLineSeparator(java.lang.String separator)
Change the line separator.

To reset to the default mode preserving file format use null.

Parameters:
separator - a string value or null to reset


Copyright © 2004-2006 PalmEd. All Rights Reserved.