|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This configuration interface of the Gui aspect defines all the methods that handle the appearence of the methods in views.
GuiAC
,
View
Method Summary | |
void |
addPostInvoke(AbstractMethodItem method,
AbstractMethodItem hook)
Specifies a method to be invoked after a method is invoked from the GUI. |
void |
setCondition(AbstractMethodItem method,
String condition)
Sets a condition on a method. |
void |
setCreationAllowed(FieldItem field,
boolean allow)
Tells wether should be allowed to create a new instance when editing the value of a field. |
void |
setCreationAllowedParameters(AbstractMethodItem method,
boolean[] create)
Tells if JAC object-typed (references) arguments of a method can be created while the method's invocation or if they should be choosen in existing instances list. |
void |
setDefaultValues(AbstractMethodItem method,
Object[] values)
Sets the default value for argument names of a given method item so that they can be used by GUI aspect components. |
void |
setDirectCollectionMethods(CollectionItem collection,
String[] methods)
This configuration method allows the programmer to tell the GUI to add some buttons to the collection that will invoke the corresponding methods on the currently selected collection element. |
void |
setDynamicIcon(MethodItem method,
MethodItem iconMethod)
Defines a method to dynamically compute the icon for a menu's method. |
void |
setLinkedParameters(AbstractMethodItem method,
String[] collections)
Declares some reference parameters (non-primitive object-typed parameters) of the method to be linked with a collection that gives the choices of the object in the GUI combobox. |
void |
setMethodDynamicParameterChoice(MethodItem method,
ClassItem[] targetClasses,
String[] targetMethods,
boolean[] editable)
Same as setDynamicFieldChoice but for method parameters
The values are dynamically defined at runtime by the
invocation of a static target method. |
void |
setMethodDynamicParameterChoice(MethodItem method,
MethodItem[] targetMethods,
boolean[] editable)
Same as setDynamicFieldChoice but for method parameters
The values are dynamically defined at runtime by the
invocation of a static target method. |
void |
setMethodParametersHeight(AbstractMethodItem method,
Length[] height)
Sets the height for all parameters of one method. |
void |
setMethodParametersWidth(AbstractMethodItem method,
Length[] width)
Sets the width for all parameters of one method. |
void |
setMimeType(AbstractMethodItem method,
String type)
Sets the mime-type of the file written to an OutputStream or Writer. |
void |
setParameterEnums(AbstractMethodItem method,
String[] enumNames)
Declares some parameters of method as enums. |
void |
setParameterFields(AbstractMethodItem method,
String[] parameterFields)
Specify that a parameter of a method corresponds to a field within the invoked object. |
void |
setParameterNames(AbstractMethodItem method,
String[] parameterNames)
Sets the argument names of a given method item so that they can be used by GUI aspect components. |
void |
setPasswordParameters(AbstractMethodItem method,
String[] parameterFields)
Specify that a parameter of a method is a pasword method. |
void |
setSlowOperation(AbstractMethodItem method,
boolean isSlow)
If an operation is expected to take a long time to complete, use this method to tell the GUI that it should display a message asking the user to wait for a while. |
Method Detail |
public void setMethodDynamicParameterChoice(MethodItem method, ClassItem[] targetClasses, String[] targetMethods, boolean[] editable)
setDynamicFieldChoice
but for method parameters
The values are dynamically defined at runtime by the invocation of a static target method. This target method must return an array of objects that contains the possible new values for the fields.
method
- the methodtargetClasses
- the array of classes that contains the
target method for each parameter (elements of this array may be null)targetMethods
- the static methods within the target
classes that returns the values to choose from (elements of this
array may be null). The prototype is
callback(Object)
where the given object is the
substance.editable
- tells if the values can be edited (new values
can be manually entered)setMethodDynamicParameterChoice(MethodItem,MethodItem[],boolean[])
public void setMethodDynamicParameterChoice(MethodItem method, MethodItem[] targetMethods, boolean[] editable)
setDynamicFieldChoice
but for method parameters
The values are dynamically defined at runtime by the invocation of a static target method. This target method must return an array of objects that contains the possible new values for the fields.
method
- the methodtargetMethods
- the static methods
that returns the values to choose from (elements of this
array may be null). The prototype is
callback(Object)
where the given object is the
substance.editable
- tells if the values can be edited (new values
can be manually entered)setMethodDynamicParameterChoice(MethodItem,ClassItem[],String[],boolean[])
public void setParameterNames(AbstractMethodItem method, String[] parameterNames)
The GUI aspect can automatically fill some default parameter names for all the setters to lighten the GUI aspect programmer work (however, these automatically generated names can be overloaded if needed).
method
- the method item. It can be of the form
"methodName" or "methodName(parameterNames
- the parameter namespublic void setParameterEnums(AbstractMethodItem method, String[] enumNames) throws Exception
method
- the methodenumNames
- the name of enums, for each parameter of the
method. Use null to leave a parameter unaffected.
Exception
public void setLinkedParameters(AbstractMethodItem method, String[] collections) throws Exception
method
- the methodcollections
- the entire names of the collections that
should be linked to the corresponding parameters (empty string
if unlinked)
Exception
public void setCreationAllowedParameters(AbstractMethodItem method, boolean[] create)
method
- the method item. It can be of the form
"methodName" or "methodName(create
- a flags arrays that tells for each parameters
whether it can be created (true) or not (false). It has no
effect if the parameter is not a JAC object (a reference)setCreationAllowed(FieldItem,boolean)
public void setCreationAllowed(FieldItem field, boolean allow)
field
- the fieldallow
- wether to allow or notsetCreationAllowedParameters(AbstractMethodItem,boolean[])
public void setParameterFields(AbstractMethodItem method, String[] parameterFields)
method
- the methodparameterFields
- an array that contains the corresponding
field for each parameter of the methodpublic void setMethodParametersWidth(AbstractMethodItem method, Length[] width) throws Exception
method
- the methodwidth
- width of all parameters
Exception
setMethodParametersHeight(AbstractMethodItem,Length[])
public void setMethodParametersHeight(AbstractMethodItem method, Length[] height) throws Exception
method
- the methodheight
- height of all parameters
Exception
setMethodParametersWidth(AbstractMethodItem,Length[])
public void setPasswordParameters(AbstractMethodItem method, String[] parameterFields)
A password parameter will be rendered with stars instead of the actual characters.
method
- the methodparameterFields
- an array that must contains "true" items
if the corresponding parameter is a password, "false" or ""
otherwhise.public void setDirectCollectionMethods(CollectionItem collection, String[] methods)
collection
- the collectionmethods
- the names of the methods that can be invoked on
the selected elementpublic void setDefaultValues(AbstractMethodItem method, Object[] values)
method
- the method item. It can be of the form
"methodName" or "methodName(values
- the default parameter valuespublic void setCondition(AbstractMethodItem method, String condition)
method
- the method to put a condition oncondition
- the condition. It must be the name of method of
the same class as method which returns a boolean.public void setSlowOperation(AbstractMethodItem method, boolean isSlow)
method
- the methodisSlow
- wether the method is slow or notpublic void setMimeType(AbstractMethodItem method, String type)
Sets the mime-type of the file written to an OutputStream or Writer.
If a method takes an OutputStream or Writer as a parameter, a display (such as the web display or instance) may redirect the stream, to the browser. So that the browser can correctly interpret the data, it may be necessary to specify its mime-type.
method
- type
- the mime-type (such as "application/pdf")public void setDynamicIcon(MethodItem method, MethodItem iconMethod)
method
- methodiconMethod
- a static method which must take 3 parameters
(a MethodItem, an Object and an array of objects) and return a
String or null. It will be invoked with the parameters array
given to addMenuItem
GuiConf.addMenuItem(String,String,String[],String,AbstractMethodItem,String[])
,
FieldAppearenceGuiConf.setIcon(MemberItem,String)
public void addPostInvoke(AbstractMethodItem method, AbstractMethodItem hook)
method
- hook
- the method to be invoked after "method" is
invoked. It must be static and take an InvokeEvent parameterInvokeEvent
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |