forked from Coded/SIPRP
git-svn-id: https://svn.coded.pt/svn/SIPRP@786 bb69d46d-e84e-40c8-a05a-06db0d633741
parent
e49c36c7da
commit
23a3d92343
@ -0,0 +1,8 @@
|
||||
package siprp.higiene.legislacao;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public class GestaoDadosRelatorioWindow extends JFrame
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package leaf.ui;
|
||||
|
||||
import java.beans.PropertyChangeListener;
|
||||
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JTextArea;
|
||||
import javax.swing.event.CaretEvent;
|
||||
import javax.swing.event.CaretListener;
|
||||
|
||||
public class LeafTextArea extends JTextArea
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final String PROPERTY = "CHANGED";
|
||||
|
||||
private final ChangeThread thread = new ChangeThread();
|
||||
|
||||
private boolean isRunning = true;
|
||||
|
||||
public LeafTextArea( PropertyChangeListener parent )
|
||||
{
|
||||
this.addPropertyChangeListener( PROPERTY, parent );
|
||||
this.addCaretListener( new CaretListener()
|
||||
{
|
||||
@Override
|
||||
public void caretUpdate( CaretEvent e )
|
||||
{
|
||||
firePropertyChange( PROPERTY, false, true );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEditable( boolean b )
|
||||
{
|
||||
super.setEditable( b );
|
||||
if( b )
|
||||
{
|
||||
startThread();
|
||||
}
|
||||
else
|
||||
{
|
||||
stopThread();
|
||||
}
|
||||
}
|
||||
|
||||
private void startThread()
|
||||
{
|
||||
isRunning = true;
|
||||
thread.start();
|
||||
}
|
||||
|
||||
private void stopThread()
|
||||
{
|
||||
isRunning = false;
|
||||
}
|
||||
|
||||
private class ChangeThread extends Thread
|
||||
{
|
||||
@Override
|
||||
public synchronized void start()
|
||||
{
|
||||
while( isRunning )
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in new issue