org.opensubsystems.inventory.application.swt
Class ItemPropertiesPage

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

public class ItemPropertiesPage
extends java.lang.Object

Additional properties page of item dialog.

Version:
$Id: ItemPropertiesPage.java,v 1.9 2007/01/07 06:14:07 bastafidli Exp $
Author:
Martin Cerba
Code reviewer:
Miro Halas
Code reviewed:
1.5 2006/04/05 05:19:51 bastafidli

Field Summary
protected static int AVERAGE_COST_FIELD
          Offset of field in the field arrays
protected  org.eclipse.swt.widgets.Button[] m_buttons
          Set of buttons next to the controls to edit the data.
protected  org.eclipse.swt.widgets.Composite m_clientArea
          Client area containing all the other controls.
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  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 MINIMAL_AVAILABLE_FIELD
          Offset of field in the field arrays
protected static int PERMANENTLY_ASSIGNED_FIELD
          Offset of field in the field arrays
protected static int PRICE_FIELD
          Offset of field in the field arrays
 
Constructor Summary
ItemPropertiesPage()
           
 
Method Summary
 void addItemPropertiesPageListener(ItemPropertiesPageListener listener)
          Add listener for this dialog.
 org.eclipse.swt.widgets.Composite createClientArea(ItemDialog itemDialog, org.eclipse.swt.widgets.TabFolder tab, Item itemData)
          Create client area of this page.
 double getAverageCost()
           
 int getMinimalAvailable()
           
 boolean getPermanentlyAssigned()
           
 double getPrice()
           
protected  void notifyCostChanged(double dCost)
          Notify all listeners when cost changes.
 void removeItemPropertiesPageListener(ItemPropertiesPageListener listener)
          Remove listener from this dialog.
 void setAverageCost(double dCost)
          Set an average cost value.
 void setCost(double dCost)
          Set an actual cost value.
protected  void startNumberPad(java.lang.String strTitle, java.lang.String strFirstLineText, int iFieldToEdit, boolean bDecimalDot)
          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

PERMANENTLY_ASSIGNED_FIELD

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

See Also:
Constant Field Values

MINIMAL_AVAILABLE_FIELD

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

See Also:
Constant Field Values

PRICE_FIELD

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

See Also:
Constant Field Values

AVERAGE_COST_FIELD

protected static final int AVERAGE_COST_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_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

ItemPropertiesPage

public ItemPropertiesPage()
Method Detail

createClientArea

public org.eclipse.swt.widgets.Composite createClientArea(ItemDialog itemDialog,
                                                          org.eclipse.swt.widgets.TabFolder tab,
                                                          Item itemData)
Create client area of this page.

Parameters:
itemDialog - - dialog gui displaying this page
tab - - control this page belongs to
itemData - - item to create or edit
Returns:
Composite - client area of the page

addItemPropertiesPageListener

public void addItemPropertiesPageListener(ItemPropertiesPageListener listener)
Add listener for this dialog.

Parameters:
listener - - listener to add

removeItemPropertiesPageListener

public void removeItemPropertiesPageListener(ItemPropertiesPageListener listener)
Remove listener from this dialog.

Parameters:
listener - - listener to remove

getPermanentlyAssigned

public boolean getPermanentlyAssigned()
Returns:
boolean - flag if the item is permanently assigned to a person and doesn't have to be returned or not

getMinimalAvailable

public int getMinimalAvailable()
Returns:
int - minimal available count of this item

getPrice

public double getPrice()
Returns:
double - price of this item

getAverageCost

public double getAverageCost()
Returns:
double - average cost of this item

setAverageCost

public void setAverageCost(double dCost)
Set an average cost value. This will disable cost editing since the set value is an average of some other values. It will also change cost label text to an average cost.

Parameters:
dCost - - average cost value

setCost

public void setCost(double dCost)
Set an actual cost value. This will enable cost editing and change cost label text to an actual cost.

Parameters:
dCost - - cost value

startNumberPad

protected void startNumberPad(java.lang.String strTitle,
                              java.lang.String strFirstLineText,
                              int iFieldToEdit,
                              boolean bDecimalDot)
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
bDecimalDot - - if true display decimal dot button in number pad

notifyCostChanged

protected void notifyCostChanged(double dCost)
Notify all listeners when cost changes.

Parameters:
dCost - - new cost value


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