public class InteractionManager extends Object implements Freeable, ValueChangeListener, DataNavigationListener
Form basic events.
The FormManager sets an InteractionManager to every Form. When a
specific InteractionManager is needed, this class must be extended, and the
relation between the Form to manage and the implemented Interaction Manager
must be done in the way specified by the FormManager
Important
In order to make this Manager to work right, the buttons (see Button)
must have the following standard keys:
| Modifier and Type | Class and Description |
|---|---|
protected class |
InteractionManager.DeleteFieldsListener
Class that implements the lister to the button 'delete fields' which set
a initial mode to the form (QueryInsert mode
setQueryInsertMode()) and delete the contents
of all the fields in the form. |
protected class |
InteractionManager.InteractionManagerAction
This class implements the normal behavior buttons in the
InteractionManager must have. |
protected class |
InteractionManager.PrintingThread
Class that creates a thread which prints the form contents using a
HTMLProcessor |
| Modifier and Type | Field and Description |
|---|---|
protected InteractionManagerAction |
actionHandler |
static String |
ADVANCED_QUERY_KEY |
static boolean |
CHECK_MODIFIED_DATA_CHANGED_DEFAULT_VALUE |
protected boolean |
checkModifiedDataChangeEvent
Enables or disables checking the modified data when performing a
navigation operation in the application, for example, changing the record
when a field was modified.
|
int |
currentMode
The form current mode.
|
protected boolean |
dataChangedEventProcessing |
static String |
DELETE_KEY |
protected InteractionManager.DeleteFieldsListener |
deleteFieldsListener |
protected String |
f11Button |
protected String |
f12Button |
protected String |
f7Button |
protected String |
f9Button |
IFormManager |
formManager
The form manager related to the InteractionManager
|
static String |
HELP_KEY |
static int |
INSERT |
static String |
INSERT_KEY |
protected List<InteractionManagerModeListener> |
interactionManagerModeListenerList |
Form |
managedForm
The form managed by this
InteractionManager |
protected Vector |
modifiedFieldAttributes |
static boolean |
NEWMODE
Activates a new state diagram, in which in
QUERYINSERT state you
can either insert or query directly. |
protected Thread |
printThread |
static int |
QUERY |
static String |
QUERY_INSERT_KEY |
static String |
QUERY_KEY |
static int |
QUERYINSERT |
static String |
selectionPrintingKey |
protected boolean |
setDefaultFocusEnabled |
static int |
UPDATE |
static int |
UPDATE_ALL |
static int |
UPDATE_CHANGED |
static String |
UPDATE_KEY |
protected int |
updateMethod |
protected Vector |
valueChangedListenerAttributes |
protected boolean |
valueChangeListenerEnabled |
protected static String |
warningBirthdayMessage |
| Constructor and Description |
|---|
InteractionManager()
Constructs an InteractionManager
|
| Modifier and Type | Method and Description |
|---|---|
void |
addInteractionManagerModeListener(InteractionManagerModeListener listener)
Register a listener that will be notified of the changes of mode in the
Interaction Manager.
|
boolean |
checkBirthday(String attr)
Checks that the field in the managed form identified by the attr Strings
is a Date and, if so, checks that the Date is before than the actual
Date.
|
InteractionManager |
cloneInteractionManager()
Clones this InteractionManager.
|
void |
dataChanged(DataNavigationEvent e)
Method invoked when the register shown in the form changes.
|
boolean |
dataWillChange(DataNavigationEvent e)
Method invoked when the register shown in the form is going to change.
|
protected void |
finalize() |
protected void |
fireInteractionManagerModeChanged(InteractionManagerModeEvent event)
Notifies all the registered listeners that the form mode has changed.
|
void |
free()
Removes all the references that this InteractionManager has in order to
free the memory.
|
InteractionManagerAction |
getActionHandler() |
boolean |
getCheckModifiedDataChangeEvent()
Checks whether the verification of modified data is enabled or not.
|
int |
getCurrentMode()
Returns the actual mode of the form
|
boolean |
getDataChangedEventProcessing()
Checks whether the execution of the method
dataChanged(DataNavigationEvent) is enabled or not. |
boolean |
getDefaultActiveFocus()
Returns the current focus configuration.
|
Hashtable |
getFieldValues(Form form)
Gets field values included in form that are inserted when template is
filled.
|
Hashtable |
getImageValues(Form form,
boolean insertEmptyImages)
Gets image values included in form that are inserted when template is
filled.
|
Vector |
getModifiedFieldAttributes()
Returns a Vector with the atributes of the fields that have been
modified.
|
Hashtable |
getTableValues(Form form)
Gets table values included in form that are inserted when template is
filled.
|
Hashtable |
getTemplateFields(Form form)
Gets fields included in form that are inserted when template is created.
|
Hashtable |
getTemplateImages(Form form)
Gets images included in form that are inserted when template is created.
|
Hashtable |
getTemplateTables(Form form)
Gets tables included in form that are inserted when template is created.
|
protected void |
injectAnnotatedFields() |
boolean |
isValueChangeListenerEnabled() |
void |
loadActionHandler(String resource) |
void |
print()
Method that responds to the print button keystroke.
|
protected void |
registerFormKeyBindings()
Called when creating the InteractionManager, this method registers all
the keystrokes for the form.
|
void |
registerInteractionManager(Form form,
IFormManager formManager)
Registers the InteractionManager as form event listener.
|
protected void |
registerRuleEngineFor(Object component) |
void |
removeInteractionManagerModeListener(InteractionManagerModeListener listener)
Removes a listener from the ones sets to listen to the InteractionManager
mode changes.
|
void |
setCheckModifiedDataChangeEvent(boolean check)
Enables or disables the verification of modified data.
|
void |
setDataChangedEventProcessing(boolean enable)
Enables or disables the execution of the method
dataChanged(DataNavigationEvent). |
void |
setDefaultFocusEnabled(boolean enable)
Enables or not the focus strategy in which the focus is set to the first
form component.
|
void |
setInitialState()
Establishes the initial state of the managed form, and sets the form
states in QueryInsert mode that implies that by default the query button
and the insert button will be enables.
|
void |
setInsertMode()
Sets the mode of the form in Insert.
|
void |
setQueryInsertMode()
Sets the mode of the form in QueryInsert.
|
void |
setQueryMode()
Sets the mode of the form in Query.
|
protected void |
setUpdateMethodVersion(int method)
Sets the update method.
|
void |
setUpdateMode()
Sets the mode of the form in Update.
|
void |
setValueChangedEventListener(Object attr,
boolean listen)
Register elements as valuechanged listeners, so in the case that they are
a valuechangeevent source the InteractionManager will process that
events.
|
void |
setValueChangeEventListenerEnabled(boolean enabled) |
void |
setWarningBirthdayMessage(String message)
Deprecated.
|
void |
valueChanged(ValueEvent e)
Invoked when a value in some of the form elements has changed.
|
public static boolean NEWMODE
QUERYINSERT state you
can either insert or query directly.public static String selectionPrintingKey
public static boolean CHECK_MODIFIED_DATA_CHANGED_DEFAULT_VALUE
public static final int QUERYINSERT
public static final int QUERY
public static final int INSERT
public static final int UPDATE
public static final String HELP_KEY
public static final String QUERY_KEY
public static final String QUERY_INSERT_KEY
public static final String INSERT_KEY
public static final String UPDATE_KEY
public static final String DELETE_KEY
public static final String ADVANCED_QUERY_KEY
protected String f7Button
protected String f9Button
protected String f11Button
protected String f12Button
protected List<InteractionManagerModeListener> interactionManagerModeListenerList
protected boolean dataChangedEventProcessing
protected static String warningBirthdayMessage
protected boolean setDefaultFocusEnabled
protected boolean checkModifiedDataChangeEvent
protected Vector valueChangedListenerAttributes
protected boolean valueChangeListenerEnabled
public static final int UPDATE_ALL
public static final int UPDATE_CHANGED
protected Vector modifiedFieldAttributes
protected int updateMethod
public IFormManager formManager
public Form managedForm
InteractionManagerpublic int currentMode
protected InteractionManagerAction actionHandler
protected Thread printThread
protected InteractionManager.DeleteFieldsListener deleteFieldsListener
protected void setUpdateMethodVersion(int method)
method - - the update method to setpublic void setInitialState()
public void registerInteractionManager(Form form, IFormManager formManager)
IFormManager when a Form is loaded.
If new listeners wants to be added to some objects of the managed form,
this must be done by overwriting this method.
In this basic implementation of the method, only the form and the form manager are assigned and stored by the InteractionManager in order to have references to these classes later. A basic way of overwriting this must call the super.registerInteractionManager(form, FormsManager)
This method links a key stroke to the standard buttons:
form - - the form to be associated with this managerformManager - - the form manager that rules the associationprotected void injectAnnotatedFields()
protected void registerRuleEngineFor(Object component)
public void setQueryInsertMode()
public void setInsertMode()
public void setUpdateMode()
public void setQueryMode()
public void print()
throws Exception
Exceptionpublic InteractionManager cloneInteractionManager()
public void free()
throws Exception
protected void finalize()
throws Throwable
public boolean getCheckModifiedDataChangeEvent()
public void setCheckModifiedDataChangeEvent(boolean check)
check - public Vector getModifiedFieldAttributes()
public void valueChanged(ValueEvent e)
valueChanged in interface ValueChangeListenere - Event with the previous value and the new onepublic int getCurrentMode()
public boolean dataWillChange(DataNavigationEvent e)
dataWillChange in interface DataNavigationListenerpublic void dataChanged(DataNavigationEvent e)
If there's no match between the register in the form and the organizational node's child (this could happen because the tree is not refreshed yet) the organizational node is selected. In this case the update button is disabled and the list of modified fields is removed.
dataChanged in interface DataNavigationListenerpublic void setDataChangedEventProcessing(boolean enable)
dataChanged(DataNavigationEvent).enable - public boolean getDataChangedEventProcessing()
dataChanged(DataNavigationEvent) is enabled or not.@Deprecated public void setWarningBirthdayMessage(String message)
message - public boolean checkBirthday(String attr)
attr - = the field which has to be compared topublic void setValueChangedEventListener(Object attr, boolean listen)
attr - the attribute of the element that wants to be registered. This
object should be a String in the text fields or integer
fields, but it can be a different object in other fields like
reference fieldslisten - if the value is true, the element will be added, is false, the
element will be removedpublic void setValueChangeEventListenerEnabled(boolean enabled)
public boolean isValueChangeListenerEnabled()
protected void registerFormKeyBindings()
public void setDefaultFocusEnabled(boolean enable)
enable - public boolean getDefaultActiveFocus()
public Hashtable getTemplateTables(Form form)
form - Form that is source to create templateHashtable with tables included in templatepublic Hashtable getTemplateFields(Form form)
form - Form that is source to create templateHashtable with fields included in templatepublic Hashtable getTemplateImages(Form form)
form - Form that is source to create templateHashtable with tables included in templatepublic Hashtable getFieldValues(Form form)
form - Form that is source to fill templateHashtable with field values included in templatepublic Hashtable getTableValues(Form form)
form - Form that is source to fill templateHashtable with table values included in templatepublic Hashtable getImageValues(Form form, boolean insertEmptyImages)
form - Form that is source to fill templateHashtable with image values included in templatepublic void addInteractionManagerModeListener(InteractionManagerModeListener listener)
listener - the listener to addpublic void removeInteractionManagerModeListener(InteractionManagerModeListener listener)
listener - the listener to be removedprotected void fireInteractionManagerModeChanged(InteractionManagerModeEvent event)
event - public InteractionManagerAction getActionHandler()
public void loadActionHandler(String resource)
Copyright © 2016 Imatia Innovation S.L.. All rights reserved.