com.mucommander.ui.main.table
Class FolderChangeMonitor

java.lang.Object
  extended by com.mucommander.ui.main.table.FolderChangeMonitor
All Implemented Interfaces:
LocationListener, java.awt.event.WindowListener, java.lang.Runnable, java.util.EventListener

public class FolderChangeMonitor
extends java.lang.Object
implements java.lang.Runnable, java.awt.event.WindowListener, LocationListener

This file monitors changes in the current folder of a FolderPanel, checking periodically if the current folder's date has changed. If a change has been detected, the FolderPanel will be asked to refresh its current folder.

If the MainFrame which contains the monitored FolderPanel becomes inactive (lies in the background), monitoring on will be not happen until the MainFrame becomes active again.

Implementation note: the monitoring is done in one single thread for all folders, each folder being monitored one after another. Current folder refreshes are performed in a separate thread.

Author:
Maxence Bernard

Constructor Summary
FolderChangeMonitor(FolderPanel folderPanel)
           
 
Method Summary
 void locationCancelled(LocationEvent locationEvent)
          This method is invoked when the current folder has been cancelled by the user.
 void locationChanged(LocationEvent locationEvent)
          This method is invoked when the current folder has changed.
 void locationChanging(LocationEvent locationEvent)
          This method is invoked when the current folder is being changed.
 void locationFailed(LocationEvent locationEvent)
          This method is invoked when the current folder could not be changed, as a result of the folder not existing or failing to list its contents.
 void run()
           
 void setPaused(boolean paused)
          Suspends or resumes this monitor.
 void stop()
          Stops monitoring (stops monitoring thread).
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
           
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FolderChangeMonitor

public FolderChangeMonitor(FolderPanel folderPanel)
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

stop

public void stop()
Stops monitoring (stops monitoring thread).


setPaused

public void setPaused(boolean paused)
Suspends or resumes this monitor.

Parameters:
paused - true to supsend, false to resume

locationChanging

public void locationChanging(LocationEvent locationEvent)
Description copied from interface: LocationListener
This method is invoked when the current folder is being changed.

A call to either LocationListener.locationChanged(LocationEvent), LocationListener.locationCancelled(LocationEvent) or LocationListener.locationFailed(LocationEvent) will always follow to indicate the outcome of the folder change.

Specified by:
locationChanging in interface LocationListener
Parameters:
locationEvent - describes the location change event

locationChanged

public void locationChanged(LocationEvent locationEvent)
Description copied from interface: LocationListener
This method is invoked when the current folder has changed.

Specified by:
locationChanged in interface LocationListener
Parameters:
locationEvent - describes the location change event

locationCancelled

public void locationCancelled(LocationEvent locationEvent)
Description copied from interface: LocationListener
This method is invoked when the current folder has been cancelled by the user.

Specified by:
locationCancelled in interface LocationListener
Parameters:
locationEvent - describes the location change event

locationFailed

public void locationFailed(LocationEvent locationEvent)
Description copied from interface: LocationListener
This method is invoked when the current folder could not be changed, as a result of the folder not existing or failing to list its contents.

Specified by:
locationFailed in interface LocationListener
Parameters:
locationEvent - describes the location change event

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Specified by:
windowClosing in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard