de.enough.polish.blackberry.nativeui
Class StringItemLabelField

java.lang.Object
  extended by net.rim.device.api.ui.Field
      extended by net.rim.device.api.ui.component.LabelField
          extended by de.enough.polish.blackberry.nativeui.StringItemLabelField
All Implemented Interfaces:
Animatable, NativeItem, net.rim.device.api.ui.DrawStyle

public class StringItemLabelField
extends net.rim.device.api.ui.component.LabelField
implements NativeItem

Paints a J2ME Polish field as it behaves normally instead of using a native BlackBerry representation.

Copyright Enough Software 2010

Author:
Robert Virkus, j2mepolish@enough.de

Field Summary
protected  StringItem stringItem
           
 
Fields inherited from class net.rim.device.api.ui.component.LabelField
DEFAULT_POSITION
 
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
 
Fields inherited from interface net.rim.device.api.ui.DrawStyle
BASELINE, BOTTOM, ELLIPSIS, HALIGN_MASK, HCENTER, HDEFAULT, HFULL, LEADING, LEFT, RIGHT, TOP, TRAILING, TRUNCATE_BEGINNING, VALIGN_MASK, VCENTER, VDEFAULT, VFULL
 
Constructor Summary
StringItemLabelField(StringItem parent)
          Creates a new custom field with a FIELD_LEFT style
StringItemLabelField(StringItem parent, long style)
          Creates a new custom field
 
Method Summary
 void animate(long currentTime, ClippingRegion repaintRegion)
          Animates this element.
 Item getPolishItem()
          Retrieves access to the parent item of this Native item.
 void notifyValueChanged(Item parent, Object value)
          Notifies the native implementation about a value change.
 
Methods inherited from class net.rim.device.api.ui.component.LabelField
getAccessibleContext, getPosition, getPreferredHeight, getPreferredWidth, getText, isSelectionCopyable, layout, paint, selectionCopy, setPosition, setText, setText, setText, setText, toString
 
Methods inherited from class net.rim.device.api.ui.Field
applyTheme, assertHaveEventLock, drawFocus, drawHighlightRegion, fieldChangeNotify, focusAdd, focusChangeNotify, focusRemove, getBackground, getBackground, getBorder, getBorder, getBorder, getChangeListener, getCommandItemProvider, getContentHeight, getContentLeft, getContentRect, getContentRect, getContentTop, getContentWidth, getContextMenu, getCookie, getExtent, getExtent, getFieldStyle, getFocusListener, getFocusRect, getFont, getHeight, getIndex, getLeafFieldWithFocus, getLeft, getManager, getMargin, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getOriginal, getPadding, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getScreen, getState, getStyle, getTop, getVisualState, getWidth, invalidate, invalidate, invalidateAll, invokeAction, isDataValid, isDirty, isEditable, isEnabled, isFocus, isFocusable, isMuddy, isPasteable, isScrollCopyable, isSelectable, isSelecting, isSelectionCutable, isSelectionDeleteable, isSpellCheckable, isStyle, isVisible, keyChar, keyControl, keyDown, keyRepeat, keyStatus, keyUp, makeContextMenu, moveFocus, moveFocus, navigationClick, navigationMovement, navigationUnclick, onDisplay, onExposed, onFocus, onMenuDismissed, onMenuDismissed, onObscured, onUndisplay, onUnfocus, onVisibilityChange, paintBackground, paste, select, selectionCut, selectionDelete, setBackground, setBackground, setBorder, setBorder, setBorder, setBorder, setChangeListener, setCommandItemProvider, setCookie, setDirty, setEditable, setEnabled, setExtent, setFocus, setFocusListener, setFont, setMargin, setMargin, setMinimalWidth, setMuddy, setNonSpellCheckable, setPadding, setPadding, setPosition, setVisualState, touchEvent, trackwheelClick, trackwheelRoll, trackwheelUnclick, updateLayout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

stringItem

protected StringItem stringItem
Constructor Detail

StringItemLabelField

public StringItemLabelField(StringItem parent)
Creates a new custom field with a FIELD_LEFT style

Parameters:
parent - the parent item

StringItemLabelField

public StringItemLabelField(StringItem parent,
                            long style)
Creates a new custom field

Parameters:
parent - the parent item
style - the BlackBerry native style
Method Detail

getPolishItem

public Item getPolishItem()
Description copied from interface: NativeItem
Retrieves access to the parent item of this Native item.

Specified by:
getPolishItem in interface NativeItem
Returns:
the parent item

notifyValueChanged

public void notifyValueChanged(Item parent,
                               Object value)
Description copied from interface: NativeItem
Notifies the native implementation about a value change. Note that this will call back the native item even when the NativeItem itself changes the value of the item.

Specified by:
notifyValueChanged in interface NativeItem
Parameters:
parent - the J2ME Polish parent item.
value - the new value, might be null

animate

public void animate(long currentTime,
                    ClippingRegion repaintRegion)
Description copied from interface: Animatable
Animates this element. Subclasses can override this method to create animations. The default implementation animates the background and the item view if present.

Specified by:
animate in interface Animatable
Parameters:
currentTime - the current time in milliseconds
repaintRegion - the repaint area that needs to be updated when this item is animated
See Also:
Item.addRelativeToContentRegion(ClippingRegion, int, int, int, int)