|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.control.LyController
leon.control.LyAreaController
leon.control.LyPanelController
leon.control.LySimpleTableController
leon.control.LyTableController
leon.control.LyMultiPageTableController
leon.control.LyImportTableController
public class LyImportTableController
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.
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.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.LyPanelController |
---|
buildFilter, closeBorderPanel, endFilter, getFilter, getFilterController, getFilterEditorController, getPreference, getRefreshTime, isFilterActive, isHorizontal, objectUserEvent, setFilter, setIdle, setRefreshTime |
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 |
---|
public static final java.lang.String __VERSION
public static int DEFAULT_ROW_IMAGE_SIZE
public static final java.lang.String DEMAND_IMPORT_SELECT_ALL
public static final java.lang.String DEMAND_IMPORT_SELECTION
public static final java.lang.String DEMAND_IMPORT_ALL
public static final java.lang.String DEMAND_VIEW_IMPORTED
public boolean OLD_IMPORT
Constructor Detail |
---|
public LyImportTableController(LySession session, LyController parent, LyAction action, LyClassInfo classInfo)
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 importpublic LyImportTableController(LySession session, LyController parent, LyAction action, LyClassInfo classInfo, boolean withoutGui)
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 importMethod Detail |
---|
public void free(LyController controller)
free
in class LySimpleTableController
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.LyAreaController.free()
public LyBuilder getBuilder()
getBuilder
in class LyAreaController
public LyComponent getComponent()
getComponent
in class LyController
public LyView getView()
getView
in class LyController
public void reset(boolean full)
reset
in class LyMultiPageTableController
full
- Boolean indicating if a full reset (including reset of datas) is requiered or not
(only reset graphical area).public LyViewController getViewController()
getViewController
in class LyAreaController
public void hideView(boolean free)
This method should consider that the page is closed and should disappear.
hideView
in class LyAreaController
free
- Indicates if only HIDDEN, not FREED (true).public LyImportContentXmlController importContentXmlFactory(LySession session, LyController parent, LyAction action)
session
- The current session.parent
- The parent of the build controller.action
- The action definition for import.
public LyImportController getImportControllerParent()
public LyAction getImportAction()
public boolean loadData()
public boolean loadData(boolean full)
full
- indicates if a full reload must be performed.
public void actionDemand(LyActionDemand demand)
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
actionDemand
in class LyMultiPageTableController
demand
- demand parameters sent by the view component.LyController.demandPerformed(leon.view.event.LyDemand)
public void importObjects(LyObjectList objects)
objects
- the list of objects to importcommit()
,
rollbackNonImportedObjects()
,
rollback()
public void importObjects(LyObjectList objects, boolean importErrors)
objects
- the list of objects to importimportErrors
- indicates if we accept to import objects in error.commit()
,
rollbackNonImportedObjects()
,
rollback()
public LyImportBehavior getImportBehavior()
public void setImportBehavior(LyImportBehavior importBehavior)
importBehavior
- the LyImportBehaviorpublic LyObject createObjectFromImportedObject(LyObject object)
object
- an imported object
public LyContext.Status commit()
importObjects(leon.data.LyObjectList)
,
rollbackNonImportedObjects()
,
rollback()
public void rollback()
importObjects(leon.data.LyObjectList)
,
rollbackNonImportedObjects()
,
commit()
public LyObject getRealObject(LyObject importObject)
importObject
- the temporary object read from import file
public LyInfoList<LyFieldInfo> isSameObject(LyObject importObject)
importObject
- the 'real' object instance for content comparizon
public boolean isDeletedObject(LyObject importObject)
importObject
- the imported object instance for the check
public boolean isNewObject(LyObject importObject)
importObject
- the imported object instance for the check
public LyFieldInfo checkRealFieldInfo(LyFieldInfo fieldInfo)
fieldInfo
- the fieldInfo to convert
public LyFieldInfo getLocalFieldInfo(LyFieldInfo fieldInfo)
fieldInfo
- the fieldInfo to convert
public java.lang.String checkFields(LyObjectList objects)
objects
- the ojbects to check.
public java.lang.Class<?> getBehaviorInterface()
getBehaviorInterface
in class LySimpleTableController
public LyClassInfo getRealClassInfo()
public void setFile(java.lang.String file)
file
- File pathpublic void setBuffer(java.lang.String buffer)
buffer
- the buffer containing the objects descriptionpublic LyInfoList<LyFieldInfo> getFields()
getFields
in class LySimpleTableController
LySimpleTableController.setFields(LyInfoList)
public LyClassInfo getClassInfo()
getClassInfo
in interface LyGetClassInfoInterface
getClassInfo
in class LySimpleTableController
public void setFields(LyInfoList<LyFieldInfo> fields)
setFields
in class LySimpleTableController
fields
- the list of fields to be read from the import filepublic void setFieldSep(java.lang.String fieldSep)
fieldSep
- the field separatorpublic void setValueSep(java.lang.String valueSep)
valueSep
- the multiple value separatorpublic void setImportType(java.lang.String importType)
importType
- The import type.public void setOperations(java.util.BitSet operations)
operations
- a bitset containing operations to be executed. Operations may be one of the
following:
public void setAllowOperations(boolean allowOperations)
allowOperations
- true if operations field must be displayed, false otherwise.public boolean allowOperations()
public void setStartLine(int startLine)
startLine
- the index of the first line of the imported file containing real data.public LyObjectList getImportedObjects()
public LyObjectList getTemporaryImportedObjects()
public LyObjectList getRealImportedObjects()
public LyObjectList getObjectsToDelete()
public LyRow buildRow(LyObject object, LyInfoList<LyFieldInfo> fields, LyInfoList<LyFieldInfo> statusFields)
buildRow
in class LySimpleTableController
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.
LySimpleTableController.insertRow(leon.data.LyObject, int, boolean)
public boolean isStatusColumn(LyInfoList<LyFieldInfo> statusFields)
isStatusColumn
in class LySimpleTableController
statusFields
- (optional) list of status fields
public void completeMessages(LyMessages messages, int level)
LyTableController
completeMessages
in class LyTableController
messages
- messages barlevel
- index of messageLyTableController.completeMessages(leon.view.LyMessages, int)
public void completeMenuBar(LyMenuBar menuBar, int level)
completeMenuBar
in class LyAreaController
menuBar
- the menuBar structurelevel
- : level of current Controller. one of the LEVEL_XXX contants in
LyViewControllerLyViewController
public void setViewController(LyViewController viewController)
setViewController
in class LyAreaController
viewController
- the controller which manages the parent frame / dialogpublic LyTitleBar updateTitleBar(java.lang.String image, java.lang.String title, java.lang.String contextTitle)
updateTitleBar
in class LyAreaController
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).
public void fixColumn(int column)
fixColumn
in class LySimpleTableController
column
- column index to fixpublic LyPanel getPanelComponent()
getPanelComponent
in class LySimpleTableController
LySimpleTableController.getTableComponent()
public LyTable getTableComponent()
getTableComponent
in class LySimpleTableController
public void menuDemand(LyMenuDemand demand)
This method overriden to create a popup menu : buildPopupMenu.
menuDemand
in class LySimpleTableController
demand
- demand parameters sent by the view component.LyController.demandPerformed(leon.view.event.LyDemand)
public void selectionDemand(LySelectionDemand demand)
selectionDemand
in class LyMultiPageTableController
demand
- selection event created from the view. User interaction.LyController.selectionDemand(leon.view.event.LySelectionDemand)
public void selectObject(LyObject object, boolean select, boolean updateView, boolean showSelected)
selectObject
in class LyTableController
object
- selected or unselected objectselect
- new selection statusupdateView
- indicates if the view (tools, messages...) must be updated.showSelected
- indicates wether the view should scroll to the new selection statuspublic int selectRow(LyFieldInfo fieldInfo, java.lang.String pattern, int from, boolean next, boolean substring, boolean caseSensitive)
LyMultiPageTableController
selectRow
in class LyMultiPageTableController
fieldInfo
- the fieldInfo to selectpattern
- the search patternfrom
- the start index for the searchnext
- true to find next row, false for previoussubstring
- true to find in substringcaseSensitive
- true for case sensitive search
LyMultiPageTableController.selectRow(leon.info.LyFieldInfo, java.lang.String, int, boolean, boolean, boolean)
public void updatePreferencesMenu()
updatePreferencesMenu
in class LyPanelController
public boolean objectChanged(LyWorkSpaceEvent event)
objectChanged
in interface LyWorkSpaceListener
objectChanged
in class LySimpleTableController
event
- the workspace event
LyWorkSpaceListener.objectChanged(leon.data.LyWorkSpaceEvent)
public LyContext getControllerContext()
getControllerContext
in interface LyControllerContextInterface
LyControllerContextInterface.getControllerContext()
public LyContext getControllerContext(LyController controller)
getControllerContext
in interface LyControllerContextInterface2
controller
- Controller wich is requesting the context
LyControllerContextInterface.getControllerContext()
public void showError(java.lang.String message)
showError
in class LyController
message
- the message to showLyViewManager
,
LyStrings
public void showView()
For any display, this method should consider that the page is ready to be shown and should be displayed.
showView
in class LyAreaController
public void showWarning(java.lang.String message)
showWarning
in class LyController
message
- the message to showLyViewManager
,
LyStrings
public void updateViewFromValues(LyDemand demand)
updateViewFromValues
in class LyController
demand
- demand parameters sent by the view component.public java.lang.String getLastErrorMessage()
public boolean workSpaceEventsGrouped(java.util.ArrayList<LyWorkSpaceEvent> events)
workSpaceEventsGrouped
in interface LyAdvancedWorkSpaceListener
workSpaceEventsGrouped
in class LyPanelController
events
- Sorted list of events.
LyAdvancedWorkSpaceListener.workSpaceEventsGrouped(java.util.ArrayList)
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |