com.mucommander.ui.event
Class LocationManager

java.lang.Object
  extended by com.mucommander.ui.event.LocationManager

public class LocationManager
extends java.lang.Object

Author:
Maxence Bernard

Constructor Summary
LocationManager(FolderPanel folderPanel)
          Creates a new LocationManager that manages location events listeners and broadcasts for the specified FolderPanel.
 
Method Summary
 void addLocationListener(LocationListener listener)
          Registers a LocationListener to receive notifications whenever the current folder of the associated FolderPanel has or is being changed.
 void fireLocationCancelled(FileURL folderURL)
          Notifies all registered listeners that the folder change as notified by fireLocationChanging(FileURL) has been cancelled by the user.
 void fireLocationChanged(FileURL folderURL)
          Notifies all registered listeners that the current folder has changed on associated FolderPanel.
 void fireLocationChanging(FileURL folderURL)
          Notifies all registered listeners that the current folder is being changed on the associated FolderPanel.
 void fireLocationFailed(FileURL folderURL)
          Notifies all registered listeners that the folder change as notified by fireLocationChanging(FileURL) could not be changed, as a result of the folder not existing or failing to list its contents.
 void removeLocationListener(LocationListener listener)
          Removes the LocationListener from the list of listeners that receive notifications when the current folder of the associated FolderPanel has or is being changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationManager

public LocationManager(FolderPanel folderPanel)
Creates a new LocationManager that manages location events listeners and broadcasts for the specified FolderPanel.

Parameters:
folderPanel - the FolderPanel instance this LocationManager manages location events for
Method Detail

addLocationListener

public void addLocationListener(LocationListener listener)
Registers a LocationListener to receive notifications whenever the current folder of the associated FolderPanel has or is being changed.

Listeners are stored as weak references so removeLocationListener(LocationListener) doesn't need to be called for listeners to be garbage collected when they're not used anymore.

Parameters:
listener - the LocationListener to register

removeLocationListener

public void removeLocationListener(LocationListener listener)
Removes the LocationListener from the list of listeners that receive notifications when the current folder of the associated FolderPanel has or is being changed.

Parameters:
listener - the LocationListener to remove

fireLocationChanging

public void fireLocationChanging(FileURL folderURL)
Notifies all registered listeners that the current folder is being changed on the associated FolderPanel.

Parameters:
folderURL - url of the folder that will become the new location if the folder change is successful

fireLocationChanged

public void fireLocationChanged(FileURL folderURL)
Notifies all registered listeners that the current folder has changed on associated FolderPanel.

Parameters:
folderURL - url of the new current folder in the associated FolderPanel

fireLocationCancelled

public void fireLocationCancelled(FileURL folderURL)
Notifies all registered listeners that the folder change as notified by fireLocationChanging(FileURL) has been cancelled by the user.

Parameters:
folderURL - url of the folder for which a failed attempt was made to make it the current folder

fireLocationFailed

public void fireLocationFailed(FileURL folderURL)
Notifies all registered listeners that the folder change as notified by fireLocationChanging(FileURL) could not be changed, as a result of the folder not existing or failing to list its contents.

Parameters:
folderURL - url of the folder for which a failed attempt was made to make it the current folder


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