LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.control
Class LyImportTableController

java.lang.Object
  extended by leon.control.LyController
      extended by leon.control.LyAreaController
          extended by leon.control.LyPanelController
              extended by leon.control.LySimpleTableController
                  extended by leon.control.LyTableController
                      extended by leon.control.LyMultiPageTableController
                          extended by leon.control.LyImportTableController
All Implemented Interfaces:
java.lang.Runnable, LyGetSessionInterface, LyContextInterface, LyControllerContextInterface, LyControllerContextInterface2, LyFastFilterEndInterface, LyFilterEndInterface, LyFindInterface, LyGetActionInterface, LySelectFileListenerInterface, LySortEndInterface, LyAdvancedWorkSpaceListener, LyGuiListener, LyWorkSpaceListener, LyGetClassInfoInterface, LyInfoListener, LyEvaluator, LyDemandListener, LyPrintListenerInterface, LyAnswerInterface, LyQuestionAnswerInterface, LySetPrintModeInterface
Direct Known Subclasses:
LyMultiClassImportController

public class LyImportTableController
extends LyMultiPageTableController
implements LyControllerContextInterface2

This class implements a table view to import data. Data obtained from the import file are shown as objects in the table : this is only an 'import preview' since data have not yet been added into the view.

The user may check if the import procedure was successful and finally decide to import all data or only selected items.

It is possible to apply filters and sort as in any table then select the requested items. Usually this view is the result of the _import action associated to the LyImportController.

See Also:
LyImportController, LyExportController, LySimpleTableController

Field Summary
static java.lang.String __VERSION
          File Version
static int DEFAULT_ROW_IMAGE_SIZE
          Default image size for icons.
static java.lang.String DEMAND_IMPORT_ALL
          Internal action : import all items.
static java.lang.String DEMAND_IMPORT_SELECT_ALL
          Internal action : select all.
static java.lang.String DEMAND_IMPORT_SELECTION
          Internal action : import selected.
static java.lang.String DEMAND_VIEW_IMPORTED
          Internal action : view imported objects.
 boolean OLD_IMPORT
          TEMPORARY parameter due to import rewriting.
 
Fields inherited from class leon.control.LyMultiPageTableController
IMPACT_OUTSIDE_OF_CURRENT_VIEW, SELECT_PAGE
 
Fields inherited from class leon.control.LyTableController
MAX_OBJECTS_COUNT_FOR_CONTEXT_FILTER
 
Fields inherited from class leon.control.LySimpleTableController
DEMAND_CHOOSE_COLUMNS, DEMAND_COPY_CELL_CONTENT, DEMAND_FIX_COLUMN, DEMAND_GROUP_BY, DEMAND_INVERT_STATUS_SORT, DEMAND_LIST_DISPLAY, DEMAND_NEXT_PAGE, DEMAND_PREVIOUS_PAGE, DEMAND_PRINT_TABLE, DEMAND_REVERSE, DEMAND_ROW_TOOL, DEMAND_SORT_BY, DEMAND_SORT_DEFAULT, DEMAND_SORT_EXTEND, DEMAND_SORT_REVERSE, DEMAND_SORT_WIZARD, DEMAND_STATUS_SORT, DEMAND_SUB_TOOL_ACTION, DEMAND_UNFIX_COLUMN, EMPTY_CELL, FOOTER_ROW_PREFIX, MESSAGE_OBJECTS_COUNT, SECTION_ROW_PREFIX
 
Fields inherited from class leon.control.LyPanelController
DEMAND_DEFAULT_FOR_MOBILE_PREFERENCE, DEMAND_DEFAULT_PREFERENCE, DEMAND_PREFERENCE_TARGET, DEMAND_SAVE_PREFERENCE, DEMAND_SELECT_ALL, DEMAND_SHARED_PREFERENCE, DEMAND_UNSELECT_ALL, EXTEND_SIMPLE_FILTER, EXTENDED_FILTER_NEW, FAST_FILTER, FILTER_ACTIVE, FILTER_SET, PREFERENCE_TARGET_ACTION, PREFERENCE_TARGET_CLASS, SIMPLE_FILTER_NEW
 
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
LyImportTableController(LySession session, LyController parent, LyAction action, LyClassInfo classInfo)
          Constructor.
LyImportTableController(LySession session, LyController parent, LyAction action, LyClassInfo classInfo, boolean withoutGui)
          Constructor.
 
Method Summary
 void actionDemand(LyActionDemand demand)
          Invoked when an action notification is sent to this listener.
 boolean allowOperations()
          Returns a boolean that indicates if operations field must be displayed.
 LyRow buildRow(LyObject object, LyInfoList<LyFieldInfo> fields, LyInfoList<LyFieldInfo> statusFields)
          Current builder of a new row.
 java.lang.String checkFields(LyObjectList objects)
          Used to check the fields of the objects.
 LyFieldInfo checkRealFieldInfo(LyFieldInfo fieldInfo)
          Converts a temporary locally imported fieldInfo to the real fieldInfo Should be used internally by this class (only).
 LyContext.Status commit()
          Commit data modifications on imported objects This method closes current context and validates all objects in import It is possible to commit() partially the import with importObjects() method or to rollback() part of the import with rollbackNonImportedObjects.
 void completeMenuBar(LyMenuBar menuBar, int level)
          This method is invoked to enable the the area to complete the menuBar of the view and add its own menu items.
 void completeMessages(LyMessages messages, int level)
          This method is invoked to enable the the area(s) to complete the message bar of the view and add its own message items.
 LyObject createObjectFromImportedObject(LyObject object)
          Create a real object from an imported object
 void fixColumn(int column)
          Freeze or unFreeze a column.
 void free(LyController controller)
          Free this controller on request of the specified controller.
 java.lang.Class<?> getBehaviorInterface()
          Method that gives the interface that must be implemented by the behavior associated to this controller.
 LyBuilder getBuilder()
          Accessor to the internal builder.
 LyClassInfo getClassInfo()
          Class info : content description.
 LyComponent getComponent()
          Accessor to the view component instance.
 LyContext getControllerContext()
          Gets the controller context.
 LyContext getControllerContext(LyController controller)
          Get current controller context.
 LyInfoList<LyFieldInfo> getFields()
          Accessor to the list of fields for import.
 LyAction getImportAction()
          Gets import action.
 LyImportBehavior getImportBehavior()
          A getter to retrieve the LyImportBehavior Be careful: this is not the bahavior of the tablle (import table) but the behavior of the import action itself.
 LyImportController getImportControllerParent()
          Gets import controller parent.
 LyObjectList getImportedObjects()
          Deprecated. replaced by getTemporaryImportedObjects()
 java.lang.String getLastErrorMessage()
          Accessor to the Last error that was shown during import This may be used to check by code if import was Ok.
 LyFieldInfo getLocalFieldInfo(LyFieldInfo fieldInfo)
          Converts a real fieldInfo to the a temporary imported fieldInfo if it exists Should be used internally by this class (only).
 LyObjectList getObjectsToDelete()
          Return the list of objects that may be deleted during the import process.
 LyPanel getPanelComponent()
          Accessor to panel component.
 LyClassInfo getRealClassInfo()
          Return the classInfo used for the import.
 LyObjectList getRealImportedObjects()
          The list of real imported objects since last loadData.
 LyObject getRealObject(LyObject importObject)
          Deprecated. getRealObject is not used any more with new import. Method returns importObject.
 LyTable getTableComponent()
          Accessor to the Table component.
 LyObjectList getTemporaryImportedObjects()
          Deprecated. Used by OLD_IMPORT only,
 LyView getView()
          Accessor view that contains the component (getComponent) of the controller.
 LyViewController getViewController()
          Accessor to the view controller (Frame or dialog controller) which is the container of this view.
 void hideView(boolean free)
          Hide the view.
 LyImportContentXmlController importContentXmlFactory(LySession session, LyController parent, LyAction action)
          Factory to build the import content controller for XML import.
 void importObjects(LyObjectList objects)
          Do the final import operation : this will commit the import context for the specified objects.
 void importObjects(LyObjectList objects, boolean importErrors)
          Do the final import operation : this will commit the import context for the specified objects.
 boolean isDeletedObject(LyObject importObject)
          Indicates if the imported object may be deleted or not.
 boolean isNewObject(LyObject importObject)
          Indicates if the imported object has been created or not.
 LyInfoList<LyFieldInfo> isSameObject(LyObject importObject)
          Indicates if the real object corresponding to the imported object has exactly the same values or not.
 boolean isStatusColumn(LyInfoList<LyFieldInfo> statusFields)
          Check if the status column exists.
 boolean loadData()
          Load the data contained in the file.
 boolean loadData(boolean full)
          Load the data contained in the file.
 void menuDemand(LyMenuDemand demand)
          Invoked when an menu item notification is sent to this listener.
 boolean objectChanged(LyWorkSpaceEvent event)
          Called when an object has changed in the dynamic object list.
 void reset(boolean full)
          Reset component.
 void rollback()
          Rollback all data modifications on imported objects, even those imported with importObjects().
 void selectionDemand(LySelectionDemand demand)
          Invoked when a selection occurs.
 void selectObject(LyObject object, boolean select, boolean updateView, boolean showSelected)
          Select an object in the table.
 int selectRow(LyFieldInfo fieldInfo, java.lang.String pattern, int from, boolean next, boolean substring, boolean caseSensitive)
          Select a row in the table for given parameters.
 void setAllowOperations(boolean allowOperations)
          Sets the parameter that indicates if operations field must be displayed.
 void setBuffer(java.lang.String buffer)
          Set the buffer to be used to load objects.
 void setFields(LyInfoList<LyFieldInfo> fields)
          Accessor to the list of fields for import.
 void setFieldSep(java.lang.String fieldSep)
          Sets the field separator to be used.
 void setFile(java.lang.String file)
          Sets the file to be used.
 void setImportBehavior(LyImportBehavior importBehavior)
          A setter to retrieve the LyImportBehavior Be careful: this is not the bahavior of the tablle (import table) but the behavior of the import action itself.
 void setImportType(java.lang.String importType)
          Sets the import type.
 void setOperations(java.util.BitSet operations)
          Sets the operations to be executed.
 void setStartLine(int startLine)
          Sets the start line.
 void setValueSep(java.lang.String valueSep)
          Sets the value separator to be used.
 void setViewController(LyViewController viewController)
          Accessor to the view controller of the area.
 void showError(java.lang.String message)
          Show a popup message error box with the specified message.
 void showView()
          Make the view visible to the user.
 void showWarning(java.lang.String message)
          Show a popup message warning box with the specified message.
 void updatePreferencesMenu()
          Update the preferences menuitem.
 LyTitleBar updateTitleBar(java.lang.String image, java.lang.String title, java.lang.String contextTitle)
          Update the title bar content (if any titlebar is associated with this area).
 void updateViewFromValues(LyDemand demand)
          Update the view of the controller with the specified values from the demand (internal use) .
 boolean workSpaceEventsGrouped(java.util.ArrayList<LyWorkSpaceEvent> events)
          Called when grouped events are sent.
 
