public abstract class EditControl extends Control implements Selectable
Modifier and Type | Field and Description |
---|---|
boolean |
actAsLabel |
protected Object |
blinkId |
static int |
CASE_LOWER |
static int |
CASE_NORMAL |
static int |
CASE_NUMBERS |
static int |
CASE_SENTENCE |
static int |
CASE_UPPER |
protected Color[] |
colors |
protected char |
conditionalChar |
protected int |
conditionalCharIndex |
static int |
defaultInputFlags
This is assigned to the inputFlags field of each newly created EditControl (Input/TextPad).
|
protected boolean |
doingLocalInput |
protected boolean |
doingNativeInput |
static int |
FLAG_INPUT_ON_FOCUS
Use this in combination with FLAG_PASSIVE.
|
static int |
FLAG_KEEP_FOCUS_AFTER_INPUT
Use this in combination with FLAG_PASSIVE.
|
static int |
FLAG_NEED_FULL_ACTION
Use this in combination with FLAG_PASSIVE.
|
static int |
FLAG_PASSIVE
This tells the system that the EditControl should be "passive", i.e. no input is allowed
until the input is activated by the action key or pen press.
|
static int |
FLAG_USE_NATIVE
This tells the system to use a native input method.
|
protected boolean |
inFocus
If native input is used, this will normally start automatically when the
input gets focus.
|
int |
inputFlags
This value is -1 as default - which tells the VM to pick the best input flags for
the current system.
|
InputMethod |
inputMethod
You can set this to be a valid InputMethod object.
|
boolean |
justGotFocus |
String |
nothingEnteredText
If this is not null then this is displayed if the user has not entered anything yet.
|
protected String |
oldText |
Color |
pageColor
This is the color of the "Page" on which the text is displayed.
|
protected boolean |
startNativeOnPaint |
int |
textCase
This is CASE_NORMAL by default.
|
InputValidator |
validator |
backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, curFont, debugModify, debugRepaintNow, disabledBackground, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, fontChange, fontFrom, foreGround, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, lockPaint, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, name, next, parent, penStatus, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, startDragResolution, tags, tail, text, toolTip, width, x, y
clipItems, clipObject, clipOwner, debugControl, debugFlag, doubleBuffer, doubleClickTime, doubleSizedFontHeight, firstPress, globalEditable, globalEnabled, PEN_STATUS_DID_HOLD_DOWN, PEN_STATUS_GOT_PEN_DOWN, PEN_STATUS_PEN_IS_ON, pressPoint, TAG_BOOLEAN_KEEP_BELOW_SIP, TAG_HOVER_TIME_INT, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_ABUT_ANY, BF_ABUT_BOTTOM, BF_ABUT_LEFT, BF_ABUT_RIGHT, BF_ABUT_TOP, BF_BOTTOM, BF_BOTTOMLEFT, BF_BOTTOMRIGHT, BF_BUTTON, BF_DIAGONAL, BF_DIAGONAL_ENDBOTTOMLEFT, BF_DIAGONAL_ENDBOTTOMRIGHT, BF_DIAGONAL_ENDTOPLEFT, BF_DIAGONAL_ENDTOPRIGHT, BF_EXACT, BF_FLAT, BF_LEFT, BF_MIDDLE, BF_MONO, BF_PALM, BF_RECT, BF_RIGHT, BF_SOFT, BF_SQUARE, BF_TOP, BF_TOPLEFT, BF_TOPRIGHT, EDGE_BUMP, EDGE_ETCHED, EDGE_RAISED, EDGE_SUNKEN
ALWAYS_STRETCHABLE, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_HIDDEN, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TAG_BACKGROUND_IMAGE, TAG_BUSY_DISPLAY, TAG_COLORS, TAG_CONTROL_PAINTER, TAG_EXPOSE_GROUP, TAG_FIXEDSIZE, TAG_GRAY_BACKGROUND, TAG_HIDE_CONTROL_OBJECT, TAG_HIDE_PARENT, TAG_INNER_TEXT_INSETS, TAG_INPUT_STACK_PARENT, TAG_INSETS, TAG_MAKE_VISIBLE, TAG_MAXIMUMSIZE, TAG_MINIMUMSIZE, TAG_PAINT_CONTROL_LIST, TAG_PREFERRED_TEXT_SIZE, TAG_PREFERRED_TEXT_SIZE_HEIGHT, TAG_PREFERRED_TEXT_SIZE_WIDTH, TAG_PREFERREDSIZE, TAG_RECT, TAG_SHADOW_INSETS, TAG_SPAN, TAG_SWIPER, TAG_TEMPORARY_ERROR, TAG_TEXT_INSETS, TAG_TEXTSIZE, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, ContainerDontPaintChildren, Disabled, DisablePopupMenu, DisplayOnly, DontBuffer, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, ModifiersInheritedFromWindow, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpUIEvents, ShowSIP, ShrinkToNothing, SmallControl, TakeChildUIEvents, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
KEEP_VISIBLE
Constructor and Description |
---|
EditControl() |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsData(Object data,
DragContext how)
This should indicate whether this control will accept the data either via
a drag and drop or via a paste operation.
|
protected int |
calculateInputFlags()
If inputFlags is -1 (default), then return what it should be when gotFocus()
is called.
|
protected KeyEvent |
checkInputMethod(KeyEvent receivedKeyEvent) |
boolean |
checkSipCoverage() |
protected void |
dataBeingRemoved(Object data,
DragContext dc)
This tells the control that data is being removed from it either via
a cut operation or by a drag operation that is not explicitly a copy operation.
|
protected void |
dataTransferCancelled(Object data)
This gets called either when that was cut from this control was not
placed into another control (either it was rejected by a paste or a
subsequent copy/cut into the clipboard occured before the data was pasted)
or a drag and drop was initiated but not completed.
|
String |
fixCase(String text)
This converts the case of the incoming text to the one associated with
the edit control.
|
int |
getBestPassiveFlags()
Passive mode is normally selected on SmartPhone devices.
|
protected void |
getColors(boolean hasFocus,
int flags)
Provides the colors to be used for the text and background colors.
|
protected TextInputParameters |
getNativeInputParameters() |
boolean |
hasChanged() |
boolean |
inActivePassiveInput()
Return if the EditControl uses passive input and is currently in an active input session.
|
boolean |
isLabel() |
protected boolean |
keepConditionalChar() |
protected void |
nativeInputStopped() |
void |
onControlEvent(ControlEvent ev) |
protected abstract boolean |
paintConditionalChar(Graphics g,
boolean highlight) |
abstract void |
selectAll() |
void |
setAsLabel() |
protected void |
setConditionalChar(char cc,
int index) |
protected void |
setNativeInputFlags(TextInputParameters tip) |
protected boolean |
showHoldDownIndicator(int x,
int y)
If this returns true then the Pen Hold Down indicator will be
displayed before a Popup menu is shown.
|
boolean |
startActiveInput(boolean selectAll)
This tells the Control to start active input IF it has the FLAG_PASSIVE value
set.
|
protected void |
startLocalInput(boolean selectAll) |
protected boolean |
startNativeInput(boolean selectAll) |
boolean |
takeData(Object data,
DragContext how)
This tells the Control to take the data which has either come from a clipboard operation
or from a DragAndDrop.
|
void |
update() |
void |
updateData()
This tells the control to consider its current data to be unchanged.
|
boolean |
verifyWantDrag()
This is called only if the WantDrag modifier is set for the Control.
|
boolean |
verifyWantHoldDown()
This is called only if the WantHoldDown modifier is set for the Control.
|
activate, addListener, amOnTopFrame, applyFontChange, baseOnPenEvent, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, cache, calculatedSizes, calculateSizes, calculateTextSize, calculateTextSize, calculateTextSize, cancelHoldDown, cancelPenPress, canEdit, change, changeDimension, changeTag, checkClipboardOperations, checkExitKey, checkMenu, checkMenuKey, checkModifiers, checkParentInterceptsUIEvent, checkPenTransparent, childrenPainted, clearTag, clipboardToString, clipboardTransfer, closeMenu, contains, contains, createNewMenu, dataAccepted, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, deactivate, defaultTo, deferInWindowThread, doAction, doActionKey, doBackground, doBorder, doHotKey, doMenu, dontAcceptDrop, doPaint, doPaintChildren, doPaintData, doPaintData, doShowMenu, dragged, draw, draw, draw, exitEntry, fillBackground, fillBackgroundNotInFrame, findTagInParents, fontChanged, formClosing, free, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getAncestor, getAncestor, getAncestorProperty, getBackground, getCached, getCachedChildren, getCachedDim, getCachedDim, getCachedRect, getCachedRect, getCachedSubControls, getChildAnchor, getChildren, getChildren, getChildrenBackwards, getClipboardMenu, getClipObject, getContentsInsets, getContentsInsets, getContentsRect, getDataToCopy, getDataToDragAndDrop, getDim, getDisplayText, getDragAndDropContext, getFieldTransfer, getFont, getFontMetrics, getFontMetrics, getFontMetricsForSizeCalculations, getForeground, getFrame, getFrameOrContainer, getGraphics, getGraphics, getHeight, getHideParent, getImage, getLastSelected, getLocation, getLock, getMaximumSize, getMenu, getMinimumSize, getModifiedBorderFlags, getModifiers, getNext, getNextKeyFocus, getPaintParameters, getParent, getParent, getParent, getParentOrListener, getPasswordCharacter, getPosInFrame, getPosInFrame, getPosInParent, getPosInParent, getPreferredSize, getPreferredSizeByParent, getPreferredTextSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getSubControls, getSubControls, getTag, getText, getToolTip, getWidth, getWindow, getWindowGraphics, gotFocus, hasModifier, hasPopupFormAttached, hasTag, hide, inheritModifiers, insetToContents, interceptChildUIEvent, isChildOf, isDirectChildOfWindow, isHidden, isModal, isOnMe, isOnMe, isOnMe, isSomeonesHotKey, lostFocus, make, makeFrameTopMost, makeHot, makeHot, makeInvisible, makeVisible, markAsTemporaryError, menuIsActive, menuStateChanged, modify, modifyAll, modifyAll, modifyFlags, mouseHover, newEventThread, notifyAction, notifyDataChange, notifyDataChange, notifyMenuItemSelected, notifyStructureChanged, onEvent, onKeyEvent, onLabelPenEvent, onPenEvent, paintBackground, paintWithControlPainter, pauseEventThread, penClicked, penDoubleClicked, penHeld, penPressed, penReleased, penRightReleased, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, postEvent, postInWindowThread, postUIEvent, putInside, queueKeyEvent, queuePenEvent, readLock, recalculatePreferredSize, redisplay, refresh, releaseBufferedGraphics, removed, removeListener, repaint, repaint, repaintDataNow, repaintInWindowThread, repaintInWindowThread, repaintNow, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetAllCachedProperties, resetCachedProperties, resetRect, resizeTo, restore, restoreBorderModifiers, restoreFlags, resumeEventThread, scrollAndRepaint, sendToListeners, set, setAllFonts, setBackgroundImage, setBorder, setBorderModifiers, setCell, setChildAnchor, setClipObject, setControl, setCursor, setFieldTransfer, setFixedSize, setFont, setFontChange, setFreeDragging, setHidden, setHiddenParent, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPreferredTextSize, setPreferredTextSize, setPromptControl, setRect, setRect, setScaledBackgroundImage, setServer, setShadow, setSwiping, setTag, setTags, setText, setTextSize, setTiledBackgroundImage, setToolTip, shown, simulateClickOn, simulateKeyPresses, simulateKeyType, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, startDragging, stopDragging, takeFocus, takeFromClipboard, takePromptControl, testInWindowThread, ticked, tipIsDisplayed, toClipboard, toField, toField, toIDString, toString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryGetGraphics, tryNext, tryStartMenu, unhide, unlock, updateDCDuringDD, updateFrom, updateTo, waitEventThread, willAcceptDrop, willShowFrame, windowHasFloatingControls, writeLock
doubleSizeIt, getGuiTextHeight, isDoubleSized, isDoubleSizedFont, loadImage, tryLoadImage
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
deleteSelection, getSelection, hasSelection, noSelection, replaceSelection
public boolean justGotFocus
protected String oldText
public String nothingEnteredText
public Color pageColor
protected boolean doingLocalInput
protected boolean doingNativeInput
public int textCase
public static final int CASE_NORMAL
public static final int CASE_UPPER
public static final int CASE_LOWER
public static final int CASE_SENTENCE
public static final int CASE_NUMBERS
protected Color[] colors
public int inputFlags
public static int FLAG_USE_NATIVE
public static int FLAG_PASSIVE
public static int FLAG_INPUT_ON_FOCUS
public static int FLAG_KEEP_FOCUS_AFTER_INPUT
public static int FLAG_NEED_FULL_ACTION
public InputMethod inputMethod
public static int defaultInputFlags
public InputValidator validator
public boolean actAsLabel
protected boolean inFocus
protected boolean startNativeOnPaint
protected Object blinkId
protected int conditionalCharIndex
protected char conditionalChar
protected void nativeInputStopped()
protected TextInputParameters getNativeInputParameters()
public boolean inActivePassiveInput()
protected void getColors(boolean hasFocus, int flags)
hasFocus
- True if the control currently has the focus.flags
- This is the result of a call to getFlags(true) - which provides an OR'ing of all the flags
of this control and all its parents.public int getBestPassiveFlags()
protected int calculateInputFlags()
public boolean isLabel()
public void setAsLabel()
public abstract void selectAll()
public boolean hasChanged()
public void updateData()
Control
updateData
in class Control
public void onControlEvent(ControlEvent ev)
onControlEvent
in class Control
public boolean checkSipCoverage()
public boolean takeData(Object data, DragContext how)
Control
public boolean acceptsData(Object data, DragContext how)
Control
acceptsData
in class Control
data
- The data to be transferred.how
- if the transfer is via DragAndDrop this will be a DragContext object,
otherwise it will be null to indicate a clipboard operation.protected void dataBeingRemoved(Object data, DragContext dc)
Control
dataBeingRemoved
in class Control
protected void dataTransferCancelled(Object data)
Control
dataTransferCancelled
in class Control
data
- The data that was being transferred. If it is null it indicates
that this Control was a destination for a Drag and Drop operation, but the
operation was cancelled by the user.public void update()
protected boolean startNativeInput(boolean selectAll)
protected void startLocalInput(boolean selectAll)
public boolean startActiveInput(boolean selectAll)
protected void setNativeInputFlags(TextInputParameters tip)
public String fixCase(String text)
protected abstract boolean paintConditionalChar(Graphics g, boolean highlight)
protected boolean keepConditionalChar()
protected void setConditionalChar(char cc, int index)
protected boolean showHoldDownIndicator(int x, int y)
Control
showHoldDownIndicator
in class Control
x
- the x position on the Control.y
- the y position on the Control.public boolean verifyWantDrag()
Control
verifyWantDrag
in class Control
public boolean verifyWantHoldDown()
Control
verifyWantHoldDown
in class Control