JAC project
AOPSYS
CEDRIC & LIP6 labs

org.objectweb.jac.aspects.gui
Interface BehaviorGuiConf

All Known Subinterfaces:
GuiConf
All Known Implementing Classes:
GuiAC

public interface BehaviorGuiConf

This configuration interface of the Gui aspect defines all the methods that handle some behavioral configurations of the widgets.

Author:
Renaud Pawlak, Laurent Martelli
See Also:
GuiAC, View

Method Summary
 void addViewFieldDependency(ClassItem cl, String fieldName)
          Specify that the object views of instances of a class depend on the value of a field.
 void captureSystemErr()
          Tells the swing administration gui to capture System.err so that it appears in a tab.
 void captureSystemOut()
          Tells the swing administration gui to capture System.out so that it appears in a tab.
 void setAutoCreate(FieldItem field)
          This configuration method tells the GUI to automatically create a new instance of the field type when a setter or an adder is invoke on the object that owns this field.
 void setAutoCreateAll(ClassItem cl)
          This configuration method tells that all the class methods must be in auto-creation mode.
 void setAutoCreateInitializer(FieldItem field, MethodItem initializer)
          Defines a method to initialize new objects created by the auto-create behaviour.
 void setAutoCreateParameters(AbstractMethodItem method)
          This configuration method tells which parameters of the given method should be autocreated.
 void setAutoCreateParametersEx(ClassItem cl, String[] excludedMethods)
          This configuration method tells that all the class methods must be in auto-creation mode except the excluded ones.
 void setAutoCreateState(ClassItem cl, String[] fields)
          This configuration method tells which fields of the given class should be auto-created.
 void setClosingMethod(ClassItem cl, String methodName)
          Sets the given method to be closing (ie, when the user press the corresponding button, it performs the call and closes the current object view).
 void setCommitOnFocusLost(boolean value)
          Set the commit method to use when attibutes are edited.
 void setEditableDefaultValues(CollectionItem collection, boolean editable)
          Tells if the default values of an item can be editable from the GUI.
 void setIndexNotFoundHandler(ClassItem cl, MethodItem handler)
          Defines a method to be called when an object referred to by it's indexed field is not found.
 void setInteractionHandler(MethodItem method, MethodItem handler)
          Sets a method to be used to handler user interaction when a method is called, instead of the standard "ask for parameters stuffs".
 void setOnSelection(CollectionItem collection, MethodItem eventHandler)
          Sets the event handler to be called when an item of the collection is selected.
 void setOpenViewMethod(ClassItem cl, String methodName)
          This configuration method allows the programmer to specify that the result of a given method (should be a wrappe) opens a new view on this result instead of treating it as a simple result.
 void setSelectionTarget(CollectionItem collection, ClassItem targetClass, String targetField)
          Sets the field to be displayed when an item of the collection is selected, instead of the item itself.
 void setViewOnSelection(CollectionItem collection)
          This configuration method allows the programmer to specify that the view on an object contained in a collection will be automatically opened by the GUI when the user selects it.
 

Method Detail

setAutoCreate

public void setAutoCreate(FieldItem field)
This configuration method tells the GUI to automatically create a new instance of the field type when a setter or an adder is invoke on the object that owns this field.

This features makes the GUI more usable in many cases (otherwhise, a intermediate step is asked to the user for creating or picking an existing instance).

Parameters:
field - the field to be auto-created

setAutoCreateInitializer

public void setAutoCreateInitializer(FieldItem field,
                                     MethodItem initializer)
Defines a method to initialize new objects created by the auto-create behaviour.

Parameters:
field - the field whose autocreate behaviour is considered
initializer - method used to initialize new objects. It must be a method of the field's owning class that takes an instance of the auto created object as parameter.
See Also:
setAutoCreate(FieldItem)

setAutoCreateAll

public void setAutoCreateAll(ClassItem cl)
This configuration method tells that all the class methods must be in auto-creation mode.

Parameters:
cl - the class

setAutoCreateParameters

public void setAutoCreateParameters(AbstractMethodItem method)
This configuration method tells which parameters of the given method should be autocreated.

It does not use the constructor view but the actual modal view on an empty created object that needs to be filled by the user.

Parameters:
method - the method

setAutoCreateParametersEx

public void setAutoCreateParametersEx(ClassItem cl,
                                      String[] excludedMethods)
