org.opensubsystems.inventory.application.swt
Class ItemBasicPage

java.lang.Object
  extended by org.opensubsystems.inventory.application.swt.ItemBasicPage

public class ItemBasicPage
extends java.lang.Object

Basic information page of item dialog. TODO: ThickClient: This page doesn't allow to multiselect subcategories. If user is using mouse he should be able to do multiple at once.

Version:
$Id: ItemBasicPage.java,v 1.9 2007/01/07 06:14:07 bastafidli Exp $
Author:
Martin Cerba
Code reviewer:
Miro Halas
Code reviewed:
1.6 2006/04/05 05:18:27 bastafidli

Field Summary
protected static int AVAILABLE_FIELD
          Offset of field in the field arrays
protected static int DESCRIPTION_FIELD
          Offset of field in the field arrays
protected  org.eclipse.swt.widgets.Button m_addSub
          Add subcategory button.
protected  java.util.List m_availableSubCategoriesList
          List of all available subcategories for root category.
protected  org.eclipse.swt.widgets.List m_availableSubs
          List with available subcategories for main category.
protected  org.eclipse.swt.widgets.Button[] m_buttons
          Set of buttons next to the controls to edit the data.
protected  org.eclipse.swt.widgets.Combo m_categoryComboBox
          Main category selection combo box.
protected  org.eclipse.swt.widgets.Composite m_clientArea
          Client area containing all the other controls.
protected  int m_currentAvailableValue
          Current available value.
protected  int m_iInventoryId
          Inventory in the item should exist.
protected  ItemDialog m_itemDialog
          Dialog this gui is representing.
protected  org.eclipse.swt.widgets.Label[] m_labels
          Set of labels next to the controls.
protected  org.eclipse.swt.widgets.Button m_removeSub
          Remove subcategory button.
protected  int[] m_rootCategoryIds
          Ids of root categories loaded into the category combo box.
protected  java.util.List m_selectedSubCategoriesList
          List of selected subcategories.We need to store the entire categories in here so that we have access to display order attribute to order the categories correctly, therefore this list stores Category objects.
protected  org.eclipse.swt.widgets.List m_selectedSubs
          List with selected subcategories for main category.
protected  java.util.Set m_setListeners
          Set where all listeners listening to the event notifications specific to this object are stored.
protected  org.eclipse.swt.widgets.Text[] m_texts
          Set of text edit fields to edit data in.
protected static int NAME_STEM_FIELD
          Offset of field in the field arrays
protected static int REUSABLE_FIELD
          Offset of field in the field arrays
protected static int SHIPPED_FIELD
          Offset of field in the field arrays
protected static int SIZE_FIELD
          Offset of field in the field arrays
 
Constructor Summary
ItemBasicPage()
           
 
Method Summary
 void addItemBasicPageListener(ItemBasicPageListener listener)
          Add listener for this dialog.
protected  void addSubcategories()
          Add selected subcategory from available list to selected list.
 org.eclipse.swt.widgets.Composite createClientArea(ItemDialog itemDialog, org.eclipse.swt.widgets.TabFolder tab, Item itemData, int iRootCategoryId, java.util.List lstSubcategoryIds)
          Create client area of this page.
 int getAvailableCount()
           
 int getCategoryId()
           
 java.lang.String getDescription()
           
protected  org.opensubsystems.patterns.listdata.logic.ListController getListController()
          Get list controller to use.
 java.lang.String getNameStem()
           
 boolean getReusable()
           
 int getShippedCount()
           
 java.lang.String getSize()
           
 int[] getSubcategoryIds()
           
protected  void loadCategories(int iRootCategoryId)
          Load categories into a category combo box and select current category.
protected  void loadSubcategories(int iCategoryId, java.util.List lstSubcategoryIds)
          Load all subcategories to available list and clear selected list
 void modifyAvailableCount(int iDifference)
          Modify available item count value by a specified amount.
protected  void notifySetConsumable(boolean bNewState)
          Notify all listeners when consumable flag changes.
 void removeItemTypeBasicPageListener(ItemBasicPageListener listener)
          Remove listener from this dialog.
protected  void removeSubcategories()
          Remove selected subcategory from selected to available list
 void setAvailableCount(int iCount)
          Set available count value.
 void setIdentificationCount(int iCount)
          Number of identifications and therefore uniquely identifiable items has changed so readjust the values on this page.
 void setShippedCount(int iCount)
          Set shipped count value.
protected  void startCharacterPad(java.lang.String strTitle, java.lang.String strFirstLineText, int iFieldToEdit)
          Starts character pad dialog to edit textual value of a field.
protected  void startNumberPad(java.lang.String strTitle, java.lang.String strFirstLineText, int iFieldToEdit)
          Starts number pad dialog to edit numeric value of a field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_STEM_FIELD

protected static final int NAME_STEM_FIELD
Offset of field in the field arrays

See Also:
Constant Field Values

SIZE_FIELD

protected static final int SIZE_FIELD
Offset of field in the field arrays

See Also:
Constant Field Values

DESCRIPTION_FIELD

protected static final int DESCRIPTION_FIELD
Offset of field in the field arrays

See Also:
Constant Field Values

REUSABLE_FIELD

protected static final int REUSABLE_FIELD
Offset of field in the field arrays

See Also:
Constant Field Values

SHIPPED_FIELD

protected static final int SHIPPED_FIELD
Offset of field in the field arrays

See Also:
Constant Field Values

AVAILABLE_FIELD

protected static final int AVAILABLE_FIELD
Offset of field in the field arrays

See Also:
Constant Field Values

m_setListeners

protected java.util.Set m_setListeners
Set where all listeners listening to the event notifications specific to this object are stored.


m_labels

protected org.eclipse.swt.widgets.Label[] m_labels
Set of labels next to the controls.


m_texts

protected org.eclipse.swt.widgets.Text[] m_texts
Set of text edit fields to edit data in.


m_buttons

protected org.eclipse.swt.widgets.Button[] m_buttons
Set of buttons next to the controls to edit the data.


m_categoryComboBox

protected org.eclipse.swt.widgets.Combo m_categoryComboBox
Main category selection combo box.


m_availableSubs

protected org.eclipse.swt.widgets.List m_availableSubs
List with available subcategories for main category.


m_selectedSubs

protected org.eclipse.swt.widgets.List m_selectedSubs
List with selected subcategories for main category.


m_addSub

protected org.eclipse.swt.widgets.Button m_addSub
Add subcategory button.


m_removeSub

protected org.eclipse.swt.widgets.Button m_removeSub
Remove subcategory button.


m_iInventoryId

protected int m_iInventoryId
Inventory in the item should exist.


m_rootCategoryIds

protected int[] m_rootCategoryIds
Ids of root categories loaded into the category combo box.


m_availableSubCategoriesList

protected java.util.List m_availableSubCategoriesList
List of all available subcategories for root category. We need to store the entire categories in here so that we have access to display order attribute to order the categories correctly, therefore this list stores Category objects.


m_selectedSubCategoriesList

protected java.util.List m_selectedSubCategoriesList
List of selected subcategories.We need to store the entire categories in here so that we have access to display order attribute to order the categories correctly, therefore this list stores Category objects.


m_currentAvailableValue

protected int m_currentAvailableValue
Current available value. This value needs to be remembered in the member variable since the dialog is not going to display negative value and therefore we need to rember the actual value here.


m_clientArea

protected org.eclipse.swt.widgets.Composite m_clientArea
Client area containing all the other controls.


m_itemDialog

protected ItemDialog m_itemDialog
Dialog this gui is representing.

Constructor Detail

ItemBasicPage

public ItemBasicPage()
Method Detail

createClientArea

public org.eclipse.swt.widgets.Composite createClientArea(ItemDialog itemDialog,
                                                          org.eclipse.swt.widgets.TabFolder tab,
                                                          Item itemData,
                                                          int iRootCategoryId,
                                                          java.util.List lstSubcategoryIds)
                                                   throws org.opensubsystems.core.error.OSSException
Create client area of this page.

Parameters:
itemDialog - - dialog displaying this page
tab - - control this page belongs to
itemData - - item to create or edit
iRootCategoryId - - root category this item should or does exist in
lstSubcategoryIds - - ids of subcategories this item should or does exist in
Returns:
Composite - create area for this page
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

getNameStem

public java.lang.String getNameStem()
Returns:
String - name stem of the item

getSize

public java.lang.String getSize()
Returns:
String - size of the item which can determine display order

getDescription

public java.lang.String getDescription()
Returns:
String - description of the item

getReusable

public boolean getReusable()
Returns:
boolean - if true then item is reusable and can be returned and issued again

getShippedCount

public int getShippedCount()
Returns:
int - count of how many items were shipped to the inventory

setShippedCount

public void setShippedCount(int iCount)
Set shipped count value.

Parameters:
iCount - - new value for shipped count to apply on this page.

setIdentificationCount

public void setIdentificationCount(int iCount)
Number of identifications and therefore uniquely identifiable items has changed so readjust the values on this page.

Parameters:
iCount - - new count of uniquely identifiable items to apply on this page

getAvailableCount

public int getAvailableCount()
Returns:
int - count of how many items are actually available in the inventory to be issued

setAvailableCount

public void setAvailableCount(int iCount)
Set available count value.

Parameters:
iCount - - new value for available count to apply on this page.

modifyAvailableCount

public void modifyAvailableCount(int iDifference)
Modify available item count value by a specified amount.

Parameters:
iDifference - - amount to change available count by.

getCategoryId

public int getCategoryId()
Returns:
int - main category id

getSubcategoryIds

public int[] getSubcategoryIds()
Returns:
int[] - array with selected subcategories ids

addItemBasicPageListener

public void addItemBasicPageListener(ItemBasicPageListener listener)
Add listener for this dialog.

Parameters:
listener - - listener to add

removeItemTypeBasicPageListener

public void removeItemTypeBasicPageListener(ItemBasicPageListener listener)
Remove listener from this dialog.

Parameters:
listener - - listener to remove

loadCategories

protected void loadCategories(int iRootCategoryId)
                       throws org.opensubsystems.core.error.OSSException
Load categories into a category combo box and select current category.

Parameters:
iRootCategoryId - - id of root category where the item does or should exist in
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

loadSubcategories

protected void loadSubcategories(int iCategoryId,
                                 java.util.List lstSubcategoryIds)
                          throws org.opensubsystems.core.error.OSSException
Load all subcategories to available list and clear selected list

Parameters:
iCategoryId - - root category id for which to load subcategories
lstSubcategoryIds - - ids of subcategories this item should or does exist in
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

addSubcategories

protected void addSubcategories()
Add selected subcategory from available list to selected list.


removeSubcategories

protected void removeSubcategories()
Remove selected subcategory from selected to available list


startCharacterPad

protected void startCharacterPad(java.lang.String strTitle,
                                 java.lang.String strFirstLineText,
                                 int iFieldToEdit)
Starts character pad dialog to edit textual value of a field.

Parameters:
strTitle - - text to display in the title of the dialog
strFirstLineText - - text displayed above the entry area
iFieldToEdit - - what field should be edited

startNumberPad

protected void startNumberPad(java.lang.String strTitle,
                              java.lang.String strFirstLineText,
                              int iFieldToEdit)
Starts number pad dialog to edit numeric value of a field.

Parameters:
strTitle - - text to display on the dialog
strFirstLineText - - text displayed above the entry area
iFieldToEdit - - what field should be edited

notifySetConsumable

protected void notifySetConsumable(boolean bNewState)
Notify all listeners when consumable flag changes.

Parameters:
bNewState - - new consumable button state

getListController

protected org.opensubsystems.patterns.listdata.logic.ListController getListController()
                                                                               throws org.opensubsystems.core.error.OSSException
Get list controller to use.

Returns:
ListController
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured


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