Methods inherited from class leon.control.LyMultiPageTableController
getLastPage, getPage, hasViewLimit, isDisplayNextPreviousTools, isDisplayPagesNumber, isPaginated, loadPage, setClassFilter, setContext, setLastModified, setPage, setPrintMode, setSort
 
Methods inherited from class leon.control.LyTableController
print, selectObjects
 
Methods inherited from class leon.control.LySimpleTableController
allowSortOnField, clearTranslatedStringMap, clearViewCache, dragDropDemand, enablesMultiSelection, endFastFilter, endSort, findObject, getClassFilter, getColsNumberListDisplay, getColumnSize, getComplexFields, getContent, getFastFilterFieldInfo, getFastFilterValue, getFieldMarks, getLimit, getRealFields, getSelection, getSelection, getSort, getStatusFieldInfos, getTableComponentFields, getTableComponentFields, hasDisplayListToggleButton, hasPrintMode, isDisplayList, isDisplayListShowFields, isFastFilterExtended, isFastFilterSet, isFopMode, isImageColumn, objectAdded, objectRemoved, objectStateChanged, printList, questionAnswer, run, selectAllObjects, selectObject, setFieldMarks, setFopMode, setPreference, showObject, translate
 
Methods inherited from class leon.control.LyPanelController
buildFilter, closeBorderPanel, endFilter, getFilter, getFilterController, getFilterEditorController, getPreference, getRefreshTime, isFilterActive, isHorizontal, objectUserEvent, setFilter, setIdle, setRefreshTime
 
Methods inherited from class leon.control.LyAreaController
canClose, canFree, free, getAction, getAreaStackController, getBehavior, getContext, getContextClient, getContextTitle, getDefaultAction, getEnvironment, getFastEditionAction, getHelpFile, getImage, getImageTooltip, getInfoLabel, getInfoLabel, getKeyValue, getLabel, getLastModified, getMenuItemImage, getName, getParameter, getParameter, getParameterMarks, getParent, getParent, getParentAreaController, getShortLabel, getTarget, getTitle, getViewController, hasMark, hasNotMark, hasViewController, infoEvent, initialize, isInitialized, isOutlined, isViewResizable, reset, selectFileDemand, setContext, setContextClient, showView, testParameter, toString, update
 
Methods inherited from class leon.control.LyController
activateViewDemand, demandPerformed, getApplication, getClassInfo, getId, getImage, getImage, getImage, getImage, getImageFromPrefix, getImageFromPrefix, getImageFromPrefix, getName, getObjectId, getSession, getUserData, getViewManager, helpDemand, hideView, isFreed, isIdle, setBuilder, setBuilderClass, setName, setUserData, showError
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface leon.control.LyContextInterface
getContext
 
Methods inherited from interface leon.data.LyAdvancedWorkSpaceListener
objectUserEvent
 
Methods inherited from interface leon.control.LyFilterEndInterface
endFilter, getFilter
 
Methods inherited from interface leon.control.LyFastFilterEndInterface
getFilter
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File Version

See Also:
Constant Field Values

DEFAULT_ROW_IMAGE_SIZE

public static int DEFAULT_ROW_IMAGE_SIZE
Default image size for icons.


DEMAND_IMPORT_SELECT_ALL

public static final java.lang.String DEMAND_IMPORT_SELECT_ALL
Internal action : select all.


DEMAND_IMPORT_SELECTION

public static final java.lang.String DEMAND_IMPORT_SELECTION
Internal action : import selected.


DEMAND_IMPORT_ALL

public static final java.lang.String DEMAND_IMPORT_ALL
Internal action : import all items.


DEMAND_VIEW_IMPORTED

public static final java.lang.String DEMAND_VIEW_IMPORTED
Internal action : view imported objects.


OLD_IMPORT

public boolean OLD_IMPORT
TEMPORARY parameter due to import rewriting. Indicates if the import is an old import or a new import This attribute and all code sequence between if (OLD_IMPORT) { } will be deprecated and removed

Constructor Detail

LyImportTableController

public LyImportTableController(LySession session,
                               LyController parent,
                               LyAction action,
                               LyClassInfo classInfo)
Constructor. Must be used for import action with GUI.

Parameters:
session - current session associated to the controller. The controller automatically registers on the specified session.
parent - parent controller (or null for 'root' controller).
action - related action.
classInfo - classInfo which indicates which kind of objects we expect in import

LyImportTableController

public LyImportTableController(LySession session,
                               LyController parent,
                               LyAction action,
                               LyClassInfo classInfo,
                               boolean withoutGui)
Constructor. Must be used for import action without GUI.

Parameters:
session - current session associated to the controller. The controller automatically registers on the specified session.
parent - parent controller (or null for 'root' controller).
action - related action.
classInfo - classInfo which indicates which kind of objects we expect.
withoutGui - Indicates if the import has some GUI or not. This parameter must be set to true to execute an import action by code. in import
Method Detail

free

public void free(LyController controller)
Free this controller on request of the specified controller.

Overrides:
free in class LySimpleTableController
Parameters:
controller - controller instance which requested the freeing of this controller. If the controller is the parent, this controller is freed otherwise the method does nothing.
See Also:
LyAreaController.free()

getBuilder

public LyBuilder getBuilder()
Accessor to the internal builder. If no builder is set, the method returns the reference to a default builder (invokes getDefaultBuilder).

Overrides:
getBuilder in class LyAreaController
Returns:
the builder which creates the XML description of the view. Returned value is not null and several invocation on getBuilder always return the same instance.

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.

getView

public LyView getView()
Accessor view that contains the component (getComponent) of the controller. This is a shortcut to getViewController.getView(). Returned value depends on the nature of the controller.

Overrides:
getView in class LyController
Returns:
the LyView instance (memory representation of the XML view) which contains the current LyComponent.

reset

public void reset(boolean full)
Reset component.

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

getViewController

