Class symantec.itools.awt.util.spinner.ListSpinner
All Packages  Class Hierarchy  This Package  Previous  Next  Index
  Class symantec.itools.awt.util.spinner.ListSpinner
Object
   |
   +----Component
           |
           +----Container
                   |
                   +----Panel
                           |
                           +----Spinner
                                   |
                                   +----symantec.itools.awt.util.spinner.ListSpinner
  -  public class ListSpinner
  
-  extends Spinner
  
Creates a text box, containing a list of items, with up and down arrows.
 Use this component to allow your users to move through a set of fixed
 values or type a valid value in the box.
 
 At run time only the selected value is displayed in the text box.
 
  -  Version:
  
 -  1.1, October 1, 1997
  
 -  Author:
  
 -  Symantec
    
 -  See Also:
    
 -  Spinner
 
  
  -  
	dynamicResizing
   -   Flag to keep track of allowance of dynamic resizing of the edit box as new values are entered.
  
 -  
	internalMax
   -   The maximum value the list is allowed to go to.
  
 -  
	isPossibleEdit
   -   Is possible to edit the component.
  
 -  
	list
   -   The list of strings that get displayed in the spinner.
  
 -  
	oldText
   -   Text value at the time focus was gained.
 
  
  -  
	symantec.itools.awt.util.spinner.ListSpinner()
   -   Constructs an empty ListSpinner.
 
  
  -  
	addItem(String)
   -   Adds a string to the end of the list.
  
 -  
	addMaxListener(PropertyChangeListener)
   -   Adds a listener for the max property changes.
  
 -  
	addMaxListener(VetoableChangeListener)
   -   Adds a vetoable listener for the max property changes.
  
 -  
	addNotify()
   -   Tells this component that it has been added to a container.
  
 -  
	addPropertyChangeListener(PropertyChangeListener)
   -   Adds a listener for all property change events.
  
 -  
	addVetoableChangeListener(VetoableChangeListener)
   -   Adds a listener for all vetoable property change events.
  
 -  
	getCurrentText()
   -   Gets the currently selected string from the list.
  
 -  
	getListItems()
   -   Returns the current list as an array of Strings.
  
 -  
	isAllowDynamicResizing()
   -   Gets whether the current value can wrap around from maximum
 to minimum and from minimum to maximum.
  
 -  
	isValidCurrentValue(int)
   -   Is the given value valid for the Current property .
  
 -  
	isValidMaxValue(int)
   -   Is the given value valid for the Max property .
  
 -  
	isValidMinValue(int)
   -   Is the given value valid for the Min property .
  
 -  
	removeMaxListener(PropertyChangeListener)
   -   Removes a listener for the max property changes.
  
 -  
	removeMaxListener(VetoableChangeListener)
   -   Removes a vetoable listener for the max property changes.
  
 -  
	removeNotify()
   -   Tells this component that it is being removed from a container.
  
 -  
	removePropertyChangeListener(PropertyChangeListener)
   -   Removes a listener for all property change events.
  
 -  
	removeVetoableChangeListener(VetoableChangeListener)
   -   Removes a listener for all vetoable property change events.
  
 -  
	scrollDown()
   -   Decrements the spinner's value and handles wrapping as needed.
  
 -  
	scrollUp()
   -   Increments the spinner's value and handles wrapping as needed.
  
 -  
	setAllowDynamicResizing(boolean)
   -   Conditionally allows resizing of the edit box if needed when new values are entered.
  
 -  
	setListItems(String[])
   -   Adds the given string array to the end of the list.
  
 -  
	setMax(int)
   -   Sets the maximum value the spinner may have.
  
 -  
	truncateContents(String)
   -   Gets the current contets and truncates the string appropriately.
  
 -  
	updateButtonStatus()
   -   Handles enabling or disabling the spinner buttons as needed.
  
 -  
	updateInternalMax()
   -   Keeps track of the maximum value the list is allowed to go to.
  
 -  
	updateText(boolean)
   -   Updates the text field with the current text, as needed or depending on the force flag.
 
  
dynamicResizing
protected boolean dynamicResizing
  -  Flag to keep track of allowance of dynamic resizing of the edit box as new values are entered.
 
internalMax
protected int internalMax
  -  The maximum value the list is allowed to go to.
 
isPossibleEdit
protected boolean isPossibleEdit
  -  Is possible to edit the component. True when it has the focus.
 
list
protected java.util.Vector list
  -  The list of strings that get displayed in the spinner.
 
oldText
protected java.lang.String oldText
  -  Text value at the time focus was gained.
 
  
ListSpinner
public ListSpinner()
  -  Constructs an empty ListSpinner.
  
 
 
  
addItem
public void addItem(String s)
  -  Adds a string to the end of the list.
  
 
 
    -  Parameters:
    
 -  s - the string to be appended to the list
    
 -  See Also:
    
 -  setListItems
  
 
 
 
addMaxListener
public synchronized void addMaxListener(PropertyChangeListener listener)
  -  Adds a listener for the max property changes.
  
 
 
    -  Parameters:
    
 -  listener - the listener to add.
    
 -  Overrides:
    
 -  addMaxListener in class Spinner
    
 -  See Also:
    
 -  removeMaxListener(java.beans.PropertyChangeListener)
  
 
 
 
addMaxListener
public synchronized void addMaxListener(VetoableChangeListener listener)
  -  Adds a vetoable listener for the max property changes.
  
 
 
    -  Parameters:
    
 -  listener - the listener to add.
    
 -  Overrides:
    
 -  addMaxListener in class Spinner
    
 -  See Also:
    
 -  removeMaxListener(java.beans.VetoableChangeListener)
  
 
 
 
addNotify
public void addNotify()
  -  Tells this component that it has been added to a container.
 This is a standard Java AWT method which gets called by the AWT when
 this component is added to a container. Typically, it is used to
 create this component's peer.
 Here it's used to get the length of the largest string in the list.
  
 
 
    -  Overrides:
    
 -  addNotify in class Spinner
    
 -  See Also:
    
 -  removeNotify
  
 
 
 
addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
  -  Adds a listener for all property change events.
  
 
 
    -  Parameters:
    
 -  listener - the listener to add
    
 -  Overrides:
    
 -  addPropertyChangeListener in class Spinner
    
 -  See Also:
    
 -  removePropertyChangeListener
  
 
 
 
addVetoableChangeListener
public synchronized void addVetoableChangeListener(VetoableChangeListener listener)
  -  Adds a listener for all vetoable property change events.
  
 
 
    -  Parameters:
    
 -  listener - the listener to add
    
 -  Overrides:
    
 -  addVetoableChangeListener in class Spinner
    
 -  See Also:
    
 -  removeVetoableChangeListener
  
 
 
 
getCurrentText
public java.lang.String getCurrentText()
  -  Gets the currently selected string from the list.
  
 
 
    -  Returns:
    
 -  the string currently visible in the Spinner
    
 -  Overrides:
    
 -  getCurrentText in class Spinner
  
 
 
 
getListItems
public java.lang.String[] getListItems()
  -  Returns the current list as an array of Strings.
  
 
 
    -  Returns:
    
 -  the current list
    
 -  See Also:
    
 -  setListItems
  
 
 
 
isAllowDynamicResizing
public boolean isAllowDynamicResizing()
  -  Gets whether the current value can wrap around from maximum
 to minimum and from minimum to maximum.
  
 
 
    -  Returns:
    
 -  true if the edit box will resize if needed when new values are entered.
    
 -  See Also:
    
 -  setAllowDynamicResizing
  
 
 
 
isValidCurrentValue
protected boolean isValidCurrentValue(int i)
  -  Is the given value valid for the Current property .
  
 
 
    -  Parameters:
    
 -  i - the given value
    
 -  Returns:
    
 -  true if the given value is acceptable, false if not.
    
 -  Overrides:
    
 -  isValidCurrentValue in class Spinner
  
 
 
 
isValidMaxValue
protected boolean isValidMaxValue(int i)
  -  Is the given value valid for the Max property .
  
 
 
    -  Parameters:
    
 -  i - the given value
    
 -  Returns:
    
 -  true if the given value is acceptable, false if not.
    
 -  Overrides:
    
 -  isValidMaxValue in class Spinner
  
 
 
 
isValidMinValue
protected boolean isValidMinValue(int i)
  -  Is the given value valid for the Min property .
  
 
 
    -  Parameters:
    
 -  i - the given value
    
 -  Returns:
    
 -  true if the given value is acceptable, false if not.
    
 -  Overrides:
    
 -  isValidMinValue in class Spinner
  
 
 
 
removeMaxListener
public synchronized void removeMaxListener(PropertyChangeListener listener)
  -  Removes a listener for the max property changes.
  
 
 
    -  Parameters:
    
 -  listener - the listener to remove.
    
 -  Overrides:
    
 -  removeMaxListener in class Spinner
    
 -  See Also:
    
 -  addMaxListener(java.beans.PropertyChangeListener)
  
 
 
 
removeMaxListener
public synchronized void removeMaxListener(VetoableChangeListener listener)
  -  Removes a vetoable listener for the max property changes.
  
 
 
    -  Parameters:
    
 -  listener - the listener to remove.
    
 -  Overrides:
    
 -  removeMaxListener in class Spinner
    
 -  See Also:
    
 -  addMaxListener(java.beans.VetoableChangeListener)
  
 
 
 
removeNotify
public synchronized void removeNotify()
  -  Tells this component that it is being removed from a container.
 This is a standard Java AWT method which gets called by the AWT when
 this component is removed from a container. Typically, it is used to
 destroy the peers of this component and all its subcomponents.
 It has been overridden here to unhook event listeners.
  
 
 
    -  Overrides:
    
 -  removeNotify in class Spinner
    
 -  See Also:
    
 -  addNotify
  
 
 
 
removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
  -  Removes a listener for all property change events.
  
 
 
    -  Parameters:
    
 -  listener - the listener to remove
    
 -  Overrides:
    
 -  removePropertyChangeListener in class Spinner
    
 -  See Also:
    
 -  addPropertyChangeListener
  
 
 
 
removeVetoableChangeListener
public synchronized void removeVetoableChangeListener(VetoableChangeListener listener)
  -  Removes a listener for all vetoable property change events.
  
 
 
    -  Parameters:
    
 -  listener - the listener to remove
    
 -  Overrides:
    
 -  removeVetoableChangeListener in class Spinner
    
 -  See Also:
    
 -  addVetoableChangeListener
  
 
 
 
scrollDown
protected void scrollDown()
  -  Decrements the spinner's value and handles wrapping as needed.
  
 
 
    -  Overrides:
    
 -  scrollDown in class Spinner
    
 -  See Also:
    
 -  scrollUp, increment
  
 
 
 
scrollUp
protected void scrollUp()
  -  Increments the spinner's value and handles wrapping as needed.
  
 
 
    -  Overrides:
    
 -  scrollUp in class Spinner
    
 -  See Also:
    
 -  scrollDown, increment
  
 
 
 
setAllowDynamicResizing
public void setAllowDynamicResizing(boolean f) throws PropertyVetoException
  -  Conditionally allows resizing of the edit box if needed when new values are entered.
  
 
 
    -  Parameters:
    
 -  f - if true the edit box will resize if needed when new values are entered.
    
 -  Throws: PropertyVetoException
    
 -   if the specified property value is unacceptable
    
 -  See Also:
    
 -  isAllowDynamicResizing
  
 
 
 
setListItems
public void setListItems(String[] items) throws PropertyVetoException
  -  Adds the given string array to the end of the list.
  
 
 
    -  Parameters:
    
 -  items - the items to add to the list
    
 -  Throws: PropertyVetoException
    
 -   if the specified property value is unacceptable
    
 -  See Also:
    
 -  getListItems
  
 
 
 
setMax
public void setMax(int i) throws PropertyVetoException
  -  Sets the maximum value the spinner may have.
  
 
 
    -  Parameters:
    
 -  i - the new maximum value
    
 -  Throws: PropertyVetoException
    
 -   if the specified property value is unacceptable
    
 -  Overrides:
    
 -  setMax in class Spinner
    
 -  See Also:
    
 -  getMax
  
 
 
 
truncateContents
protected java.lang.String truncateContents(String contents)
  -  Gets the current contets and truncates the string appropriately.
 This assumes it is geting called from updateText
  
 
 
    -  Parameters:
    
 -  contents - the string to truncate as if it were to be placed in
 the textField
    
 -  Returns:
    
 -  The truncated string.  This may not be truncated if it was not needed.
  
 
 
 
updateButtonStatus
protected void updateButtonStatus()
  -  Handles enabling or disabling the spinner buttons as needed.
  
 
 
    -  Overrides:
    
 -  updateButtonStatus in class Spinner
  
 
 
 
updateInternalMax
protected void updateInternalMax()
  -  Keeps track of the maximum value the list is allowed to go to.
  
 
 
updateText
protected void updateText(boolean force)
  -  Updates the text field with the current text, as needed or depending on the force flag.
  
 
 
    -  Overrides:
    
 -  updateText in class Spinner
  
 
 
 
All Packages  Class Hierarchy  This Package  Previous  Next  Index