Groovy Documentation

com.wordpress.tipsforjava.swing.text
[Java] Class LimitLinesDocumentListener

java.lang.Object
  com.wordpress.tipsforjava.swing.text.LimitLinesDocumentListener
All Implemented Interfaces:
DocumentListener

public class LimitLinesDocumentListener
extends Object

A class to control the maximum number of lines to be stored in a Document Excess lines can be removed from the start or end of the Document depending on your requirement. a) if you append text to the Document, then you would want to remove lines from the start. b) if you insert text at the beginning of the Document, then you would want to remove lines from the end.

Authors:
Rob Camick
Darryl Burke


Field Summary
private boolean isRemoveFromStart

private int maximumLines

 
Constructor Summary
LimitLinesDocumentListener(int maximumLines)

LimitLinesDocumentListener(int maximumLines, boolean isRemoveFromStart)

 
Method Summary
void changedUpdate(DocumentEvent e)

int getLimitLines()

void insertUpdate(DocumentEvent e)

private void removeFromEnd(Document document, Element root)

private void removeFromStart(Document document, Element root)

private void removeLines(DocumentEvent e)

void removeUpdate(DocumentEvent e)

void setLimitLines(int maximumLines)

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

isRemoveFromStart

private boolean isRemoveFromStart


maximumLines

private int maximumLines


 
Constructor Detail

LimitLinesDocumentListener

public LimitLinesDocumentListener(int maximumLines)


LimitLinesDocumentListener

public LimitLinesDocumentListener(int maximumLines, boolean isRemoveFromStart)


 
Method Detail

changedUpdate

public void changedUpdate(DocumentEvent e)


getLimitLines

public int getLimitLines()


insertUpdate

public void insertUpdate(DocumentEvent e)


removeFromEnd

private void removeFromEnd(Document document, Element root)


removeFromStart

private void removeFromStart(Document document, Element root)


removeLines

private void removeLines(DocumentEvent e)


removeUpdate

public void removeUpdate(DocumentEvent e)


setLimitLines

public void setLimitLines(int maximumLines)


 

Groovy Documentation