com.mucommander.ui.viewer
Class EditorRegistrar

java.lang.Object
  extended by com.mucommander.ui.viewer.EditorRegistrar

public class EditorRegistrar
extends java.lang.Object

EditorRegistrar maintains a list of registered file editors and provides methods to dynamically register file editors and create appropriate FileEditor (Panel) and EditorFrame (Window) instances for a given AbstractFile.

Author:
Maxence Bernard

Constructor Summary
EditorRegistrar()
           
 
Method Summary
static EditorFrame createEditorFrame(MainFrame mainFrame, AbstractFile file, java.awt.Image icon)
          Creates and returns an EditorFrame to start viewing the given file.
static FileEditor createFileEditor(AbstractFile file)
          Creates and returns an appropriate FileEditor for the given file type.
static void registerFileEditor(EditorFactory factory)
          Registers a FileEditor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditorRegistrar

public EditorRegistrar()
Method Detail

registerFileEditor

public static void registerFileEditor(EditorFactory factory)
Registers a FileEditor.

Parameters:
factory - file editor factory to register.

createEditorFrame

public static EditorFrame createEditorFrame(MainFrame mainFrame,
                                            AbstractFile file,
                                            java.awt.Image icon)
Creates and returns an EditorFrame to start viewing the given file. The EditorFrame will be monitored so that if it is the last window on screen when it is closed by the user, it will trigger the shutdown sequence.

Parameters:
mainFrame - the parent MainFrame instance
file - the file that will be displayed by the returned EditorFrame
icon - editor frame's icon.
Returns:
the created EditorFrame

createFileEditor

public static FileEditor createFileEditor(AbstractFile file)
                                   throws UserCancelledException
Creates and returns an appropriate FileEditor for the given file type.

Parameters:
file - the file that will be displayed by the returned FileEditor
Returns:
the created FileEditor
Throws:
UserCancelledException - if the user has been asked to confirm the operation and cancelled


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