Class symantec.itools.awt.ComboBox
All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.awt.ComboBox
Object
|
+----Component
|
+----Container
|
+----Panel
|
+----symantec.itools.awt.ComboBox
- public class ComboBox
- extends Panel
A ComboBox is a text field with an attached drop-down list box. It may be
user-editable, "searchable", have horizontal and/or vertical scroll
bars, and can use different fonts for the text box and the drop-down list.
Also each list box item can have an image in addition to text.
A user-editable ComboBox allows the user to enter any desired text into
the text field. A searchable ComboBox allows the user to enter text into
the text field as long as it matches one of the existing list items.
This allows the user to select from a non-editable list by typing instead
of dropping-down the list and selecting with the mouse.
Use a ComboBox to:
- Compactly provide a list of items for the user to select from.
- Have a text field that maintains a history of what's been entered in it.
- Allow the user to either select from a list or enter a new value.
- Version:
- 1.1, June 6, 1997
- Author:
- Symantec
-
actionCommand
- The command name of the action event fired by this component.
-
actionListener
- The action listener to keep track of listeners for our action event.
-
arrow
- The button on the right part of this ComboBox that controls dopping the list.
-
arrowDim
- The dimension of the arrow button.
-
bCaseSensitive
- If true search compares are case-sensitive.
-
bDown
- True if the list is currently dropped (displayed).
-
bEditable
- If true this ComboBox has a user-editable text field.
-
bOsFlag
- True if running under Windows.
-
bOverList
- True if the mouse is over the ComboBox.
-
bSearchable
- If true this ComboBox is searchable.
-
editBox
- The text field part of this ComboBox.
-
hPad
- The distance between the direction button and the edit text box.
-
iwidth
- The width parameter value in the latest reshape() call.
-
ix
- The x parameter value in the latest reshape() call.
-
iy
- The y parameter value in the latest reshape() call.
-
lheight
- The current height of the list.
-
list
- The list part of this ComboBox.
-
maxNumChars
- The number of characters of the longest item in the list.
-
sLastText
- The latest user-entered text.
-
sSearchItem
- The list item string used to match during searches.
-
sSearchOrig
- The user-entered string used to match during searches.
-
sSearchText
- The case-normalized user-entered string used to match during searches.
-
searchI
- The list item currently being checked for search match.
-
searchIndex
- Where the selected area starts in the user-entered text.
-
searchLen
- The number of items in the list to seach (all).
-
showHScroll
- If true the horizontal scroll bar is shown as needed.
-
showVScroll
- If true the vertical scroll bar is shown as needed.
-
vPad
- The distance between the edit text box and the drop down list.
-
symantec.itools.awt.ComboBox()
- Constructs a new default ComboBox.
-
symantec.itools.awt.ComboBox(boolean, boolean)
- Constructs a new editable and/or searchable ComboBox.
-
addActionListener(ActionListener)
- Adds the specified action listener to receive action events
-
addFirstTopDown()
- Determines whether the ComboBox should be the first component added to
its container, or the last.
-
addItem(String)
- Adds the specified item to the end of the drop-down list and enables the item.
-
addItem(String, boolean)
- Adds the specified item to the end of the drop-down list and conditionally enables it.
-
addItem(Image, String)
- Adds the specified item with an image to the end of the drop-down list and enables it.
-
addItem(Image, String, boolean)
- Adds the specified item with an image to the end of the drop-down list and
conditionally enables it.
-
addLastBottomUp()
- Determines whether the ComboBox should be the last component added to
its container, or the first.
-
addNotify()
- Tells this component that it has been added to a container.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a listener for all event changes.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds a vetoable listener for all event changes.
-
changeImage(int, Image)
-
-
changeText(int, String)
-
-
clear()
- Clears all items from the drop-down list.
-
countItems()
- Returns the total number of items in the drop-down list.
-
delItem(int)
- Deletes an item from the drop-down list.
-
delItems(int, int)
- Deletes multiple items from the drop-down list.
-
delSelectedItem()
- Deletes the currently selected item from the list.
-
deselect(int)
- Deselects the drop-down list item at the specified zero-relative index.
-
disable(int)
-
-
dropList(boolean)
-
-
enable(int)
-
-
enable(int, boolean)
-
-
getActionCommand()
-
-
getCaseSensitive()
-
-
getEditable()
-
-
getItem(int)
-
-
getListItems()
- Returns the current list as an array.
-
getListText(int)
- Returns the text associated with a drop-down item.
-
getMinimumSize()
- Returns the minimum dimensions to properly display this component.
-
getPreferredSize()
- Returns the recommended dimensions to properly display this component.
-
getSearchable()
-
-
getSelectedIndex()
- Gets the zero-relative index of the currently selected item in the drop-down list.
-
getSelectedItem()
- Returns the selected item on the drop-down list.
-
getShowHorizontalScroll()
-
-
getShowVerticalScroll()
-
-
getText()
- Returns the text in the edit field portion of the ComboBox, unless the ComboBox
is not editable.
-
isCaseSensitive()
- Returns the current ComboBox case-sensitive search status.
-
isEditable()
- Gets whether the ComboBox is user-editable.
-
isListDown()
- Is the list up or down?
-
isSearchable()
- Returns the current ComboBox "searchable" status.
-
isSelected(int)
- Returns the selection state of the list item at the given zero-relative index.
-
isShowHorizontalScroll()
- Gets the current horizontal scrollbar display option.
-
isShowVerticalScroll()
- Gets the current vertical scrollbar display option.
-
needsPlatformHelp()
- Use this method to set a flag for use in your handleEvent to determine if
the ComboBox needs help in "un-dropping".
-
paint(Graphics)
- Paints this component using the given graphics context.
-
removeActionListener(ActionListener)
- Removes the specified action listener so it no longer receives
action events.
-
removeNotify()
- Tells this component that it is being removed from a container.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes a listener for all event changes.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes a vetoable listener for all event changes.
-
reshape(int, int, int, int)
- Moves and/or resizes this component.
-
reshapeInternals()
- A utility routine to resize the sub-components that make up a ComboBox.
-
select(int)
- Selects the drop-down list item with the specified zero-relative index.
-
select(String)
- Selects the first drop-down item in the list which has exactly matching text.
-
setActionCommand(String)
- Sets the command name of the action event fired by this button.
-
setCaseSensitive(boolean)
- Conditionally set the ComboBox to be case sensitive during searches.
-
setEditable(boolean)
- Conditionally sets the ComboBox to be user-editable.
-
setEnabled(int)
- Enables a drop-down list item at a given zero-relative index.
-
setEnabled(int, boolean)
- Conditionally enables a drop-down list item at a given zero-relative index.
-
setFont(Font)
- Sets the font of the component.
-
setImage(int, Image)
- Changes the image associated with a drop-down item.
-
setLayout(LayoutManager)
- Takes no action.
-
setListDown(boolean)
- Handles dropping and "un-dropping" the ComboBox list.
-
setListItems(String[])
- Adds the string array to the list.
-
setListText(int, String)
- Changes the text associated with a drop-down item.
-
setSearchable(boolean)
- Conditionally sets the ComboBox to be searchable.
-
setShowHorizontalScroll(boolean)
- Sets whether or not the horizontal scrollbar should be made visible when
necessary or should never be made visible.
-
setShowVerticalScroll(boolean)
- Sets whether or not the vertical scrollbar should be made visible when
necessary or should never be made visible.
-
setText(String)
- Sets the text in the edit field portion of the ComboBox
is not editable.
-
sourceActionEvent(String)
- Fire an action event to the listeners
-
sourceActionEvent()
- Fire an action event to the listeners
with the actionCommand
-
updateMaxNumChars()
- Used to calculate the preferred size of the text field to
determine overall preferred size.
-
validate()
-
-
verify()
- Verify that at least one list item starts with the edit field's text.
actionCommand
protected java.lang.String actionCommand
- The command name of the action event fired by this component.
actionListener
protected java.awt.event.ActionListener actionListener
- The action listener to keep track of listeners for our action event.
arrow
protected symantec.itools.awt.DirectionButton arrow
- The button on the right part of this ComboBox that controls dopping the list.
arrowDim
protected int arrowDim
- The dimension of the arrow button.
bCaseSensitive
protected boolean bCaseSensitive
- If true search compares are case-sensitive.
bDown
protected transient boolean bDown
- True if the list is currently dropped (displayed).
bEditable
protected boolean bEditable
- If true this ComboBox has a user-editable text field.
bOsFlag
protected static transient boolean bOsFlag
- True if running under Windows.
bOverList
protected transient boolean bOverList
- True if the mouse is over the ComboBox.
bSearchable
protected boolean bSearchable
- If true this ComboBox is searchable.
editBox
protected java.awt.TextField editBox
- The text field part of this ComboBox.
hPad
protected int hPad
- The distance between the direction button and the edit text box.
iwidth
protected int iwidth
- The width parameter value in the latest reshape() call.
ix
protected int ix
- The x parameter value in the latest reshape() call.
iy
protected int iy
- The y parameter value in the latest reshape() call.
lheight
protected int lheight
- The current height of the list.
list
protected symantec.itools.awt.ImageListBox list
- The list part of this ComboBox.
maxNumChars
protected int maxNumChars
- The number of characters of the longest item in the list.
Used to calculate preferred size.
- See Also:
- updateMaxNumChars
sLastText
protected transient java.lang.String sLastText
- The latest user-entered text.
sSearchItem
protected java.lang.String sSearchItem
- The list item string used to match during searches.
sSearchOrig
protected java.lang.String sSearchOrig
- The user-entered string used to match during searches.
Not case normalized.
sSearchText
protected java.lang.String sSearchText
- The case-normalized user-entered string used to match during searches.
searchI
protected int searchI
- The list item currently being checked for search match.
searchIndex
protected int searchIndex
- Where the selected area starts in the user-entered text.
searchLen
protected int searchLen
- The number of items in the list to seach (all).
showHScroll
protected boolean showHScroll
- If true the horizontal scroll bar is shown as needed.
showVScroll
protected boolean showVScroll
- If true the vertical scroll bar is shown as needed.
vPad
protected int vPad
- The distance between the edit text box and the drop down list.
ComboBox
public ComboBox()
- Constructs a new default ComboBox. The ComboBox is not editable and
not searchable by default.
ComboBox
public ComboBox(boolean editable,
boolean searchable)
- Constructs a new editable and/or searchable ComboBox.
- Parameters:
- editable - true = editable, false = non-editable
- searchable - true = searchable, false = non-searchable
addActionListener
public synchronized void addActionListener(ActionListener l)
- Adds the specified action listener to receive action events
- Parameters:
- l - the action listener
addFirstTopDown
public static boolean addFirstTopDown()
- Determines whether the ComboBox should be the first component added to
its container, or the last. This varies from system to system depending
on the native user interface. If this method returns true, add the
ComboBox before adding other components. If it returns false, add other
components before adding the ComboBox. If the ComboBox is added in the
wrong order, the drop-down list box will be drawn under the other
components instead of on top of them.
- Returns:
- if true add the ComboBox to its container before other components,
otherwise add after all other components
- See Also:
- addLastBottomUp
addItem
public synchronized void addItem(String item) throws PropertyVetoException
- Adds the specified item to the end of the drop-down list and enables the item.
- Parameters:
- item - the item to be added
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- addItem(java.lang.String, boolean), addItem(java.awt.Image, java.lang.String), addItem(java.awt.Image, java.lang.String, boolean), setListItems(java.lang.String[])
addItem
public synchronized void addItem(String item,
boolean bEnabled) throws PropertyVetoException
- Adds the specified item to the end of the drop-down list and conditionally enables it.
- Parameters:
- item - the item to be added
- bEnabled - true = enable the item, false = disable it
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- addItem(java.lang.String), addItem(java.awt.Image, java.lang.String), addItem(java.awt.Image, java.lang.String, boolean), setListItems(java.lang.String[])
addItem
public synchronized void addItem(Image image,
String item) throws PropertyVetoException
- Adds the specified item with an image to the end of the drop-down list and enables it.
- Parameters:
- image - the image to display on the item line
- item - the item to be added
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- addItem(java.lang.String), addItem(java.lang.String, boolean), addItem(java.awt.Image, java.lang.String, boolean), setListItems(java.lang.String[])
addItem
public synchronized void addItem(Image image,
String item,
boolean bEnabled) throws PropertyVetoException
- Adds the specified item with an image to the end of the drop-down list and
conditionally enables it.
- Parameters:
- image - the image to display on the item line
- item - the item to be added
- bEnabled - true = enable the item, false = disable it
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- addItem(java.lang.String), addItem(java.lang.String, boolean), addItem(java.awt.Image, java.lang.String), setListItems(java.lang.String[])
addLastBottomUp
public static boolean addLastBottomUp()
- Determines whether the ComboBox should be the last component added to
its container, or the first. This varies from system to system depending
on the native user interface. If this method returns true, add the
ComboBox after adding other components. If it returns false, add other
components after adding the ComboBox. If the ComboBox is added in the
wrong order, the drop-down list box will be drawn under the other
components instead of on top of them.
- Returns:
- if true add the ComboBox to its container after other components,
otherwise add before all other components
- See Also:
- addFirstTopDown
addNotify
public synchronized 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.
It has been overridden here to hook-up event listeners.
- Overrides:
- addNotify in class Panel
- See Also:
- removeNotify
addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
- Adds a listener for all event changes.
- Parameters:
- listener - the listener to add.
- See Also:
- removePropertyChangeListener
addVetoableChangeListener
public synchronized void addVetoableChangeListener(VetoableChangeListener listener)
- Adds a vetoable listener for all event changes.
- Parameters:
- listener - the listener to add.
- See Also:
- removeVetoableChangeListener
changeImage
public void changeImage(int index,
Image image) throws PropertyVetoException
- Note: changeImage() is deprecated.
-
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setImage(int, java.awt.Image)
changeText
public void changeText(int index,
String text) throws PropertyVetoException
- Note: changeText() is deprecated.
-
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setListText(int, java.lang.String)
clear
public void clear()
- Clears all items from the drop-down list.
countItems
public int countItems()
- Returns the total number of items in the drop-down list.
delItem
public synchronized void delItem(int position) throws PropertyVetoException
- Deletes an item from the drop-down list.
- Parameters:
- position - the zero-relative index of the item
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- delItems, addItem(java.lang.String), addItem(java.lang.String, boolean), addItem(java.awt.Image, java.lang.String), addItem(java.awt.Image, java.lang.String, boolean), setListItems(java.lang.String[])
delItems
public synchronized void delItems(int start,
int end) throws PropertyVetoException
- Deletes multiple items from the drop-down list.
(Note: the end position must be greater than or equal to the start position.)
- Parameters:
- start - the starting zero-relative index of the items
- end - the ending zero-relative index of the items
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- delItem, addItem(java.lang.String), addItem(java.lang.String, boolean), addItem(java.awt.Image, java.lang.String), addItem(java.awt.Image, java.lang.String, boolean), setListItems(java.lang.String[])
delSelectedItem
public synchronized void delSelectedItem() throws PropertyVetoException
- Deletes the currently selected item from the list.
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- addItem(java.lang.String), addItem(java.lang.String, boolean), addItem(java.awt.Image, java.lang.String), addItem(java.awt.Image, java.lang.String, boolean), setListItems(java.lang.String[])
deselect
public synchronized void deselect(int index) throws PropertyVetoException
- Deselects the drop-down list item at the specified zero-relative index.
- Parameters:
- index - the zero-relative index of the drop-down item to deselect
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- select
disable
public void disable(int index) throws PropertyVetoException
- Note: disable() is deprecated.
-
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setEnabled(int, boolean)
dropList
public void dropList(boolean bDown) throws PropertyVetoException
- Note: dropList() is deprecated.
-
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setListDown
enable
public void enable(int index) throws PropertyVetoException
- Note: enable() is deprecated.
-
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setEnabled(int)
enable
public void enable(int index,
boolean cond) throws PropertyVetoException
- Note: enable() is deprecated.
-
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setEnabled(int, boolean)
getActionCommand
public java.lang.String getActionCommand()
-
- Returns:
- the command name of the action event fired by this button.
getCaseSensitive
public boolean getCaseSensitive()
- Note: getCaseSensitive() is deprecated.
-
- See Also:
- isSearchable
getEditable
public boolean getEditable()
- Note: getEditable() is deprecated.
-
- See Also:
- isEditable
getItem
public java.lang.String getItem(int index)
- Note: getItem() is deprecated.
-
- See Also:
- getListText(int)
getListItems
public java.lang.String[] getListItems()
- Returns the current list as an array.
- See Also:
- setListItems
getListText
public java.lang.String getListText(int index)
- Returns the text associated with a drop-down item.
- Returns:
- the text associated with the drop-down item at index
- See Also:
- setListText(int, java.lang.String)
getMinimumSize
public java.awt.Dimension getMinimumSize()
- Returns the minimum dimensions to properly display this component.
This is a standard Java AWT method which gets called to determine
the minimum size of this component.
Returns the results of a call to getPreferredSize.
- Overrides:
- getMinimumSize in class Container
- See Also:
- getPreferredSize
getPreferredSize
public java.awt.Dimension getPreferredSize()
- Returns the recommended dimensions to properly display this component.
This is a standard Java AWT method which gets called to determine
the recommended size of this component.
Preferred size is .
- Overrides:
- getPreferredSize in class Container
- See Also:
- getMinimumSize
getSearchable
public boolean getSearchable()
- Note: getSearchable() is deprecated.
-
- See Also:
- isSearchable
getSelectedIndex
public int getSelectedIndex()
- Gets the zero-relative index of the currently selected item in the drop-down list.
- Returns:
- the zero-relative index of the current selection, or -1 if no item is selected
- See Also:
- getSelectedItem
getSelectedItem
public java.lang.String getSelectedItem()
- Returns the selected item on the drop-down list.
- Returns:
- the text of the selected item, or null if no item is selected
- See Also:
- getText, getSelectedIndex
getShowHorizontalScroll
public boolean getShowHorizontalScroll()
- Note: getShowHorizontalScroll() is deprecated.
-
- See Also:
- isShowHorizontalScroll
getShowVerticalScroll
public boolean getShowVerticalScroll()
- Note: getShowVerticalScroll() is deprecated.
-
- See Also:
- isShowVerticalScroll
getText
public java.lang.String getText()
- Returns the text in the edit field portion of the ComboBox, unless the ComboBox
is not editable.
- Returns:
- the edit field text if editable, or null if this ComboBox is not editable
- See Also:
- getSelectedItem
isCaseSensitive
public boolean isCaseSensitive()
- Returns the current ComboBox case-sensitive search status.
- See Also:
- setSearchable
isEditable
public boolean isEditable()
- Gets whether the ComboBox is user-editable.
- Returns:
- true if it is user-editable, false otherwise
- See Also:
- setEditable
isListDown
public boolean isListDown()
- Is the list up or down?
- Returns:
- true if the list is down, false if not.
- See Also:
- setListDown
isSearchable
public boolean isSearchable()
- Returns the current ComboBox "searchable" status.
A searchable ComboBox allows the user to enter text into
the text field as long as it matches one of the existing list items.
This allows the user to select from a non-editable list by typing instead
of dropping-down the list and selecting with the mouse.
- See Also:
- setSearchable
isSelected
public synchronized boolean isSelected(int index)
- Returns the selection state of the list item at the given zero-relative index.
- Parameters:
- index - the zero-relative index of the drop-down list item to be checked
- Returns:
- true if the drop-down list item at the specified index has been
selected; false otherwise
- See Also:
- select
isShowHorizontalScroll
public boolean isShowHorizontalScroll()
- Gets the current horizontal scrollbar display option.
- Returns:
- true if the horizontal scrollbar should be displayed when necessary,
false if the scrollbar should never be shown
- See Also:
- setShowHorizontalScroll
isShowVerticalScroll
public boolean isShowVerticalScroll()
- Gets the current vertical scrollbar display option.
- Returns:
- true if the vertical scrollbar should be displayed when necessary,
false if the scrollbar should never be shown
- See Also:
- setShowVerticalScroll
needsPlatformHelp
public static boolean needsPlatformHelp()
- Use this method to set a flag for use in your handleEvent to determine if
the ComboBox needs help in "un-dropping". This will improve useability
under platforms which do not provide proper focus events. For best
performance assign a variable in your class once to avoid repeated function
calls to this method, like this:
boolean bNeedsPlatformHelp = ComboBox.needsPlatformHelp();
public boolean handleEvent(Event evt)
{
switch (evt.id)
{
case Event.MOUSE_UP:
// do it on mouse up, which indicates a full click somewhere other than
// the ComboBox that could be currently dropped down.
if (bNeedsPlatformHelp && ComboBox.isListDown)
ComboBox.setListDown(false);
break; // or other MOUSE_UP processing as necessary
...
}
...
}
- See Also:
- setListDown
paint
public void paint(Graphics g)
- Paints this component using the given graphics context.
This is a standard Java AWT method which typically gets called
by the AWT to handle painting this component. It paints this component
using the given graphics context. The graphics context clipping region
is set to the bounding rectangle of this component and its [0,0]
coordinate is this component's top-left corner.
- Parameters:
- g - the graphics context used for painting
- Overrides:
- paint in class Container
- See Also:
- repaint, update
removeActionListener
public synchronized void removeActionListener(ActionListener l)
- Removes the specified action listener so it no longer receives
action events.
- Parameters:
- l - the action listener
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 Container
- See Also:
- addNotify
removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
- Removes a listener for all event changes.
- Parameters:
- listener - the listener to remove.
- See Also:
- addPropertyChangeListener
removeVetoableChangeListener
public synchronized void removeVetoableChangeListener(VetoableChangeListener listener)
- Removes a vetoable listener for all event changes.
- Parameters:
- listener - the listener to remove.
- See Also:
- addVetoableChangeListener
reshape
public synchronized void reshape(int x,
int y,
int width,
int height)
- Moves and/or resizes this component.
This is a standard Java AWT method which gets called to move and/or
resize this component. Components that are in containers with layout
managers should not call this method, but rely on the layout manager
instead.
- Parameters:
- x - horizontal position in the parent's coordinate space
- y - vertical position in the parent's coordinate space
- width - the new width
- height - the new height
- Overrides:
- reshape in class Component
reshapeInternals
protected void reshapeInternals()
- A utility routine to resize the sub-components that make up a ComboBox.
select
public synchronized void select(int index) throws PropertyVetoException
- Selects the drop-down list item with the specified zero-relative index.
- Parameters:
- index - the zero-relative index of the drop-down list item to select
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- deselect
select
public void select(String str) throws PropertyVetoException
- Selects the first drop-down item in the list which has exactly matching text.
- Parameters:
- str - the String to match
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- deselect
setActionCommand
public void setActionCommand(String command) throws PropertyVetoException
- Sets the command name of the action event fired by this button.
- Parameters:
- command - The name of the action event command fired by this button
- Throws: PropertyVetoException
- if the specified property value is unacceptable
setCaseSensitive
public void setCaseSensitive(boolean bCaseSensitive) throws PropertyVetoException
- Conditionally set the ComboBox to be case sensitive during searches.
- Parameters:
- bCaseSensitive - true = case-sensitive, false = case-insensitive
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getCaseSensitive
setEditable
public void setEditable(boolean editable) throws PropertyVetoException
- Conditionally sets the ComboBox to be user-editable.
- Parameters:
- editable - true = editable, false = non-editable
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- isEditable
setEnabled
public void setEnabled(int index) throws PropertyVetoException
- Enables a drop-down list item at a given zero-relative index.
- Parameters:
- index - the zero-relative index of the drop-down list item
- Throws: PropertyVetoException
- if the specified property value is unacceptable
setEnabled
public void setEnabled(int index,
boolean cond) throws PropertyVetoException
- Conditionally enables a drop-down list item at a given zero-relative index.
- Parameters:
- index - the zero-relative index of the drop-down list item
- cond - true = enable the item, false = disable it
- Throws: PropertyVetoException
- if the specified property value is unacceptable
setFont
public synchronized void setFont(Font newFont)
- Sets the font of the component.
- Parameters:
- f - the font
- Overrides:
- setFont in class Component
- See Also:
- getFont
setImage
public void setImage(int index,
Image image) throws PropertyVetoException
- Changes the image associated with a drop-down item.
- Parameters:
- index - the zero-relative index of the drop-down item
- image - the image to associate with the drop-down item
- Throws: PropertyVetoException
- if the specified property value is unacceptable
setLayout
public void setLayout(LayoutManager lm)
- Takes no action.
This is a standard Java AWT method which gets called to specify
which layout manager should be used to layout the components in
standard containers.
Since layout managers CANNOT BE USED with this container the standard
setLayout has been OVERRIDDEN for this container and does nothing.
- Parameters:
- lm - the layout manager to use to layout this container's components
(IGNORED)
- Overrides:
- setLayout in class Container
- See Also:
- getLayout
setListDown
public void setListDown(boolean isDown) throws PropertyVetoException
- Handles dropping and "un-dropping" the ComboBox list.
- Parameters:
- isDown - true to drop the list, false to "un-drop" the list.
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- isListDown
setListItems
public void setListItems(String[] items) throws PropertyVetoException
- Adds the string array to the list.
- Parameters:
- items - items to add to the list
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getListItems, addItem(java.lang.String), addItem(java.lang.String, boolean), addItem(java.awt.Image, java.lang.String), addItem(java.awt.Image, java.lang.String, boolean)
setListText
public void setListText(int index,
String text) throws PropertyVetoException
- Changes the text associated with a drop-down item.
- Parameters:
- index - the zero-relative index of the drop-down item
- text - the text to associate with the drop-down item
- Throws: PropertyVetoException
- if the specified property value is unacceptable
setSearchable
public void setSearchable(boolean searchable) throws PropertyVetoException
- Conditionally sets the ComboBox to be searchable.
A searchable ComboBox allows the user to enter text into
the text field as long as it matches one of the existing list items.
This allows the user to select from a non-editable list by typing instead
of dropping-down the list and selecting with the mouse.
- Parameters:
- searchable - true = searchable, false = non-searchable
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- isSearchable
setShowHorizontalScroll
public void setShowHorizontalScroll(boolean cond) throws PropertyVetoException
- Sets whether or not the horizontal scrollbar should be made visible when
necessary or should never be made visible.
- Parameters:
- cond - true = show when necessary, false = never show
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- isShowHorizontalScroll
setShowVerticalScroll
public void setShowVerticalScroll(boolean cond) throws PropertyVetoException
- Sets whether or not the vertical scrollbar should be made visible when
necessary or should never be made visible.
- Parameters:
- cond - true = show when necessary, false = never show
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- isShowVerticalScroll
setText
public void setText(String newText) throws PropertyVetoException
- Sets the text in the edit field portion of the ComboBox
is not editable.
- Parameters:
- text - to replace the text of the EditBox
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getSelectedItem
sourceActionEvent
protected void sourceActionEvent(String command)
- Fire an action event to the listeners
- Parameters:
- command - the string containing the command to send
with the event.
- See Also:
- sourceActionEvent()
sourceActionEvent
protected void sourceActionEvent()
- Fire an action event to the listeners
with the actionCommand
- See Also:
- sourceActionEvent(java.lang.String)
updateMaxNumChars
protected void updateMaxNumChars()
- Used to calculate the preferred size of the text field to
determine overall preferred size.
Should be called after any manipulation of the list items.
- See Also:
- getPreferredSize
validate
public void validate()
- Overrides:
- validate in class Container
verify
protected void verify()
- Verify that at least one list item starts with the edit field's text.
If a match is found, the edit field's text is set to that item's value.
This is done only if searching is enabled.
All Packages Class Hierarchy This Package Previous Next Index