public class DialogDescription extends Object
dialog.id.<running number>=<ID of the dialog>
dialog.class.<running number>=<class name of the dialog>
dialog.name.<running number>=<name of the dialog as shown to the user>
dialog.icon.<running number>=<icon of the dialog as shown to the user>
dialog.<myKey>.<running number>=<value for myKey>
The dialog.icon and dialog.name properties are optional, as well as the individual
key value definitions. <myKey> may contain '.', as long as there is the identifying running
number at the end.
The individual key value definitions are stored in
mParameters.
The class optionally stores a dialog instance of a dialog, this is usefull if the same dialog should be re-used.
| Constructor and Description |
|---|
DialogDescription() |
| Modifier and Type | Method and Description |
|---|---|
void |
addParameter(String pKey,
Object pValue)
Add a paraemter to the dialog
|
Dc |
getDc()
Return the dialog of this description
|
Class<? extends Dc> |
getDialogClass()
Retrun the dialog class.
|
String |
getDialogIcon()
Return the dialog icon name.
|
String |
getDialogId()
Return the dialog id.
|
String |
getDialogName()
Return the dialog name.
|
Map<String,Object> |
getParameters()
Return the parameters or null if there are none.
|
static void |
initDialogs(Map<String,DialogDescription> pKnownDialogs,
Application pApp,
Dc pParent,
Map<String,? super Object> pArgs)
Initialize the Dc's for a map of dialog descriptions.
|
boolean |
isComplete()
Returns true if we have a id and class
|
static Map<String,DialogDescription> |
loadKnownDialogs(String pFileName)
Load known dialogs from a properties file.
|
void |
setDc(Dc pDc)
Set the dialog for this description
|
void |
setDialogClass(Class<? extends Dc> pDialogClass)
Set the dialog class
|
void |
setDialogClassName(String pDialogClassName)
Set the dialog class name.
|
void |
setDialogIcon(String pDialogIcon)
Set the dialog icon name.
|
void |
setDialogId(String pDialogId)
Set the dialog id.
|
void |
setDialogName(String pDialogName)
Set the dialog name.
|
void |
setParameters(Map<String,Object> pParameters)
Set the parameters.
|
public static Map<String,DialogDescription> loadKnownDialogs(String pFileName)
pFileName - the name of the properties filepublic static void initDialogs(Map<String,DialogDescription> pKnownDialogs, Application pApp, Dc pParent, Map<String,? super Object> pArgs)
The custom parameters from the DialogDescription
are added to those provided by the pArgs:
First, the getParameters() is used,
then the parameters from pArgs are added,
and finally the Application is added with the key Application.APPLICATION_KEY.
This means that pArgs may overwrite the custom parameters
in the dialog description but may not overwrite the application parameter.
pKnownDialogs - a Map of DialogDescription objects, never null,
key= DialogID, value= DialogDescription objectpApp - the application, must not be nullpParent - the parent Dc for the init call, may be nullpArgs - arguments for the init call, may be nullpublic boolean isComplete()
public String getDialogId()
public void setDialogId(String pDialogId)
pDialogId - the dialog id, must not be nullpublic Class<? extends Dc> getDialogClass()
public void setDialogClass(Class<? extends Dc> pDialogClass)
pDialogClass - the dialog class, must not be nullpublic void setDialogClassName(String pDialogClassName)
pDialogClassName - the dialog class, must not be null and must be a Dc derivatepublic String getDialogName()
public void setDialogName(String pDialogName)
pDialogName - the dialog name, may be nullpublic String getDialogIcon()
public void setDialogIcon(String pDialogIcon)
pDialogIcon - the dialog icon name, may be nullpublic void addParameter(String pKey, Object pValue)
pKey - the parameter to add, must not be nullpValue - the value, must not be nullpublic Map<String,Object> getParameters()
public void setParameters(Map<String,Object> pParameters)
pParameters - the parameter map, may be nulpublic Dc getDc()
public void setDc(Dc pDc)
pDc - the dialog, may be nullCopyright © 2014 Jürgen Zeller (privat). All rights reserved.