|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.app.Listener
danger.ui.View
danger.ui.Container
danger.ui.Control
danger.ui.WrappedText
danger.ui.DisplayText
danger.ui.StaticTextBox
danger.ui.ScrollingTextBox
danger.ui.LinkTextBox
public class LinkTextBox
This class is a text box within which the user can select and click inline links.
The CharSequence returned from WrappedText.getContents() is not
guaranteed to be Spannable unless a Spanned was passed to setText().
| Field Summary |
|---|
| Fields inherited from class danger.ui.WrappedText |
|---|
JUSTIFY_CENTER, JUSTIFY_LEFT, JUSTIFY_RIGHT |
| Constructor Summary | |
|---|---|
LinkTextBox()
Create a new LinkTextBox with no title. |
|
LinkTextBox(String title)
Create a new LinkTextBox with the specified title. |
|
| Method Summary | |
|---|---|
boolean |
addLinkMenuItems(Menu addTo)
Append the context menu items for the currently selected link, if any, to the specified menu. |
boolean |
eventKeyUp(char c,
Event event)
Standard UI method: handles the return key, which activates links. |
boolean |
eventWidgetDown(int widget,
Event event)
Standard UI method: handles rolling and paging down (which advance focus), and arrow up and down (which reverse and advance focus, respectively). |
boolean |
eventWidgetUp(int widget,
Event event)
Standard UI method: handles the wheel button (which activates links) and rolling and paging up (which reverse link focus). |
boolean |
getAcceptFocusOnlyWhenLinksVisible()
Return what you specified in setAcceptFocusOnlyWhenLinksVisible(boolean) |
boolean |
getCanMakeChanges()
Return whether the user can make changes to the text. |
ClickSpan |
getClickSpan()
Return the currently selected ClickSpan. |
Menu |
getLinkOptionsMenu()
Return the "Links" menu, which provides contextual items appropriate to the selected link, or null if none. |
boolean |
getLinksFocusable()
Find out whether or not the inline links feature is enabled. |
void |
loseFocus()
When a LinkTextBox loses focus, any visible link it may previously have had focused within loses focus. |
boolean |
moveToAnchor(String anchor)
Set the scroll position to bring the named anchor into view, if there is such an anchor. |
boolean |
pageToEnd()
Standard UI method: after paging to the end, try to select a link that has become visible. |
boolean |
pageToHome()
Standard UI method: after paging to the start, try to select a link that has become visible. |
boolean |
receiveEvent(Event e)
Standard UI method: receives events to give focus to a visible link (if any) after ScrollView paging. |
protected boolean |
selectNextLink()
Select the next visible link, if any. |
protected boolean |
selectNextLinkBelow(int line)
Select the next visible link on or below the specified line, if any. |
protected boolean |
selectNextLinkOn(int line)
Select the next visible link on the specified line, if any. |
protected boolean |
selectPreviousLink()
Select the previous visible link, if any. |
protected boolean |
selectPreviousLinkAbove(int line)
Select the previous visible link on or above the specified line, if any. |
protected boolean |
selectPreviousLinkOn(int line)
Select the previous visible link on the specified line, if any. |
void |
setAcceptFocusOnlyWhenLinksVisible(boolean whether)
Set whether the LinkTextBox will decline focus unless there is a link visible. |
void |
setLinksFocusable(boolean whether)
Enable or disable the inline links feature. |
boolean |
showContextMenu(int enterMenuFlags)
Show the context menu, if any, for the currently selected link. |
void |
takeFocus(boolean fromAbove)
When a LinkTextBox takes focus, it tries to focus the first visible link if from above or the last visible link if from below. |
boolean |
willFocusWithin(Rect r)
If you setAcceptFocusOnlyWhenLinksVisible(boolean),
the LinkTextBox will decline focus unless there is a link
in view. |
boolean |
willFocusWithin(Rect r,
boolean fromAbove)
If you setAcceptFocusOnlyWhenLinksVisible(boolean),
the LinkTextBox will decline focus unless there is a link
in view. |
| Methods inherited from class danger.ui.ScrollingTextBox |
|---|
canSuperFocus, drawContent, getBackgroundColor, getFocusPadding, getInterestingRect, getLabelWhenEmpty, getScrolling, getTextBackgroundColor, getTextColor, getTextOutlineColor, isSuperFocused, setCanSuperFocus, setLabelWhenEmpty, setScrolling, setSuperFocused |
| Methods inherited from class danger.ui.Control |
|---|
drawFocusBox, drawIdleBox, drawIdleBox, getEvent, getEventListener, getEventType, getHasBorder, getMaxToolTipLines, getTitle, getTitleSequence, getToolTip, getValue, hasToolTip, notifyWhenBaselineChanges, onBaselineChanged, onControlBaselineChanged, sendEvent, setEvent, setEvent, setEvent, setEvent, setEvent, setEventArg, setEventListener, setEventMethod, setHasBorder, setMaxToolTipLines, setTitle, setTitle, setToolTip, setValue, showToolTip |
| 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 java.lang.CharSequence |
|---|
charAt, length, subSequence, toString |
| Methods inherited from interface danger.ui.TextControl |
|---|
getFont, getTextSequence, setFont |
| Methods inherited from interface java.lang.CharSequence |
|---|
charAt, length, subSequence, toString |
| Methods inherited from interface danger.util.GetChars |
|---|
getChars |
| Methods inherited from interface java.lang.CharSequence |
|---|
charAt, length, subSequence, toString |
| Constructor Detail |
|---|
public LinkTextBox()
public LinkTextBox(String title)
| Method Detail |
|---|
public void takeFocus(boolean fromAbove)
takeFocus in class ScrollingTextBoxfromAbove - whether the focus was entered into this view from abovepublic void loseFocus()
loseFocus in class Control
public boolean eventWidgetUp(int widget,
Event event)
eventWidgetUp in class ScrollingTextBoxwidget - the widget that went down
public boolean eventWidgetDown(int widget,
Event event)
eventWidgetDown in class ScrollingTextBoxwidget - the widget that went up
public boolean getCanMakeChanges()
public boolean eventKeyUp(char c,
Event event)
eventKeyUp in class StaticTextBoxc - the character being released.
public boolean willFocusWithin(Rect r,
boolean fromAbove)
setAcceptFocusOnlyWhenLinksVisible(boolean),
the LinkTextBox will decline focus unless there is a link
in view.
willFocusWithin in class Containerr - the rectangle to be displayed infromAbove - true if the focus is coming from above;
false if it is coming from belowpublic boolean willFocusWithin(Rect r)
setAcceptFocusOnlyWhenLinksVisible(boolean),
the LinkTextBox will decline focus unless there is a link
in view.
willFocusWithin in class Containerpublic boolean getAcceptFocusOnlyWhenLinksVisible()
setAcceptFocusOnlyWhenLinksVisible(boolean)
public void setAcceptFocusOnlyWhenLinksVisible(boolean whether)
public Menu getLinkOptionsMenu()
public boolean addLinkMenuItems(Menu addTo)
addTo - The Menu to add the items to.
public boolean showContextMenu(int enterMenuFlags)
showContextMenu in class ViewenterMenuFlags - zero or more of
BaseMenu.WITH_WIDGET_HELD and
BaseMenu.WITH_KEY_HELD. This should be
passed into BaseMenu.enterMenu(boolean).public boolean receiveEvent(Event e)
receiveEvent in class Containere - non-null; the event to process
true) or not (false) this
method actually handled the event to completionprotected final boolean selectNextLink()
protected final boolean selectNextLinkBelow(int line)
protected final boolean selectNextLinkOn(int line)
protected final boolean selectPreviousLink()
protected final boolean selectPreviousLinkAbove(int line)
protected final boolean selectPreviousLinkOn(int line)
public ClickSpan getClickSpan()
public boolean moveToAnchor(String anchor)
moveToAnchor in interface Anchoredpublic final void setLinksFocusable(boolean whether)
public final boolean getLinksFocusable()
public boolean pageToHome()
pageToHome in class DisplayTextpublic boolean pageToEnd()
pageToEnd in class DisplayText
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||