de.enough.polish.blackberry.ui
Class PolishOneLineField

java.lang.Object
  extended by net.rim.device.api.ui.Field
      extended by net.rim.device.api.ui.ScrollView
          extended by net.rim.device.api.ui.Manager
              extended by net.rim.device.api.ui.container.VerticalFieldManager
                  extended by de.enough.polish.blackberry.ui.PolishOneLineField
All Implemented Interfaces:
AccessibleField, PolishTextField, net.rim.device.api.ui.AdjustmentListener

public class PolishOneLineField
extends net.rim.device.api.ui.container.VerticalFieldManager
implements PolishTextField, AccessibleField

An EditField that uses a single line (without text wrapping)

Copyright Enough Software 2011

Author:
Ovidiu Iliescu

Field Summary
 boolean ignoreLocalSetCurrentLocation
           
 boolean processKeyEvents
           
 
Fields inherited from class net.rim.device.api.ui.Manager
BOTTOMMOST, DOWNWARD, HORIZONTAL_SCROLL, HORIZONTAL_SCROLL_MASK, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_MASK, LEAVE_BLANK_SPACE, LEFTMOST, LEFTWARD, NO_HORIZONTAL_SCROLL, NO_HORIZONTAL_SCROLLBAR, NO_SCROLL_RESET, NO_VERTICAL_SCROLL, NO_VERTICAL_SCROLLBAR, QUANTA_FONT, RIGHTMOST, RIGHTWARD, TOPMOST, UPWARD, VERTICAL_SCROLL, VERTICAL_SCROLL_MASK, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_MASK
 
Fields inherited from class net.rim.device.api.ui.Field
ACTION_INVOKE, AXIS_HORIZONTAL, AXIS_SEQUENTIAL, AXIS_VERTICAL, EDITABLE, EDITABLE_MASK, FIELD_BOTTOM, FIELD_HALIGN_MASK, FIELD_HCENTER, FIELD_LEADING, FIELD_LEFT, FIELD_RIGHT, FIELD_TOP, FIELD_TRAILING, FIELD_VALIGN_MASK, FIELD_VCENTER, FOCUSABLE, FOCUSABLE_MASK, HIGHLIGHT_FOCUS, HIGHLIGHT_SELECT, NON_FOCUSABLE, NON_SPELLCHECKABLE, READONLY, SPELLCHECKABLE, SPELLCHECKABLE_MASK, STATUS_MOVE_FOCUS_HORIZONTALLY, STATUS_MOVE_FOCUS_VERTICALLY, USE_ALL_HEIGHT, USE_ALL_WIDTH, VISUAL_STATE_ACTIVE, VISUAL_STATE_DISABLED, VISUAL_STATE_DISABLED_FOCUS, VISUAL_STATE_FOCUS, VISUAL_STATE_NORMAL
 
Constructor Summary
PolishOneLineField(String label, String text, int numChars, long style)
          Creates a new edit field that uses a single line (without text wrapping)
 
Method Summary
 void doLayout(int width, int height)
           
 void focusAdd(boolean draw)
           
 void focusRemove()
           
 int getCursorPosition()
           
 PolishEditField getEditField()
          Retrieves the internally used edit field
 int getInsertPositionOffset()
           
 String getText()
           
 void moveTo(int x, int y)
          Sets the position of the field
 boolean navigationMovement(int dx, int dy, int status, int time)
           
 boolean needsNavigationFix()
           
protected  void onUnfocus()
           
 void relayout()
          Updates the layout (just calls updateLayout())
 void setChangeListener(net.rim.device.api.ui.FieldChangeListener listener)
           
 void setCurrentLocation(int x, int y)
           
 void setCursorPosition(int pos)
           
 void setFilter(net.rim.device.api.ui.text.TextFilter filter)
           
 void setPaintPosition(int x, int y)
           
 void setStyle(Style style)
           
 void setText(String text)
           
 void sublayout(int width, int height)
           
 
Methods inherited from class net.rim.device.api.ui.container.VerticalFieldManager
getFieldAtLocation, getPreferredHeight, getPreferredWidth, nextFocus, subpaint
 
Methods inherited from class net.rim.device.api.ui.Manager
add, addAll, delete, deleteAll, deleteRange, getAccessibleContext, getField, getFieldCount, getFieldWithFocus, getFieldWithFocusIndex, getFocusRect, getHorizontalScroll, getLeafFieldWithFocus, getPreferredHeightOfChild, getPreferredWidthOfChild, getVerticalScroll, getVirtualHeight, getVirtualWidth, insert, insertAll, invalidate, invalidate, invalidateFieldRange, invokeAction, isDataValid, isDirty, isDownArrowShown, isFocusable, isMuddy, isSelecting, isUpArrowShown, isValidLayout, keyChar, keyControl, keyDown, keyRepeat, keyStatus, keyUp, layout, layoutChild, makeMenu, moveFocus, moveFocus, navigationClick, navigationUnclick, nextFocus, onFocus, paint, paintChild, replace, setDirty, setFieldWithFocus, setFocus, setHorizontalQuantization, setPositionChild, setScrollingInertial, setVerticalQuantization, setVirtualExtent, touchEvent, trackwheelClick, trackwheelUnclick
 
