danger.ui
Class PasswordEditText

java.lang.Object
  extended by danger.app.Listener
      extended by danger.ui.View
          extended by danger.ui.Container
              extended by danger.ui.Control
                  extended by danger.ui.WrappedText
                      extended by danger.ui.DisplayText
                          extended by danger.ui.StaticTextBox
                              extended by danger.ui.ScrollingTextBox
                                  extended by danger.ui.LinkTextBox
                                      extended by danger.ui.SelectTextBox
                                          extended by danger.ui.MutableTextBox
                                              extended by danger.ui.Editor.Filters
                                                  extended by danger.ui.Editor.TextChanges
                                                      extended by danger.ui.Editor.Keyboard
                                                          extended by danger.ui.Editor.Clipboard
                                                              extended by danger.ui.Editor.UndoRedo
                                                                  extended by danger.ui.Editor.Input
                                                                      extended by danger.ui.Editor.AutoText
                                                                          extended by danger.ui.EditText
                                                                              extended by danger.ui.PasswordEditText
All Implemented Interfaces:
Anchored, Spannable, Spanned, TextControl, ToolTipOwner, GetChars, TextBufferLike, CharSequence


public class PasswordEditText
extends EditText

PasswordTextField is a TextField in which all characters display as dots. The user is also prevented from copying text from the field to the pasteboard. There is not much motivation for a multiline password field to exist, but MIDP requires one, so here it is for you to use too.


Field Summary
 
Fields inherited from class danger.ui.SelectTextBox
CURSOR_FIXED, CURSOR_MOBILE, LAST_POINT_SET, mCursorRect, SELECTION_ANCHOR, SELECTION_END
 
Fields inherited from class danger.ui.WrappedText
JUSTIFY_CENTER, JUSTIFY_LEFT, JUSTIFY_RIGHT
 
Fields inherited from class danger.ui.Control
mValue
 
Fields inherited from class danger.ui.View
DEFAULT_SCROLL_FOCUS_MARGIN, FOCUS_DEFAULT, FOCUS_DOWNWARD, FOCUS_LEFTWARD, FOCUS_NONE, FOCUS_RIGHTWARD, FOCUS_UPWARD, mOriginX, mOriginY, mStyle, POSITION_ABOVE, POSITION_ALIGN_BASELINE, POSITION_ALIGN_BOTTOM, POSITION_ALIGN_HORIZONTALLY, POSITION_ALIGN_LEFT, POSITION_ALIGN_PARENT_BOTTOM, POSITION_ALIGN_PARENT_RIGHT, POSITION_ALIGN_RIGHT, POSITION_ALIGN_TOP, POSITION_ALIGN_VERTICALLY, POSITION_BELOW, POSITION_CENTER_HORIZONTALLY, POSITION_CENTER_VERTICALLY, POSITION_TO_LEFT, POSITION_TO_RIGHT, PREFER_DIRECTION_NONE, PREFER_HORIZONTAL_DIRECTION, PREFER_VERTICAL_DIRECTION, STATE_AT_AND_SPACE_PAGE, STATE_CAN_FOCUS, STATE_DEBUG_BOUNDS, STATE_ENABLED, STATE_FOCUSED, STATE_MAKE_DING, STATE_PARTIAL_FOCUS_OK, STATE_TRANSPARENT, STATE_VISIBLE, WIDTH_FILL_TO_RIGHT
 
Fields inherited from interface danger.text.span.Spannable
SPAN_DELETE_ON_EMPTY, SPAN_ENDS_AFTER, SPAN_ENDS_BEFORE, SPAN_EXCLUSIVE_AFTER, SPAN_EXCLUSIVE_BEFORE, SPAN_EXCLUSIVE_EXCLUSIVE, SPAN_EXCLUSIVE_INCLUSIVE, SPAN_GROW_FROM_ZERO, SPAN_INCLUSIVE_AFTER, SPAN_INCLUSIVE_BEFORE, SPAN_INCLUSIVE_EXCLUSIVE, SPAN_INCLUSIVE_INCLUSIVE, SPAN_MARKLIKE, SPAN_PARAGRAPH, SPAN_POINTLIKE, SPAN_STARTS_AFTER, SPAN_STARTS_BEFORE
 
Constructor Summary
PasswordEditText()
          Default constructor
PasswordEditText(String inLabel)
          Constructor that includes a label
 
Method Summary
 boolean canGrabSelection()
          Returns false because you can't copy from a password field.
protected  CharSequence getDisplayText()
          Returns the display buffer, which has bullets instead of the real characters of the buffer.
 CharSequence grabSelectionSequence()
          Returns null because you can't copy from a password field.
protected  void onTextChanged(int start, int oldLen, int newLen)
          Updates the display buffer to match the insertions and deletions of the real buffer.
 
Methods inherited from class danger.ui.EditText
getActiveMetaKey, setActiveMetaKey
 
Methods inherited from class danger.ui.Editor.AutoText
clear, deleteChar, getAutoCap, getAutoText, insert, isShortcutTrigger, setAutoCap, setAutoText
 
Methods inherited from class danger.ui.Editor.Input
canInsertSpecial, eventKeyDown, eventRawKeyUp, eventShortcut, isInputMethodActive, receiveEvent
 
Methods inherited from class danger.ui.Editor.UndoRedo
canRedo, canUndo, clearUndo, redo, setText, setText, undo
 
Methods inherited from class danger.ui.Editor.Clipboard
canCut, canPaste, cutSelection, paste
 
Methods inherited from class danger.ui.Editor.Keyboard
deleteLineAtPoint, deleteWord, eventKeyHeld, eventKeyRepeat, eventKeyUp, forwardDeleteChar, getAcceptKeyRepeats, getCanMakeChanges, getCursorColor, getSelectionBackgroundColor, isEditable, setAcceptKeyRepeats, setCanMakeChanges, setEditable, setUseOverlay
 
Methods inherited from class danger.ui.Editor.TextChanges
delete, deleteSelection, forwardDeleteChar, insert, insert, insertChar
 
Methods inherited from class danger.ui.Editor.Filters
attachInputFilter, attachInputVerifier, attachInputVerifiers, detachInputVerifier, getInputFilter, getInputVerifiers, getTextColor, loseFocus, setInputFilter, takeFocus
 
Methods inherited from class danger.ui.SelectTextBox
addTextEditMenuItems, bringCursorIntoView, canCopy, canSelectAll, copySelection, eventPeriodicPulse, eventWidgetDown, eventWidgetUp, extendSelectionByCharacters, extendSelectionByLines, extendSelectionToEnd, extendSelectionToEndOfLine, extendSelectionToEndOfWord, extendSelectionToHome, extendSelectionToNextPage, extendSelectionToPreviousPage, extendSelectionToStartOfLine, extendSelectionToStartOfWord, getAdvanceFocusOnReturnKey, getCursorPolicy, getInsertionPoint, getInterestingRect, getLastPointSet, getLeftBorder, getSelectionForegroundColor, getStyled, getTextEditMenu, grabSelection, invalidateCursor, moveCursorByCharacters, moveCursorByLines, moveCursorToEndOfLine, moveCursorToEndOfWord, moveCursorToStartOfLine, moveCursorToStartOfWord, moveToAnchor, pageDown, pageToEnd, pageToHome, pageUp, paint, removeSpan, resetSelection, seekAfterAtomic, seekBeforeAtomic, selectAll, selectionEnd, selectionStart, setAdvanceFocusOnReturnKey, setAllowCursorBlink, setCursorPolicy, setInsertionPoint, setSelectAllOnFocus, setSelection, setSelectionEnd, setSelectionStart, setSpan, setStyled, showContextMenu
 
Methods inherited from class danger.ui.LinkTextBox
addLinkMenuItems, getAcceptFocusOnlyWhenLinksVisible, getClickSpan, getLinkOptionsMenu, getLinksFocusable, selectNextLink, selectNextLinkBelow, selectNextLinkOn, selectPreviousLink, selectPreviousLinkAbove, selectPreviousLinkOn, setAcceptFocusOnlyWhenLinksVisible, setLinksFocusable, willFocusWithin, willFocusWithin
 
Methods inherited from class danger.ui.ScrollingTextBox
canSuperFocus, drawContent, getBackgroundColor, getFocusPadding, getLabelWhenEmpty, getScrolling, getTextBackgroundColor, getTextOutlineColor, isSuperFocused, setCanSuperFocus, setLabelWhenEmpty, setScrolling, setSuperFocused
 
Methods inherited from class danger.ui.StaticTextBox
bringPointIntoView, chooseWrapWidth, drawFrame, getAutoResize, getBaseline, getBorderShowsScrolling, getBottomBorder, getHeightForLines, getPointRect, getRightBorder, getTopBorder, getVisibleSpans, getVisibleSpans, getWantQuoteHack, onSetHasBorder, onSetTitle, setAcceptFocus, setAutoReflowChildren, setAutoResize, setBorderShowsScrolling, setSize, setWantQuoteHack, textHeightChanged
 
Methods inherited from class danger.ui.DisplayText
attachScrollbar, canScrollDown, canScrollUp, detachScrollbar, drawText, getDisplayHorizontalScroll, getGrowFromBottom, getHorizontalScroll, getTextAreaHeight, getTextAreaWidth, getVerticalPadding, getVerticalScroll, pageDown, pageUp, paint, scrollDown, scrollUp, setGrowFromBottom, setHorizontalScroll, setTextAreaHeight, setTextAreaWidth, setVerticalScroll, setWidth
 
Methods inherited from class danger.ui.WrappedText
afterTextChanged, beforeTextChanged, charAt, getAdvance, getAlignment, getAllSpans, getBlankAfterFinalNewline, getChars, getChars, getChars, getContents, getFinalLineSpacing, getFont, getLine, getLineBaseline, getLineBottom, getLineCount, getLineEnd, getLineFlags, getLineForOffset, getLineForVertical, getLineParagraphStart, getLineSpacing, getLineStart, getLineTop, getLineVisibleLength, getSpanEnd, getSpanFlags, getSpansOverlapping, getSpanStart, getTabIncrement, getText, getTextHeight, getTextSequence, getVerticalDimensions, getWrapWidth, length, newLineBreaker, nextSpanTransition, numLines, rewrap, setAlignment, setBlankAfterFinalNewline, setFinalLineSpacing, setFont, setLineSpacing, setTabIncrement, setWrapWidth, subSequence, toString
 
Methods inherited from class danger.ui.Control
drawFocusBox, drawIdleBox, drawIdleBox, getEvent, getEventListener, getEventType, getHasBorder, getMaxToolTipLines, getTitle, getTitleSequence, getToolTip, getValue, hasToolTip, sendEvent, setEvent, setEvent, setEvent, setEvent, setEvent, setEventArg, setEventListener, setHasBorder, setMaxToolTipLines, setTitle, setTitle, setToolTip, setValue, showToolTip
 
Methods inherited from class danger.ui.Container
addChild, addChild, addChildAt, addChildAt, addFromContainerResource, addFromContainerResource, addFromContainerResource, addFromDialogResource, addFromDialogResource, advanceFocus, advanceFocusInWindow, childCount, childIsOnScreen, disable, enable, eventRawKeyDown, eventRawKeyHeld, eventRawKeyRepeat, eventWidgetHeld, focusedDescendantIsValid, getBottomChild, getBottomChild, getChildAt, getChildIndex, getChildWithID, getControlWithID, getDescendantWithID, getFirstChild, getFirstFocusableChild, getFocusableChildInWindow, getFocusedChild, getFocusedLeaf, getLastChild, getLastFocusableChild, getLeftMostChild, getNextFocusableChild, getNextFocusableChild, getPageHeight, getPrevFocusableChild, getPrevFocusableChild, getRightMostChild, getRightMostChild, handleButtonShortcut, hideAllChildren, isDescendant, keepRectInView, moveChildToIndex, onChildPositionChanged, onChildSizeChanged, onChildVisibilityChanged, paintChildren, reflowChildren, removeAllChildren, removeChild, reverseFocus, setFocusedChild, setFocusedChild, setFocusedChild, setFocusedDescendant, setFocusedDescendant, setFocusedDescendant, setFocusToFirstDescendant, setFormatDateForControlWithID, setFormatDateForTextControlWithID, setFormatTextForControlWithID, setFormatTextForControlWithID, setFormatTextForControlWithID, setFormatTextForControlWithID, setFormatTextForControlWithID, setFormatTextForTextControlWithID, setFormatTextForTextControlWithID, setFormatTextForTextControlWithID, setFormatTextForTextControlWithID, setFormatTextForTextControlWithID, setListenerForAllControls, setReflowAdjustHeight, setWindow, showAllChildren, snapHeightToChildren, snapHeightToChildren, snapToChildren, snapWidthToChildren, snapWidthToChildren
 
