|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jac.aspects.gui.EventHandler
This handler manages events received from GUIs (web and swing for now). It is especially used for lists and arrays (onSelection, onView, etc ...)
Constructor Summary | |
EventHandler()
|
Method Summary | |
void |
fieldUpdated(Object substance,
FieldItem field,
Object value,
Object param)
Upcalled when a field was modified. |
static EventHandler |
get()
|
void |
handleResult(DisplayContext context,
HandlerResult hres)
|
static void |
initAutocreatedObject(Object created,
Object substance,
FieldItem role)
Initialize an autocreated object by setting |
void |
maybeInvalidatePane(ViewFactory factory,
DisplayContext context,
CustomizedView customizedView,
String selectedPaneID)
Removes the content of pane when another pane's content is changed |
void |
onAddToCollection(DisplayContext context,
AddEvent add)
This method is upcalled when an object is added to a collection. |
void |
onAddToCollection(DisplayContext context,
AddEvent add,
boolean noAutoCreate)
This method is upcalled when an object is added to a collection. |
Object |
onCreateObject(DisplayContext context,
ClassItem cli,
Object substance,
FieldItem field)
This method is upcalled when an object has to be created in an object chooser. |
void |
onDropObject(DisplayContext context,
Object target,
Object droppedObject,
Object source,
boolean copy)
|
InvokeThread |
onInvoke(DisplayContext context,
InvokeEvent invoke)
Upcalled when an invocation is performed on an object. |
InvokeThread |
onInvoke(DisplayContext context,
InvokeEvent invoke,
boolean askFormParameters,
String[] attrNames,
Object[] attrValues)
Invoke a method in the general case. |
InvokeThread |
onInvoke(DisplayContext context,
InvokeEvent invoke,
String[] attrNames,
Object[] attrValues)
Upcalled when an invocation is performed on an object. |
void |
onInvokeDirect(DisplayContext context,
Object substance,
AbstractMethodItem method,
Object[] parameters)
Upcalled when a direct invocation is performed on an object (no parameters will be asked by the GUI). |
Object |
onInvokeSynchronous(DisplayContext context,
InvokeEvent invoke)
Invoke a method and waits for the result (and returns it). |
void |
onNodeSelection(DisplayContext context,
AbstractNode node,
boolean forceView)
Upcalled when a tree node is selected. |
void |
onRemoveFromCollection(DisplayContext context,
RemoveEvent remove,
boolean askFormParameters)
This method is upcalled when an object is removed from a collection. |
void |
onSelection(DisplayContext context,
MemberItem container,
Object selectedObject,
FieldItem field,
Object extraOption)
Upcalled when a selection occurs on a field. |
void |
onSelection(DisplayContext context,
MemberItem container,
Object selectedObject,
FieldItem field,
Object extraOption,
boolean forceView)
Upcalled when a selection occurs on a field. |
void |
onView(DisplayContext context,
MemberItem container,
Object selectedObject,
FieldItem field,
Object extraOption)
Upcalled when a view is asked on an object. |
void |
setFocus(View top,
FieldItem field,
Object option)
Gives focus to the view which is a field editor for a given field. |
static FieldItem |
setOppositeRole(FieldItem field)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EventHandler()
Method Detail |
public static EventHandler get()
public void onSelection(DisplayContext context, MemberItem container, Object selectedObject, FieldItem field, Object extraOption)
context
- the contextcontainer
- ???selectedObject
- the selected objectfield
- ???extraOption
- public void onView(DisplayContext context, MemberItem container, Object selectedObject, FieldItem field, Object extraOption)
context
- the contextcontainer
- ???selectedObject
- the selected objectfield
- ???extraOption
- public void onSelection(DisplayContext context, MemberItem container, Object selectedObject, FieldItem field, Object extraOption, boolean forceView)
context
- the contextcontainer
- member (reference, collection, or method) that
references the selected object (the result in case of a method)selectedObject
- the selected objectfield
- give focus to this field in the view of the selected objectextraOption
- forceView
- when true, a window containing the selected
object is opened if we could not find a place where to put the
new view.public void handleResult(DisplayContext context, HandlerResult hres)
public void maybeInvalidatePane(ViewFactory factory, DisplayContext context, CustomizedView customizedView, String selectedPaneID)
selectedPaneID
- ID of the selected panepublic void setFocus(View top, FieldItem field, Object option)
top
- view to start searching from. All subviews of this
view will be recursively inspected.field
- the field whose editor to search foroption
- an option that will be passed when calling
onSetFocus()
on the FieldEditor.FieldEditor.onSetFocus(Object)
public static void initAutocreatedObject(Object created, Object substance, FieldItem role)
public void onNodeSelection(DisplayContext context, AbstractNode node, boolean forceView)
context
- the display contextnode
- the selected tree nodeforceView
- if true, the subtance of the node is opened in
a new windowpublic void onInvokeDirect(DisplayContext context, Object substance, AbstractMethodItem method, Object[] parameters)
context
- the display contextsubstance
- the object that holds the methodmethod
- the method to invokeparameters
- the parameters of the methodpublic InvokeThread onInvoke(DisplayContext context, InvokeEvent invoke)
context
- the display contextinvoke
-
onInvoke(DisplayContext,InvokeEvent,String[],Object[])
,
onInvoke(DisplayContext,InvokeEvent,boolean,String[],Object[])
public InvokeThread onInvoke(DisplayContext context, InvokeEvent invoke, String[] attrNames, Object[] attrValues)
context
- the display contextinvoke
- attrNames
- the contextual attributes names to passattrValues
- the contextual attributes values
onInvoke(DisplayContext,InvokeEvent)
,
onInvoke(DisplayContext,InvokeEvent,boolean,String[],Object[])
public InvokeThread onInvoke(DisplayContext context, InvokeEvent invoke, boolean askFormParameters, String[] attrNames, Object[] attrValues)
context
- the display contextinvoke
- attrNames
- the contextual attributes names to passattrValues
- the contextual attributes values
onInvoke(DisplayContext,InvokeEvent)
,
onInvoke(DisplayContext,InvokeEvent,String[],Object[])
public Object onInvokeSynchronous(DisplayContext context, InvokeEvent invoke)
context
- the display contextinvoke
- the method invocation to performpublic void onAddToCollection(DisplayContext context, AddEvent add)
context
- the display contextadd
- the add that triggered the eventpublic void onAddToCollection(DisplayContext context, AddEvent add, boolean noAutoCreate)
context
- the display contextadd
- the add that triggered the eventnoAutoCreate
- if true, does not auto create the object to
add, whatever the configuration for the collection.public void onRemoveFromCollection(DisplayContext context, RemoveEvent remove, boolean askFormParameters)
context
- the display contextremove
- askFormParameters
- wether to to display an input box for
the parameters of the remover methodpublic Object onCreateObject(DisplayContext context, ClassItem cli, Object substance, FieldItem field)
context
- the display contextcli
- the class of the object to createsubstance
- field
- a field to which the created object will be "added". May be null.public void onDropObject(DisplayContext context, Object target, Object droppedObject, Object source, boolean copy)
public void fieldUpdated(Object substance, FieldItem field, Object value, Object param)
FieldUpdate
fieldUpdated
in interface FieldUpdate
substance
- the object of which a field was updatedfield
- the updated fieldvalue
- new value of the vieldparam
- extra infos (unused)ViewControlWrapper.registerField(Wrappee,FieldItem,FieldUpdate,Object)
public static FieldItem setOppositeRole(FieldItem field)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |