editorListener.handlers
Class AcceptableFileTypeHandler

java.lang.Object
  extended by editorListener.handlers.AcceptableFileTypeHandler

public class AcceptableFileTypeHandler
extends java.lang.Object

This class provides functionality to allow different file types opened by the editor to be listened to. In doing so, this class provides some abstraction towards a common set of Dispatch clients across all file types. However, most dispatches rely on the JavaEditor's SourceViewer which is not accessible to superclasses. This may seriously limit extensibility.

Version:
4/8/2009
Author:
Matthew Harward

Constructor Summary
AcceptableFileTypeHandler()
          Default constructor, provides default Java implementation.
AcceptableFileTypeHandler(java.util.Set<java.lang.String> allowedFileTypes, java.util.List<java.lang.String> allowedClassTypes)
          Constructor for any type of file.
 
Method Summary
 boolean allowableObject(java.lang.Object obj)
          Checks the provided object against the existing set of acceptable class names.
 boolean checkFileType(java.lang.String name)
          Checks the underlying file type names against an existing set.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AcceptableFileTypeHandler

public AcceptableFileTypeHandler()
Default constructor, provides default Java implementation.


AcceptableFileTypeHandler

public AcceptableFileTypeHandler(java.util.Set<java.lang.String> allowedFileTypes,
                                 java.util.List<java.lang.String> allowedClassTypes)
Constructor for any type of file.

Method Detail

allowableObject

public boolean allowableObject(java.lang.Object obj)
Checks the provided object against the existing set of acceptable class names.

Parameters:
obj - the Object to be checked
Returns:
true if the object is acceptable and can be found, else false.

checkFileType

public boolean checkFileType(java.lang.String name)
Checks the underlying file type names against an existing set.

Parameters:
name - the file name to be checked
Returns:
true if the file is acceptable, else false.