org.openpermis.editor.policy
Class FileType

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by org.openpermis.editor.policy.FileType

public class FileType
extends FileFilter

Constants for types of files handled by the policy editor.

Also acts as file filter if required.

Since:
0.3.0
0.9.0 Renamed from PolicyFileFilter

Field Summary
static FileType ACE_POLICY
          Type for ACE policy files.
static FileType ACE_ROLE_ASSIGNMENT
          Type for ACE role assignment files.
static FileType ANY_FILE
          File type for any file.
static FileType PKCS12_FILE
          Type for PKC12 files.
static FileType WSDL_FILE
          Type for WSDL files.
static FileType XML_POLICY
          Type for XML policy files.
 
Constructor Summary
FileType(String typeName, String extension)
          Creates a new file type for the specified type name and extension.
 
Method Summary
 boolean accept(File file)
           
 String getDescription()
           
 String getTypeName()
          Returns the type name of this file type.
static void initialize(ApplicationContext context)
          Initializes the file types from the specified application context.
 void setDescription(String description)
          Sets the description of this file type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANY_FILE

public static final FileType ANY_FILE
File type for any file.

Since:
0.9.0

XML_POLICY

public static final FileType XML_POLICY
Type for XML policy files.

Since:
0.9.0

ACE_POLICY

public static final FileType ACE_POLICY
Type for ACE policy files.

Since:
0.9.0

ACE_ROLE_ASSIGNMENT

public static final FileType ACE_ROLE_ASSIGNMENT
Type for ACE role assignment files.

Since:
0.9.0

WSDL_FILE

public static final FileType WSDL_FILE
Type for WSDL files.

Since:
0.9.0

PKCS12_FILE

public static final FileType PKCS12_FILE
Type for PKC12 files.

Since:
0.9.0
Constructor Detail

FileType

public FileType(String typeName,
                String extension)
Creates a new file type for the specified type name and extension.

Parameters:
typeName - the name of the type.
extension - the file extension to filter or ANY_EXTENSION for any file.
Since:
0.3.0
Method Detail

initialize

public static void initialize(ApplicationContext context)
Initializes the file types from the specified application context.

Translations for file types are read and injected here.

Parameters:
context - the context used to access translations.
Since:
0.9.0

getTypeName

public String getTypeName()
Returns the type name of this file type.

Returns:
the type name of this file type.
Since:
0.9.0

setDescription

public void setDescription(String description)
Sets the description of this file type.

Parameters:
description - the description to set.
See Also:
initialize(ApplicationContext)
Since:
0.9.0

accept

public boolean accept(File file)
Specified by:
accept in class FileFilter
Since:
0.3.0

getDescription

public String getDescription()
Specified by:
getDescription in class FileFilter
Since:
0.3.0


OpenPermis Role Based Access Control 0.9.0 (Build 16)
2009/08/13 07:17:21
Copyright (c) 2002-2007 Ergon Informatik AG