danger.ui
Class EditText
java.lang.Object
|
+--danger.app.Listener
|
+--danger.ui.View
|
+--danger.ui.Container
|
+--danger.ui.Control
|
+--danger.ui.EditText
- Direct Known Subclasses:
- TextField
- public class EditText
- extends Control
|
Constructor Summary |
EditText()
|
EditText(boolean autoText,
boolean autoCap)
|
EditText(java.lang.String inLabel)
|
EditText(java.lang.String inLabel,
boolean autoText,
boolean autoCap)
|
| Methods inherited from class danger.ui.Control |
drawFocusBox, drawIdleBox, drawIdleBox, getEvent, getEventListener, getEventType, getHasBorder, getTitle, getValue, sendEvent, setEvent, setEvent, setEvent, setEvent, setEvent, setEventListener, setTitle, setValue |
| Methods inherited from class danger.ui.Container |
addChild, addChild, addChildAt, advanceFocus, childCount, childIsOnScreen, disable, enable, eventKeyHeld, eventKeyUp, getBottomChild, getChildAt, getChildIndex, getChildWithID, getDescendantWithID, getFirstChild, getFirstFocusableChild, getFocusedChild, getLastChild, getLastFocusableChild, hideAllChildren, moveChildToIndex, paintChildren, reflowChildren, removeAllChildren, removeChild, reverseFocus, setFocusedChild, setFocusedChild, setWindow, showAllChildren, snapToChildren |
| Methods inherited from class danger.ui.View |
clear, copyStyle, getAcceptFocus, getBackgroundColor, getBottom, getBounds, getBounds, getFrame, getFrame, getHeight, getLeft, getOrigin, getOrigin, getOriginX, getOriginY, getParent, getRight, getSibling, getStyle, getStyleColor, getStyleFont, getTop, getWidth, getWindow, globalToLocal, hide, invalidate, invalidate, invalidate, isEnabled, isFocusable, isFocused, isOnScreen, isTransparent, isVisible, keepRectInView, localToGlobal, localToGlobal, localToWindow, moveBy, offsetOrigin, offsetOrigin, onAddedToParent, onDecoded, onPeriodicPulse, onRemovedFromParent, onStyleChanged, onWindowPaint, receiveEventInternal, resetOrigin, sendEventToWindow, setAcceptFocus, setBackgroundColor, setBottom, setDebugBounds, setEnabled, setFrame, setHeight, setKeyedValue, setLeft, setOrigin, setOrigin, setPosition, setRight, setStyle, setStyleColor, setStyleFont, setStyleFrameColor, setTop, setTransparent, setVisible, setWidth, shouldDropEvent, show, styleIsDefault, windowToLocal |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mCursorRect
protected Rect mCursorRect
mFont
protected Font mFont
EditText
public EditText()
EditText
public EditText(java.lang.String inLabel)
EditText
public EditText(boolean autoText,
boolean autoCap)
EditText
public EditText(java.lang.String inLabel,
boolean autoText,
boolean autoCap)
setInputFilter
public void setInputFilter(TextInputFilter inInputFilter)
getInterestingRect
public Rect getInterestingRect()
- Overrides:
getInterestingRect in class View
getInterestingRect
public Rect getInterestingRect(Rect r)
- Overrides:
getInterestingRect in class View
setSize
public void setSize(int width,
int height)
- Resize the block of text.
The parent will Invalidate() as a side-effect if the View
is visible. The number of displayable lines will also be
recalculated based on the new height.
- Overrides:
setSize in class View
insert
public void insert(java.lang.String inText)
insert
public void insert(char inChar)
deleteChar
public void deleteChar()
delete
public void delete(int numChar)
forwardDeleteChar
public void forwardDeleteChar()
forwardDeleteChar
public void forwardDeleteChar(int count)
deleteLineAtPoint
public void deleteLineAtPoint()
setText
public void setText(java.lang.String inText)
setFont
public void setFont(Font inFont)
clear
public void clear()
setAcceptKeyRepeats
public void setAcceptKeyRepeats(boolean inAccept)
getAcceptKeyRepeats
public boolean getAcceptKeyRepeats()
selectionEnd
protected final int selectionEnd()
selectAll
public final boolean selectAll()
setSelection
public final void setSelection(int inStart,
int inEnd)
resetSelection
public final void resetSelection()
cutSelection
public final boolean cutSelection()
copySelection
public final boolean copySelection()
grabSelection
public final char[] grabSelection()
paste
public final boolean paste()
receiveEvent
public boolean receiveEvent(Event e)
- Description copied from class:
Listener
- Entry point for event processing.
Default behaviour is to do nothing and return false.
Normally this method is called from a Dispatcher when it
discovers an Event in its queue that is targetted at this
Listener.
- Overrides:
receiveEvent in class Container
eventWidgetUp
public boolean eventWidgetUp(int inWhichWidget,
Event event)
- Description copied from class:
Container
- Handle the release of a device widget
- Overrides:
eventWidgetUp in class Container
- Following copied from class:
danger.ui.Container
- Parameters:
inWidget - the widget that went down- Returns:
- whether or not the event was consumed
eventWidgetDown
public boolean eventWidgetDown(int inWhichWidget,
Event event)
- Handles 'down' actions on the gizmo widgets. The wheel controls movement of
the insertion point.
- Overrides:
eventWidgetDown in class Container
- Parameters:
inWhichWidget - indicates which of the controls on the device went 'down'
eventKeyDown
public boolean eventKeyDown(char c,
Event event)
- Overrides:
eventKeyDown in class Container
eventKeyRepeat
public boolean eventKeyRepeat(char c,
Event event)
- Overrides:
eventKeyRepeat in class Container
eventShortcut
public boolean eventShortcut(char inKey)
- Overrides:
eventShortcut in class Container
eventPeriodicPulse
public boolean eventPeriodicPulse(int timestamp)
- Overrides:
eventPeriodicPulse in class Container
setAllowCursorBlink
protected void setAllowCursorBlink(boolean allow)
invalidateCursor
protected void invalidateCursor()
canScrollUp
public boolean canScrollUp()
canScrollDown
public boolean canScrollDown()
scrollDown
public boolean scrollDown()
scrollUp
public boolean scrollUp()
getString
public java.lang.String getString()
- Overrides:
getString in class Control
getStringCRLF
public java.lang.String getStringCRLF()
getLine
public java.lang.String getLine(int inLineNum)
numLines
public int numLines()
numChars
public int numChars()
charAt
public char charAt(int index)
getChars
public char[] getChars()
getChars
public char[] getChars(int inFirstChar,
int inNumChars)
drawFrame
protected void drawFrame(Pen p,
Rect dim)
paint
public void paint(Pen p)
- Description copied from class:
View
- Draw the contents of this View. This method is called by the graphics
system when the View needs to be repainted. A Pen will be provided which
is appropriately clipped and translated for drawing on this View.
- Overrides:
paint in class Container
getCursorLine
public int getCursorLine()
setCursorLine
public void setCursorLine(int line)
bringCursorIntoView
public void bringCursorIntoView()
takeFocus
public void takeFocus(boolean inFromAbove)
- Overrides:
takeFocus in class Container
loseFocus
public void loseFocus()
- Overrides:
loseFocus in class Container
loadCursorRect
protected boolean loadCursorRect(Rect outRect)
setHasBorder
public void setHasBorder(boolean inHasBorder)
- Overrides:
setHasBorder in class Control
setAutoResize
public void setAutoResize(boolean inAutoResize)
getAutoResize
public boolean getAutoResize()
justifyLeft
public void justifyLeft()
justifyCenter
public void justifyCenter()
justifyRight
public void justifyRight()
setInsertionPoint
public void setInsertionPoint(int inOffset)
getInsertionPoint
public int getInsertionPoint()
willFocusWithin
public boolean willFocusWithin(Rect r)
- Overrides:
willFocusWithin in class View
getAutoText
public boolean getAutoText()
setAutoText
public void setAutoText(boolean inAutoText)
getAutoCap
public boolean getAutoCap()
setAutoCap
public void setAutoCap(boolean inAutoCap)
setWantQuoteHack
public void setWantQuoteHack(boolean opt)
isEditable
public boolean isEditable()
setEditable
public void setEditable(boolean inEditable)
setActiveMetaKey
public static void setActiveMetaKey(int key)
getActiveMetaKey
public static int getActiveMetaKey()
isShortcutTrigger
protected static boolean isShortcutTrigger(char ch)
addTextEditMenuItems
public final int addTextEditMenuItems(Menu m)
eventWidgetHeld
public final boolean eventWidgetHeld(int inWhichWidget,
Event event)
- Overrides:
eventWidgetHeld in class Container
Danger Confidential. Copyright © 2000-2003, Danger Inc.