|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.wordpress.tipsforjava.swing.text.LimitLinesDocumentListener
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.
| 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 |
|---|
private boolean isRemoveFromStart
private int maximumLines
| Constructor Detail |
|---|
public LimitLinesDocumentListener(int maximumLines)
public LimitLinesDocumentListener(int maximumLines, boolean isRemoveFromStart)
| Method Detail |
|---|
public void changedUpdate(DocumentEvent e)
public int getLimitLines()
public void insertUpdate(DocumentEvent e)
private void removeFromEnd(Document document, Element root)
private void removeFromStart(Document document, Element root)
private void removeLines(DocumentEvent e)
public void removeUpdate(DocumentEvent e)
public void setLimitLines(int maximumLines)
Groovy Documentation