ewe.ui
Class ExecTransfer

java.lang.Object
  extended byewe.ui.ExecTransfer
All Implemented Interfaces:
Runnable

public class ExecTransfer
extends Object
implements Runnable


Field Summary
static int CREATE_NEW_FORM
          A value sent to the createForm method.
 boolean doTransfer
           
 Handle handle
           
static int NEW_FORM_EXITED
          A value sent to the createForm method.
 boolean newFormChecksFileSaverOnExit
          False by default - set this to true if you want the new Form to check the FileSaver for before saving before closing.
 boolean oldFileSaverListensToNewForm
          True by default - set this to false if you do not want the new Form to affect the changed state of any FileSaver.
static int RECREATE_ORIGINAL_FORM
          A value sent to the createNewForm method.
 FileSaver saver
           
 PropertyList sourceProperties
           
 
Constructor Summary
ExecTransfer(Form sourceForm)
          This creates an ExecTransfer that will do the transfer only if the VM reports that the executing device is considered a low memory device.
ExecTransfer(Form sourceForm, boolean doTransfer)
          This creates an ExecTransfer that will do the transfer only if the doTransfer parameter is true.
ExecTransfer(Form sourceForm, boolean doTransfer, Object formCreator, String formCreatorMethodName)
          This creates an ExecTransfer that will do the transfer only if the VM reports that the executing device is considered a low memory device.
ExecTransfer(Form sourceForm, Object formCreator, String formCreatorMethodName)
          This creates an ExecTransfer that will do the transfer only if the VM reports that the executing device is considered a low memory device.
 
Method Summary
 Form createForm(ExecTransfer et, int creationAction, int newFormRetCode)
           
 Form getOrignalForm()
          This is used to get the original displayed Form ONLY if an exec transfer is not being done.
 void run()
           
 Form stopSourceForm(int exitCode)
          This stops the Handle of the sourceForm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Field Detail

handle

public Handle handle

saver

public FileSaver saver

sourceProperties

public PropertyList sourceProperties

doTransfer

public boolean doTransfer

CREATE_NEW_FORM

public static final int CREATE_NEW_FORM
A value sent to the createForm method. It indicates that the new Form should be created and returned. This will be called even if an exec transfer is not being done.

See Also:
Constant Field Values

RECREATE_ORIGINAL_FORM

public static final int RECREATE_ORIGINAL_FORM
A value sent to the createNewForm method. It indicates that the new Form has exited and that the original Form should be recreated and returned. It is only called if an exec transfer IS being done.

See Also:
Constant Field Values

NEW_FORM_EXITED

public static final int NEW_FORM_EXITED
A value sent to the createForm method. It indicates that the new Form has exited but the original Form is still displayed. No Form should be returned. It is only called if an exec transfer is NOT being done.

See Also:
Constant Field Values

oldFileSaverListensToNewForm

public boolean oldFileSaverListensToNewForm
True by default - set this to false if you do not want the new Form to affect the changed state of any FileSaver. In that case setFileSaver() will not be called on the new Form.


newFormChecksFileSaverOnExit

public boolean newFormChecksFileSaverOnExit
False by default - set this to true if you want the new Form to check the FileSaver for before saving before closing. In that case you may need to set the ObjectToSave property of the new Form if you need it to save something other than object being edited.

Constructor Detail

ExecTransfer

public ExecTransfer(Form sourceForm)
This creates an ExecTransfer that will do the transfer only if the VM reports that the executing device is considered a low memory device.


ExecTransfer

public ExecTransfer(Form sourceForm,
                    boolean doTransfer)
This creates an ExecTransfer that will do the transfer only if the doTransfer parameter is true.

Parameters:
sourceForm - The original currently displaying Form
doTransfer - If this is true then an exec transfer will be done, otherwise the new Form

ExecTransfer

public ExecTransfer(Form sourceForm,
                    Object formCreator,
                    String formCreatorMethodName)
             throws IllegalArgumentException
This creates an ExecTransfer that will do the transfer only if the VM reports that the executing device is considered a low memory device.

Parameters:
sourceForm - The original currently displaying Form
formCreator - An object that will create the new Form and re-create the original Form on request.
formCreatorMethodName - The name of the method of the formCreator that will be called.
This method must be of the form:
ewe.ui.Form any_method_name(ewe.ui.ExecTransfer transfer,boolean createNewForm); or
ewe.ui.Form any_method_name(ewe.ui.ExecTransfer transfer,boolean createNewForm,int newFormExitCode);
Throws:
IllegalArgumentException - if the method could not be found in the supplied formCreator object.

ExecTransfer

public ExecTransfer(Form sourceForm,
                    boolean doTransfer,
                    Object formCreator,
                    String formCreatorMethodName)
             throws IllegalArgumentException
This creates an ExecTransfer that will do the transfer only if the VM reports that the executing device is considered a low memory device.

Parameters:
sourceForm - The original currently displaying Form
doTransfer - If this is true then an exec transfer will be done, otherwise the new Form will be displayed without the old one being removed.
formCreator - An object that will create the new Form and re-create the original Form on request.
formCreatorMethodName - The name of the method of the formCreator that will be called.
This method must be of the form:
ewe.ui.Form any_method_name(ewe.ui.ExecTransfer transfer,boolean createNewForm); or
ewe.ui.Form any_method_name(ewe.ui.ExecTransfer transfer,boolean createNewForm,int newFormExitCode);
Throws:
IllegalArgumentException - if the method could not be found in the supplied formCreator object.
Method Detail

getOrignalForm

public Form getOrignalForm()
This is used to get the original displayed Form ONLY if an exec transfer is not being done. If it returns null then an exec transfer is being done and the original Form is no longer available.


run

public void run()
Specified by:
run in interface Runnable

stopSourceForm

public Form stopSourceForm(int exitCode)
This stops the Handle of the sourceForm. This can be used to abort the the recreation of the source, requesting that it report that it exited instead.

Parameters:
exitCode - The exit code to return.
Returns:
always a null Form.

createForm

public Form createForm(ExecTransfer et,
                       int creationAction,
                       int newFormRetCode)