org.opensubsystems.inventory.application.swt
Class ItemTable

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by org.opensubsystems.inventory.application.swt.CategorizedItemsTable
                      extended by org.opensubsystems.inventory.application.swt.ItemTable
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable, org.opensubsystems.patterns.listdata.util.AsyncDataLoaderOwner

public class ItemTable
extends CategorizedItemsTable

Table displaying list of items in the inventory.

Version:
$Id: ItemTable.java,v 1.9 2007/03/24 08:33:31 bastafidli Exp $
Author:
Miro Halas
Code reviewer:
Miro Halas
Code reviewed:
1.6 2006/04/05 05:20:51 bastafidli

Field Summary
static int AVAILABLE_COUNT_COLUMN
          Column, which displays available count.
static int DIFF_COUNT_COLUMN
          Column, which displays difference between available and shipped count.
protected  org.opensubsystems.patterns.thickclient.application.swt.ToggleButtonSelectionAdapter m_adapter
          Adapter used to selet if the item is ordered or not.
protected  int m_iTableVersion
          Table version value for async data loader
static int OUT_COUNT_COLUMN
          Column, which displays out count, which is count of items users borrowed.
protected static java.text.NumberFormat s_currencyFormat
          Formatting object used to format currencies.
 
Fields inherited from class org.opensubsystems.inventory.application.swt.CategorizedItemsTable
DISPLAY_INVENTORY, DISPLAY_ISSUED, DISPLAY_ISSUED_WITHOUT_FILTERS, DISPLAY_UNKNOVN, FIND_BUTTONS, m_allItemsButton, m_allMainCategories, m_allSubCategories, m_arMainCategoryButtons, m_arSubCategoryButtons, m_categoryRow, m_defaultInventory, m_displayedDataType, m_extraFiltersButton, m_findItemsButton, m_issuedItemsButton, m_likeText, m_loader, m_mainCategoryOptions, m_missingItemsButton, m_module, m_nextMainCategories, m_nextSubCategories, m_permanentItemsButton, m_permFilterState, m_previousMainCategories, m_previousSubCategories, m_recentItemsButton, m_selectedCategoriesLabel, m_selectedMainCategories, m_selectedSubCategories, m_setListeners, m_shippedItemsButton, m_showButtonsState, m_specialFlags, m_subCategoryOptions, m_subCategoryRow, m_table, MAIN_CATEGORY_COLUMNS, MAIN_CATEGORY_COUNT, MAX_FIND_LENGTH_TEXT, SF_ISSUED, SF_NOMISSING, SF_NONE, SF_NORECENT, SF_PERMANENT, SHOW_ALL, SHOW_DEFAULT, SHOW_ISSUED, SHOW_MISSING, SHOW_NONE, SHOW_RECENT, SHOW_SHIPPED, SUB_CATEGORY_COUNT
 
Fields inherited from class org.eclipse.swt.widgets.Composite
embeddedHandle
 
Fields inherited from class org.eclipse.swt.widgets.Widget
handle
 
Constructor Summary
ItemTable(org.eclipse.swt.widgets.Composite parent, InventoryModule module, Inventory defaultInventory, java.util.Map selectedCategories, java.util.Map selectedSubCategories, int[] showStatus, int displayedDataType)
          Constructor.
 
Method Summary
 void allDataLoaded(org.opensubsystems.patterns.listdata.util.AsyncDataLoader loader)
          
 org.opensubsystems.patterns.listdata.data.ListOptions getInitialListOptions(org.opensubsystems.patterns.listdata.util.AsyncDataLoader loader, org.opensubsystems.patterns.listdata.data.ListOptions defaultOptions)
          
 int getSelectedItemId()
          Get id of the selected item
protected  void loadItems()
          Load items asynchronously.
 void processData(org.opensubsystems.patterns.listdata.util.AsyncDataLoader loader, java.util.List lstDataToAdd, int iOriginalObjectVersion)
          
 void refresh()
          Refresh screen by reloading all items.
protected  void setSelectedItemValue(java.lang.String strNewAvailableValue, java.lang.String strNewDiffValue, java.lang.Integer iItemId, org.eclipse.swt.graphics.Color newColor)
          Set new value for the selected item.
protected  void startNumberPad(java.lang.String strValue)
          Function opens number pad dialog
 
Methods inherited from class org.opensubsystems.inventory.application.swt.CategorizedItemsTable
addCategorizedItemsTableListener, allItemsButton, categoriesLoaded, findItems, getListController, getSelectedCategoryId, getSelectedSubcategoryId, getTable, isPermanentState, issuedItemsButton, loadMainCategories, loadNextMainCategories, loadNextSubcategories, loadPreviousMainCategories, loadPreviousSubcategories, loadSubcategories, missingItemsButton, notifyCategorySelected, permanentItemsButton, recentItemsButton, removeCategorizedItemsTableListener, setTableLabel, shippedItemsButton, showAllCategories, showAllSubCategories, stopLoading, updateMainCategoryControls, updateMainCategoryControlState, updateSubCategoryControls, updateSubCategoryControlState
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, getChildren, getClientArea, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getBorderWidth, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AVAILABLE_COUNT_COLUMN

public static final int AVAILABLE_COUNT_COLUMN
Column, which displays available count.

See Also:
Constant Field Values

OUT_COUNT_COLUMN

public static final int OUT_COUNT_COLUMN
Column, which displays out count, which is count of items users borrowed.

See Also:
Constant Field Values

DIFF_COUNT_COLUMN

public static final int DIFF_COUNT_COLUMN
Column, which displays difference between available and shipped count.

See Also:
Constant Field Values

s_currencyFormat

protected static java.text.NumberFormat s_currencyFormat
Formatting object used to format currencies.


m_iTableVersion

protected int m_iTableVersion
Table version value for async data loader


m_adapter

protected org.opensubsystems.patterns.thickclient.application.swt.ToggleButtonSelectionAdapter m_adapter
Adapter used to selet if the item is ordered or not.

Constructor Detail

ItemTable

public ItemTable(org.eclipse.swt.widgets.Composite parent,
                 InventoryModule module,
                 Inventory defaultInventory,
                 java.util.Map selectedCategories,
                 java.util.Map selectedSubCategories,
                 int[] showStatus,
                 int displayedDataType)
          throws org.opensubsystems.core.error.OSSException
Constructor.

Parameters:
parent - - who is parent of this table
module - - module displaying this table
defaultInventory - - Inventory which is used in the system.
selectedCategories - - what categories are selected in the list of items. Key is the id, category is the value;
selectedSubCategories - - what subcategories are selected in the list of items. Key is the id, category is the value;
showStatus - - which show button will be toggled
displayedDataType - - which data are displayed : Inventory, Receiving
Throws:
org.opensubsystems.core.error.OSSException - - an error initializing the screen
Method Detail

getInitialListOptions

public org.opensubsystems.patterns.listdata.data.ListOptions getInitialListOptions(org.opensubsystems.patterns.listdata.util.AsyncDataLoader loader,
                                                                                   org.opensubsystems.patterns.listdata.data.ListOptions defaultOptions)


processData

public void processData(org.opensubsystems.patterns.listdata.util.AsyncDataLoader loader,
                        java.util.List lstDataToAdd,
                        int iOriginalObjectVersion)


allDataLoaded

public void allDataLoaded(org.opensubsystems.patterns.listdata.util.AsyncDataLoader loader)


getSelectedItemId

public int getSelectedItemId()
Get id of the selected item

Returns:
int - id of the selected item or DataObject.NEW_ID if no item is selected

refresh

public void refresh()
Refresh screen by reloading all items.


loadItems

protected void loadItems()
Load items asynchronously.

Specified by:
loadItems in class CategorizedItemsTable

startNumberPad

protected void startNumberPad(java.lang.String strValue)
Function opens number pad dialog

Parameters:
strValue - - initial value in the dialog

setSelectedItemValue

protected void setSelectedItemValue(java.lang.String strNewAvailableValue,
                                    java.lang.String strNewDiffValue,
                                    java.lang.Integer iItemId,
                                    org.eclipse.swt.graphics.Color newColor)
Set new value for the selected item.

Parameters:
strNewAvailableValue - - new value for the current selected item available count
strNewDiffValue - - new value for the current selected item out count
iItemId - - id of data to set
newColor - - new color of the item


Copyright © 2003 - 2006 OpenSubsystems s.r.o.