com.mucommander.ui.viewer
Interface EditorFactory

All Known Implementing Classes:
TextFactory

public interface EditorFactory

A common interface for instanciating FileEditor implementations, and finding out if a editor is capable of editing a particular file.

Author:
Nicolas Rinaudo, Maxence Bernard

Method Summary
 boolean canEditFile(AbstractFile file)
          Returns true if this factory can create a file editor for the specified file.
 FileEditor createFileEditor()
          Returns a new instance of FileEditor.
 

Method Detail

canEditFile

boolean canEditFile(AbstractFile file)
                    throws WarnUserException
Returns true if this factory can create a file editor for the specified file.

The FileEditor may base its decision stricly upon the file's name and its extension or may wish to read some of the file and compare it to a magic number.

Parameters:
file - file for which a editor must be created.
Returns:
true if this factory can create a file editor for the specified file.
Throws:
WarnUserException - if the specified file can be edited after the warning message contained in the exception is displayed to the end user.

createFileEditor

FileEditor createFileEditor()
Returns a new instance of FileEditor.

Returns:
a new instance of FileEditor.


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard