|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjecteTextReader.PasteListener
public class PasteListener
A class to monitor the currently focussed JTextComponent amoung those that register an instance of PasteListener as a FocusListener.
Field Summary | |
---|---|
private javax.swing.text.JTextComponent |
currentcomp
A JTextComponent representing the current focus ownner. |
private javax.swing.text.JTextComponent |
lastcomp
A JTextComponent representing the last focus owner. |
private boolean |
verbose
If this boolean is true, print status messages to the console. |
Constructor Summary | |
---|---|
PasteListener()
Constructs a paste listener that monitors the currently focussed component with a default verbose value of false . |
|
PasteListener(boolean verbose)
Constructs a paste listener that monitors the currently focussed component. |
Method Summary | |
---|---|
void |
focusGained(java.awt.event.FocusEvent e)
Updates currentcomp based on the newly focussed component. |
void |
focusLost(java.awt.event.FocusEvent e)
Inherited. |
javax.swing.text.JTextComponent |
getCurrentComponent()
Returns currentcomp |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private javax.swing.text.JTextComponent currentcomp
JTextComponent
representing the current focus ownner.
private javax.swing.text.JTextComponent lastcomp
JTextComponent
representing the last focus owner.
private boolean verbose
boolean
is true, print status messages to the console.
Constructor Detail |
---|
public PasteListener()
false
.
public PasteListener(boolean verbose)
verbose
- sets verbose
to the given value.Method Detail |
---|
public void focusGained(java.awt.event.FocusEvent e)
currentcomp
based on the newly focussed component.
Throws a ClassCastException if the component is not a JTextComponent.
focusGained
in interface java.awt.event.FocusListener
e
- the FocusEvent
fired by the component that is the focus owner.public void focusLost(java.awt.event.FocusEvent e)
focusLost
in interface java.awt.event.FocusListener
e
- the FocusEvent
fired by the component that lost focus ownership.public javax.swing.text.JTextComponent getCurrentComponent()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |