org.openide.loaders
Class ExtensionList

java.lang.Object
  |
  +--org.openide.loaders.ExtensionList
All Implemented Interfaces:
Cloneable, Serializable

public class ExtensionList
extends Object
implements Cloneable, Serializable

Property class that collects a modifiable list of file extensions and permits checking of whether a name or a file object has a given extension. It comes with a property editor to allow the user to modify the extensions.

See Also:
Serialized Form

Constructor Summary
ExtensionList()
          Default constructor.
 
Method Summary
 void addExtension(String ext)
          Add a new extension.
 void addMimeType(String mime)
          Adds new mime type.
 Object clone()
          Clone new object.
 Enumeration extensions()
          Get all extensions.
 boolean isRegistered(FileObject fo)
          Tests whether the file object is acceptable.
 boolean isRegistered(String s)
          Test whether the name in the string is acceptable.
 Enumeration mimeTypes()
          Get all mime types.
 void removeExtension(String ext)
          Remove an extension.
 void removeMimeType(String mime)
          Removes a mime type.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtensionList

public ExtensionList()
Default constructor.
Method Detail

clone

public Object clone()
Clone new object.
Overrides:
clone in class Object

addExtension

public void addExtension(String ext)
Add a new extension.
Parameters:
ext - the extension

removeExtension

public void removeExtension(String ext)
Remove an extension.
Parameters:
ext - the extension

addMimeType

public void addMimeType(String mime)
Adds new mime type.
Parameters:
mime - the mime type

removeMimeType

public void removeMimeType(String mime)
Removes a mime type.
Parameters:
mime - the name of the type

isRegistered

public boolean isRegistered(String s)
Test whether the name in the string is acceptable. It should end with a dot and be one of the registered extenstions.
Parameters:
s - the name
Returns:
true if the name is acceptable

isRegistered

public boolean isRegistered(FileObject fo)
Tests whether the file object is acceptable. Its extension should be registered.
Parameters:
fo - the file object to test
Returns:
true if the file object is acceptable

extensions

public Enumeration extensions()
Get all extensions.
Returns:
enumeration of Strings

mimeTypes

public Enumeration mimeTypes()
Get all mime types.
Returns:
enumeration of Strings


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.