org.salespointframework.desktop.formsheets
Class ListViewFormSheet

java.lang.Object
  extended by org.salespointframework.core.FormSheet
      extended by org.salespointframework.desktop.formsheets.ListViewFormSheet

public class ListViewFormSheet
extends FormSheet

The List view formsheet represents a JList with an Slider for dynamic cell scaling and a JModelFilter for search. This FormSheet can be used for Catalogs, Stocks, UserManagers as well as for DataBaskets. The View provides four different orientations defined by ListViewOrientation enumeration. as renderer you can use any ListCellRenderer. The use of the AbstractListViewRenderer is recommended. There already exists a set of derived classes for special rendering tasks

Since:
4.0
Author:
Thomas Kissinger
See Also:
JList, AbstractListViewRenderer, CatalogListViewRenderer, CountingStockListViewRenderer, StoringStockListViewRenderer, DataBasketListViewRenderer, JUserList.UserListCellRenderer

Nested Class Summary
private static class ListViewFormSheet.SLVFSContentCreator
          Abstract content creator for the ListViewFormSheet
 
Nested classes/interfaces inherited from class org.salespointframework.core.FormSheet
FormSheet.FormButton
 
Field Summary
private  DataBasket db
          Databasket used for visibility
private  JListView listView
          internal JListView reference
private  int[] selection
          current selection index
private  java.lang.Object source
          source of JListView
private  UIGate uiGate
          the UIGate, the formsheet is attached to
 
Fields inherited from class org.salespointframework.core.FormSheet
BTNID_CANCEL, BTNID_OK, BUTTONBAR_BOTTOM, BUTTONBAR_LEFT, BUTTONBAR_NONE, BUTTONBAR_RIGHT, BUTTONBAR_TOP, m_fCancelled
 
Constructor Summary
ListViewFormSheet(java.lang.String caption, UIGate uiGate, FormSheetContentCreator fscc)
          Default constructor
 
Method Summary
static ListViewFormSheet create(java.lang.String caption)
          Creates a new instance of ListViewFormSheet from a UserManager source uses UserManager.getInstance() as source
static ListViewFormSheet create(java.lang.String caption, Catalog c)
          create an instance of ListViewFormSheet from a Catalog source
static ListViewFormSheet create(java.lang.String caption, Catalog c, DataBasket db)
          create an instance of ListViewFormSheet from a Catalog source
static ListViewFormSheet create(java.lang.String caption, CountingStock stock)
          create a new instance of ListViewFormSheet from a CountingStock source
static ListViewFormSheet create(java.lang.String caption, CountingStock stock, DataBasket db)
          create a new instance of ListViewFormSheet from a CountingStock source
static ListViewFormSheet create(java.lang.String caption, DataBasket db)
          creates a new instance of ListViewFormSheet from a DataBasket source
static ListViewFormSheet create(java.lang.String caption, DataBasket db, DataBasketCondition dbc)
          creates a new instance of ListViewFormSheet from a DataBasket source
static ListViewFormSheet create(java.lang.String caption, StoringStock stock)
          creates a new instance of ListViewFormSheet from a StoringStock source
static ListViewFormSheet create(java.lang.String caption, StoringStock stock, DataBasket db)
          creates a new instance of ListViewFormSheet from a StoringStock source
static ListViewFormSheet create(java.lang.String caption, UIGate uiGate, Catalog c, DataBasket db, java.util.Comparator<CatalogItem> cmp, JListView.ListViewOrientation orientation, javax.swing.ListCellRenderer renderer)
          create an instance of ListViewFormSheet from a Catalog source
static ListViewFormSheet create(java.lang.String caption, UIGate uiGate, Catalog c, DataBasket db, java.util.Comparator<CatalogItem> cmp, JListView.ListViewOrientation orientation, javax.swing.ListCellRenderer renderer, boolean categorize, Category defaultCategory)
          create an instance of ListViewFormSheet from a Catalog source
static ListViewFormSheet create(java.lang.String caption, UIGate uiGate, CountingStock stock, DataBasket db, java.util.Comparator<CatalogItem> cmp, boolean showZeros, JListView.ListViewOrientation orientation, javax.swing.ListCellRenderer renderer)
          create a new instance of ListViewFormSheet from a CountingStock source
static ListViewFormSheet create(java.lang.String caption, UIGate uiGate, CountingStock stock, DataBasket db, java.util.Comparator<CatalogItem> cmp, boolean showZeros, JListView.ListViewOrientation orientation, javax.swing.ListCellRenderer renderer, boolean categorize, Category defaulCategory)
          create a new instance of ListViewFormSheet from a CountingStock source
static ListViewFormSheet create(java.lang.String caption, UIGate uiGate, DataBasket db, DataBasketCondition dbc, java.util.Comparator<DataBasketEntry> cmp, JListView.ListViewOrientation orientation, javax.swing.ListCellRenderer renderer)
          creates a new instance of ListViewFormSheet from a DataBasket source
static ListViewFormSheet create(java.lang.String caption, UIGate uiGate, DataBasket db, DataBasketCondition dbc, java.util.Comparator<DataBasketEntry> cmp, JListView.ListViewOrientation orientation, javax.swing.ListCellRenderer renderer, boolean categorize, Category defaulCategory, DataBasketEntryGrouper dbeg)
          creates a new instance of ListViewFormSheet from a DataBasket source
static ListViewFormSheet create(java.lang.String caption, UIGate uiGate, StoringStock stock, DataBasket db, java.util.Comparator<StockItem> cmp, JListView.ListViewOrientation orientation, javax.swing.ListCellRenderer renderer)
          creates a new instance of ListViewFormSheet from a StoringStock source
static ListViewFormSheet create(java.lang.String caption, UIGate uiGate, StoringStock stock, DataBasket db, java.util.Comparator<StockItem> cmp, JListView.ListViewOrientation orientation, javax.swing.ListCellRenderer renderer, boolean categorize, Category defaultCategory)
          creates a new instance of ListViewFormSheet from a StoringStock source
static ListViewFormSheet create(java.lang.String caption, UIGate uiGate, UserManager um, UserFilter filter, java.util.Comparator<User> cmp, JListView.ListViewOrientation orientation, javax.swing.ListCellRenderer renderer)
          Creates a new instance of ListViewFormSheet from a UserManager source
static ListViewFormSheet create(java.lang.String caption, UIGate uiGate, UserManager um, UserFilter filter, java.util.Comparator<User> cmp, JListView.ListViewOrientation orientation, javax.swing.ListCellRenderer renderer, boolean categorize, Category defaulCategory)
          Creates a new instance of ListViewFormSheet from a UserManager source
 DataBasket getDataBasket()
          get databasket used for visibility
 UIGate getGate()
          get UIGate the formsheet is attached to
 JListView getListView()
          get JListView component
 java.lang.Object getSelectedItem()
          get the currently selected item
 java.lang.Object getSource()
          get listview source
 void setCellConstraints(float minimum, float maximum, float initial, float cellRatio)
          set the cell constraints.
 void setGate(UIGate uiGate)
          set the uigate, the formsheet is attached to
 
Methods inherited from class org.salespointframework.core.FormSheet
addButton, addButton, addContentCreator, attach, attach, attach, buttonIterator, buttonIterator, cancel, close, copyFormSheetDnDComponents, customizeButtonbar, detachDisplay, detachProcess, detachSalesPoint, fillBtnPanel, getButton, getButtonbarPosition, getButtonsLock, getCaption, getComponent, getComponentLock, getDisplay, getDisplayLock, getDragLayer, getModalLayer, getPopupLayer, getProcess, getSalesPoint, getWrappedComponent, isCancelled, letFollowComponentOnDragLayer, ok, paintButtonBarBackground, registerDnDComponent, removeAllButtons, removeAllDndComponents, removeButton, removeDnDComponent, setButtonbarPosition, setCaption, setComponent, setFormsheetCustomizationListener, setWaitResponse, stopFollowComponentOnDragLayer, toString, waitResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

uiGate

private UIGate uiGate
the UIGate, the formsheet is attached to


selection

private int[] selection
current selection index


listView

private JListView listView
internal JListView reference


source

private java.lang.Object source
source of JListView


db

private DataBasket db
Databasket used for visibility

Constructor Detail

ListViewFormSheet

public ListViewFormSheet(java.lang.String caption,
                         UIGate uiGate,
                         FormSheetContentCreator fscc)
Default constructor

Parameters:
caption - formsheet caption
uiGate - uigate, the formsheet will be attached to
fscc - additional FormSheetContentCreator
Method Detail

setGate

public void setGate(UIGate uiGate)
set the uigate, the formsheet is attached to

Parameters:
uiGate - new UIGate

getGate

public UIGate getGate()
get UIGate the formsheet is attached to

Returns:

getListView

public JListView getListView()
get JListView component

Returns:

getSource

public java.lang.Object getSource()
get listview source

Returns:

getDataBasket

public DataBasket getDataBasket()
get databasket used for visibility

Returns:

getSelectedItem

public java.lang.Object getSelectedItem()
get the currently selected item

Returns:
item or null if nothing is selected

setCellConstraints

public void setCellConstraints(float minimum,
                               float maximum,
                               float initial,
                               float cellRatio)
set the cell constraints.

Parameters:
minimum - minimum of slider range
maximum - maximum of slider range
initial - initial slider position
cellRatio - aspect ration of cell
See Also:
JListView.setCellConstraints(float, float, float, float)

create

public static ListViewFormSheet create(java.lang.String caption,
                                       Catalog c)
create an instance of ListViewFormSheet from a Catalog source

Parameters:
caption - FormSheet caption
c - Catalog source
Returns:
new instance of ListViewFormSheet

create

public static ListViewFormSheet create(java.lang.String caption,
                                       Catalog c,
                                       DataBasket db)
create an instance of ListViewFormSheet from a Catalog source

Parameters:
caption - FormSheet caption
c - Catalog source
db - DataBasket used for visibility
Returns:
new instance of ListViewFormSheet

create

public static ListViewFormSheet create(java.lang.String caption,
                                       UIGate uiGate,
                                       Catalog c,
                                       DataBasket db,
                                       java.util.Comparator<CatalogItem> cmp,
                                       JListView.ListViewOrientation orientation,
                                       javax.swing.ListCellRenderer renderer)
create an instance of ListViewFormSheet from a Catalog source

Parameters:
caption - FormSheet caption
c - Catalog source
db - DataBasket used for visibility
cmp - comparator to use for sorting. comparator should be aware of categories.
orientation - orientation of list
renderer - cell renderer to use
Returns:
new instance of ListViewFormSheet

create

public static ListViewFormSheet create(java.lang.String caption,
                                       UIGate uiGate,
                                       Catalog c,
                                       DataBasket db,
                                       java.util.Comparator<CatalogItem> cmp,
                                       JListView.ListViewOrientation orientation,
                                       javax.swing.ListCellRenderer renderer,
                                       boolean categorize,
                                       Category defaultCategory)
create an instance of ListViewFormSheet from a Catalog source

Parameters:
caption - FormSheet caption
c - Catalog source
db - DataBasket used for visibility
cmp - comparator to use for sorting. comparator should be aware of categories if categorize is true.
orientation - orientation of list
renderer - cell renderer to use
categorize - true if categories should be displayed
defaultCategory - default category for items with no category
Returns:
new instance of ListViewFormSheet

create

public static ListViewFormSheet create(java.lang.String caption,
                                       CountingStock stock)
create a new instance of ListViewFormSheet from a CountingStock source

Parameters:
caption - FormSheet caption
stock - source for list
Returns:
new instance of ListViewFormSheet

create

public static ListViewFormSheet create(java.lang.String caption,
                                       CountingStock stock,
                                       DataBasket db)
create a new instance of ListViewFormSheet from a CountingStock source

Parameters:
caption - FormSheet caption
stock - source for list
db - databasket used for visibility
Returns:
new instance of ListViewFormSheet

create

public static ListViewFormSheet create(java.lang.String caption,
                                       UIGate uiGate,
                                       CountingStock stock,
                                       DataBasket db,
                                       java.util.Comparator<CatalogItem> cmp,
                                       boolean showZeros,
                                       JListView.ListViewOrientation orientation,
                                       javax.swing.ListCellRenderer renderer)
create a new instance of ListViewFormSheet from a CountingStock source

Parameters:
caption - FormSheet caption
stock - source for list
db - databasket used for visibility
cmp - Comparator used for sorting. should be aware of categories.
showZeros - show items with zero count
uiGate - UIgate to attach this FormSheet
orientation - list orientation
renderer - renderer used for cell rendering
Returns:
new instance of ListViewFormSheet

create

public static ListViewFormSheet create(java.lang.String caption,
                                       UIGate uiGate,
                                       CountingStock stock,
                                       DataBasket db,
                                       java.util.Comparator<CatalogItem> cmp,
                                       boolean showZeros,
                                       JListView.ListViewOrientation orientation,
                                       javax.swing.ListCellRenderer renderer,
                                       boolean categorize,
                                       Category defaulCategory)
create a new instance of ListViewFormSheet from a CountingStock source

Parameters:
caption - FormSheet caption
stock - source for list
db - databasket used for visibility
cmp - Comparator used for sorting. should be aware of categories, if categorize is true.
showZeros - show items with zero count
uiGate - UIgate to attach this FormSheet
orientation - list orientation
renderer - renderer used for cell rendering
categorize - display categories
defaulCategory - category used for items with no category set.
Returns:
new instance of ListViewFormSheet

create

public static ListViewFormSheet create(java.lang.String caption,
                                       StoringStock stock)
creates a new instance of ListViewFormSheet from a StoringStock source

Parameters:
caption - FormSheet caption
stock - StoringStock source
Returns:
a new instance of ListViewFormSheet

create

public static ListViewFormSheet create(java.lang.String caption,
                                       StoringStock stock,
                                       DataBasket db)
creates a new instance of ListViewFormSheet from a StoringStock source

Parameters:
caption - FormSheet caption
stock - StoringStock source
db - Databasket used for visibility
Returns:
a new instance of ListViewFormSheet

create

public static ListViewFormSheet create(java.lang.String caption,
                                       UIGate uiGate,
                                       StoringStock stock,
                                       DataBasket db,
                                       java.util.Comparator<StockItem> cmp,
                                       JListView.ListViewOrientation orientation,
                                       javax.swing.ListCellRenderer renderer)
creates a new instance of ListViewFormSheet from a StoringStock source

Parameters:
caption - FormSheet caption
stock - StoringStock source
db - Databasket used for visibility
uiGate - UIgate the FormSheet wille be attached to
cmp - Comparator used for sorting. should be aware of categories.
orientation - listview orientation
renderer - cell renderer
Returns:
a new instance of ListViewFormSheet

create

public static ListViewFormSheet create(java.lang.String caption,
                                       UIGate uiGate,
                                       StoringStock stock,
                                       DataBasket db,
                                       java.util.Comparator<StockItem> cmp,
                                       JListView.ListViewOrientation orientation,
                                       javax.swing.ListCellRenderer renderer,
                                       boolean categorize,
                                       Category defaultCategory)
creates a new instance of ListViewFormSheet from a StoringStock source

Parameters:
caption - FormSheet caption
stock - StoringStock source
db - Databasket used for visibility
uiGate - UIgate the FormSheet wille be attached to
cmp - Comparator used for sorting. should be aware of categories.
orientation - listview orientation
renderer - cell renderer
categorize - if true, categories will be displayed in list
defaultCategory - category used for items with no Category set.
Returns:
a new instance of ListViewFormSheet

create

public static ListViewFormSheet create(java.lang.String caption)
Creates a new instance of ListViewFormSheet from a UserManager source uses UserManager.getInstance() as source

Parameters:
caption - FormSheet caption
Returns:
a new instance of ListViewFormSheet

create

public static ListViewFormSheet create(java.lang.String caption,
                                       UIGate uiGate,
                                       UserManager um,
                                       UserFilter filter,
                                       java.util.Comparator<User> cmp,
                                       JListView.ListViewOrientation orientation,
                                       javax.swing.ListCellRenderer renderer)
Creates a new instance of ListViewFormSheet from a UserManager source

Parameters:
caption - FormSheet caption
uiGate - UIGate the FormSheet will be attached to
um - usermanager to use a source
filter - filters users
cmp - Comparator used for sorting. should be aware of categories.
orientation - orientation of listview
renderer - cell renderer
Returns:
a new instance of ListViewFormSheet

create

public static ListViewFormSheet create(java.lang.String caption,
                                       UIGate uiGate,
                                       UserManager um,
                                       UserFilter filter,
                                       java.util.Comparator<User> cmp,
                                       JListView.ListViewOrientation orientation,
                                       javax.swing.ListCellRenderer renderer,
                                       boolean categorize,
                                       Category defaulCategory)
Creates a new instance of ListViewFormSheet from a UserManager source

Parameters:
caption - FormSheet caption
uiGate - UIGate the FormSheet will be attached to
um - usermanager to use a source
filter - filters users
cmp - Comparator used for sorting. should be aware of categories.
orientation - orientation of listview
renderer - cell renderer
categorize - if true, categories will be displayed. otherwise not.
defaulCategory - category used for items with no category set
Returns:
a new instance of ListViewFormSheet

create

public static ListViewFormSheet create(java.lang.String caption,
                                       DataBasket db)
creates a new instance of ListViewFormSheet from a DataBasket source

Parameters:
caption - FormSheet caption
db - list source
Returns:
a new instance of ListViewFormSheet

create

public static ListViewFormSheet create(java.lang.String caption,
                                       DataBasket db,
                                       DataBasketCondition dbc)
creates a new instance of ListViewFormSheet from a DataBasket source

Parameters:
caption - FormSheet caption
db - list source
dbc - condition for filtering DataBasketEntrys
Returns:
a new instance of ListViewFormSheet

create

public static ListViewFormSheet create(java.lang.String caption,
                                       UIGate uiGate,
                                       DataBasket db,
                                       DataBasketCondition dbc,
                                       java.util.Comparator<DataBasketEntry> cmp,
                                       JListView.ListViewOrientation orientation,
                                       javax.swing.ListCellRenderer renderer)
creates a new instance of ListViewFormSheet from a DataBasket source

Parameters:
caption - FormSheet caption
db - list source
dbc - condition for filtering DataBasketEntrys
uiGate - UIgate the FormSheet will be attached to
cmp - Comparator used for entry sorting. should be aware of categories.
orientation - listview orientation
renderer - cell renderer
Returns:
a new instance of ListViewFormSheet

create

public static ListViewFormSheet create(java.lang.String caption,
                                       UIGate uiGate,
                                       DataBasket db,
                                       DataBasketCondition dbc,
                                       java.util.Comparator<DataBasketEntry> cmp,
                                       JListView.ListViewOrientation orientation,
                                       javax.swing.ListCellRenderer renderer,
                                       boolean categorize,
                                       Category defaulCategory,
                                       DataBasketEntryGrouper dbeg)
creates a new instance of ListViewFormSheet from a DataBasket source

Parameters:
caption - FormSheet caption
db - list source
dbc - condition for filtering DataBasketEntrys
uiGate - UIgate the FormSheet will be attached to
cmp - Comparator used for entry sorting. should be aware of categories.
orientation - listview orientation
renderer - cell renderer
categorize - true, if categories should be displayed
defaulCategory - category used for items with no category set
the - DataBasketEntryGrouper
Returns:
a new instance of ListViewFormSheet