ewe.ui
Class Editor

java.lang.Object
  extended byewe.ui.ControlBase
      extended byewe.ui.Control
          extended byewe.ui.Container
              extended byewe.ui.Canvas
                  extended byewe.ui.Panel
                      extended byewe.ui.CellPanel
                          extended byewe.ui.FormBase
                              extended byewe.ui.Form
                                  extended byewe.ui.Editor
All Implemented Interfaces:
CellConstants, ControlConstants, EventListener, FieldListener, HasProperties, ImageRefresher, IScroll, LayoutManager, ScrollClient, TimerProc, UIConstants
Direct Known Subclasses:
AppForm, CopyOverProgress, DateChooser, FileChooserBase, InputBox, LaunchPanel, ListEditor, ListSelect, mFileInput, PngIconMaker, RegistryViewForm, SaveableEditor, TreeEdit, VMLauncher

public class Editor
extends Form
implements FieldListener

An Editor is a special type of Form that can automatically transfer data between public fields in an Object and Gui Controls within the Editor.

You should consult the Ewe Programming Guide for instructions on how to use this correctly.


Field Summary
 int coroutineStackSize
           
 Event currentEvent
          This is the event that caused the current fieldChanged() or action() event.
static int DoDataTransfer
           
 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.
 Reflect 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.
 Vector transfers
          This holds a list of all the FieldTransfers used in the Editor.
 
Fields inherited from class ewe.ui.Form
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, deflt, dismantleOnClose, exitButtonDefined, exitSystemOnClose, exitValue, firstFocus, formFrame, globalIcon, handle, hasTopBar, keepFrame, moveable, no, noBorder, ok, pl, reset, resizable, resizeOnSIP, taskbarIcon, title, titleCancel, titleControls, titleOK, topControls, untitledTitle, windowFlagsToClear, windowFlagsToSet, windowIcon, windowTitle, yes
 
Fields inherited from class ewe.ui.FormBase
BACKB, CANCELB, close, cross, defaultShowOptions, 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
 
Fields inherited from class ewe.ui.CellPanel
autoSpan, equalHeights, equalWidths, layout, mySplitter, nextSplitter, quickRecalculate
 
Fields inherited from class ewe.ui.Panel
all, backgroundImage, calculated, childListeners, defaultAddToMeCellConstraints, defaultTags, grid, lastAdded, layoutManager, made, noInsets, stretchFirstColumn, stretchFirstRow, stretchLastColumn, stretchLastRow, titleGap
 
Fields inherited from class ewe.ui.Canvas
isFullScrollClient, origin, scrollPercent, virtualSize
 
Fields inherited from class ewe.ui.Container
closedFocus, cycleFocus, dontAutoScroll, dontFocusOnChildren
 
Fields inherited from class ewe.ui.Control
_debug, backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, DoPaintMethod, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, foreGround, haveNativePaint, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, MyClass, name, next, np, parent, penStatus, popupSound, popupSoundClip, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, standardBorder, standardEdge, startDragResolution, tags, tail, text, toolTip, width, x, y
 
Fields inherited from class ewe.ui.ControlBase
clipItems, clipObject, clipOwner, curPoint, currentPenEvent, debugControl, debugFlag, DidHoldDown, doubleBuffer, doubleClickTime, firstPress, globalDrawFlat, globalEditable, globalEnabled, globalPalmStyle, globalSmallControls, GotPenDown, PenIsOn, pressPoint, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed, useNativeTextInput
 
Fields inherited from interface ewe.ui.CellConstants
BORDER, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, FIXEDSIZE, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
 
Fields inherited from interface ewe.ui.IScroll
Higher, Horizontal, Lower, OPTION_INDICATOR_ONLY, PageHigher, PageLower, ScrollHigher, ScrollLower, TrackTo, Vertical
 
Fields inherited from interface ewe.ui.UIConstants
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, 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
 
Fields inherited from interface ewe.ui.ControlConstants
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, Disabled, DisablePopupMenu, DisplayOnly, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpKeyEvents, SendUpPenEvents, ShowSIP, ShrinkToNothing, SmallControl, SpecialBackground, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
 
Fields inherited from interface ewe.fx.ImageRefresher
KEEP_VISIBLE
 
Constructor Summary
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.
 
Method Summary
 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.
 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.
 void addField(FieldTransfer ft)
           
protected  boolean canExit(int exitCode)
          This is called by the exit() method to see if the form can be closed.
 void dataChanged()
          This calls toControls() and then notifyDataChange().
 void dataChanged(String fields)
          This calls toControls(fields) and then notifyDataChange().
 void dismantle(Control stopAt)
           
 boolean enableScrolling(boolean enable)
          If a ScrollablePanel has been setup in the Editor, and the property "MainScrollBarPanel" has been added to the PropertyList of this Editor, then this will either enable or disable the scrolling of the scrollbar.
 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.
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 fireFieldChanged(String fieldName)
           
protected  void fireFieldEvent(FieldListener fl, FieldTransfer ft, Object event, int type)
           
 void fireFieldEvent(Iterator it, Object event, int type)
           
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).
 FileSaver getFileSaver()
          This will return the Saver associated with the Form if one was assigned.
protected  boolean handleTransferError(Exception e, FieldTransfer ft, int direction)
           
static void main(String[] args)
           
 void make(boolean reMake)
          This is used to "make" the control before being displayed.
 void modifyFields(String fields, boolean condition, int turnOn, int turnOff, boolean repaint)
          This will modify field controls in the editor conditionally.
 void onControlEvent(ControlEvent ev)
          Make sure you call super.onControlEvent() if you override this method.
 void onDataChangeEvent(DataChangeEvent ev)
           
protected  void postEditorEvent(int type, Object parameter)
           
 void setData(Object obj)
          This calls setObject(obj).
 void setFields(Object objectOrClassOrReflectToEdit)
           
 void setFileSaver(FileSaver fs, boolean checkOnExit)
          This saves the FileSaver as a property called "FileSaver" in the Form's property list and sets up the saver as a listener for DataChangeEvents.
 void setObject(Object obj)
          This is used to set the Object to be edited by the Editor.
 void shown()
           
 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)
           
 
Methods inherited from class ewe.ui.Form
_getSetField, addButton, addTabbedPanel, addToolbar, buttonsToMenu, buttonsToSoftKeyBar, buttonsToSoftKeyBar, cancelWait, checkButtons, close, closeAll, closeForTransfer, closeForTransfer, continueWait, createMenuItem, createMenuItem, createMenuItem, createWindow, defaultTitleTo, doButtons, doShowExec, exec, exec, exec, exec, exec, exec, exec, exec, exec, execute, execute, execute, exit, filesDropped, formShown, gatherButtons, getButton, getFirstFocus, getFormFrame, getProperties, getSoftKeyBarFor, getTopmostForm, handleAction, handleAction, hasExitButton, makeButtonForForm, makeButtonForForm, makeDefaultButton, makeDefaultButton, makeFrame, makeMenuItemForForm, makeMenuItemForForm, makeSoftKeys, makeSoftKeys, mb, menuItemSelected, modifyForSmartPhone, onEvent, onSoftKey, placeCancelOnLeft, removeSoftKeyBarFor, setOKCancel, setSoftKeyBarFor, setSoftKeyBarForAll, setTitle, setTopLevelTitle, setupFrame, show, show, show, show, show, show, showWait, stopFormHandle, toolsOnBottom, waitUntilClosed, waitUntilClosed, waitUntilClosed, waitUntilClosed, waitUntilPainted
 
Methods inherited from class ewe.ui.CellPanel
calculateSizes, makeLayoutGrid, relayout, relayoutMe, removeAll, reShow, resize, resizeTo
 
Methods inherited from class ewe.ui.Panel
add, addChildListener, addDirectly, addLast, addLast, addNext, addNext, addNext, doBackground, doBorder, endRow, getControlTag, getPreferredSize, getSubControls, isEmpty, layout, remove, removeChildListener, sendToChildListeners, setText
 
Methods inherited from class ewe.ui.Canvas
canGo, canScreenScroll, checkScrolls, doScroll, fixOrigin, getActual, getBuffer, getCurrent, getDisplayedSize, getMySize, getPercent, getScrollablePanel, getScrollClient, getVisible, getVisibleArea, needScrollBar, onScroll, onSetOrigin, reduceClip, scroll, scroll, scrollToVisible, setOrigin, updateScrollServer
 
Methods inherited from class ewe.ui.Container
_paintChildren, add, containerHasFocus, dismantle, doHotKey, findChild, focusFirst, focusFirst, focusOnContainer, focusOnData, getChildren, getChildrenBackwards, getNextKeyFocus, gotFocus, lostFocus, repaintDataNow, takeFocus, takePromptControl
 
Methods inherited from class ewe.ui.Control
acceptsData, activate, addListener, addTimer, amOnTopFrame, calculateTextSize, cancelCut, cancelHoldDown, canEdit, chainDataChange, change, checkClipboardOperations, checkExitKey, checkMenu, checkMenuKey, checkModifiers, checkPenTransparent, clearTag, clipboardToString, clipboardTransfer, closeMenu, contains, contains, createGraphics, dataAccepted, dataBeingRemoved, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, dataTransferCancelled, deactivate, defaultTo, doAction, doActionKey, doMenu, dontAcceptDrop, doPaint, doPaintChildren, doPaintChildren, doPaintChildren, doPaintData, doPaintData, doShowMenu, dragged, exitEntry, fillBackground, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getBackground, getClipboardMenu, getClipObject, getControlBuffer, getControlBuffer, getDataRect, getDataToCopy, getDataToDragAndDrop, getDim, getDisplayText, getDragAndDropContext, getFont, getFontMetrics, getFontMetrics, getForeground, getFrame, getFrameOrContainer, getGraphics, getImage, getLastSelected, getLocation, getMaximumSize, getMenu, getMinimumSize, getModifiers, getNext, getParent, getPasswordCharacter, getPosInFrame, getPosInParent, getPreferredSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getTag, getText, getToolTip, getWindow, hasModifier, hasPopupFormAttached, hasTag, inheritModifiers, isChildOf, isModal, isOnMe, isSomeonesHotKey, makeFrameTopMost, makeHot, menuIsActive, modify, modifyAll, modifyAll, notifyAction, notifyDataChange, notifyDataChange, notNative_doPaintChildren, oldButWorksDoPaintChildren, oldPaintChildren, oldPostEvent, onKeyEvent, onLabelPenEvent, onPaint, onPenEvent, paintBackground, paintChildren, penClicked, penDoubleClicked, penHeld, penPressed, penReleased, penRightReleased, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, postEvent, recalculatePreferredSize, redisplay, refresh, removeListener, removeTimer, repaint, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetRect, restore, scrollAndRepaint, sendToListeners, set, setBorder, setCell, setClipObject, setControl, setCursor, setFixedSize, setFont, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPromptControl, setRect, setRect, setServer, setTag, setTags, setTextSize, setToolTip, show, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, startDragging, stopDragging, takeData, takeFromClipboard, testDim, ticked, toClipboard, toField, toField, toString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryNext, tryStartMenu, updateData, willAcceptDrop, willShowFrame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode
 
Methods inherited from interface ewe.ui.ScrollClient
getServer, setServer
 

Field Detail

transfers

public Vector transfers
This holds a list of all the FieldTransfers used in the Editor.


fieldListeners

public Vector fieldListeners
This holds a list of all the fieldListeners listening to the Editor.


coroutineStackSize

public int coroutineStackSize

objectClass

public Reflect objectClass
This must be set before adding fields.


sampleObject

public Object sampleObject
This is only necessary if you are using the objects _getField() and _setField() methods for field transfer. If not, you can leave this as null.


myObject

public Object myObject
This is the object currently being edited. Use setObject() to set it.


fieldsWillNotBeAdded

public boolean fieldsWillNotBeAdded
Set this true if you are adding fields with Controls which themselves will not be added as a child of the Editor. The Editor will still listen to events from the controls.


DoDataTransfer

public static final int DoDataTransfer
See Also:
Constant Field Values

currentEvent

public Event currentEvent
This is the event that caused the current fieldChanged() or action() event.

Constructor Detail

Editor

public Editor()
Create a new Editor that will initially be set to edit itself.


Editor

public Editor(Object objectOrClassOrReflectToEdit)
Create a new Editor to edit the type of Object specified. Additional verbose

Parameters:
objectOrClassOrReflectToEdit - Can be either an instance of the Object to edit, or a Class or Reflect Object that represents the Object class to edit.
Method Detail

dismantle

public void dismantle(Control stopAt)
Overrides:
dismantle in class Form

enableScrolling

public boolean enableScrolling(boolean enable)
If a ScrollablePanel has been setup in the Editor, and the property "MainScrollBarPanel" has been added to the PropertyList of this Editor, then this will either enable or disable the scrolling of the scrollbar.

Parameters:
enable - true to enable the scrolling, false to disable it.
Returns:
true if a "MainScrollBarPanel" was defined, false if it was not.

setFileSaver

public void setFileSaver(FileSaver fs,
                         boolean checkOnExit)
This saves the FileSaver as a property called "FileSaver" in the Form's property list and sets up the saver as a listener for DataChangeEvents.


getFileSaver

public FileSaver getFileSaver()
This will return the Saver associated with the Form if one was assigned.


canExit

protected boolean canExit(int exitCode)
Description copied from class: Form
This is called by the exit() method to see if the form can be closed. It should return true if it can be closed and false if it cannot.

Overrides:
canExit in class Form

setFields

public void setFields(Object objectOrClassOrReflectToEdit)

setObject

public void setObject(Object obj)
This is used to set the Object to be edited by the Editor. This will automatically cause a toControls() to be called, which causes the on-screen Controls to reflect the data in the Object.

Parameters:
obj - The Object to be edited.

action

public 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. By default it will look for a method called void _action(Editor ed) and if it finds it, it will be executed.


fieldChanged

public void fieldChanged(String fieldName,
                         Editor ed)
This gets called by fieldChanged(FieldTransfer ft,Editor ed). By default it will look for a method called void _changed(Editor ed) and if it finds it, it will be executed.


action

public void action(FieldTransfer ft,
                   Editor ed)
This implements the action() method in FieldListener. By default it calls action(String name,Editor ed)

Specified by:
action in interface FieldListener

fieldChanged

public void fieldChanged(FieldTransfer ft,
                         Editor ed)
This implements the fieldChanged() method in FieldListener. If the field is of type MenuItem then action(String fieldName,Editor ed) method is called - where fieldName is set to be the "action" value for the MenuItem.

Specified by:
fieldChanged in interface FieldListener

fieldEvent

public void fieldEvent(FieldTransfer ft,
                       Editor ed,
                       Object event)
This implements fieldEvent() in FieldListener. By default it does nothing.

Specified by:
fieldEvent in interface FieldListener

setData

public void setData(Object obj)
This calls setObject(obj).


getData

public void getData(Object obj)
This calls fromControls(obj).


make

public void make(boolean reMake)
Description copied from class: Control
This is used to "make" the control before being displayed. This is usually only overridden by containers.

Overrides:
make in class Form

addField

public void addField(FieldTransfer ft)

addField

public 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. This only associates the Control with the Field of the Object to be edited with the specified field name. The Control must be added to the Editor either directly or somewhere within the child tree.

Parameters:
control - The control to associate with the field.
fieldName - The field to be associated with the Control.
Returns:
The control itself.

addField

public 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. This only associates the Control with the Field of the Object to be edited with the specified field name. The Control must be added to the Editor either directly or somewhere within the child tree.

Parameters:
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.
Returns:
The control itself.

addExternalField

public 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. This will tell the Editor to listen to events from the Control.

Parameters:
control - The Control for the field.
fieldName - The name of the field.
convert - An optional DataConverter.
Returns:
The Control

addExternalField

public 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. This will tell the Editor to listen to events from the Control.

Parameters:
control - The Control for the field.
fieldName - The name of the field.
Returns:
The Control

postEditorEvent

protected void postEditorEvent(int type,
                               Object parameter)

shown

public void shown()
Overrides:
shown in class Form

formClosing

protected void formClosing()
Description copied from class: Form
This is called to indicate that the Form is about to close and it causes a FormEvent.CLOSED event to be posted. If you override it you should call super.formClosing(). There is no way of stopping the Form closing at this point.

Overrides:
formClosing in class Form

transfer

public void transfer(Object obj,
                     Iterator it,
                     int direction)

toControls

public void toControls()
Transfer all edited fields from the Object currently being edited to the on-screen controls.


fromControls

public void fromControls()
Transfer all edited fields to the Object currently being edited from the on-screen controls.


toControls

public void toControls(Object obj)
Transfer all edited fields from the specified Object to the on-screen controls.


fromControls

public void fromControls(Object obj)
Transfer all edited fields to the specified Object from the on-screen controls.


toControls

public void toControls(String fields)
Transfer specified fields from the Object currently being edited to the on-screen controls. The "fields" argument should be pure field names separated by commas (,).


fromControls

public void fromControls(String fields)
Transfer specified fields to the Object currently being edited from the on-screen controls. The "fields" argument should be pure field names separated by commas (,).


toControls

public void toControls(Object obj,
                       String fields)
Transfer specified fields from the specified Object to the on-screen controls. The "fields" argument should be pure field names separated by commas (,).


fromControls

public void fromControls(Object obj,
                         String fields)
Transfer specified fields to the specified Object from the on-screen controls. The "fields" argument should be pure field names separated by commas (,).


dataChanged

public void dataChanged(String fields)
This calls toControls(fields) and then notifyDataChange().

Parameters:
fields - a comma separated field list.

dataChanged

public void dataChanged()
This calls toControls() and then notifyDataChange().


findFields

protected Vector findFields(String fieldNames,
                            String exclude,
                            Vector dest)

transfer

protected void transfer(Object obj,
                        String fields,
                        String exclude,
                        int direction)

findFieldTransfer

public FieldTransfer findFieldTransfer(String name)
Find the FieldTransfer associated with the specified field.

Parameters:
name - The field to look for.
Returns:
The FieldTransfers associated with the field or null if it was not found.

findFieldTransfer

public FieldTransfer findFieldTransfer(Control c,
                                       boolean menuItem)
Find the FieldTransfer associated with the specified control.

Parameters:
c - The Control associated with the field.
menuItem - true if you are looking for the FieldTransfer associated with a MenuItem field for the Control.
Returns:

findFieldTransfer

public FieldTransfer findFieldTransfer(Control c)
Find the FieldTransfer associated with the specified control.

Parameters:
c - The Control associated with the field.
Returns:

findControlFor

public Control findControlFor(String fieldName)
Find the Control associated with the field.

Parameters:
fieldName - The name of the field.
Returns:
The Control associated with the field, or null if one was not found.

onDataChangeEvent

public void onDataChangeEvent(DataChangeEvent ev)
Overrides:
onDataChangeEvent in class Form

onControlEvent

public void onControlEvent(ControlEvent ev)
Description copied from class: Form
Make sure you call super.onControlEvent() if you override this method.

Overrides:
onControlEvent in class Form

fireFieldChanged

public void fireFieldChanged(String fieldName)

fireFieldEvent

protected void fireFieldEvent(FieldListener fl,
                              FieldTransfer ft,
                              Object event,
                              int type)

handleTransferError

protected boolean handleTransferError(Exception e,
                                      FieldTransfer ft,
                                      int direction)

fireFieldEvent

public void fireFieldEvent(Iterator it,
                           Object event,
                           int type)

modifyFields

public void modifyFields(String fields,
                         boolean condition,
                         int turnOn,
                         int turnOff,
                         boolean repaint)
This will modify field controls in the editor conditionally. If "condition" is true, then the turnOn flags will be set and the turnOff flags will be cleared. If it is false then the reverse will be done. If the flags have changed then the control will be repainted if repaint is true.


main

public static void main(String[] args)
                 throws Exception
Throws:
Exception