public LyViewController getViewController()
Accessor to the view controller (Frame or dialog controller) which is the container of this view. This method must be implemented in subclasses depending on the nature of the component.

Overrides:
getViewController in class LyAreaController
Returns:
the reference to a view controller, never returns null if the controller is associated to a view.

hideView

public void hideView(boolean free)
Hide the view. The effect of this command depends on the nature of the application. If the display is a fat client for example (windows (awt) / swing) this methods should close the window or hide the view.

This method should consider that the page is closed and should disappear.

Overrides:
hideView in class LyAreaController
Parameters:
free - Indicates if only HIDDEN, not FREED (true).

importContentXmlFactory

public LyImportContentXmlController importContentXmlFactory(LySession session,
                                                            LyController parent,
                                                            LyAction action)
Factory to build the import content controller for XML import.

Parameters:
session - The current session.
parent - The parent of the build controller.
action - The action definition for import.
Returns:
The inmportContentXmlController.

getImportControllerParent

public LyImportController getImportControllerParent()
Gets import controller parent.

Returns:
the import controller

getImportAction

public LyAction getImportAction()
Gets import action.

Returns:
the import action

loadData

public boolean loadData()
Load the data contained in the file.

Returns:
true if successfull

loadData

public boolean loadData(boolean full)
Load the data contained in the file.

Parameters:
full - indicates if a full reload must be performed.
Returns:
true if successfull

actionDemand

public void actionDemand(LyActionDemand demand)
Invoked when an action notification is sent to this listener.

This method is called by demandPerformed.

At this level, the implementation handles demands of type LyActionDemand.TYPE_ACTION : DEMAND_IMPORT_SELECT_ALL, DEMAND_IMPORT_SELECTION, DEMAND_IMPORT_ALL, LyFormController.DEMAND_CANCEL

Overrides:
actionDemand in class LyMultiPageTableController
Parameters:
demand - demand parameters sent by the view component.
See Also:
LyController.demandPerformed(leon.view.event.LyDemand)

importObjects

public void importObjects(LyObjectList objects)
Do the final import operation : this will commit the import context for the specified objects. The result is STILL in the cancellable context of this controller. Only subcontext are commited. This method is a shortcut for importObjects(objects, true) for backward compatibility

Parameters:
objects - the list of objects to import
See Also:
commit(), rollbackNonImportedObjects(), rollback()

importObjects

public void importObjects(LyObjectList objects,
                          boolean importErrors)
Do the final import operation : this will commit the import context for the specified objects. The result is STILL in the cancellable context of this controller. Only subcontext are commited.

Parameters:
objects - the list of objects to import
importErrors - indicates if we accept to import objects in error.
See Also:
commit(), rollbackNonImportedObjects(), rollback()

getImportBehavior

public LyImportBehavior getImportBehavior()
A getter to retrieve the LyImportBehavior Be careful: this is not the bahavior of the tablle (import table) but the behavior of the import action itself.

Returns:
the LyImportBehavior

setImportBehavior

public void setImportBehavior(LyImportBehavior importBehavior)
A setter to retrieve the LyImportBehavior Be careful: this is not the bahavior of the tablle (import table) but the behavior of the import action itself.

Parameters:
importBehavior - the LyImportBehavior

createObjectFromImportedObject

public LyObject createObjectFromImportedObject(LyObject object)
Create a real object from an imported object

Parameters:
object - an imported object
Returns:
the real object

commit

public LyContext.Status commit()
Commit data modifications on imported objects This method closes current context and validates all objects in import It is possible to commit() partially the import with importObjects() method or to rollback() part of the import with rollbackNonImportedObjects. After this operation the context is not accessible.

Returns:
The status of the committed context.
See Also:
importObjects(leon.data.LyObjectList), rollbackNonImportedObjects(), rollback()

rollback

public void rollback()
Rollback all data modifications on imported objects, even those imported with importObjects().

See Also:
importObjects(leon.data.LyObjectList), rollbackNonImportedObjects(), commit()

getRealObject

public LyObject getRealObject(LyObject importObject)
Deprecated. getRealObject is not used any more with new import. Method returns importObject.

Return the real object corresponding to the imported object.

Parameters:
importObject - the temporary object read from import file
Returns:
the 'real' object instance if any, or null if it could not be found

isSameObject

public LyInfoList<LyFieldInfo> isSameObject(LyObject importObject)
Indicates if the real object corresponding to the imported object has exactly the same values or not.

Parameters:
importObject - the 'real' object instance for content comparizon
Returns:
null if all values are identical, the list of fields with different values or an empty list.

isDeletedObject

public boolean isDeletedObject(LyObject importObject)
Indicates if the imported object may be deleted or not.

Parameters:
importObject - the imported object instance for the check
Returns:
true if the object may be deleted, false otherwise

isNewObject

public boolean isNewObject(LyObject importObject)
Indicates if the imported object has been created or not.

Parameters:
importObject - the imported object instance for the check
Returns:
true if the object was created, false otherwise

checkRealFieldInfo

public LyFieldInfo checkRealFieldInfo(LyFieldInfo fieldInfo)
Converts a temporary locally imported fieldInfo to the real fieldInfo Should be used internally by this class (only).

Parameters:
fieldInfo - the fieldInfo to convert
Returns:
the original fieldInfo or the parameter fieldInfo if not found

getLocalFieldInfo

public LyFieldInfo getLocalFieldInfo(LyFieldInfo fieldInfo)
Converts a real fieldInfo to the a temporary imported fieldInfo if it exists Should be used internally by this class (only).

Parameters:
fieldInfo - the fieldInfo to convert
Returns:
the temporary fieldInfo or null if it could not be found

checkFields

public java.lang.String checkFields(LyObjectList objects)
Used to check the fields of the objects.

Parameters:
objects - the ojbects to check.
Returns:
the error message or null if there's not error.

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 LySimpleTableController
Returns:
Class representing the behavior interface of this controller.

getRealClassInfo

public LyClassInfo getRealClassInfo()
Return the classInfo used for the import.

Returns:
The temp classInfo.

setFile

public void setFile(java.lang.String file)
Sets the file to be used.

Parameters:
file - File path

setBuffer

public void setBuffer(java.lang.String buffer)
Set the buffer to be used to load objects.

Parameters:
buffer - the buffer containing the objects description

getFields

public LyInfoList<LyFieldInfo> getFields()
Accessor to the list of fields for import.

Overrides:
getFields in class LySimpleTableController
Returns:
the list of fields to be displayed in the import view
See Also:
LySimpleTableController.setFields(LyInfoList)

getClassInfo

public LyClassInfo getClassInfo()
Class info : content description. (application class)

Specified by:
getClassInfo in interface LyGetClassInfoInterface
Overrides:
getClassInfo in class LySimpleTableController
Returns:
the classInfo being shown in this table

setFields

public void setFields(LyInfoList<LyFieldInfo> fields)
Accessor to the list of fields for import.

Overrides:
setFields in class LySimpleTableController
Parameters:
fields - the list of fields to be read from the import file

setFieldSep

public void setFieldSep(java.lang.String fieldSep)
Sets the field separator to be used.

Parameters:
fieldSep - the field separator

setValueSep

public void setValueSep(java.lang.String valueSep)
Sets the value separator to be used.

Parameters:
valueSep - the multiple value separator

setImportType

public void setImportType(java.lang.String importType)
Sets the import type.

Parameters:
importType - The import type.

setOperations

public void setOperations(java.util.BitSet operations)
Sets the operations to be executed.

Parameters:
operations - a bitset containing operations to be executed. Operations may be one of the following:

setAllowOperations

public void setAllowOperations(boolean allowOperations)
Sets the parameter that indicates if operations field must be displayed.

Parameters:
allowOperations - true if operations field must be displayed, false otherwise.

allowOperations

public boolean allowOperations()
Returns a boolean that indicates if operations field must be displayed.

Returns:
true if operations field must be displayed, false otherwise.

setStartLine

public void setStartLine(int startLine)
Sets the start line.

Parameters:
startLine - the index of the first line of the imported file containing real data.

getImportedObjects

public LyObjectList getImportedObjects()
Deprecated. replaced by getTemporaryImportedObjects()

The list of temporary imported objects (not the real objects) To get the list of realObjects, importObjects(xxx) should be invoked with this list (or part of this list) of temporary objects.

Returns:
the list of temporary objects

getTemporaryImportedObjects

public LyObjectList getTemporaryImportedObjects()
Deprecated. Used by OLD_IMPORT only,

The list imported objects.

Returns:
the list of imported objects

getRealImportedObjects

public LyObjectList getRealImportedObjects()
The list of real imported objects since last loadData.

Returns:
the list of real objects

getObjectsToDelete

public LyObjectList getObjectsToDelete()
Return the list of objects that may be deleted during the import process.

Returns:
the list of objects that may be deleted during the import process.

buildRow

public LyRow buildRow(LyObject object,
                      LyInfoList<LyFieldInfo> fields,
                      LyInfoList<LyFieldInfo> statusFields)
Current builder of a new row.

Overrides:
buildRow in class LySimpleTableController
Parameters:
object - object added in the contextual list, and which should set the content of row cells.
fields - list of fields which should be seen.
statusFields - list of fields which may set the status icon.
Returns:
LyRow the new Row description (XML description) which is added in the LyTable component.
See Also:
LySimpleTableController.insertRow(leon.data.LyObject, int, boolean)

isStatusColumn

public boolean isStatusColumn(LyInfoList<LyFieldInfo> statusFields)
Check if the status column exists.

Overrides:
isStatusColumn in class LySimpleTableController
Parameters:
statusFields - (optional) list of status fields
Returns:
true

completeMessages

public void completeMessages(LyMessages messages,
                             int level)
Description copied from class: LyTableController
This method is invoked to enable the the area(s) to complete the message bar of the view and add its own message items.

Overrides:
completeMessages in class LyTableController
Parameters:
messages - messages bar
level - index of message
See Also:
LyTableController.completeMessages(leon.view.LyMessages, int)

completeMenuBar

public void completeMenuBar(LyMenuBar menuBar,
                            int level)
This method is invoked to enable the the area to complete the menuBar of the view and add its own menu items. Default implementation invokes the method on the builder instance.

Overrides:
completeMenuBar in class LyAreaController
Parameters:
menuBar - the menuBar structure
level - : level of current Controller. one of the LEVEL_XXX contants in LyViewController
See Also:
LyViewController

setViewController

public void setViewController(LyViewController viewController)
Accessor to the view controller of the area. The view controller is a Frame / dialog which contains this area. This method is reserved for internal use and should not be used by the application.

Overrides:
setViewController in class LyAreaController
Parameters:
viewController - the controller which manages the parent frame / dialog

updateTitleBar

public LyTitleBar updateTitleBar(java.lang.String image,
                                 java.lang.String title,
                                 java.lang.String contextTitle)
Update the title bar content (if any titlebar is associated with this area).

Overrides:
updateTitleBar in class LyAreaController
Parameters:
image - the image on the left side of the titlebar. If no image is given, try to get the image from the controller.
title - the string displayed on the left label of the titlebar. May be either a text message, or a String key found in the dictionnary (StringXXX.properties) files. if to title is given, try to get a title from the behavior (@see LyActionBehavior#getTitle).
contextTitle - the string displayed on the right side of the titlebar. May be either a text message, or a String key found in the dictionnary (StringXXX.properties) files. If no string is given, try to construct one from the current context (if any).
Returns:
the titlebar view component

fixColumn

public void fixColumn(int column)
Freeze or unFreeze a column.

Overrides:
fixColumn in class LySimpleTableController
Parameters:
column - column index to fix

getPanelComponent

public LyPanel getPanelComponent()
Accessor to panel component.

Overrides:
getPanelComponent in class LySimpleTableController
Returns:
the panel component
See Also:
LySimpleTableController.getTableComponent()

getTableComponent

public LyTable getTableComponent()
Accessor to the Table component.

Overrides:
getTableComponent in class LySimpleTableController
Returns:
the table component

menuDemand

public void menuDemand(LyMenuDemand demand)
Invoked when an menu item notification is sent to this listener.

This method overriden to create a popup menu : buildPopupMenu.

Overrides:
menuDemand in class LySimpleTableController
Parameters:
demand - demand parameters sent by the view component.
See Also:
LyController.demandPerformed(leon.view.event.LyDemand)

selectionDemand

public void selectionDemand(LySelectionDemand demand)
Invoked when a selection occurs. This method handles: select all, unselect all and objects by objects selection

Overrides:
selectionDemand in class LyMultiPageTableController
Parameters:
demand - selection event created from the view. User interaction.
See Also:
LyController.selectionDemand(leon.view.event.LySelectionDemand)

selectObject

public void selectObject(LyObject object,
                         boolean select,
                         boolean updateView,
                         boolean showSelected)
Select an object in the table.

Overrides:
selectObject in class LyTableController
Parameters:
object - selected or unselected object
select - new selection status
updateView - indicates if the view (tools, messages...) must be updated.
showSelected - indicates wether the view should scroll to the new selection status

selectRow

public int selectRow(LyFieldInfo fieldInfo,
                     java.lang.String pattern,
                     int from,
                     boolean next,
                     boolean substring,
                     boolean caseSensitive)
Description copied from class: LyMultiPageTableController
Select a row in the table for given parameters.

Overrides:
selectRow in class LyMultiPageTableController
Parameters:
fieldInfo - the fieldInfo to select
pattern - the search pattern
from - the start index for the search
next - true to find next row, false for previous
substring - true to find in substring
caseSensitive - true for case sensitive search
Returns:
the index of the selected row, -1 if none has been found
See Also:
LyMultiPageTableController.selectRow(leon.info.LyFieldInfo, java.lang.String, int, boolean, boolean, boolean)

updatePreferencesMenu

public void updatePreferencesMenu()
Update the preferences menuitem.

Overrides:
updatePreferencesMenu in class LyPanelController

objectChanged

public boolean objectChanged(LyWorkSpaceEvent event)
Called when an object has changed in the dynamic object list.

Specified by:
objectChanged in interface LyWorkSpaceListener
Overrides:
objectChanged in class LySimpleTableController
Parameters:
event - the workspace event
Returns:
true if event was handled
See Also:
LyWorkSpaceListener.objectChanged(leon.data.LyWorkSpaceEvent)

getControllerContext

public LyContext getControllerContext()
Gets the controller context.

Specified by:
getControllerContext in interface LyControllerContextInterface
Returns:
The controller context.
See Also:
LyControllerContextInterface.getControllerContext()

getControllerContext

public LyContext getControllerContext(LyController controller)
Get current controller context.

Specified by:
getControllerContext in interface LyControllerContextInterface2
Parameters:
controller - Controller wich is requesting the context
Returns:
current context or null if none is specified
See Also:
LyControllerContextInterface.getControllerContext()

showError

public void showError(java.lang.String message)
Show a popup message error box with the specified message. The message may be a text message, or the key to a String in the application disctionnary. (stringsXXX.properties files) This is a shortcut to getViewManager().showError()

Overrides:
showError in class LyController
Parameters:
message - the message to show
See Also:
LyViewManager, LyStrings

showView

public void showView()
Make the view visible to the user. The effect of this command depends on the nature of the application. If the display is a fat client (windows (awt) / swing) this methods should open a window and show the view. In the case of thin client (html), this prepares the pages which will be returned and displayed in the client browser.

For any display, this method should consider that the page is ready to be shown and should be displayed.

Overrides:
showView in class LyAreaController

showWarning

public void showWarning(java.lang.String message)
Show a popup message warning box with the specified message. The message may be a text message, or the key to a String in the application disctionnary. (stringsXXX.properties files) This is a shortcut to getViewManager().showWarning()

Overrides:
showWarning in class LyController
Parameters:
message - the message to show
See Also:
LyViewManager, LyStrings

updateViewFromValues

public void updateViewFromValues(LyDemand demand)
Update the view of the controller with the specified values from the demand (internal use) .

Overrides:
updateViewFromValues in class LyController
Parameters:
demand - demand parameters sent by the view component.

getLastErrorMessage

public java.lang.String getLastErrorMessage()
Accessor to the Last error that was shown during import This may be used to check by code if import was Ok.

Returns:
the last message or null if no error occured

workSpaceEventsGrouped

public boolean workSpaceEventsGrouped(java.util.ArrayList<LyWorkSpaceEvent> events)
Called when grouped events are sent.

Specified by:
workSpaceEventsGrouped in interface LyAdvancedWorkSpaceListener
Overrides:
workSpaceEventsGrouped in class LyPanelController
Parameters:
events - Sorted list of events.
Returns:
True if the events are used by the listener, false otherwise.
See Also:
LyAdvancedWorkSpaceListener.workSpaceEventsGrouped(java.util.ArrayList)

(c) January 2013 - W4 S.A.

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