Methods inherited from class net.rim.device.api.ui.ScrollView
configurationChanged, getHorizontalAdjustment, getVerticalAdjustment, getVisibleHeight, getVisibleWidth, onDisplay, onUndisplay, setExtent, setHorizontalAdjustment, setHorizontalScroll, setHorizontalScroll, setScrollListener, setVerticalAdjustment, setVerticalScroll, setVerticalScroll, valueChanged, waitForScrolling
 
Methods inherited from class net.rim.device.api.ui.Field
applyTheme, assertHaveEventLock, drawFocus, drawHighlightRegion, fieldChangeNotify, focusChangeNotify, getBackground, getBackground, getBorder, getBorder, getBorder, getChangeListener, getCommandItemProvider, getContentHeight, getContentLeft, getContentRect, getContentRect, getContentTop, getContentWidth, getContextMenu, getCookie, getExtent, getExtent, getFieldStyle, getFocusListener, getFont, getHeight, getIndex, getLeft, getManager, getMargin, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getOriginal, getPadding, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getScreen, getState, getStyle, getTop, getVisualState, getWidth, invalidateAll, isEditable, isEnabled, isFocus, isPasteable, isScrollCopyable, isSelectable, isSelectionCopyable, isSelectionCutable, isSelectionDeleteable, isSpellCheckable, isStyle, isVisible, makeContextMenu, onExposed, onMenuDismissed, onMenuDismissed, onObscured, onVisibilityChange, paintBackground, paste, select, selectionCopy, selectionCut, selectionDelete, setBackground, setBackground, setBorder, setBorder, setBorder, setBorder, setCommandItemProvider, setCookie, setEditable, setEnabled, setFocus, setFocusListener, setFont, setMargin, setMargin, setMinimalWidth, setMuddy, setNonSpellCheckable, setPadding, setPadding, setPosition, setVisualState, trackwheelRoll, updateLayout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.enough.polish.blackberry.ui.PolishTextField
getExtent
 

Field Detail

processKeyEvents

public boolean processKeyEvents

ignoreLocalSetCurrentLocation

public boolean ignoreLocalSetCurrentLocation
Constructor Detail

PolishOneLineField

public PolishOneLineField(String label,
                          String text,
                          int numChars,
                          long style)
Creates a new edit field that uses a single line (without text wrapping)

Parameters:
label - the label
text - the current text
numChars - the number of allowed characters
style - the style
Method Detail

getEditField

public PolishEditField getEditField()
Retrieves the internally used edit field

Returns:
the edit field

moveTo

public void moveTo(int x,
                   int y)
Sets the position of the field

Parameters:
x - horizontal position
y - vertical position

sublayout

public void sublayout(int width,
                      int height)
Overrides:
sublayout in class net.rim.device.api.ui.container.VerticalFieldManager

relayout

public void relayout()
Updates the layout (just calls updateLayout())


getText

public String getText()
Specified by:
getText in interface PolishTextField

setText

public void setText(String text)
Specified by:
setText in interface PolishTextField

setStyle

public void setStyle(Style style)
Specified by:
setStyle in interface PolishTextField

setPaintPosition

public void setPaintPosition(int x,
                             int y)
Specified by:
setPaintPosition in interface PolishTextField

focusRemove

public void focusRemove()
Specified by:
focusRemove in interface PolishTextField
Overrides:
focusRemove in class net.rim.device.api.ui.Field

focusAdd

public void focusAdd(boolean draw)
Overrides:
focusAdd in class net.rim.device.api.ui.Field

setCurrentLocation

public void setCurrentLocation(int x,
                               int y)
Overrides:
setCurrentLocation in class net.rim.device.api.ui.ScrollView

onUnfocus

protected void onUnfocus()
Overrides:
onUnfocus in class net.rim.device.api.ui.Manager

navigationMovement

public boolean navigationMovement(int dx,
                                  int dy,
                                  int status,
                                  int time)
Specified by:
navigationMovement in interface AccessibleField
Overrides:
navigationMovement in class net.rim.device.api.ui.Manager

setCursorPosition

public void setCursorPosition(int pos)
Specified by:
setCursorPosition in interface PolishTextField

getInsertPositionOffset

public int getInsertPositionOffset()
Specified by:
getInsertPositionOffset in interface PolishTextField

setChangeListener

public void setChangeListener(net.rim.device.api.ui.FieldChangeListener listener)
Specified by:
setChangeListener in interface PolishTextField
Overrides:
setChangeListener in class net.rim.device.api.ui.Field

getCursorPosition

public int getCursorPosition()
Specified by:
getCursorPosition in interface PolishTextField

doLayout

public void doLayout(int width,
                     int height)
Specified by:
doLayout in interface PolishTextField

needsNavigationFix

public boolean needsNavigationFix()
Specified by:
needsNavigationFix in interface PolishTextField

setFilter

public void setFilter(net.rim.device.api.ui.text.TextFilter filter)
Specified by:
setFilter in interface PolishTextField