LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.control
Class LyUserInputController

java.lang.Object
  extended by leon.control.LyController
      extended by leon.control.LyAreaController
          extended by leon.control.LyUserInputController
All Implemented Interfaces:
LyGetSessionInterface, LyContextInterface, LyGetActionInterface, LySelectFileListenerInterface, LyGuiListener, LyInfoListener, LyEvaluator, LyDemandListener
Direct Known Subclasses:
LyChooseFieldsController, LyCommonServiceController, LyFastFilterController, LyFindController, LyLoginController, LyMailController, LyPasswordController, LySelectByNameController, LySelectFileController, LyWebServiceController

public class LyUserInputController
extends LyAreaController

This class implements a user input dialog/window to ask some values from the user. Values may be read when window/dialog is closed This controller is associated with a builder (LyUserInputBuilder) and a behavior that implements LyUserInputBehaviorInterface. Usually, this behavior is an instance of the LyUserInputBehavior class.

See Also:
LyUserInputBuilder, LyUserInputBehaviorInterface, LyUserInputBehavior

Field Summary
static java.lang.String __VERSION
          File Version
 
Fields inherited from class leon.control.LyAreaController
DEFAULT_MENU_ITEM_IMAGE_SIZE, DEMAND_APPLY, DEMAND_CANCEL, DEMAND_CLOSE, DEMAND_CREATE_CHART, DEMAND_DELETE_CHART, DEMAND_DELETE_OBJECTINFOS, DEMAND_DELETE_PREFERENCE, DEMAND_UPDATE_VIEW, DEMAND_VALIDATE
 
Fields inherited from class leon.control.LyController
_nbControllers, _nextId, CONTROLLER_ID_SEP, DEFAULT_IMAGE_FORMAT, DEMAND_HELP, ID_SEP
 
Constructor Summary
LyUserInputController(LySession session, LyController parent, LyAction action)
          Constructor.
LyUserInputController(LySession session, LyController parent, LyAction action, LyClassInfo classInfo)
          Constructor.
LyUserInputController(LySession session, LyController parent, LyAction action, LyClassInfo classInfo, LyObjectList context)
          Constructor.
LyUserInputController(LySession session, LyController parent, LyAction action, LyObjectList context)
          Constructor.
 
Method Summary
 void actionDemand(LyActionDemand demand)
          Invoked when an action occurs.
 LyBoolean addBoolean(java.lang.String fieldId, java.lang.String fieldLabel, LyBoolean.Status status, boolean optional)
          Add a boolean field in the user input window.
 LyBoolean addBoolean(java.lang.String fieldId, java.lang.String fieldLabel, LyBoolean.Status status, boolean optional, int pos)
          Add a boolean field in the user input window.
 LyChoice addChoice(java.lang.String fieldId, java.lang.String fieldLabel, boolean multiple, boolean optional)
          Add a choice field (empty) in the user input window.
 LyChoice addChoice(java.lang.String fieldId, java.lang.String fieldLabel, boolean multiple, boolean optional, int pos)
          Add a choice field (empty) in the user input window.
 LyDate addDate(java.lang.String fieldId, java.lang.String fieldLabel, java.lang.String itemLabel, java.lang.String format, boolean optional)
          Add a date field in the user input window.
 LyDate addDate(java.lang.String fieldId, java.lang.String fieldLabel, java.lang.String itemLabel, java.lang.String format, boolean optional, int pos)
          Add a date field in the user input window.
 LyFile addFile(java.lang.String fieldId, java.lang.String fieldLabel, java.lang.String itemLabel, LyFile.Type type, boolean optional)
          Add a text field in the user input window.
 LyFile addFile(java.lang.String fieldId, java.lang.String fieldLabel, java.lang.String itemLabel, LyFile.Type type, boolean optional, int pos)
          Add a text field in the user input window.
 LyLabel addLabel(java.lang.String fieldId, java.lang.String fieldLabel, java.lang.String itemLabel)
          Add a label in the user input window.
 LyLabel addLabel(java.lang.String fieldId, java.lang.String fieldLabel, java.lang.String itemLabel, int pos)
          Add a label in the user input window.
 LyList addList(java.lang.String fieldId, java.lang.String fieldLabel, boolean multiple, int height, boolean optional)
          Add a list field (empty) in the user input window.
 LyList addList(java.lang.String fieldId, java.lang.String fieldLabel, boolean multiple, int height, boolean optional, int pos)
          Add a list field (empty) in the user input window.
 LyNumber addNumber(java.lang.String fieldId, java.lang.String fieldLabel, java.lang.String itemLabel, LyNumberFieldInfo.Type type, boolean optional)
          Add a number field in the user input window.
 LyNumber addNumber(java.lang.String fieldId, java.lang.String fieldLabel, java.lang.String itemLabel, LyNumberFieldInfo.Type type, boolean optional, int pos)
          Add a number field in the user input window.
 LyRelation addRelation(java.lang.String fieldId, java.lang.String fieldLabel, boolean multiple, boolean optional)
          Add a relation field (empty) in the user input window.
 LyRelation addRelation(java.lang.String fieldId, java.lang.String fieldLabel, boolean multiple, boolean optional, int pos)
          Add a relation field (empty) in the user input window.
 LyText addText(java.lang.String fieldId, java.lang.String fieldLabel, java.lang.String itemLabel, int ncols, int nrows, java.lang.String format, boolean optional, int pos)
          Add a text field in the user input window.
 LyText addText(java.lang.String fieldId, java.lang.String fieldLabel, java.lang.String itemLabel, int ncols, java.lang.String format, boolean optional)
          Add a text field in the user input window.
 LyText addText(java.lang.String fieldId, java.lang.String fieldLabel, java.lang.String itemLabel, int ncols, java.lang.String format, boolean optional, int pos)
          Add a text field in the user input window.
 java.lang.Class<?> getBehaviorInterface()
          Method that gives the interface that must be implemented by the behavior associated to this controller.
 LyClassInfo getClassInfo()
          Get controller class info if any.
 LyComponent getComponent()
          Accessor to the view component instance.
 LyForm getFormComponent()
          Retrieves form that contains input fields.
 java.lang.String getImage()
          Retrieve the image shown in the window titleBar.
 java.lang.String getInputId()
          Retrieve the identification freely set by the listener.
 java.lang.String getTitleBar()
          Retrieve the label of the titleBar.
 LyViewController getViewController()
          Accessor to the associated view controller.
 boolean isDialog()
          Gets dialog status. default is true
 boolean isViewResizable()
          Indicates if the view for this input controller is resizable.
 void reset(boolean full)
          Reset all the content of the view.
 void setBehavior(LyBehaviorInterface behavior)
          Setter to controller behavior A behavior is associated to a controller to let the developper specify application logic in the behavior.
 void setBuilder(LyBuilder builder)
          Setter to controller builder A builder is associated to a controller to let the developper construct the desired view.
 void setDialog(boolean isDialog)
          Sets dialog status. default is true
 void setImage(java.lang.String image)
          Sets the image shown in the window titleBar.
 void setInputId(java.lang.String inputId)
          Sets the identification freely set by the listener.
 void setTitleBar(java.lang.String titleBar)
          Sets the label of the titleBar.
 
Methods inherited from class leon.control.LyAreaController
canClose, canFree, clearViewCache, completeMenuBar, completeMessages, free, free, getAction, getAreaStackController, getBehavior, getBuilder, getContent, getContext, getContextClient, getContextTitle, getDefaultAction, getEnvironment, getFastEditionAction, getHelpFile, getImageTooltip, getInfoLabel, getInfoLabel, getKeyValue, getLabel, getLastModified, getMenuItemImage, getName, getParameter, getParameter, getParameterMarks, getParent, getParent, getParentAreaController, getRefreshTime, getSelection, getShortLabel, getTarget, getTitle, getViewController, hasMark, hasNotMark, hasViewController, hideView, infoEvent, initialize, isInitialized, isOutlined, menuDemand, reset, selectFileDemand, setContext, setContext, setContextClient, setIdle, setPreference, setViewController, showView, showView, testParameter, toString, update, updateTitleBar
 
Methods inherited from class leon.control.LyController
activateViewDemand, demandPerformed, dragDropDemand, getApplication, getClassInfo, getId, getImage, getImage, getImage, getImage, getImageFromPrefix, getImageFromPrefix, getImageFromPrefix, getName, getObjectId, getSession, getUserData, getView, getViewManager, helpDemand, hideView, isFreed, isIdle, selectionDemand, setBuilderClass, setLastModified, setName, setUserData, showError, showError, showWarning, updateViewFromValues
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File Version

See Also:
Constant Field Values
Constructor Detail

LyUserInputController

public LyUserInputController(LySession session,
                             LyController parent,
                             LyAction action)
Constructor.

Parameters:
session - current session associated to the controller. The controller automatically registers on the specified session.
parent - parent controller (or null for 'root' controller). Controller hierarchy indicates a child controller (for example a dialog created from a main view)
action - related action. If an action is specified, the controller uses action parameters (action name, action specific XML view description ...)

LyUserInputController

public LyUserInputController(LySession session,
                             LyController parent,
                             LyAction action,
                             LyClassInfo classInfo)
Constructor.

Parameters:
session - current session associated to the controller. The controller automatically registers on the specified session.
parent - parent controller (or null for 'root' controller). Controller hierarchy indicates a child controller (for example a dialog created from a main view)
action - related action. If an action is specified, the controller uses action parameters (action name, action specific XML view description ...)
classInfo - This parameter is not used. Kept from introspection compatibility.

LyUserInputController

public LyUserInputController(LySession session,
                             LyController parent,
                             LyAction action,
                             LyObjectList context)
Constructor.

Parameters:
session - current session associated to the controller. The controller automatically registers on the specified session.
parent - parent controller (or null for 'root' controller). Controller hierarchy indicates a child controller (for example a dialog created from a main view)
action - related action. If an action is specified, the controller uses action parameters (action name, action specific XML view description ...)
context - current context (may be null if the view is not contextual to a list of objects).

LyUserInputController

public LyUserInputController(LySession session,
                             LyController parent,
                             LyAction action,
                             LyClassInfo classInfo,
                             LyObjectList context)
Constructor.

Parameters:
session - current session associated to the controller. The controller automatically registers on the specified session.
parent - parent controller (or null for 'root' controller). Controller hierarchy indicates a child controller (for example a dialog created from a main view)
action - related action. If an action is specified, the controller uses action parameters (action name, action specific XML view description ...)
classInfo - This parameter is not used. Kept from introspection compatibility.
context - current context (may be null if the view is not contextual to a list of objects).
Method Detail

getClassInfo

public LyClassInfo getClassInfo()
Get controller class info if any. This method is overriden if it makes sense to return a classInfo for this controller. Default returns null.

Overrides:
getClassInfo in class LyAreaController
Returns:
a classinfo if any or null.

getComponent

public LyComponent getComponent()
Accessor to the view component instance. (XML description of the view) This instance is created by the builder, and multiple calls to this method always return the same instance.

Overrides:
getComponent in class LyController
Returns:
the LyComponent instance of the view package, memory representation (parsed) of the XML description of the view.

getBehaviorInterface

public java.lang.Class<?> getBehaviorInterface()
Method that gives the interface that must be implemented by the behavior associated to this controller.

Overrides:
getBehaviorInterface in class LyAreaController
Returns:
Class representing the behavior interface of this controller.

actionDemand

public void actionDemand(LyActionDemand demand)
Invoked when an action occurs. (LyDemandListener interface) The current implementation calls the userInputDemand method of the behavior.

Overrides:
actionDemand in class LyAreaController
Parameters:
demand - the action demand.
See Also:
LyController.demandPerformed(leon.view.event.LyDemand)

getInputId

public java.lang.String getInputId()
Retrieve the identification freely set by the listener.

Returns:
the identification

setInputId

public void setInputId(java.lang.String inputId)
Sets the identification freely set by the listener.

Parameters:
inputId - the identification

getTitleBar

public java.lang.String getTitleBar()
Retrieve the label of the titleBar.

Returns:
the label of the titlebar

setTitleBar

public void setTitleBar(java.lang.String titleBar)
Sets the label of the titleBar.

Parameters:
titleBar - the label of the titleBar

getImage

public java.lang.String getImage()
Retrieve the image shown in the window titleBar.

Overrides:
getImage in class LyAreaController
Returns:
the associated image

setDialog

public void setDialog(boolean isDialog)
Sets dialog status. default is true

Parameters:
isDialog - dialog status (view is a dialog)

isDialog

public boolean isDialog()
Gets dialog status. default is true

Returns:
dialog status (view is a dialog)

setImage

public void setImage(java.lang.String image)
Sets the image shown in the window titleBar.

Parameters:
image - the image to set

getViewController

public LyViewController getViewController()
Accessor to the associated view controller.

Overrides:
getViewController in class LyAreaController
Returns:
the view controller

addLabel

public LyLabel addLabel(java.lang.String fieldId,
                        java.lang.String fieldLabel,
                        java.lang.String itemLabel)
Add a label in the user input window.

Parameters:
fieldId - Id of the field
fieldLabel - field label
itemLabel - content of the field
Returns:
the label component

addLabel

public LyLabel addLabel(java.lang.String fieldId,
                        java.lang.String fieldLabel,
                        java.lang.String itemLabel,
                        int pos)
Add a label in the user input window.

Parameters:
fieldId - Id of the field
fieldLabel - field label
itemLabel - content of the field
pos - indicates the position of the field, -1 for the last position
Returns:
the label component

addText

public LyText addText(java.lang.String fieldId,
                      java.lang.String fieldLabel,
                      java.lang.String itemLabel,
                      int ncols,
                      java.lang.String format,
                      boolean optional)
Add a text field in the user input window.

Parameters:
fieldId - Id of the field
fieldLabel - field label
itemLabel - content of the field
ncols - number of columns for the field
format - format for the field (f.e. IP Address format...)
optional - indicates if the field is optional or not
Returns:
the text component

addText

public LyText addText(java.lang.String fieldId,
                      java.lang.String fieldLabel,
                      java.lang.String itemLabel,
                      int ncols,
                      java.lang.String format,
                      boolean optional,
                      int pos)
Add a text field in the user input window.

Parameters:
fieldId - Id of the field
fieldLabel - field label
itemLabel - content of the field
ncols - number of columns for the field
format - format for the field (f.e. IP Address format...)
optional - indicates if the field is optional or not
pos - indicates the position of the field, -1 for the last position
Returns:
the text component

addText

public LyText addText(java.lang.String fieldId,
                      java.lang.String fieldLabel,
                      java.lang.String itemLabel,
                      int ncols,
                      int nrows,
                      java.lang.String format,
                      boolean optional,
                      int pos)
Add a text field in the user input window.

Parameters:
fieldId - Id of the field
fieldLabel - field label
itemLabel - content of the field
ncols - number of columns for the field
nrows - number of rows for the field
format - format for the field (f.e. IP Address format...)
optional - indicates if the field is optional or not
pos - indicates the position of the field, -1 for the last position
Returns:
the text component

addRelation

public LyRelation addRelation(java.lang.String fieldId,
                              java.lang.String fieldLabel,
                              boolean multiple,
                              boolean optional)
Add a relation field (empty) in the user input window.

Parameters:
fieldId - Id of the field
fieldLabel - field label
multiple - indicates if this is a multiple relation
optional - indicates if the field is optional or not
Returns:
the relation component

addRelation

public LyRelation addRelation(java.lang.String fieldId,
                              java.lang.String fieldLabel,
                              boolean multiple,
                              boolean optional,
                              int pos)
Add a relation field (empty) in the user input window.

Parameters:
fieldId - Id of the field
fieldLabel - field label
multiple - indicates if this is a multiple relation
optional - indicates if the field is optional or not
pos - indicates the position of the field, -1 for the last position
Returns:
the relation component

addChoice

public LyChoice addChoice(java.lang.String fieldId,
                          java.lang.String fieldLabel,
                          boolean multiple,
                          boolean optional)
Add a choice field (empty) in the user input window.

Parameters:
fieldId - Id of the field
fieldLabel - field label
multiple - indicates if this is a multiple relation
optional - indicates if the field is optional or not
Returns:
the choice component

addChoice

public LyChoice addChoice(java.lang.String fieldId,
                          java.lang.String fieldLabel,
                          boolean multiple,
                          boolean optional,
                          int pos)
Add a choice field (empty) in the user input window.

Parameters:
fieldId - Id of the field
fieldLabel - field label
multiple - indicates if this is a multiple relation
optional - indicates if the field is optional or not
pos - indicates the position of the field, -1 for the last position
Returns:
the choice component

addNumber

public LyNumber addNumber(java.lang.String fieldId,
                          java.lang.String fieldLabel,
                          java.lang.String itemLabel,
                          LyNumberFieldInfo.Type type,
                          boolean optional)
Add a number field in the user input window.

Parameters:
fieldId - Id of the field
fieldLabel - field label
itemLabel - the original value of the field
type - the type of the number field
optional - indicates if the field is optional or not
Returns:
the number component

addNumber

public LyNumber addNumber(java.lang.String fieldId,
                          java.lang.String fieldLabel,
                          java.lang.String itemLabel,
                          LyNumberFieldInfo.Type type,
                          boolean optional,
                          int pos)
Add a number field in the user input window.

Parameters:
fieldId - Id of the field
fieldLabel - field label
itemLabel - the original value of the field
type - the type of the number field
optional - indicates if the field is optional or not
pos - indicates the position of the field, -1 for the last position
Returns:
the number component

addDate

public LyDate addDate(java.lang.String fieldId,
                      java.lang.String fieldLabel,
                      java.lang.String itemLabel,
                      java.lang.String format,
                      boolean optional)
Add a date field in the user input window.

Parameters:
fieldId - Id of the field
fieldLabel - field label
itemLabel - content of the field
format - date format for the field
optional - indicates if the field is optional or not
Returns:
the date component

addDate

public LyDate addDate(java.lang.String fieldId,
                      java.lang.String fieldLabel,
                      java.lang.String itemLabel,
                      java.lang.String format,
                      boolean optional,
                      int pos)
Add a date field in the user input window.

Parameters:
fieldId - Id of the field
fieldLabel - field label
itemLabel - content of the field
format - date format for the field
optional - indicates if the field is optional or not
pos - indicates the position of the field, -1 for the last position
Returns:
the date component

addFile

public LyFile addFile(java.lang.String fieldId,
                      java.lang.String fieldLabel,
                      java.lang.String itemLabel,
                      LyFile.Type type,
                      boolean optional)
Add a text field in the user input window.

Parameters:
fieldId - Id of the field
fieldLabel - field label
itemLabel - original content of the field
type - type of the file
optional - indicates if the field is optional or not
Returns:
the date component

addFile

public LyFile addFile(java.lang.String fieldId,
                      java.lang.String fieldLabel,
                      java.lang.String itemLabel,
                      LyFile.Type type,
                      boolean optional,
                      int pos)
Add a text field in the user input window.

Parameters:
fieldId - Id of the field
fieldLabel - field label
itemLabel - original content of the field
type - type of the file
optional - indicates if the field is optional or not
pos - indicates the position of the field, -1 for the last position
Returns:
the date component

addList

public LyList addList(java.lang.String fieldId,
                      java.lang.String fieldLabel,
                      boolean multiple,
                      int height,
                      boolean optional)
Add a list field (empty) in the user input window.

Parameters:
fieldId - Id of the field
fieldLabel - field label
multiple - indicates if selection mode is multiple in the list
height - the height of the list
optional - indicates if the field is optional or not
Returns:
the list component

addList

public LyList addList(java.lang.String fieldId,
                      java.lang.String fieldLabel,
                      boolean multiple,
                      int height,
                      boolean optional,
                      int pos)
Add a list field (empty) in the user input window.

Parameters:
fieldId - Id of the field
fieldLabel - field label
multiple - indicates if selection mode is multiple in the list
height - the height of the list
optional - indicates if the field is optional or not
pos - indicates the position of the field, -1 for the last position
Returns:
the list component

addBoolean

public LyBoolean addBoolean(java.lang.String fieldId,
                            java.lang.String fieldLabel,
                            LyBoolean.Status status,
                            boolean optional)
Add a boolean field in the user input window.

Parameters:
fieldId - the id of the field
fieldLabel - the label of the field
status - the boolean status
optional - indicates if the choice is optional
Returns:
the boolean component

addBoolean

public LyBoolean addBoolean(java.lang.String fieldId,
                            java.lang.String fieldLabel,
                            LyBoolean.Status status,
                            boolean optional,
                            int pos)
Add a boolean field in the user input window.

Parameters:
fieldId - the id of the field
fieldLabel - the label of the field
status - the boolean status
optional - indicates if the choice is optional
pos - indicates the position of the field, -1 for the last position
Returns:
the boolean component

isViewResizable

public boolean isViewResizable()
Indicates if the view for this input controller is resizable.

Overrides:
isViewResizable in class LyAreaController
Returns:
true if the view is resizable, false otherwise.

setBuilder

public void setBuilder(LyBuilder builder)
Setter to controller builder A builder is associated to a controller to let the developper construct the desired view.

Overrides:
setBuilder in class LyController
Parameters:
builder - associated builder

setBehavior

public void setBehavior(LyBehaviorInterface behavior)
Setter to controller behavior A behavior is associated to a controller to let the developper specify application logic in the behavior.

Parameters:
behavior - associated behavior

getFormComponent

public LyForm getFormComponent()
Retrieves form that contains input fields.

Returns:
the form component

reset

public void reset(boolean full)
Reset all the content of the view. This method may be called several times. This method should be overriden, default implementation makes nothing

Overrides:
reset in class LyAreaController
Parameters:
full - Boolean indicating if a full reset (including reset of datas) is requiered or not (only reset graphical area).

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com