com.mucommander.ui.main
Class FolderHistory

java.lang.Object
  extended by com.mucommander.ui.main.FolderHistory

public class FolderHistory
extends java.lang.Object

This class maintains a history of visited folders for a given panel, and provides methods to go back and go forward in the folder history.

FolderHistory also keeps track of the last visited folder that can be saved and recalled next time the application is started.

There is a limit to the number of folders the history can contain, set by HISTORY_CAPACITY.

Author:
Maxence Bernard

Constructor Summary
FolderHistory(FolderPanel folderPanel)
          Creates a new FolderHistory instance which will keep track of visited folders in the given FolderPanel.
 
Method Summary
 FileURL[] getBackFolders()
          Returns a list of 'back' folders, most recently visited folder first.
 FileURL[] getForwardFolders()
          Returns a list of 'forward' folders, most recently visited folder first.
 java.lang.String getLastRecallableFolder()
          Returns the last visited folder that can be saved when the application terminates, and recalled next time the application is started.
 void goBack()
          Changes current folder to be the previous one in folder history.
 void goForward()
          Changes current folder to be the next one in folder history.
 boolean hasBackFolder()
          Returns true if there is at least one folder 'back' in the history.
 boolean hasForwardFolder()
          Returns true if there is at least one folder 'forward' in the history.
 boolean historyContains(FileURL folderURL)
          Returns true if the folder history contains the given FileURL, either as a back or forward folder, or as the current folder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FolderHistory

public FolderHistory(FolderPanel folderPanel)
Creates a new FolderHistory instance which will keep track of visited folders in the given FolderPanel.

Method Detail

goBack

public void goBack()
Changes current folder to be the previous one in folder history. Does nothing if there is no previous folder in history.


goForward

public void goForward()
Changes current folder to be the next one in folder history. Does nothing if there is no next folder in history.


hasBackFolder

public boolean hasBackFolder()
Returns true if there is at least one folder 'back' in the history.


hasForwardFolder

public boolean hasForwardFolder()
Returns true if there is at least one folder 'forward' in the history.


getBackFolders

public FileURL[] getBackFolders()
Returns a list of 'back' folders, most recently visited folder first. The returned array may be empty if there currently isn't any 'back' folder in history, but may never be null.


getForwardFolders

public FileURL[] getForwardFolders()
Returns a list of 'forward' folders, most recently visited folder first. The returned array may be empty if there currently isn't any 'forward' folder in history, but may never be null.


historyContains

public boolean historyContains(FileURL folderURL)
Returns true if the folder history contains the given FileURL, either as a back or forward folder, or as the current folder.


getLastRecallableFolder

public java.lang.String getLastRecallableFolder()
Returns the last visited folder that can be saved when the application terminates, and recalled next time the application is started.

The returned folder will NOT be a folder on a remote filesystem which would be likely not to be reachable next time the app is started, or a removable media drive (cd/dvd/floppy) under Windows, which would trigger a nasty 'drive not ready' popup dialog if the drive is not available or the media has changed.



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