org.openswing.swing.client
Class ExpandableRowController

java.lang.Object
  extended byorg.openswing.swing.client.ExpandableRowController

public class ExpandableRowController
extends java.lang.Object

Title: OpenSwing Framework

Description: controller used to manage row expansion in grid control.

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
ExpandableRowController()
           
 
Method Summary
 javax.swing.JComponent getComponentToShow(VOListTableModel model, int rowNum)
           
 java.awt.Component getFocusableComponent(javax.swing.JComponent showedComponent)
           
 boolean isRowExpandable(VOListTableModel model, int rowNum)
           
 boolean removeShowedComponent(VOListTableModel model, int rowNum, javax.swing.JComponent showedComponent)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpandableRowController

public ExpandableRowController()
Method Detail

isRowExpandable

public boolean isRowExpandable(VOListTableModel model,
                               int rowNum)
Parameters:
model - grid model
rowNum - the current row number
Returns:
true if the current row must be expanded, false otherwise

getComponentToShow

public javax.swing.JComponent getComponentToShow(VOListTableModel model,
                                                 int rowNum)
Parameters:
model - grid model
rowNum - the current row number
Returns:
JComponent to show when expanding row; null to do not show anything

removeShowedComponent

public boolean removeShowedComponent(VOListTableModel model,
                                     int rowNum,
                                     javax.swing.JComponent showedComponent)
Parameters:
model - grid model
rowNum - the current row number that is just collapsed
showedComponent - component to remove
Returns:
true to detach the component from internal cache; false to store the collapsed component in cache This callback method is automatically invoked when the component must be collapsed and can be used also to perfom additional operations to correctly dispose the component. When returned value is true, the grid removes the component from cache, so reducing the amount of memory required by the application; a drawback is that re-expansion of the same row requires to recreate the component, i.e. the invokation of "getComponentToShow" method again. When returned value is false, the grid mantains the component into its internal cache, this will increase the amount of memory required by the application, but avoid to re-create the component for future expansions of the same row, i.e. "getComponentToShow" method is not invoked twice for the same row.

getFocusableComponent

public java.awt.Component getFocusableComponent(javax.swing.JComponent showedComponent)
Parameters:
showedComponent - component currently showed
Returns:
component that will receive focus when showing frame; null to do not set focus automatically