|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.microedition.lcdui.Displayable
javax.microedition.lcdui.Canvas
de.enough.polish.ui.Screen
de.enough.polish.ui.List
de.enough.polish.ui.FilteredList
public class FilteredList
Displays a list of choices that can be limited by the user by entering some input.
Copyright Enough Software 2007 - 2008
history
Jun 21, 2007 - michael creation
| Field Summary | |
|---|---|
protected int |
filterMode
|
protected int |
filterPosition
|
protected TextField |
filterTextField
|
| Fields inherited from class de.enough.polish.ui.List |
|---|
choiceGroup, listType, SELECT_COMMAND |
| Fields inherited from class javax.microedition.lcdui.Canvas |
|---|
DOWN, FIRE, GAME_A, GAME_B, GAME_C, GAME_D, KEY_NUM0, KEY_NUM1, KEY_NUM2, KEY_NUM3, KEY_NUM4, KEY_NUM5, KEY_NUM6, KEY_NUM7, KEY_NUM8, KEY_NUM9, KEY_POUND, KEY_STAR, LEFT, RIGHT, UP |
| Fields inherited from interface de.enough.polish.ui.Choice |
|---|
EXCLUSIVE, IMPLICIT, MULTIPLE, POPUP, TEXT_WRAP_DEFAULT, TEXT_WRAP_OFF, TEXT_WRAP_ON |
| Constructor Summary | |
|---|---|
FilteredList(java.lang.String title,
int listType)
Creates a new FilteredList |
|
FilteredList(java.lang.String title,
int listType,
ChoiceItem[] items)
Creates a new FilteredList |
|
FilteredList(java.lang.String title,
int listType,
ChoiceItem[] items,
Style style)
Creates a new FilteredList |
|
FilteredList(java.lang.String title,
int listType,
java.lang.String[] stringElements,
javax.microedition.lcdui.Image[] imageElements)
Creates a new FilteredList |
|
FilteredList(java.lang.String title,
int listType,
java.lang.String[] stringElements,
javax.microedition.lcdui.Image[] imageElements,
Style style)
Creates a new FilteredList |
|
FilteredList(java.lang.String title,
int listType,
Style style)
Creates a new FilteredList |
|
| Method Summary | |
|---|---|
void |
animate(long currentTime,
ClippingRegion repaintRegion)
Animates this screen. |
int |
append(ChoiceItem item)
Appends a ChoiceItem to the List. |
protected void |
calculateContentArea(int x,
int y,
int width,
int height)
Calculates and sets the content area for this screen. |
boolean |
containsChangesTo(boolean[] flags)
Determines whether there are any changes compared to the specified boolean array. |
protected java.lang.String |
createCssSelector()
Retrieves the CSS selector for this screen. |
void |
delete(int elementNum)
Deletes the element referenced by elementNum. |
void |
deleteAll()
Deletes all elements from this List. |
void |
focus(int index,
boolean force)
Focuses the specified item. |
void |
focus(int index,
Item item,
boolean force)
Focuses the specified item. |
void |
focus(Item item,
boolean force)
Focuses the specified item. |
Item |
getCurrentItem()
Retrieves the currently focused item. |
java.lang.String |
getFilterText()
|
ChoiceItem |
getItem(int elementNum)
Gets the ChoiceItem of the element referenced by
elementNum. |
int |
getSelectedFlags(boolean[] selectedArray_return)
Queries the state of a List and returns the
state of all elements in the boolean array
selectedArray_return. |
int |
getSelectedIndex()
Returns the index number of an element in the List
that is selected. |
protected boolean |
handleCommand(javax.microedition.lcdui.Command cmd)
Tries to handle the specified command. |
protected boolean |
handleKeyPressed(int keyCode,
int gameAction)
Handles the key-pressed event. |
protected boolean |
handleKeyReleased(int keyCode,
int gameAction)
Handles the key-released event. |
protected boolean |
handleKeyRepeated(int keyCode,
int gameAction)
Handles the key-repeated event. |
void |
insert(int elementNum,
ChoiceItem item)
Inserts an element into the List just prior to the element specified. |
boolean |
isSelected(int elementNum)
Gets a boolean value indicating whether this element is selected. |
void |
itemStateChanged(Item item)
Called when internal state of an Item has been
changed by the user. |
protected boolean |
matches(java.lang.String filterText,
ChoiceItem cItem,
boolean checkForSelectedRadioItem)
Checks if the given item matches the current input text. |
protected void |
paintScreen(javax.microedition.lcdui.Graphics g)
Paints the screen. |
void |
set(int elementNum,
ChoiceItem item)
Sets the ChoiceItem of the
element referenced by elementNum,
replacing the previous one. |
void |
set(int elementNum,
java.lang.String stringPart,
javax.microedition.lcdui.Image imagePart,
Style elementStyle)
Sets the String and Image parts of the
element referenced by elementNum,
replacing the previous contents of the element. |
void |
setFilterLabel(java.lang.String label)
|
void |
setFilterStyle(Style filterStyle)
|
void |
setFilterText(java.lang.String text)
|
protected void |
setItemCommands(ArrayList commandsList,
Item item)
Sets the commands of the given item |
void |
setSelectedFlags(boolean[] selectedArray)
Sets the selected state of all elements of the List. |
void |
setSelectedIndex(int elementNum,
boolean selected)
Sets the selected state of an element. |
void |
setStyle(Style style)
Sets the style of this screen. |
void |
showNotify()
Initialises this screen and informs all items about being painted soon. |
int |
size()
Gets the number of elements in the List. |
java.lang.String |
toSelectionString(java.lang.String delimiter)
Concats all strings from the selected elements together. |
| Methods inherited from class de.enough.polish.ui.List |
|---|
append, append, getFitPolicy, getFont, getImage, getString, insert, insert, removeCommand, set, setFitPolicy, setFont, setSelectCommand |
| Methods inherited from class javax.microedition.lcdui.Canvas |
|---|
getKeyCode, getKeyName, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, isDoubleBuffered, repaint, repaint, serviceRepaints |
| Methods inherited from class javax.microedition.lcdui.Displayable |
|---|
getHeight, getTicker, getWidth, setTicker |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int filterPosition
protected int filterMode
protected final TextField filterTextField
| Constructor Detail |
|---|
public FilteredList(java.lang.String title,
int listType)
title - the titlelistType - the type, either Choice.MULTIPLE, Choice.IMPLICIT or Choice.EXCLUSIVE
public FilteredList(java.lang.String title,
int listType,
Style style)
title - the titlelistType - the type, either Choice.MULTIPLE, Choice.IMPLICIT or Choice.EXCLUSIVEstyle - style for the list
public FilteredList(java.lang.String title,
int listType,
java.lang.String[] stringElements,
javax.microedition.lcdui.Image[] imageElements)
title - the titlelistType - the type, either Choice.MULTIPLE, Choice.IMPLICIT or Choice.EXCLUSIVEstringElements - list item textsimageElements - list item images
public FilteredList(java.lang.String title,
int listType,
java.lang.String[] stringElements,
javax.microedition.lcdui.Image[] imageElements,
Style style)
title - the titlelistType - the type, either Choice.MULTIPLE, Choice.IMPLICIT or Choice.EXCLUSIVEstringElements - list item textsimageElements - list item imagesstyle - style for the list
public FilteredList(java.lang.String title,
int listType,
ChoiceItem[] items)
title - the titlelistType - the type, either Choice.MULTIPLE, Choice.IMPLICIT or Choice.EXCLUSIVEitems - items of the list
public FilteredList(java.lang.String title,
int listType,
ChoiceItem[] items,
Style style)
title - the titlelistType - the type, either Choice.MULTIPLE, Choice.IMPLICIT or Choice.EXCLUSIVEitems - items of the liststyle - style for the list| Method Detail |
|---|
protected boolean handleKeyPressed(int keyCode,
int gameAction)
Screen
handleKeyPressed in class ListkeyCode - the code of the pressed key, e.g. Canvas.KEY_NUM2gameAction - the corresponding game-action, e.g. Canvas.UP
protected boolean handleKeyReleased(int keyCode,
int gameAction)
Screen
handleKeyReleased in class ScreenkeyCode - the code of the released key, e.g. Canvas.KEY_NUM2gameAction - the corresponding game-action, e.g. Canvas.UP
protected boolean handleKeyRepeated(int keyCode,
int gameAction)
Screen
handleKeyRepeated in class ScreenkeyCode - the code of the repeated key, e.g. Canvas.KEY_NUM2gameAction - the corresponding game-action, e.g. Canvas.UP
public void animate(long currentTime,
ClippingRegion repaintRegion)
Screen
animate in class ScreencurrentTime - the current time in millisecondsrepaintRegion - the repaint area that needs to be updated when this item is animated
protected void setItemCommands(ArrayList commandsList,
Item item)
Screen
setItemCommands in class Screenitem - the item which has at least one commandScreen.removeItemCommands(Item)
protected void calculateContentArea(int x,
int y,
int width,
int height)
Screen
calculateContentArea in class Screenx - left start of the content area, might later be adjusted by an external scrollindicatory - top start of the content area, is adjusted by the top margin, title height, subtitle height,
info height and maybe ticker height (when the ticker should be painted at the top).width - width of the content area, might later be adjusted by an external scrollindicatorheight - height of the content area, is adjusted by the title height, subtitle height,
info height and ticker height.public void showNotify()
Screen
showNotify in interface AccessibleCanvasshowNotify in class Screenpublic Item getCurrentItem()
Screen
getCurrentItem in class Screenprotected void paintScreen(javax.microedition.lcdui.Graphics g)
Screen
paintScreen in class Screeng - the graphics on which the screen should be paintedScreen.contentX,
Screen.contentY,
Screen.contentWidth,
Screen.contentHeight,
Screen.paintScrollIndicator,
Screen.paintScrollIndicatorUp,
Screen.paintScrollIndicatorDownpublic int append(ChoiceItem item)
ListChoiceItem to the List.
append in class Listitem - ChoiceItem to be added
public void delete(int elementNum)
ListelementNum.
delete in interface Choicedelete in class ListelementNum - the index of the element to be deletedin interface Choicepublic void deleteAll()
List
deleteAll in interface ChoicedeleteAll in class Listin interface Choicepublic ChoiceItem getItem(int elementNum)
ListChoiceItem of the element referenced by
elementNum.
getItem in class ListelementNum - the number of the element to be queried
public int getSelectedFlags(boolean[] selectedArray_return)
ListList and returns the
state of all elements in the boolean array
selectedArray_return.
getSelectedFlags in interface ChoicegetSelectedFlags in class ListselectedArray_return - array to contain the results
in interface Choice,
List.setSelectedFlags(boolean[])public boolean containsChangesTo(boolean[] flags)
flags - an array indicating the expected state of this list - true array elements indicate "selected" items of this list
public int getSelectedIndex()
ListList
that is selected.
getSelectedIndex in interface ChoicegetSelectedIndex in class Listin interface Choice,
List.setSelectedIndex(int, boolean)
public void insert(int elementNum,
ChoiceItem item)
ListList just prior to the element specified.
insert in class ListelementNum - the index of the element where insertion is to occuritem - ChoiceItem of the element to be inserted
public void set(int elementNum,
java.lang.String stringPart,
javax.microedition.lcdui.Image imagePart,
Style elementStyle)
String and Image parts of the
element referenced by elementNum,
replacing the previous contents of the element.
set in class ListelementNum - the index of the element to be setstringPart - the string part of the new elementimagePart - the image part of the element, or null if there is no image partelementStyle - the style for the new list element.
java.lang.IndexOutOfBoundsException - if elementNum is invalid
java.lang.NullPointerException - if stringPart is nullin interface Choice
public void set(int elementNum,
ChoiceItem item)
ListChoiceItem of the
element referenced by elementNum,
replacing the previous one.
set in class ListelementNum - the index of the element to be setitem - ChoiceItem of the new elementpublic void setSelectedFlags(boolean[] selectedArray)
ListList.
setSelectedFlags in interface ChoicesetSelectedFlags in class ListselectedArray - an array in which the method collect the selection statusin interface Choice,
List.getSelectedFlags(boolean[])
public void setSelectedIndex(int elementNum,
boolean selected)
List
setSelectedIndex in interface ChoicesetSelectedIndex in class ListelementNum - the index of the element, starting from zeroselected - the state of the element, where true means selected and false means not selectedin interface Choice,
List.getSelectedIndex()
public void focus(int index,
boolean force)
Screen
focus in class Screenindex - the index of the item which is already shown on this screen.force - true when the item should be focused even when it is inactive (like a label for example)
public void focus(Item item,
boolean force)
Screen
focus in class Screenitem - the item which is already shown on this screen.force - true when the item should be focused even when it is inactive (like a label for example)
public void focus(int index,
Item item,
boolean force)
Screen
focus in class Screenindex - the index of the item which is already shown on this screen.item - the item which is already shown on this screen.force - true when the item should be focused even when it is inactive (like a label for example)public boolean isSelected(int elementNum)
List
isSelected in interface ChoiceisSelected in class ListelementNum - index to element to be queried
in interface Choicepublic int size()
ListList.
size in interface Choicesize in class Listin interface Choiceprotected boolean handleCommand(javax.microedition.lcdui.Command cmd)
Screen
handleCommand in class Screencmd - the command
public void setFilterLabel(java.lang.String label)
public void setFilterText(java.lang.String text)
public java.lang.String getFilterText()
public void setFilterStyle(Style filterStyle)
filterStyle -
protected boolean matches(java.lang.String filterText,
ChoiceItem cItem,
boolean checkForSelectedRadioItem)
filterText - the current filter textcItem - the ChoiceItemcheckForSelectedRadioItem - true when this is an exclusive list
FILTER_STARTS_WITH,
FILTER_INDEX_OF,
List.setFitPolicy(int)public void itemStateChanged(Item item)
ItemStateListenerItem has been
changed by the user.
This happens when the user:
ChoiceGroup;Gauge;TextField;DateField; andItem.notifyStateChanged() was called on an
Item. It is up to the device to decide when it considers a
new value to have been entered into an Item. For example,
implementations of text editing within a TextField
vary greatly
from device to device.
In general, it is not expected that the listener will be called
after every change is made. However, if an item's value
has been changed, the listener
will be called to notify the application of the change
before it is called for a change on another item, and before a
command is delivered to the Form's
CommandListener. For implementations that have the
concept of an input
focus, the listener should be called no later than when the focus moves
away from an item whose state has been changed. The listener
should be called only if the item's value has actually been
changed.
The listener is not called if the application changes the value of an interactive item.
itemStateChanged in interface ItemStateListeneritem - the item that was changedpublic void setStyle(Style style)
Screen
setStyle in class Liststyle - the styleprotected java.lang.String createCssSelector()
Screen
createCssSelector in class Listpublic java.lang.String toSelectionString(java.lang.String delimiter)
delimiter - the delimiter between elements
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||