org.fopps.ui
Class DialogFactory

java.lang.Object
  |
  +--org.fopps.ui.DialogFactory

public class DialogFactory
extends java.lang.Object

DialogFactory provides property dialogs for entities (e. g. a feature). If no dialog exists for the given class, DialogFactory searches for dialogs for the 'best match', a dialog which accepts a superclass of the entity

See Also:
hasDialog(Class)

Constructor Summary
DialogFactory()
           
 
Method Summary
static javax.swing.JDialog getDialogForClass(java.lang.Class pEntityClass, java.lang.Object[] pArgs)
          Returns the (cached) dialog instance for a given entity class.
static java.lang.reflect.Constructor guessConstructor(java.lang.Class c, java.lang.Class[] parTypes)
          Guesses a constructor for given parameter types
static boolean hasDialog(java.lang.Class pEntityClass)
          Returns true, if a (property) dialog for given class exists.
static boolean hasDialog(java.lang.Class pEntityClass, boolean pSearch)
          Returns true, if dialog for given class exists.
static boolean instanceExists(java.lang.Class pEntityClass)
          Checks, if a dialog instance already exists.
static void registerDialog(java.lang.Class pEntity, java.lang.Class pDialogClass)
          Add a (property) dialog for a given entity
static void setup()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DialogFactory

public DialogFactory()
Method Detail

setup

public static void setup()

registerDialog

public static void registerDialog(java.lang.Class pEntity,
                                  java.lang.Class pDialogClass)
Add a (property) dialog for a given entity


hasDialog

public static boolean hasDialog(java.lang.Class pEntityClass)
Returns true, if a (property) dialog for given class exists. This methos searches not for dialogs of superclasses.

Parameters:
pEntityClass - Class to search for a dialog
Returns:
true, if a dialog exists

hasDialog

public static boolean hasDialog(java.lang.Class pEntityClass,
                                boolean pSearch)
Returns true, if dialog for given class exists. This methos searches not for dialogs of superclasses.

Parameters:
pEntityClass - Class to search for a dialog
pSearch - If true, hasDialog searches also for dialogs of superclasses
Returns:
true, if a dialog exists

instanceExists

public static boolean instanceExists(java.lang.Class pEntityClass)
Checks, if a dialog instance already exists.

Returns:
true, if an instance already exists. In this case you need not pass an argument array to getDialogForClass.
See Also:
getDialogForClass(Class,Object[])

getDialogForClass

public static javax.swing.JDialog getDialogForClass(java.lang.Class pEntityClass,
                                                    java.lang.Object[] pArgs)
Returns the (cached) dialog instance for a given entity class. Some dialogs may expect arguments in their constructor, they can passeg via the pArgs parameter. If an instance already exists, the existing instance is returned. The argument array is not used in this case.

Parameters:
pEntityClass - Class for which a dialog should be created
pArgs - Arguments which should be passed to the dialog constructor
Returns:
Dialog instance or null, if
  • No dialog class could be found
  • No matching constructor for given arguments could be found
  • No instance could be created (see crossreferences below for these issues)
See Also:
Class, Constructor

guessConstructor

public static java.lang.reflect.Constructor guessConstructor(java.lang.Class c,
                                                             java.lang.Class[] parTypes)
Guesses a constructor for given parameter types



Fopps 0.19 - Copyright © 2002 Oliver Wieland. All Rights Reserved.