chrriis.dj.nativeswing.swtimpl.utilities
Class FileTypeLauncher

java.lang.Object
  extended by chrriis.dj.nativeswing.swtimpl.utilities.FileTypeLauncher

public class FileTypeLauncher
extends Object

A utility class to get the launchers of certain file types.

Author:
Christopher Deckers

Constructor Summary
FileTypeLauncher()
           
 
Method Summary
 boolean equals(Object o)
           
static String[] getAllRegisteredExtensions()
          Get all the registered file extensions.
static ImageIcon getDefaultIcon()
          Get the default icon for files that don't have a custom icon.
 ImageIcon getIcon()
          Get the icon associated with this file type.
static Dimension getIconSize()
          Get the size of the icons that can be obtained.
static FileTypeLauncher getLauncher(String fileName)
          Get the launcher for a given file name, which may or may not represent an existing file.
static FileTypeLauncher[] getLaunchers()
          Some global loading of data is performed the first time, if it is needed.
 String getName()
          Get the name of the launcher.
 String[] getRegisteredExtensions()
          Get the extensions of the files that can be launched.
 int hashCode()
           
 void launch(String filePath)
          Launch a file using this launcher.
static void load()
          Explicitely load the data if it is not yet loaded, instead of letting the system perform the appropriate loading when needed.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileTypeLauncher

public FileTypeLauncher()
Method Detail

load

public static void load()
Explicitely load the data if it is not yet loaded, instead of letting the system perform the appropriate loading when needed.


getAllRegisteredExtensions

public static String[] getAllRegisteredExtensions()
Get all the registered file extensions. Some global loading of data is performed the first time, if it is needed.

Returns:
all the registered file extensions.

getRegisteredExtensions

public String[] getRegisteredExtensions()
Get the extensions of the files that can be launched. Some global loading of data is performed the first time, if it is needed.

Returns:
the file extensions.

getName

public String getName()
Get the name of the launcher.

Returns:
the name.

getIcon

public ImageIcon getIcon()
Get the icon associated with this file type.

Returns:
the icon, which could be the default icon.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

launch

public void launch(String filePath)
Launch a file using this launcher.

Parameters:
filePath - the path to the file to launch.

getLauncher

public static FileTypeLauncher getLauncher(String fileName)
Get the launcher for a given file name, which may or may not represent an existing file. The name can also simply be the extension of a file (including the '.').


getLaunchers

public static FileTypeLauncher[] getLaunchers()
Some global loading of data is performed the first time, if it is needed.


getDefaultIcon

public static ImageIcon getDefaultIcon()
Get the default icon for files that don't have a custom icon.

Returns:
the default icon.

getIconSize

public static Dimension getIconSize()
Get the size of the icons that can be obtained.

Returns:
the size of the icons.