Methods inherited from class danger.ui.View
boundsIntersect, boundsIntersect, canLoseFocus, clear, clear, copyStyle, getAcceptFocus, getBottom, getBounds, getBounds, getFocusTraversalDirection, getFocusTraversalFrom, getFocusTraversalPolicy, getFrame, getFrame, getGlobalBottom, getGlobalLeft, getGlobalRight, getGlobalTop, getHeight, getID, getInterestingRect, getLabelFont, getLabelFont, getLeft, getOrigin, getOrigin, getOriginX, getOriginY, getParent, getParentContainer, getPartialFocusOK, getRight, getScrollFocusMargin, getSibling, getState, getStyle, getStyleColor, getStyleFont, getTop, getWidth, getWindow, globalToLocal, globalToLocalH, globalToLocalV, hide, invalidate, invalidate, invalidate, invalidateIndependentOfOrigin, invalidateIndependentOfOrigin, isEnabled, isFocusable, isFocused, isOnScreen, isTransparent, isVisible, isVisibleInHierarchy, isVisibleOnScreen, justSetVisible, localToGlobal, localToGlobal, localToGlobalH, localToGlobalV, localToWindow, moveBy, notifyWhenParentSizeChanges, notifyWhenPositionChanges, notifyWhenSizeChanges, offsetOrigin, offsetOrigin, onAddedToParent, onDecoded, onEnabledStateChanged, onHide, onPeriodicPulse, onPositionChanged, onRemovedFromParent, onShortcut, onShortcut, onShortcutConsumed, onShow, onSizeChanged, onStyleChanged, onViewPositionChanged, onViewSizeChanged, onWindowPaint, playLimitSound, receiveEventInternal, resetOrigin, sendEventToWindow, setAtAndSpacePage, setBackground, setBackgroundColor, setBottom, setDebugBounds, setDynamicPosition, setDynamicWidth, setEnabled, setFocusTraversalDirection, setFocusTraversalFrom, setFocusTraversalPolicy, setFrame, setHeight, setKeyedValue, setLabelFont, setLeft, setMakeLimitNoise, setOrigin, setOrigin, setPartialFocusOK, setPosition, setPreferredDirection, setRight, setScrollFocusMargin, setStyle, setStyleColor, setStyleFont, setStyleFrameColor, setTop, setTransparent, setVisible, shouldDropEvent, show, styleIsDefault, swapStyleColors, windowToLocal
 
Methods inherited from class danger.app.Listener
cancelEvents, childEventPump, childEventPumpDone, eventProblem, isDispatchingThread, sendEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendLowPriorityEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface danger.text.span.Spannable
removeSpan, setSpan
 
Methods inherited from interface danger.text.span.Anchored
moveToAnchor
 
Methods inherited from interface danger.util.TextBufferLike
getInsertionPoint, setInputFilter, setInsertionPoint
 
Methods inherited from interface danger.util.GetChars
getChars
 
Methods inherited from interface danger.ui.TextControl
getFont, getTextSequence, setFont
 

Constructor Detail

PasswordEditText

public PasswordEditText()
Default constructor


PasswordEditText

public PasswordEditText(String inLabel)
Constructor that includes a label

Method Detail

onTextChanged

protected void onTextChanged(int start,
                             int oldLen,
                             int newLen)
Updates the display buffer to match the insertions and deletions of the real buffer.

Overrides:
onTextChanged in class WrappedText

getDisplayText

protected CharSequence getDisplayText()
Returns the display buffer, which has bullets instead of the real characters of the buffer.

Overrides:
getDisplayText in class WrappedText

grabSelectionSequence

public CharSequence grabSelectionSequence()
Returns null because you can't copy from a password field.

Overrides:
grabSelectionSequence in class SelectTextBox

canGrabSelection

public boolean canGrabSelection()
Returns false because you can't copy from a password field.

Overrides:
canGrabSelection in class SelectTextBox