This configuration method tells that all the class methods must be in auto-creation mode except the excluded ones.

Parameters:
cl - the class
excludedMethods - the excluded methods names

setAutoCreateState

public void setAutoCreateState(ClassItem cl,
                               String[] fields)
This configuration method tells which fields of the given class should be auto-created.

When a wrappee of the given class is auto-created using the setAutoCreateParameters method, all the fields mentioned here are also autocreated afterwards and a modal view is shown to the user so that he can fill the values. The given fields should be references (on other wrappees).

Parameters:
cl - the class
fields - the fields to autocreate
See Also:
setAutoCreateParameters(AbstractMethodItem)

setOpenViewMethod

public void setOpenViewMethod(ClassItem cl,
                              String methodName)
This configuration method allows the programmer to specify that the result of a given method (should be a wrappe) opens a new view on this result instead of treating it as a simple result.

Parameters:
cl - the class
methodName - the method name
See Also:
Display.openView(Object)

setViewOnSelection

public void setViewOnSelection(CollectionItem collection)
This configuration method allows the programmer to specify that the view on an object contained in a collection will be automatically opened by the GUI when the user selects it.

Parameters:
collection - the collection
See Also:
setOnSelection(CollectionItem,MethodItem), setSelectionTarget(CollectionItem,ClassItem,String)

setOnSelection

public void setOnSelection(CollectionItem collection,
                           MethodItem eventHandler)
Sets the event handler to be called when an item of the collection is selected.

Parameters:
collection - the collection
eventHandler - the event handler method. It must be static method. It will be called with the following parameters : the CustomizedGUI, the CollectionItem and the selected Object. If the handler returns an object, it will be used as the selected object.

setSelectionTarget

public void setSelectionTarget(CollectionItem collection,
                               ClassItem targetClass,
                               String targetField)
Sets the field to be displayed when an item of the collection is selected, instead of the item itself.

If the user selects an object o, o.<targetField> will be displayed instead of o.

Parameters:
collection - the collection
targetClass - the class owning the target field
targetField - the field to display
See Also:
setViewOnSelection(CollectionItem)

addViewFieldDependency

public void addViewFieldDependency(ClassItem cl,
                                   String fieldName)
Specify that the object views of instances of a class depend on the value of a field. That is, these views must be refreshed whenever the value of that field changes.

Parameters:
cl - the class
fieldName - the field name

setEditableDefaultValues

public void setEditableDefaultValues(CollectionItem collection,
                                     boolean editable)
Tells if the default values of an item can be editable from the GUI.


setClosingMethod

public void setClosingMethod(ClassItem cl,
                             String methodName)
Sets the given method to be closing (ie, when the user press the corresponding button, it performs the call and closes the current object view).

Parameters:
cl - the class the contains the method
methodName - the method item name. It can be of the form "methodName" or "methodName()". The first syntax will use the method with that name. The second syntax allow you to specify parameter types (separated by commas, with no spaces).

setCommitOnFocusLost

public void setCommitOnFocusLost(boolean value)
Set the commit method to use when attibutes are edited.

Parameters:
value - If true, attribute changes are committed when the widget loses focus. Otherwise, a commit and a cancel button are displayed in each object view.

captureSystemOut

public void captureSystemOut()
Tells the swing administration gui to capture System.out so that it appears in a tab.


captureSystemErr

public void captureSystemErr()
Tells the swing administration gui to capture System.err so that it appears in a tab.


setInteractionHandler

public void setInteractionHandler(MethodItem method,
                                  MethodItem handler)
Sets a method to be used to handler user interaction when a method is called, instead of the standard "ask for parameters stuffs".

Parameters:
method -
handler - It should be a static method taking as arguments (Interaction,DisplayContext)

setIndexNotFoundHandler

public void setIndexNotFoundHandler(ClassItem cl,
                                    MethodItem handler)
Defines a method to be called when an object referred to by it's indexed field is not found.

Parameters:
cl - the class of which the instance is not found
handler - the method to be called. It must be a static method taking 2 parameters: a ClassItem, which is the class of the object which could not be found, and an Object which is the value of the indexed field. And it should return an Object, which if not null will used as the found object.
See Also:
ClassAppearenceGuiConf.selectWithIndexedField(ClassItem,CollectionItem,String)

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli