|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openswing.swing.table.client.GridController
Title: OpenSwing Framework
Description: Grid 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
Constructor Summary | |
GridController()
|
Method Summary | |
void |
afterDeleteGrid()
Callback method invoked after deleting data when the grid was in READONLY mode (on pressing delete button). |
void |
afterEditGrid(GridControl grid)
Callback method invoked after saving data when the grid was in EDIT mode (on pressing save button). |
void |
afterInsertGrid(GridControl grid)
Callback method invoked after saving data when the grid was in INSERT mode (on pressing save button). |
void |
afterReloadGrid()
Callback method invoked after data reloading (on pressing reload/cancel button). |
boolean |
beforeCopyGrid(GridControl grid)
Callback method invoked on pressing COPY button. |
boolean |
beforeDeleteGrid(GridControl grid)
Callback method invoked before deleting data when the grid was in READONLY mode (on pressing delete button). |
boolean |
beforeEditGrid(GridControl grid)
Callback method invoked on pressing EDIT button. |
java.lang.Object |
beforeFilterGrid(java.lang.String attributeName,
java.lang.Object value)
Callback method invoked by grid when applying a quick filter condition or a filter condition from filter panel: before executing search it is possible to change filtering value passed as argument, by returning another value. |
boolean |
beforeInsertGrid(GridControl grid)
Callback method invoked on pressing INSERT button. |
java.lang.Object |
beforeRetrieveAdditionalRows(java.lang.String attributeName,
java.lang.String textToSearch)
Callback method invoked by grid when attempting to search for the specified text in additional rows not yet loaded in grid: this method can be used to convert the text to search in the correct format, before grid executes the search and load additional data. |
void |
createValueObject(ValueObject valueObject)
Callback method invoked when the user has clicked on the insert button |
Response |
deleteRecords(java.util.ArrayList persistentObjects)
Method invoked when the user has clicked on delete button and the grid is in READONLY mode. |
void |
doubleClick(int rowNumber,
ValueObject persistentObject)
Callback method invoked when the user has double clicked on the selected row of the grid. |
void |
dragDropEnd()
This message goes to DragSourceListener, informing it that the dragging has ended. |
boolean |
dragEnabled()
Method called on beginning a drag event. |
void |
dragEnter()
This message goes to DragSourceListener, informing it that the dragging has entered the DropSite. |
void |
dragExit()
This message goes to DragSourceListener, informing it that the dragging has exited the DropSite. |
void |
dragOver()
This message goes to DragSourceListener, informing it that the dragging is currently ocurring over the DropSite. |
void |
dropActionChanged()
This method is invoked when the user changes the dropAction. |
boolean |
dropEnabled(java.lang.String gridId)
Method called on firing a drop event onto the grid. |
void |
dropEnter()
This method is invoked when you are dragging over the DropSite. |
void |
dropExit()
This method is invoked when you are exit the DropSite without dropping. |
void |
dropOver(int row)
This method is invoked when a drag operation is going on. |
void |
enterButton(int rowNumber,
ValueObject persistentObject)
Callback method invoked when the user has pressed ENTER button on the selected row of the grid. |
void |
exportGrid(ExportOptions exportOptions)
Callback method invoked by grid when exporting data from grid. |
java.awt.Color |
getBackgroundColor(int row,
java.lang.String attributeName,
java.lang.Object value)
Method used to define the background color for each cell of the grid. |
java.lang.String |
getCellTooltip(int row,
java.lang.String attributeName)
|
java.awt.Color |
getDeltaColor()
|
int |
getDeltaRow()
|
java.awt.Dimension |
getExportDialogSize(java.awt.Dimension dialogSize)
Callback method invoked by grid before showing exporting dialog; this method can be overrided to redefine dialog size |
java.lang.String[] |
getExportingFormats()
Callback method invoked by grid before showing exporting dialog; this method can be overrided to redefine document formats allowed for the grid |
java.awt.Font |
getFont(int row,
java.lang.String attributeName,
java.lang.Object value,
java.awt.Font defaultFont)
Method used to define the font to use for each cell of the grid. |
java.awt.Color |
getForegroundColor(int row,
java.lang.String attributeName,
java.lang.Object value)
Method used to define the foreground color for each cell of the grid. |
java.lang.String |
getHeaderTooltip(java.lang.String attributeName)
|
java.lang.Object |
getInitialQuickFilterValue(java.lang.String attributeName,
java.lang.Object initialValue)
Callback method invoked by grid before showing quick filter panel. |
Response |
insertRecords(int[] rowNumbers,
java.util.ArrayList newValueObjects)
Method invoked when the user has clicked on save button and the grid is in INSERT mode. |
boolean |
isCellEditable(GridControl grid,
int row,
java.lang.String attributeName)
|
void |
loadDataCompleted(boolean error)
Callback method invoked when the data loading is completed. |
void |
modeChanged(int currentMode)
Callback method invoked each time the grid mode is changed. |
void |
rowChanged(int rowNumber)
Callback method invoked when the user has selected another row. |
void |
selectedCell(int rowNumber,
int columnIndex,
java.lang.String attributedName,
ValueObject persistentObject)
Callback method invoked when a grid cell is selected. |
void |
setDeltaColor(java.awt.Color deltaColor)
Set the background cell color used when deltaRow>0. |
void |
setDeltaRow(int deltaRow)
Consente di definire la proprieta' che consente di definire un delta di righe colorate; valore di default: 0 (nessun delta). |
Response |
updateRecords(int[] rowNumbers,
java.util.ArrayList oldPersistentObjects,
java.util.ArrayList persistentObjects)
Method invoked when the user has clicked on save button and the grid is in EDIT mode. |
boolean |
validateCell(int rowNumber,
java.lang.String attributeName,
java.lang.Object oldValue,
java.lang.Object newValue)
Callback method invoked each time a cell is edited: this method define if the new value is valid. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GridController()
Method Detail |
public void enterButton(int rowNumber, ValueObject persistentObject)
rowNumber
- selected row indexpersistentObject
- v.o. related to the selected rowpublic void doubleClick(int rowNumber, ValueObject persistentObject)
rowNumber
- selected row indexpersistentObject
- v.o. related to the selected rowpublic void selectedCell(int rowNumber, int columnIndex, java.lang.String attributedName, ValueObject persistentObject)
rowNumber
- selected row indexcolumnIndex
- column index related to the column currently selectedattributedName
- attribute name related to the column currently selectedpersistentObject
- v.o. related to the selected rowpublic java.awt.Color getBackgroundColor(int row, java.lang.String attributeName, java.lang.Object value)
attributeName
- attribute name related to the column currently selectedvalue
- object contained in the selected cell
public java.awt.Color getForegroundColor(int row, java.lang.String attributeName, java.lang.Object value)
attributeName
- attribute name related to the column currently selectedvalue
- object contained in the selected cell
public boolean validateCell(int rowNumber, java.lang.String attributeName, java.lang.Object oldValue, java.lang.Object newValue)
rowNumber
- selected row indexattributeName
- attribute name related to the column currently selectedoldValue
- old cell value (before cell editing)newValue
- new cell value (just edited)
true
if cell value is valid, false
otherwisepublic int getDeltaRow()
public void setDeltaRow(int deltaRow)
deltaRow
- proprieta' che consente di definire un delta di righe coloratepublic java.awt.Color getDeltaColor()
public void setDeltaColor(java.awt.Color deltaColor)
deltaColor
- background cell colorpublic Response insertRecords(int[] rowNumbers, java.util.ArrayList newValueObjects) throws java.lang.Exception
rowNumbers
- row indexes related to the new rows to savenewValueObjects
- list of new value objects to save
java.lang.Exception
public Response updateRecords(int[] rowNumbers, java.util.ArrayList oldPersistentObjects, java.util.ArrayList persistentObjects) throws java.lang.Exception
rowNumbers
- row indexes related to the changed/new rowsoldPersistentObjects
- old value objects, previous the changes; it can contains null objects, in case of new inserted rowspersistentObjects
- value objects related to the changed/new rows
java.lang.Exception
public Response deleteRecords(java.util.ArrayList persistentObjects) throws java.lang.Exception
persistentObjects
- value objects to delete (related to the currently selected rows)
java.lang.Exception
public void createValueObject(ValueObject valueObject) throws java.lang.Exception
valueObject
- empty value object just created: the user can manage it to fill some attribute values
java.lang.Exception
public void loadDataCompleted(boolean error)
error
- true
if data loading has terminated with errors, false
otherwisepublic void rowChanged(int rowNumber)
rowNumber
- selected row indexpublic void afterReloadGrid()
public boolean beforeCopyGrid(GridControl grid)
true
allows to go to INSERT mode (by copying data), false
the mode change is interruptedpublic boolean beforeEditGrid(GridControl grid)
true
allows to go to EDIT mode, false
the mode change is interruptedpublic boolean beforeInsertGrid(GridControl grid)
true
allows to go to INSERT mode, false
the mode change is interruptedpublic boolean beforeDeleteGrid(GridControl grid)
true
allows the deleting to continue, false
the deleting is interruptedpublic void afterEditGrid(GridControl grid)
public void afterInsertGrid(GridControl grid)
public void afterDeleteGrid()
public void modeChanged(int currentMode)
currentMode
- current grid modepublic boolean isCellEditable(GridControl grid, int row, java.lang.String attributeName)
grid
- gridrow
- selected row indexattributeName
- attribute name that identifies the selected grid column
true
if the selected cell is editable, false
otherwisepublic java.awt.Font getFont(int row, java.lang.String attributeName, java.lang.Object value, java.awt.Font defaultFont)
attributeName
- attribute name related to the column currently selectedvalue
- object contained in the selected celldefaultFont
- default font currently in used with this column
public java.lang.String getHeaderTooltip(java.lang.String attributeName)
attributeName
- attribute name that identify a grid column
public java.lang.String getCellTooltip(int row, java.lang.String attributeName)
row
- row index in the gridattributeName
- attribute name that identify a grid column
public java.lang.Object getInitialQuickFilterValue(java.lang.String attributeName, java.lang.Object initialValue)
attributeName
- attribute name that identify the column just filteredinitialValue
- initial value to show within the quick filter panel
public java.lang.Object beforeFilterGrid(java.lang.String attributeName, java.lang.Object value)
attributeName
- attribute name that identify the column just filteredvalue
- current filtering value
public java.awt.Dimension getExportDialogSize(java.awt.Dimension dialogSize)
dialogSize
- default dimension of exporting dialog
public java.lang.String[] getExportingFormats()
public void exportGrid(ExportOptions exportOptions)
exportOptions
- options used to export data; these options can be programmatically changed, in order to customize exporting resultpublic java.lang.Object beforeRetrieveAdditionalRows(java.lang.String attributeName, java.lang.String textToSearch)
attributeName
- attribute name that identify the column used in search
public boolean dragEnabled()
true
, dragging can continue, false
drag is not allowed; default value: true
public boolean dropEnabled(java.lang.String gridId)
gridId
- identifier of the source grid (grid that generate a draf event)
true
, drop is allowed, false
drop is not allowed; default value: true
public void dragEnter()
public void dragExit()
public void dragOver()
public void dropActionChanged()
public void dragDropEnd()
public void dropEnter()
public void dropExit()
public void dropOver(int row)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |