|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openswing.swing.lookup.client.LookupController
Title: OpenSwing Framework
Description: Lookup controller.
Copyright: Copyright (C) 2006 Mauro Carniel
This file is part of OpenSwing Framework. This library is free software; you can redistribute it and/or modify it under the terms of the (LGPL) Lesser General Public License as published by the Free Software Foundation; GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be contacted at: maurocarniel@tin.it
Field Summary | |
boolean |
autoFitColumns
flag used to auto fit column sizes, according to text headers; default value: ClientSettings.AUTO_FIT_COLUMNS |
static int |
GRID_AND_FILTER_FRAME
constant used in "codeSelectionWindow" property to view a frame that contains a grid and a filter panel when pressing the lookup button |
static int |
GRID_AND_PANEL_FRAME
constant used in "codeSelectionWindow" property to view a frame that contains a grid and a custom panel when pressing the lookup button |
static int |
GRID_FRAME
constant used in "codeSelectionWindow" property to view a grid frame when pressing the lookup button |
static int |
ON_INVALID_CODE_CLEAR_CODE
constant used in "onInvalidCode" property to clear code on validation task that returns an invalid code |
static int |
ON_INVALID_CODE_RESTORE_FOCUS
constant used in "onInvalidCode" property to do nothing except restore focus inside the code input field on validation task that returns an invalid code |
static int |
ON_INVALID_CODE_RESTORE_LAST_VALID_CODE
constant used in "onInvalidCode" property to restore the last valid code (on "" if there no exists any valid code in the past) on validation task that returns an invalid code |
static int |
TREE_FRAME
constant used in "codeSelectionWindow" property to view a tree frame when pressing the lookup button |
static int |
TREE_GRID_AND_FILTER_FRAME
constant used in "codeSelectionWindow" property to view a frame that contains a tree+grid and a filter panel when pressing the lookup button |
static int |
TREE_GRID_AND_PANEL_FRAME
constant used in "codeSelectionWindow" property to view a frame that contains a tree+grid and a custom panel when pressing the lookup button |
static int |
TREE_GRID_FRAME
constant used in "codeSelectionWindow" property to view a tree+grid frame when pressing the lookup button |
Constructor Summary | |
LookupController()
|
Method Summary | |
void |
addComboFilter(java.lang.String attributeName,
ListFilterController filter)
Remove a combo-box filter for the specified column. |
void |
addLookup2ParentLink(java.lang.String parentAttributeName)
Add a link from the whole lookup value object to an equivalent inner v.o. included in the container v.o. |
void |
addLookup2ParentLink(java.lang.String lookupAttributeName,
java.lang.String parentAttributeName)
Add a link from an attribute of the lookup v.o. to an attribute of the lookup container v.o. |
void |
addLookupListener(LookupListener listener)
Add a lookup listener. |
void |
doubleClick(int rowNumber,
LookupParent lookupParent)
This method is automatically invoked by LookupGridController.doubleClick() method. |
void |
forceValidate()
Force the code validation: it calles fireForceValidateEvent method. |
int |
getAllColumnPreferredWidth()
|
int |
getCodeSelectionWindow()
|
CustomFilterPanel |
getCustomPanel()
|
Form |
getForm()
|
java.awt.Dimension |
getFramePreferedSize()
|
java.lang.String |
getFrameTitle()
|
java.lang.String |
getLookupAttributeName(java.lang.String parentAttributeName)
Method invoked by LookupAutoCompletitionDataLocator class, in order to retrieve the attribute in lookup value object mapped to the attribute of grid/form container. |
LookupDataLocator |
getLookupDataLocator()
|
LookupGridController |
getLookupGridController()
|
LookupListener[] |
getLookupListeners()
|
java.lang.String |
getLookupValueObjectClassName()
|
ValueObject |
getLookupVO()
|
int |
getMaxSortedColumns()
|
int |
getOnInvalidCode()
|
java.lang.Boolean |
isAllColumnsSelectable()
|
boolean |
isAllColumnVisible()
|
boolean |
isAllowTreeLeafSelectionOnly()
|
boolean |
isAnchorLastColumn()
|
boolean |
isAutoFitColumns()
|
boolean |
isCodeValid()
|
boolean |
isDisableFrameClosing()
|
boolean |
isGridCopyButton()
|
boolean |
isGridDeleteButton()
|
boolean |
isGridEditButton()
|
boolean |
isGridExportButton()
|
boolean |
isGridFilterButton()
|
boolean |
isGridInsertButton()
|
boolean |
isShowCustomErrorMessage()
|
boolean |
isShowErrorMessage()
|
boolean |
isShowNavigatorBar()
|
boolean |
isVisibleStatusPanel()
|
void |
openLookupFrame(javax.swing.JComponent source,
LookupParent lookupParent)
Method called by CodLookupControl when clicking on lookup button: it opens lookup frame (grid/tree/grid+tree frame). |
void |
openLookupFrame(javax.swing.JFrame parentFrame,
LookupParent lookupParent)
Method called by a grid column cell editor when user click on lookup button: it opens lookup frame (grid/tree/grid+tree frame). |
void |
removeComboFilter(java.lang.String attributeName)
Remove a combo-box filter for the specified column. |
void |
removeLookupListener(LookupListener listener)
Remove a lookup listener. |
void |
setAllColumnPreferredWidth(int preferredWidth)
Set columns width for the whole columns of the lookup grid frame. |
void |
setAllColumnsSelectable(java.lang.Boolean allColumnsSelectable)
Set the selectable property on all columns of lookup grid. |
void |
setAllColumnVisible(boolean visible)
Set column visibility for the whole columns of the lookup grid frame. |
void |
setAllowTreeLeafSelectionOnly(boolean allowTreeLeafSelectionOnly)
This is used when codeSelectionWindow is set to TREE_FRAME: it means that user can select only leaves (by double clicking) |
void |
setAnchorLastColumn(boolean anchorLastColumn)
Define if the last column must be anchored on the right margin of the grid, only when all columns width is lesser than grid width. |
void |
setAutoFitColumns(boolean autoFitColumns)
Set auto fit column sizes, according to text headers. |
void |
setCodeSelectionWindow(int codeSelectionWindow)
Set the code selection window. |
void |
setColumnEditableOnEdit(java.lang.String lookupAttributeName,
boolean editable)
Define if a column is editable in edit mode. |
void |
setColumnEditableOnInsert(java.lang.String lookupAttributeName,
boolean editable)
Define if a column is editable in insert mode. |
void |
setColumnRequired(java.lang.String lookupAttributeName,
boolean required)
Define if an editable column is required in insert/edit mode. |
void |
setColumnTextAlignment(java.lang.String lookupAttributeName,
int alignement)
Define column alignement in the lookup grid frame. |
void |
setCustomPanel(CustomFilterPanel customPanel)
Set the return custom filter panel to show on top of the lookup grid; this panel is showed only if "codeSelectionWindow" property is set to "xxx_AND_PANEL_FRAME" |
void |
setDisableFrameClosing(boolean disableFrameClosing)
Define if lookup grid frame must not be closed when selecting codes on it. |
void |
setDomainColumn(java.lang.String lookupAttributeName,
java.lang.String domainId)
Set domain identifier in a domain type column. |
void |
setFilterableColumn(java.lang.String lookupAttributeName,
boolean filterable)
Define if a column is filterable in the lookup grid frame. |
void |
setForm(Form form)
Method called by CodLookupControl to set the Form container panel. |
void |
setFormattedTextColumn(java.lang.String lookupAttributeName,
javax.swing.JFormattedTextField.AbstractFormatter formatter)
Set the formatter to a formatted text type column column. |
void |
setFramePreferedSize(java.awt.Dimension framePreferredSize)
Set the preferred size of the lookup frame. |
void |
setFrameTitle(java.lang.String frameTitle)
Set lookup frame title. |
void |
setGridCopyButton(boolean gridCopyButton)
Define if a copy button has to be added on top of the lookup grid; if set to true , then the GridLookupController instance must define insertRecords method. |
void |
setGridDeleteButton(boolean gridDeleteButton)
Define if a delete button has to be added on top of the lookup grid; if set to true , then the GridLookupController instance must define deleteRecords method. |
void |
setGridEditButton(boolean gridEditButton)
Define if an edit button has to be added on top of the lookup grid; if set to true , then the GridLookupController instance must define updateRecords method. |
void |
setGridExportButton(boolean gridExportButton)
Define if an export button has to be added on top of the lookup grid. |
void |
setGridFilterButton(boolean gridFilterButton)
Define if a filter button has to be added on top of the lookup grid. |
void |
setGridInsertButton(boolean gridInsertButton)
Define if an insert button has to be added on top of the lookup grid; if set to true , then the GridLookupController instance must define insertRecords method. |
void |
setGroupingEnabledColumn(java.lang.String lookupAttributeName,
boolean groupEnabled)
Set grouping setting in a numeric column. |
void |
setHeaderColumnName(java.lang.String lookupAttributeName,
java.lang.String name)
Set a column header in the lookup grid frame. |
void |
setLookupDataLocator(LookupDataLocator lookupDataLocator)
Set lookup data locator. |
void |
setLookupGridController(LookupGridController lookupGridController)
Set grid controller used with lookup grid or tree+grid frame. |
void |
setLookupValueObjectClassName(java.lang.String lookupValueObjectClassName)
Set value object class name associated to the lookup: this method calls initLookupVO method. |
void |
setMaxSortedColumns(int maxSortedColumns)
Set maximum number of sorted columns. |
void |
setOnInvalidCode(int onInvalidCode)
Define what to do in case of invalid code on validation task: clear code on input field or restore last invalid code in the input field or restore focus in the input field |
void |
setPreferredWidthColumn(java.lang.String lookupAttributeName,
int preferredWidth)
Set column width in the lookup grid frame. |
void |
setSelectableColumn(java.lang.String lookupAttributeName,
boolean selectable)
Set selectable column in the lookup grid frame. |
void |
setShowCustomErrorMessage(boolean showCustomErrorMessage)
Define if, in case of a validation task which returns an ErrorResponse, the error message must be showed instead of the standard behavior: do nothing and log error. |
void |
setShowErrorMessage(boolean showErrorMessage)
Define if, in case of a validation task which returns an ErrorResponse, the error message must be showed or not. |
void |
setShowNavigatorBar(boolean showNavigatorBar)
Define if the navigator bar must be showed on top of the lookup grid frame. |
void |
setSortableColumn(java.lang.String lookupAttributeName,
boolean sortable)
Define if a column is sortable in the lookup grid frame. |
void |
setSortedColumn(java.lang.String lookupAttributeName,
java.lang.String sortVersus)
Define if a column is sorted when the lookup grid frame is opened. |
void |
setSortedColumn(java.lang.String lookupAttributeName,
java.lang.String sortVersus,
int sortingOrder)
Define if a column is sorted when the lookup grid frame is opened. |
void |
setVisibleColumn(java.lang.String lookupAttributeName,
boolean visible)
Set column visibility in the lookup grid frame. |
void |
setVisibleStatusPanel(boolean visibleStatusPanel)
Set status panel visibility. |
void |
validateCode(javax.swing.JComponent parentComponent,
java.lang.String code,
LookupParent lookupParent)
Execute the code validation. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int GRID_FRAME
public static final int TREE_FRAME
public static final int TREE_GRID_FRAME
public static final int GRID_AND_FILTER_FRAME
public static final int TREE_GRID_AND_FILTER_FRAME
public static final int GRID_AND_PANEL_FRAME
public static final int TREE_GRID_AND_PANEL_FRAME
public static final int ON_INVALID_CODE_CLEAR_CODE
public static final int ON_INVALID_CODE_RESTORE_LAST_VALID_CODE
public static final int ON_INVALID_CODE_RESTORE_FOCUS
public boolean autoFitColumns
ClientSettings.AUTO_FIT_COLUMNS
Constructor Detail |
public LookupController()
Method Detail |
public final void validateCode(javax.swing.JComponent parentComponent, java.lang.String code, LookupParent lookupParent) throws RestoreFocusOnInvalidCodeException
parentComponent
- component which contains the code input fieldcode
- code to validate
true
if code is correcly validated, false
otherwise
RestoreFocusOnInvalidCodeException
public final void openLookupFrame(javax.swing.JComponent source, LookupParent lookupParent)
public final void openLookupFrame(javax.swing.JFrame parentFrame, LookupParent lookupParent)
parentFrame
- parent framelookupParent
- lookup containerpublic final void doubleClick(int rowNumber, LookupParent lookupParent)
public final void setVisibleColumn(java.lang.String lookupAttributeName, boolean visible)
lookupAttributeName
- attribute name that identifies the grid columnvisible
- column visibility statepublic final void setSelectableColumn(java.lang.String lookupAttributeName, boolean selectable)
lookupAttributeName
- attribute name that identifies the grid columnpublic final void setPreferredWidthColumn(java.lang.String lookupAttributeName, int preferredWidth)
lookupAttributeName
- attribute name that identifies the grid columnpreferredWidth
- column widthpublic final java.lang.String getFrameTitle()
public final void setFrameTitle(java.lang.String frameTitle)
frameTitle
- lookup frame titlepublic final void addLookupListener(LookupListener listener)
listener
- lookup listener.public final LookupListener[] getLookupListeners()
public final void removeLookupListener(LookupListener listener)
listener
- lookup listenerpublic final boolean isAllColumnVisible()
public final void setAllColumnVisible(boolean visible)
visible
- columns visibilitypublic final int getAllColumnPreferredWidth()
public final void setAllColumnPreferredWidth(int preferredWidth)
preferredWidth
- columns widthpublic final java.awt.Dimension getFramePreferedSize()
public final void setFramePreferedSize(java.awt.Dimension framePreferredSize)
framePreferredSize
- preferred size of the lookup framepublic final void forceValidate()
public final void setForm(Form form)
form
- Form container panelpublic final Form getForm()
public final void setHeaderColumnName(java.lang.String lookupAttributeName, java.lang.String name)
lookupAttributeName
- attribute name that identifies the columnname
- column header namepublic final void setGroupingEnabledColumn(java.lang.String lookupAttributeName, boolean groupEnabled)
lookupAttributeName
- attribute name that identifies the columngroupEnabled
- flag used to grouping in a numeric columnpublic final void setDomainColumn(java.lang.String lookupAttributeName, java.lang.String domainId)
lookupAttributeName
- attribute name that identifies the columndomainId
- domain identifierpublic final void setFormattedTextColumn(java.lang.String lookupAttributeName, javax.swing.JFormattedTextField.AbstractFormatter formatter)
lookupAttributeName
- attribute name that identifies the columnformatter
- formatter to use for this columnpublic final void setSortableColumn(java.lang.String lookupAttributeName, boolean sortable)
lookupAttributeName
- attribute name that identifies the columnsortable
- true
if the column is sortable, false
otherwisepublic final void setFilterableColumn(java.lang.String lookupAttributeName, boolean filterable)
lookupAttributeName
- attribute name that identifies the columnfilterable
- true
if the column is filterable, false
otherwisepublic final void setSortedColumn(java.lang.String lookupAttributeName, java.lang.String sortVersus)
setSortedColumn(String lookupAttributeName,String sortVersus,int sortingOrder)
method.
lookupAttributeName
- attribute name that identifies the columnsortVersus
- ascending/descending ordering versus; possible values: Consts.ASC_SORTED or Consts.DESC_SORTEDpublic final void setSortedColumn(java.lang.String lookupAttributeName, java.lang.String sortVersus, int sortingOrder)
lookupAttributeName
- attribute name that identifies the columnsortVersus
- ascending/descending ordering versus; possible values: Consts.ASC_SORTED or Consts.DESC_SORTEDsortingOrder
- sorting order (e.g. 0, 1, 2, ...)public final void setColumnTextAlignment(java.lang.String lookupAttributeName, int alignement)
lookupAttributeName
- attribute name that identifies the columnpublic final void setColumnEditableOnInsert(java.lang.String lookupAttributeName, boolean editable)
lookupAttributeName
- attribute name that identifies the columneditable
- true
if the column is editable in insert mode, false
otherwisepublic final void setColumnEditableOnEdit(java.lang.String lookupAttributeName, boolean editable)
lookupAttributeName
- attribute name that identifies the columneditable
- true
if the column is editable in edit mode, false
otherwisepublic final void setColumnRequired(java.lang.String lookupAttributeName, boolean required)
lookupAttributeName
- attribute name that identifies the columnrequired
- true
if the editable column is required, false
otherwisepublic final void setMaxSortedColumns(int maxSortedColumns)
maxSortedColumns
- maximum number of sorted columnspublic final int getMaxSortedColumns()
public final void addLookup2ParentLink(java.lang.String lookupAttributeName, java.lang.String parentAttributeName)
lookupAttributeName
- attribute of the lookup v.o.parentAttributeName
- attribute of the lookup container v.o.public final void addLookup2ParentLink(java.lang.String parentAttributeName)
parentAttributeName
- attribute of the lookup container v.o., related to an inner v.o. having the same type of the lookup v.o.public final java.lang.String getLookupAttributeName(java.lang.String parentAttributeName)
parentAttributeName
- parent attribute name included in mapping
public final LookupDataLocator getLookupDataLocator()
public final void setLookupDataLocator(LookupDataLocator lookupDataLocator)
lookupDataLocator
- lookup data locatorpublic final void setLookupValueObjectClassName(java.lang.String lookupValueObjectClassName)
public final java.lang.String getLookupValueObjectClassName()
public final int getCodeSelectionWindow()
public final void setCodeSelectionWindow(int codeSelectionWindow)
codeSelectionWindow
- three values are allowed: GRID_FRAME, TREE_FRAME and TREE_GRID_FRAMEpublic final boolean isAllowTreeLeafSelectionOnly()
public final void setAllowTreeLeafSelectionOnly(boolean allowTreeLeafSelectionOnly)
allowTreeLeafSelectionOnly
- user can select only leaves (by double clicking)public final ValueObject getLookupVO()
public final int getOnInvalidCode()
public final void setOnInvalidCode(int onInvalidCode)
onInvalidCode
- define what to do in case of invalid code on validation task; possible values: ON_INVALID_CODE_xxxpublic final boolean isCodeValid()
public boolean isAnchorLastColumn()
public void setAnchorLastColumn(boolean anchorLastColumn)
false
anchorLastColumn
- flag used to anchor the last column on the right margin of the grid, only when all columns width is lesser than grid widthpublic final CustomFilterPanel getCustomPanel()
public final void setCustomPanel(CustomFilterPanel customPanel)
customPanel
- return custom filter panel to show on top of the lookup gridpublic final LookupGridController getLookupGridController()
public final void setLookupGridController(LookupGridController lookupGridController)
lookupGridController
- grid controller used with lookup grid or tree+grid framepublic final boolean isGridCopyButton()
true
, then the GridLookupController instance must define insertRecords methodpublic final boolean isGridDeleteButton()
true
, then the GridLookupController instance must define deleteRecords methodpublic final boolean isGridEditButton()
true
, then the GridLookupController instance must define updateRecords methodpublic final boolean isGridExportButton()
public final boolean isGridFilterButton()
public final boolean isGridInsertButton()
true
, then the GridLookupController instance must define insertRecords methodpublic final void setGridInsertButton(boolean gridInsertButton)
true
, then the GridLookupController instance must define insertRecords method.
gridInsertButton
- define if an insert button has to be added on top of the lookup gridpublic final void setGridFilterButton(boolean gridFilterButton)
gridFilterButton
- define if a filter button has to be added on top of the lookup gridpublic final void setGridExportButton(boolean gridExportButton)
gridExportButton
- define if an export button has to be added on top of the lookup gridpublic final void setGridEditButton(boolean gridEditButton)
true
, then the GridLookupController instance must define updateRecords method.
gridEditButton
- define if an edit button has to be added on top of the lookup gridpublic final void setGridDeleteButton(boolean gridDeleteButton)
true
, then the GridLookupController instance must define deleteRecords method.
gridDeleteButton
- define if a delete button has to be added on top of the lookup gridpublic final void setGridCopyButton(boolean gridCopyButton)
true
, then the GridLookupController instance must define insertRecords method.
gridCopyButton
- define if a copy button has to be added on top of the lookup gridpublic final void addComboFilter(java.lang.String attributeName, ListFilterController filter)
attributeName
- attribute name that identifies the column having a filter to removepublic final void removeComboFilter(java.lang.String attributeName)
attributeName
- attribute name that identifies the column having a filter to removepublic final java.lang.Boolean isAllColumnsSelectable()
public final void setAllColumnsSelectable(java.lang.Boolean allColumnsSelectable)
public final boolean isAutoFitColumns()
public final void setAutoFitColumns(boolean autoFitColumns)
ClientSettings.AUTO_FIT_COLUMNS
autoFitColumns
- used to auto fit column sizes, according to text headerspublic final void setShowNavigatorBar(boolean showNavigatorBar)
showNavigatorBar
- true
to show the navigator bar on top of the grid lookup framepublic final boolean isShowNavigatorBar()
false
public final boolean isDisableFrameClosing()
false
, i.e. frame will be closed when selecting a codepublic final void setDisableFrameClosing(boolean disableFrameClosing)
false
, i.e. frame will be closed when selecting a code.
If this property is set to true
then the lookup frame is not automatically closed
disableFrameClosing
- define if lookup grid frame must not be closed when selecting codes on itpublic final void setVisibleStatusPanel(boolean visibleStatusPanel)
visibleStatusPanel
- true
to show the status panel, false
to hide the status panelpublic final boolean isVisibleStatusPanel()
public final boolean isShowCustomErrorMessage()
public final void setShowCustomErrorMessage(boolean showCustomErrorMessage)
false
, i.e. do not show a custom error message
showCustomErrorMessage
- true
to show the error message in case of validation task which returns an ErrorResponsepublic final boolean isShowErrorMessage()
true
if the error message must be showed in case of a validation task which returns an ErrorResponsepublic final void setShowErrorMessage(boolean showErrorMessage)
true
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |