de.init.loext.its.dialogs.ui
Class ItsDialogModel

java.lang.Object
  extended by de.init.loext.its.dialogs.ui.ItsDialogModel

public final class ItsDialogModel
extends java.lang.Object

Base model for all ItsAttributes.DataCategories to store all modified values for easy accessing from the outside.

Author:
mkandora

Nested Class Summary
static class ItsDialogModel.ConcurrentDialogTask
          Wrapper class to circumvent the reception of the same event twice from LibreOffice.
 
Method Summary
 void displayFC(boolean save, Util.Executor<java.io.File> exe)
          displays the file chooser dialog
static ItsDialogModel getModel()
          Returns a singleton instance of the model
 java.util.Map<ItsAttributes,java.util.List<java.lang.String>> getValues(ItsDialogs.ItsDialogBase dialog)
          Returns all values that are saved for this model
 ItsDialogs.ItsDialogBase load(ItsAttributes.DataCategories category, ItsDialogs.TerminateConfigurationListener listener)
          Displays the view for the respective ItsAttributes
protected  void registerDc(ItsAttributes.DataCategories category, ItsDialogs.ItsDialogBase dialog)
          registers a ItsAttributes.DataCategories with an ItsDialogs.ItsDialogBase
protected  void registerView(ItsDialogs.ItsDialogBase dialog)
          Registers a view for this model
 void setValues(ItsDialogs.ItsDialogBase dialog, java.util.Map<ItsAttributes,java.util.List<java.lang.String>> values)
          Sets the values for a dialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

displayFC

public void displayFC(boolean save,
                      Util.Executor<java.io.File> exe)
displays the file chooser dialog

Parameters:
save - set to true to show save dialog, open otherwise

getModel

public static ItsDialogModel getModel()
Returns a singleton instance of the model

Returns:

registerView

protected void registerView(ItsDialogs.ItsDialogBase dialog)
Registers a view for this model

Parameters:
dialog -

registerDc

protected void registerDc(ItsAttributes.DataCategories category,
                          ItsDialogs.ItsDialogBase dialog)
registers a ItsAttributes.DataCategories with an ItsDialogs.ItsDialogBase

Parameters:
category -
dialog -

load

public ItsDialogs.ItsDialogBase load(ItsAttributes.DataCategories category,
                                     ItsDialogs.TerminateConfigurationListener listener)
Displays the view for the respective ItsAttributes

Parameters:
attribute - the attribute to show
listener - provide the save cancel operation externally

getValues

public java.util.Map<ItsAttributes,java.util.List<java.lang.String>> getValues(ItsDialogs.ItsDialogBase dialog)
Returns all values that are saved for this model

Parameters:
dialog -
Returns:

setValues

public void setValues(ItsDialogs.ItsDialogBase dialog,
                      java.util.Map<ItsAttributes,java.util.List<java.lang.String>> values)
Sets the values for a dialog

Parameters:
dialog -
values -