com.limegroup.gnutella.gui.library
Class LibraryMediator

java.lang.Object
  extended bycom.limegroup.gnutella.gui.library.LibraryMediator
All Implemented Interfaces:
ThemeObserver

public final class LibraryMediator
extends java.lang.Object
implements ThemeObserver

This class functions as an initializer for all of the elements of the library and as a mediator between library objects.


Method Summary
 void addNewLibraryFolder()
          Adds a new folder to the library.
 void addSharedDirectory(java.io.File dir, java.io.File parent)
          Adds a shared directory to the library.
 void addSharedFile(com.limegroup.gnutella.FileDesc file, java.io.File parent)
          Adds a shared file to the library if its parent directory is currently selected in the library tree.
 void addSharedLibraryFolder()
          Displays a file chooser for selecting a new folder to share and adds that new folder to the settings and FileManager.
 void cancelEditing()
          Cancels all editing of fields in the tree and table.
 void clearLibrary()
          Removes the gui elements of the library tree and table.
 void deleteLibraryFile()
          Deletes the currently selected rows in the table.
 javax.swing.JComponent getComponent()
          Returns the JComponent that contains all of the elements of the library.
 void handleRootSharedDirectoryChange()
          Refreshes the shared directories in the settings manager as well as the files in the file manager based on the directories in the library tree.
 boolean incompleteDirectoryIsSelected()
          Returns true if this is showing the special incomplete directory, false if showing normal files.
static LibraryMediator instance()
          Instance accessor following singleton.
 void launch()
          Tells the library to launch the application associated with the selected row in the library.
static void launchExplorer()
          Launches explorer on PC in selected Shared directory
 void refresh()
          Reloads all file and directories in the library.
 void refreshIfIncomplete()
          Reloads file only if incomplete directory is showing
 void renameLibraryFolder()
          Renames the selected folder in the library.
 void setAnnotateEnabled(boolean enabled)
           
 void unshareLibraryFolder()
          Removesthe selected folder from the shared folder group..
 void updateSharedFile(java.io.File file)
          Update the this file's statistic
 void updateTheme()
          Update any required theme settings, such as colors or images.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static LibraryMediator instance()
Instance accessor following singleton. Returns the LibraryView instance.

Returns:
the LibraryView instance

updateTheme

public void updateTheme()
Description copied from interface: ThemeObserver
Update any required theme settings, such as colors or images.

Specified by:
updateTheme in interface ThemeObserver

getComponent

public javax.swing.JComponent getComponent()
Returns the JComponent that contains all of the elements of the library.

Returns:
the JComponent that contains all of the elements of the library.

launch

public void launch()
Tells the library to launch the application associated with the selected row in the library.


deleteLibraryFile

public void deleteLibraryFile()
Deletes the currently selected rows in the table.


clearLibrary

public void clearLibrary()
Removes the gui elements of the library tree and table.


refresh

public void refresh()
Reloads all file and directories in the library.


refreshIfIncomplete

public void refreshIfIncomplete()
Reloads file only if incomplete directory is showing


cancelEditing

public void cancelEditing()
Cancels all editing of fields in the tree and table.


launchExplorer

public static void launchExplorer()
Launches explorer on PC in selected Shared directory


addSharedLibraryFolder

public void addSharedLibraryFolder()
Displays a file chooser for selecting a new folder to share and adds that new folder to the settings and FileManager.


handleRootSharedDirectoryChange

public void handleRootSharedDirectoryChange()
Refreshes the shared directories in the settings manager as well as the files in the file manager based on the directories in the library tree.


addSharedDirectory

public void addSharedDirectory(java.io.File dir,
                               java.io.File parent)
Adds a shared directory to the library.

Parameters:
dir - a File instance denoting the abstract pathname of the shared directory to add
parent - a File instance denoting the abstract pathname of the shared directory's parent directory

addSharedFile

public void addSharedFile(com.limegroup.gnutella.FileDesc file,
                          java.io.File parent)
Adds a shared file to the library if its parent directory is currently selected in the library tree.

Parameters:
file - a FileDesc instance denoting the abstract pathname of the shared file to add
parent - a File instance denoting the abstract pathname of the shared file's parent directory

updateSharedFile

public void updateSharedFile(java.io.File file)
Update the this file's statistic


setAnnotateEnabled

public void setAnnotateEnabled(boolean enabled)

addNewLibraryFolder

public void addNewLibraryFolder()
Adds a new folder to the library. the new folder is a subdirectory of the selcected folder.


unshareLibraryFolder

public void unshareLibraryFolder()
Removesthe selected folder from the shared folder group..


renameLibraryFolder

public void renameLibraryFolder()
Renames the selected folder in the library.


incompleteDirectoryIsSelected

public boolean incompleteDirectoryIsSelected()
Returns true if this is showing the special incomplete directory, false if showing normal files.