|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.ui.ControlBase
ewe.ui.Control
ewe.ui.Container
ewe.ui.Canvas
ewe.ui.Panel
ewe.ui.CellPanel
ewe.ui.FormBase
ewe.ui.Form
ewe.ui.Editor
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.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.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 java.lang.Object |
clone, equals, finalize, getClass, hashCode |
| Methods inherited from interface ewe.ui.ScrollClient |
getServer, setServer |
| Field Detail |
public Vector transfers
public Vector fieldListeners
public int coroutineStackSize
public Reflect objectClass
public Object sampleObject
public Object myObject
public boolean fieldsWillNotBeAdded
public static final int DoDataTransfer
public Event currentEvent
| Constructor Detail |
public Editor()
public Editor(Object objectOrClassOrReflectToEdit)
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 |
public void dismantle(Control stopAt)
dismantle in class Formpublic boolean enableScrolling(boolean enable)
enable - true to enable the scrolling, false to disable it.
public void setFileSaver(FileSaver fs,
boolean checkOnExit)
public FileSaver getFileSaver()
protected boolean canExit(int exitCode)
Form
canExit in class Formpublic void setFields(Object objectOrClassOrReflectToEdit)
public void setObject(Object obj)
obj - The Object to be edited.
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 FieldListenerpublic void setData(Object obj)
public void getData(Object obj)
public void make(boolean reMake)
Control
make in class Formpublic void addField(FieldTransfer ft)
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.
protected void postEditorEvent(int type,
Object parameter)
public void shown()
shown in class Formprotected void formClosing()
Form
formClosing in class Form
public void transfer(Object obj,
Iterator it,
int direction)
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()
protected Vector findFields(String fieldNames,
String exclude,
Vector dest)
protected void transfer(Object obj,
String fields,
String exclude,
int direction)
public FieldTransfer findFieldTransfer(String name)
name - The field to look for.
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 Formpublic void onControlEvent(ControlEvent ev)
Form
onControlEvent in class Formpublic void fireFieldChanged(String fieldName)
protected void fireFieldEvent(FieldListener fl,
FieldTransfer ft,
Object event,
int type)
protected boolean handleTransferError(Exception e,
FieldTransfer ft,
int direction)
public void fireFieldEvent(Iterator it,
Object event,
int type)
public void modifyFields(String fields,
boolean condition,
int turnOn,
int turnOff,
boolean repaint)
public static void main(String[] args)
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||