public class Editor extends Form implements FieldListener
You should consult the Eve Programming Guide for instructions on how to use this correctly.
Form.FormMaker, Form.ToolsOrSoftKey, Form.ValidateBeforeExit
Modifier and Type | Field and Description |
---|---|
boolean |
autoRefreshControls
If this is true then after each time data is sent to the data object, it will be retrieved again and
displayed on the control.
|
int |
coroutineStackSize |
Event |
currentEvent
This is the event that caused the current fieldChanged() or action() event.
|
static int |
DoDataTransfer |
boolean |
dontAddSoftkeysAsActions
By default SoftKeyBars associated with this Editor are added as actions using
addSoftKeysAsActions() - but if this is set true then this is not done automatically.
|
Vector |
fieldListeners
This holds a list of all the fieldListeners listening to the Editor.
|
boolean |
fieldsWillNotBeAdded
Set this true if you are adding fields with Controls which themselves will not
be added as a child of the Editor.
|
Object |
myObject
This is the object currently being edited.
|
Class |
objectClass
This must be set before adding fields.
|
Object |
sampleObject
This is only necessary if you are using the objects _getField() and _setField()
methods for field transfer.
|
boolean |
transferOnAdding
If this is true then a toControl() will be done for each field as it is added.
|
Vector |
transfers
This holds a list of all the FieldTransfers used in the Editor.
|
acceptsDroppedFiles, apply, back, buttons, BUTTONS_TO_SOFT_KEY_FIRST_BUTTON_SEPARATE, BUTTONS_TO_SOFT_KEY_MENU_ALWAYS, BUTTONS_TO_SOFT_KEY_USE_FIRST_SOFT_KEY, buttonsPanel, buttonsPerRow, cancel, CLOSING_FLAG, deflt, dismantleOnClose, dontAddSIPFiller, exitButtonDefined, EXITING_FLAG, exitSystemOnClose, exitValue, firstFocus, formFrame, frameAlpha, handle, hasTitle, hasTopBar, hideSoftKeyBarIfNotFound, inheritSoftKeys, isAutoScrolling, isMainAppletForm, keepFrame, minimumShowTime, moveable, no, noBorder, ok, pl, reset, resizable, resizeOnSIP, shadowed, SHOWN_FLAG, shownTime, softkeyBars, title, titleCancel, titleControls, titleOK, topControls, WINDOW_TITLE_DONT_CHANGE, windowFlagsToClear, windowFlagsToSet, windowIcon, windowTitle, yes
BACKB, CANCELB, checkIcon, close, cross, crossIcon, DEFCANCELB, DEFOKB, EXIT_IDBACK, EXIT_IDCANCEL, EXIT_IDNO, EXIT_IDOK, EXIT_IDYES, IDBACK, IDCANCEL, IDNO, IDOK, IDYES, MBB, MBNONE, MBOK, MBOKCANCEL, MBYESNO, MBYESNOCANCEL, NOB, OKB, stop, tick, tools, YESB
autoSpan, layout, mySplitter, nextSplitter, quickRecalculate
all, calculated, childListeners, defaultAddToMeCellConstraints, defaultTags, equalHeights, equalWidths, grid, lastAdded, layoutManager, made, noInsets, stretchFirstColumn, stretchFirstRow, stretchLastColumn, stretchLastRow, titleGap
isFullScrollClient, origin, scrollPercent, virtualSize
closedFocus, cycleFocus, dontAutoScroll, dontFocusOnChildren, FIND_FOR_MOUSE_PRESS, takeNextFocus
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
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
GoHigher, GoLower, Horizontal, OPTION_INDICATOR_ONLY, PageHigher, PageLower, ScrollHigher, ScrollLower, TrackTo, Vertical
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
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 |
---|
Editor()
Create a new Editor that will initially be set to edit itself.
|
Editor(Object objectOrClassOrReflectToEdit)
Create a new Editor to edit the type of Object specified.
|
Modifier and Type | Method and Description |
---|---|
void |
action(FieldTransfer ft,
Editor ed)
This implements the action() method in FieldListener.
|
void |
action(String fieldName,
Editor ed)
This gets called by action(FieldTransfer ft,Editor ed) and by fieldChanged(FieldTransfer ft,Editor ed)
if the field changed is a menu item.
|
void |
addButtonAsAction(Button bc) |
Control |
addExternalField(Control control,
String fieldName)
Use this to add a Control for a field when the Control will not be added as a child of the
Editor but will be added to some external Container.
|
Control |
addExternalField(Control control,
String fieldName,
DataConverter convert)
Use this to add a Control for a field when the Control will not be added as a child of the
Editor but will be added to some external Container.
|
Control |
addField(Control control,
String fieldName)
This is the main way of adding a field to the Editor - although it does not add the control as a
child of the Editor.
|
Control |
addField(Control control,
String fieldName,
DataConverter converter)
This is the main way of adding a field to the Editor - although it does not add the control as a
child of the Editor.
|
Control |
addField(Control control,
String fieldName,
DataConverter converter,
boolean isExternalControl) |
void |
addField(FieldTransfer ft) |
void |
addMenuAsAction(Menu m) |
void |
addMenuItemAsAction(MenuItem mi) |
void |
addSoftKeysAsActions(SoftKeyBar b)
Call this after setting up a SoftKeyBar and after setting all fields.
|
void |
badField(String fieldName,
String message) |
protected boolean |
canExit(int exitCode)
This is called by the exit() method to see if the form can be
closed.
|
Control |
changeField(Control object,
String fieldName,
boolean isExternal) |
boolean |
convertData(Wrapper source,
Class sourceType,
Wrapper dest,
Class destType) |
void |
dataChanged()
This calls toControls() and then notifyDataChange().
|
void |
dataChanged(String fields)
This calls toControls(fields) and then notifyDataChange().
|
boolean |
dataObjectIsCompatible(Object dataObject) |
void |
dismantle(Control stopAt) |
boolean |
enableScrolling(boolean enable)
Deprecated.
use Form.enableScrolling(boolean horizontally, boolean vertically) instead.
|
void |
fieldChanged(FieldTransfer ft,
Editor ed)
This implements the fieldChanged() method in FieldListener.
|
void |
fieldChanged(String fieldName,
Editor ed)
This gets called by fieldChanged(FieldTransfer ft,Editor ed).
|
void |
fieldEvent(FieldTransfer ft,
Editor ed,
Object event)
This implements fieldEvent() in FieldListener.
|
Control |
findControlFor(String fieldName)
Find the Control associated with the field.
|
Object |
findControlFor(String fieldName,
Class ofType) |
protected Vector |
findFields(String fieldNames,
String exclude,
Vector dest) |
FieldTransfer |
findFieldTransfer(Control c)
Find the FieldTransfer associated with the specified control.
|
FieldTransfer |
findFieldTransfer(Control c,
boolean menuItem)
Find the FieldTransfer associated with the specified control.
|
FieldTransfer |
findFieldTransfer(String name)
Find the FieldTransfer associated with the specified field.
|
void |
fireAction(String fieldName) |
void |
fireFieldChanged(String fieldName) |
protected void |
fireFieldEvent(FieldListener fl,
FieldTransfer ft,
Object event,
int type) |
void |
fireFieldEvent(Iterator it,
Object event,
int type) |
void |
focusOn(String fieldName,
boolean inCurrentThread)
Switch the focus to a particular field.
|
protected void |
formClosing()
This is called to indicate that the Form is about to close and it causes a FormEvent.CLOSED event to be posted.
|
void |
fromControls()
Transfer all edited fields to the Object currently being edited from the on-screen controls.
|
void |
fromControls(Object obj)
Transfer all edited fields to the specified Object from the on-screen controls.
|
void |
fromControls(Object obj,
String fields)
Transfer specified fields to the specified Object from the on-screen controls.
|
void |
fromControls(String fields)
Transfer specified fields to the Object currently being edited from the on-screen controls.
|
void |
getData(Object obj)
This calls fromControls(obj).
|
Control |
getDataControls()
Get the area in the Editor that is considered to have user editable data.
|
Object |
getDataParentObject(Class ofType) |
Object |
getEditedObject()
Return the edited object.
|
static Editor |
getEditedUnder(Control child,
Class editedUnderClass)
Find a parent Editor of a an Object of a particular type that the control is being edited under (within).
|
static Wrapper |
getEditorAndFieldValue(Control c,
String fieldName)
Get the field value of the currently edited Object of an Editor as a Wrapper, providing either the field name
or the control associated with the field.
|
static Object |
getFieldValue(Editor ed,
String fieldName,
Control c,
Class expectedTypeOfData)
Get an Object field value of the currently edited Object of an Editor.
|
Wrapper |
getFieldValue(String fieldName,
Control c)
Get the field value of the currently edited Object as a Wrapper, providing either the field name
or the control associated with the field.
|
Object |
getProperty(Class ofType) |
Object |
getProperty(String name) |
protected void |
handleException(Throwable t) |
protected boolean |
handleTransferError(Exception e,
FieldTransfer ft,
int direction)
This is called if an Exception is thrown while transferring data from the
UI control to the object.
|
static boolean |
invokeFieldHandlerMethod(Object target,
String fieldName,
Editor ed,
String extra) |
static void |
main(String[] args) |
void |
make(boolean reMake)
This is used to "make" the control before being displayed.
|
static void |
modifyControl(Control c,
boolean condition,
int turnOn,
int turnOff,
boolean repaint) |
void |
modifyFields(String fields,
boolean condition,
int turnOn,
int turnOff,
boolean repaint)
This will modify field controls in the editor conditionally.
|
void |
modifyPropertiesOrFields(String propertyOrFieldNames,
boolean condition,
int turnOn,
int turnOff,
boolean repaint) |
void |
onControlEvent(ControlEvent ev)
Make sure you call super.onControlEvent() if you override
this method.
|
void |
onDataChangeEvent(DataChangeEvent ev) |
void |
onSoftKey(SoftKeyEvent se)
This method is called on a SoftKeyEvent.
|
Object |
pauseCurrentEventThread()
Normally during Event processing, a call to pauseEventThread() is
made to the topmost Form.
|
void |
pauseThisEventThread()
Deprecated.
this is not recursive - use pauseCurrentEventThread() and resumeCurrentEventThread() instead.
|
protected void |
postEditorEvent(EditorEvent ev) |
protected void |
postEditorEvent(int type,
Object parameter) |
void |
removeField(FieldTransfer ft)
Remove a FieldTransfer - this will cause the Editor to stop listening to or responding to that Field, but it will not
remove the Control associated with the field.
|
void |
resumeCurrentEventThread(Object fromPause) |
void |
resumeThisEventThread()
Deprecated.
this is not recursive - use pauseCurrentEventThread() and resumeCurrentEventThread() instead.
|
void |
setData(Object obj)
This calls setObject(obj).
|
void |
setDataControls(Control control)
Set the area in the Editor that is considered to have user editable data.
|
void |
setEditedObject(Object obj)
Set the object being edited.
|
void |
setFields(CellPanel destination,
Object objectOrClassOrReflectToEdit) |
void |
setFields(Object objectOrClassOrReflectToEdit) |
void |
setObject(Object obj)
This is used to set the Object to be edited by the Editor.
|
Editor |
setProperty(String name,
Object value) |
void |
shown()
This is called when a Control is shown in a Window.
|
Control |
takeFieldFrom(Editor ed,
String name,
boolean addAsExternalField,
boolean leaveOriginal)
This takes a field from another Editor and adds it to this one under the same name.
|
void |
toControls()
Transfer all edited fields from the Object currently being edited to the on-screen controls.
|
void |
toControls(Object obj)
Transfer all edited fields from the specified Object to the on-screen controls.
|
void |
toControls(Object obj,
String fields)
Transfer specified fields from the specified Object to the on-screen controls.
|
void |
toControls(String fields)
Transfer specified fields from the Object currently being edited to the on-screen controls.
|
void |
transfer(Object obj,
Iterator it,
int direction) |
protected void |
transfer(Object obj,
String fields,
String exclude,
int direction) |
_getSetField, addButton, addFieldHandler, addFormMaker, addSIPAdjustment, addTabbedPanel, addToolbar, addTools, addToolsFor, addValidateBeforeExit, addValidateBeforeExit, buttonsToMenu, buttonsToSoftKeyBar, buttonsToSoftKeyBar, cancelWait, checkButtons, checkCanExit, close, closeAll, closeForTransfer, closeForTransfer, continueWait, createMenuItem, createMenuItem, createMenuItem, createSipFiller, createWindow, defaultTitleTo, doButtons, doShowExec, enableScrolling, exec, exec, exec, exec, exec, execute, execute, execute, exit, filesDropped, fixWindowTitle, formMain, fromFields, fromFields, fullScreenOnPDA, gatherButtons, getAncestorProperty, getButton, getFileSaver, getFormFrame, getFormWithProperty, getProperties, getSoftKeyBarFor, getTopmostForm, handleAction, handleAction, hasExitButton, makeButtonForForm, makeButtonForForm, makeDefaultButton, makeDefaultButton, makeFrame, makeMenuItemForForm, makeMenuItemForForm, makeSmall, makeSmallOnBigScreen, makeSoftKeys, makeSoftKeys, makeSoftKeys, maximizeOnPDA, menuItemSelected, modifyForSmartPhone, onEvent, onSoftKey, placeCancelOnLeft, removeSoftKeyBarFor, setAsMainAppletForm, setAsShown, setBelowButtonBar, setBelowButtonBars, setDefaultSize, setExitHandle, setFileSaver, setMainScrollBarPanel, setNoTitleBar, setSoftKeyBarFor, setSoftKeyBarForAll, setupFrame, show, show, showButtons, showExecCalled, showWait, showWait, startRunning, stopFormHandle, takeButtons, takeButtons, takeButtons, toFields, toFields, toolsOnBottom, validateBeforeExit, waitUntilClosed, waitUntilClosed, waitUntilClosed, waitUntilShown, willBeMaximized
getCross, getParentObject, getParentObject, getSizedImage, getTick, getToolsIcon, setParentObject
calculateSizes, getFloatingControls, getSubControls, hasFloatingControls, makeLayoutGrid, relayoutMe, removeAll, reShow, resize, resizeTo
add, addChildListener, addDirectly, addLast, addLast, addLast, addNext, addNext, addNext, addNext, calculatedSizes, doBorder, endRow, getControlTag, getPreferredSize, insertRow, isEmpty, layout, remove, removeChildListener, sendToChildListeners, setAsBelowSip, setText
canGo, canScreenScroll, checkScrolls, doScroll, fixOrigin, getActual, getBuffer, getCurrent, getDisplayedSize, getMyHeight, getMySize, getMyWidth, getPercent, getScrollablePanel, getScrollClient, getVisible, getVisibleArea, needScrollBar, onScroll, onSetOrigin, reduceClip, scroll, scroll, scrollToVisible, setOrigin, updateScrollServer
add, completeAddPopupControl, containerHasFocus, dismantle, doHotKey, doPaint, findChild, findChild, focusFirst, focusFirst, focusOnContainer, focusOnData, getChildren, getFirstFocus, getNextKeyFocus, gotFocus, grayOut, hide, lostFocus, relayout, removePopupControl, repaintDataNow, setHidden, startAddPopupControl, takeFocus, takePromptControl, unhide
acceptsData, activate, addListener, amOnTopFrame, applyFontChange, baseOnPenEvent, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, cache, 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, dataBeingRemoved, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, dataTransferCancelled, deactivate, defaultTo, deferInWindowThread, doAction, doActionKey, doBackground, doMenu, dontAcceptDrop, doPaintChildren, doPaintData, doPaintData, doShowMenu, dragged, draw, draw, draw, exitEntry, fillBackground, fillBackgroundNotInFrame, findTagInParents, fontChanged, free, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getAncestor, getAncestor, getAncestorProperty, getBackground, getCached, getCachedChildren, getCachedDim, getCachedDim, getCachedRect, getCachedRect, getCachedSubControls, getChildAnchor, 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, getPaintParameters, getParent, getParent, getParent, getParentOrListener, getPasswordCharacter, getPosInFrame, getPosInFrame, getPosInParent, getPosInParent, getPreferredSize, getPreferredSizeByParent, getPreferredTextSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getSubControls, getTag, getText, getToolTip, getWidth, getWindow, getWindowGraphics, hasModifier, hasPopupFormAttached, hasTag, hide, inheritModifiers, insetToContents, interceptChildUIEvent, isChildOf, isDirectChildOfWindow, isHidden, isModal, isOnMe, isOnMe, isOnMe, isSomeonesHotKey, makeFrameTopMost, makeHot, makeHot, makeInvisible, makeVisible, markAsTemporaryError, menuIsActive, menuStateChanged, modify, modifyAll, modifyAll, modifyFlags, mouseHover, newEventThread, notifyAction, notifyDataChange, notifyDataChange, notifyMenuItemSelected, notifyStructureChanged, 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, repaintInWindowThread, repaintInWindowThread, repaintNow, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetAllCachedProperties, resetCachedProperties, resetRect, 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, setTextSize, setTiledBackgroundImage, setToolTip, showHoldDownIndicator, simulateClickOn, simulateKeyPresses, simulateKeyType, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, startDragging, stopDragging, takeData, takeFromClipboard, testInWindowThread, ticked, tipIsDisplayed, toClipboard, toField, toField, toIDString, toString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryGetGraphics, tryNext, tryStartMenu, unhide, unlock, updateData, updateDCDuringDD, updateFrom, updateTo, verifyWantDrag, verifyWantHoldDown, waitEventThread, willAcceptDrop, willShowFrame, windowHasFloatingControls, writeLock
doubleSizeIt, getGuiTextHeight, isDoubleSized, isDoubleSizedFont, loadImage, tryLoadImage
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getServer, setServer
public Vector transfers
public Vector fieldListeners
public int coroutineStackSize
public Class objectClass
public Object sampleObject
public Object myObject
public boolean autoRefreshControls
public boolean dontAddSoftkeysAsActions
public boolean fieldsWillNotBeAdded
public boolean transferOnAdding
public static final int DoDataTransfer
public Event currentEvent
public Editor()
public Editor(Object objectOrClassOrReflectToEdit)
objectOrClassOrReflectToEdit
- Can be either an instance of the
Object to edit, or a Class or Class Object that represents the Object class to edit.public Wrapper getFieldValue(String fieldName, Control c)
fieldName
- the name of the field. If this is null then c should not be null.c
- the Control associated with the field. If this is null then fieldName should not be null.public static Wrapper getEditorAndFieldValue(Control c, String fieldName)
c
- the Control within the editor. This should not be null since the Editor is determined from it.fieldName
- the name of the field. If this is null then it is assumed that the Control c is associated with
the Field and the FieldTransfer is retrieved for it.public static Object getFieldValue(Editor ed, String fieldName, Control c, Class expectedTypeOfData)
ed
- The Editor. This can be null, in which case the Editor is determined from the Control c.fieldName
- the name of the field. If this is null then it is assumed that the Control c is associated with
the Field and the FieldTransfer is retrieved for it.c
- if ed is null or fieldName is null then this cannot be null. The Editor is determined from the Control by going
up the chain of parent controls until an Editor is found, and the field name is determined from that editor.expectedTypeOfData
- the Class of the expected data which must not be a primitive type. If this is null
then Object.class is used.public void addButtonAsAction(Button bc)
public void addMenuAsAction(Menu m)
public void addMenuItemAsAction(MenuItem mi)
public void addSoftKeysAsActions(SoftKeyBar b)
b
- the SoftKeyBar created for the Editor.public Object getProperty(Class ofType)
getProperty
in class Form
public void focusOn(String fieldName, boolean inCurrentThread)
fieldName
- the name of the field.inCurrentThread
- if this is true then Gui.takeFocus() is called
directly. If it is false it is called as a separate event in the Window thread.public boolean enableScrolling(boolean enable)
enable
- true to enable the scrolling, false to disable it.protected boolean canExit(int exitCode)
Form
public void setFields(Object objectOrClassOrReflectToEdit)
public boolean dataObjectIsCompatible(Object dataObject)
public void setObject(Object obj)
obj
- The Object to be edited.public final void setEditedObject(Object obj)
obj
- the object to be edited.public final Object getEditedObject()
protected void handleException(Throwable t)
public static boolean invokeFieldHandlerMethod(Object target, String fieldName, Editor ed, String extra)
public void action(String fieldName, Editor ed)
public void fieldChanged(String fieldName, Editor ed)
public void action(FieldTransfer ft, Editor ed)
action
in interface FieldListener
public void fieldChanged(FieldTransfer ft, Editor ed)
fieldChanged
in interface FieldListener
public void fieldEvent(FieldTransfer ft, Editor ed, Object event)
fieldEvent
in interface FieldListener
public void setData(Object obj)
public void getData(Object obj)
public void make(boolean reMake)
Container
public void addField(FieldTransfer ft)
public Control addField(Control control, String fieldName, DataConverter converter, boolean isExternalControl)
public Control addField(Control control, String fieldName)
control
- The control to associate with the field.fieldName
- The field to be associated with the Control.public Control addField(Control control, String fieldName, DataConverter converter)
control
- The control to associate with the field.fieldName
- The field to be associated with the Control.converter
- An optional DataConverter to convert the data during a data transfer.public Control addExternalField(Control control, String fieldName, DataConverter convert)
control
- The Control for the field.fieldName
- The name of the field.convert
- An optional DataConverter.public Control addExternalField(Control control, String fieldName)
control
- The Control for the field.fieldName
- The name of the field.public void onSoftKey(SoftKeyEvent se)
protected void postEditorEvent(EditorEvent ev)
protected void postEditorEvent(int type, Object parameter)
public void shown()
Control
protected void formClosing()
Form
formClosing
in class Form
public void toControls()
public void fromControls()
public void toControls(Object obj)
public void fromControls(Object obj)
public void toControls(String fields)
public void fromControls(String fields)
public void toControls(Object obj, String fields)
public void fromControls(Object obj, String fields)
public void dataChanged(String fields)
fields
- a comma separated field list.public void dataChanged()
public FieldTransfer findFieldTransfer(String name)
name
- The field to look for.public Control takeFieldFrom(Editor ed, String name, boolean addAsExternalField, boolean leaveOriginal)
ed
- the Editor that is listening to the specified field.name
- the field name.addAsExternalField
- set this true if the other Editor (ed) is not or will not be added as a descendant of this
Editor.removeOriginal
- set this true to leave the FieldTransfer on the other Editor so that it will also still listen
to and respond to the field.public void removeField(FieldTransfer ft)
ft
- the FieldTransfer to remove. If it is null this wil have no effect.public FieldTransfer findFieldTransfer(Control c, boolean menuItem)
c
- The Control associated with the field.menuItem
- true if you are looking for the FieldTransfer associated with
a MenuItem field for the Control.public FieldTransfer findFieldTransfer(Control c)
c
- The Control associated with the field.public Control findControlFor(String fieldName)
fieldName
- The name of the field.public void onDataChangeEvent(DataChangeEvent ev)
onDataChangeEvent
in class Form
public void onControlEvent(ControlEvent ev)
Form
onControlEvent
in class Form
public void fireFieldChanged(String fieldName)
public void fireAction(String fieldName)
protected void fireFieldEvent(FieldListener fl, FieldTransfer ft, Object event, int type)
protected boolean handleTransferError(Exception e, FieldTransfer ft, int direction)
e
- the Exception that was thrown.ft
- the FieldTransfer for the field.direction
- the direction - either FieldTransfer.TO_OBJECT or FieldTransfer.FROM_OBJECT.public Object pauseCurrentEventThread()
public void resumeCurrentEventThread(Object fromPause)
public void pauseThisEventThread()
You can call resumeThisEventThread() to resume the current Thread as the event handling Thread, otherwise it is called automatically when the fieldChanged(), action() or fieldEvent() method returns.
public void resumeThisEventThread()
public static void modifyControl(Control c, boolean condition, int turnOn, int turnOff, boolean repaint)
public void modifyPropertiesOrFields(String propertyOrFieldNames, boolean condition, int turnOn, int turnOff, boolean repaint)
public void modifyFields(String fields, boolean condition, int turnOn, int turnOff, boolean repaint)
public static Editor getEditedUnder(Control child, Class editedUnderClass)
child
- editedUnderClass
- the type of object being edited.public Control getDataControls()
public void setDataControls(Control control)
control
- the Control considered to be data control.public boolean convertData(Wrapper source, Class sourceType, Wrapper dest, Class destType)