44 |
public static final String lineLimitAttribute = "lineLimit"; |
public static final String lineLimitAttribute = "lineLimit"; |
45 |
public static final String tabSizeAttribute = "tabSize"; |
public static final String tabSizeAttribute = "tabSize"; |
46 |
|
|
47 |
|
private Element rootElement; |
48 |
private int tabSize; |
private int tabSize; |
49 |
|
|
50 |
public PlainDocument() |
public PlainDocument() |
56 |
{ |
{ |
57 |
super(content); |
super(content); |
58 |
tabSize = 8; |
tabSize = 8; |
59 |
|
rootElement = createDefaultRoot(); |
60 |
|
} |
61 |
|
|
62 |
|
protected AbstractDocument.AbstractElement createDefaultRoot() |
63 |
|
{ |
64 |
|
BranchElement rootElement = |
65 |
|
(BranchElement) createBranchElement(null, null); |
66 |
|
Element[] lines = new Element[1]; |
67 |
|
lines[0] = createLeafElement(rootElement, null, 0, 1); |
68 |
|
rootElement.replace(0, 0, lines); |
69 |
|
return rootElement; |
70 |
} |
} |
71 |
|
|
72 |
public Element getDefaultRootElement() |
public Element getDefaultRootElement() |
73 |
{ |
{ |
74 |
return null; |
return rootElement; |
75 |
} |
} |
76 |
|
|
77 |
public Element getParagraphElement(int pos) |
public Element getParagraphElement(int pos) |