Groovy Documentation

com.wordpress.tipsforjava.swing
[Java] Class ProtectedTextComponent

java.lang.Object
  com.wordpress.tipsforjava.swing.ProtectedTextComponent

public class ProtectedTextComponent
extends Object

Field Summary
private JTextComponent component

private ProtectedDocument document

private ProtectedHighlighter highlighter

 
Constructor Summary
ProtectedTextComponent(JTextComponent component)

Specify the component to be protected.

ProtectedTextComponent(JTextComponent component, Color color)

Specify the component to be protected.

 
Method Summary
void protectLine(int line)

Protect an entire line

void protectLines(int firstLine, int lastLine)

Protect a range of lines

void protectText(int start, int end)

Protect a range of characters

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

Field Detail

component

private JTextComponent component


document

private ProtectedDocument document


highlighter

private ProtectedHighlighter highlighter


 
Constructor Detail

ProtectedTextComponent

public ProtectedTextComponent(JTextComponent component)
Specify the component to be protected. The text will be highlighted using the default color


ProtectedTextComponent

public ProtectedTextComponent(JTextComponent component, Color color)
Specify the component to be protected. The text will be highlighted using the specified color


 
Method Detail

protectLine

public void protectLine(int line)
Protect an entire line
Parameters:
line - the line to protect


protectLines

public void protectLines(int firstLine, int lastLine)
Protect a range of lines
Parameters:
firstLine - first line in the range
lastLine - last line in the range


protectText

public void protectText(int start, int end)
Protect a range of characters
Parameters:
start - starting offset
end - ending offset


 

Groovy Documentation