|
JAC project AOPSYS CEDRIC & LIP6 labs |
|||||||||
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 fields in objects views.
GuiAC
,
View
Method Summary | |
void |
hideTreeRelation(FieldItem field)
This configuration method allows to hide a given relation (collection) in a treeview, even if the show relations mode is on . |
void |
setBorder(FieldItem field)
Sets a border to the field in an object view. |
void |
setBorder(FieldItem field,
String alignment,
String style)
Sets a border to the field in an object view. |
void |
setCategories(MemberItem member,
String[] categories)
Sets the categories of an item of a class. |
void |
setCategory(MemberItem member,
String category)
Sets the category of an item of a class. |
void |
setCollectionType(CollectionItem collection,
String type)
Set the type of the objects of a collection. |
void |
setDefaultEditorHeight(ClassItem type,
int height,
int rows)
Sets the default editor height for value of a given type. |
void |
setDefaultEditorHeight(VirtualClassItem type,
int height,
int rows)
Sets the default editor height for value of a given type. |
void |
setDefaultEditorWidth(ClassItem type,
int width,
int columns)
Sets the default editor width for value of a given type. |
void |
setDefaultEditorWidth(VirtualClassItem type,
int width,
int columns)
Sets the default editor width for value of a given type. |
void |
setDefaultShowRowNumbers(boolean value)
Tells the GUI wether to show row numbers for tables and lists by default. |
void |
setDefaultSortedColumn(CollectionItem collection,
String column)
Sets a default sorted column for a collection. |
void |
setDefaultValue(FieldItem field,
MethodItem method,
String value)
Set the default value for a choice. |
void |
setDefaultValue(FieldItem field,
String value)
Set the default value for a choice. |
void |
setDescription(MemberItem member,
String description)
Sets the description of a class member (field of method). |
void |
setDisplayLabel(MemberItem member,
boolean value)
Wether to display a label containing the name of the field in views. |
void |
setDynamicFieldChoice(FieldItem field,
Boolean editable,
ClassItem targetClass,
String targetMethod)
Same as setFieldChoice but with dynamically defined values. |
void |
setDynamicFieldChoice(FieldItem field,
Boolean editable,
MethodItem targetMethod)
Same as setFieldChoice but with dynamically defined values. |
void |
setEditable(FieldItem field,
boolean editable)
Set a field to be editable. |
void |
setEditorHeight(FieldItem field,
int height,
int rows)
Sets the height of the field's embedded editor when exist. |
void |
setEditorWidth(FieldItem field,
int width,
int columns)
Sets the width of the field's embedded editor when exist. |
void |
setEmbeddedAdder(CollectionItem collection,
boolean embedded)
Tells the GUI wether to use an embedded view for the adder of a collection. |
void |
setEmbeddedEditor(MemberItem cl)
This configuration method allows the programmer to set a class member to be internally edited. |
void |
setEmbeddedEditorColumns(CollectionItem collection,
String viewName,
MemberItem[] members)
Tells to use embedded editors for the cells of some columns |
void |
setEmbeddedEditors(ClassItem cl)
Tells the GUI to use embedded editors for all fields of a class, whenever possible. |
void |
setEmbeddedEditors(CollectionItem collection,
String viewName,
boolean embedded)
Tells wether to use embedded editors for the cells of a table |
void |
setEmbeddedView(MemberItem member)
Tells the GUI to insert a referenced object to be displayed as an embedded view in its container object view. |
void |
setFieldChoice(FieldItem field,
Boolean editable,
String[] choice)
This configuration method allows the programmer to make a set of object to be proposed to the final user when an edition of this field value is performed. |
void |
setFieldEnum(FieldItem field,
String enum)
Declare a field as an enumeration. |
void |
setFileChooserView(MethodItem method,
String[] fileExtensions,
String fileDescription)
Sets the view of a given setter's calling box to be a file chooser. |
void |
setFloatFormat(FieldItem field,
String format)
Sets the display format of a float or double field. |
void |
setIcon(MemberItem field,
String name)
This configuration method attaches an icon to a given field so that the iconized instances of this field will be represented by this icon (for instance in a treeview). |
void |
setLabel(MemberItem member,
MemberItem selector,
String label)
Sets the label of a class member (field of method) for a given context |
void |
setLabel(MemberItem member,
String label)
Sets the label of a class member (field of method). |
void |
setMembersOrder(CollectionItem collection,
ClassItem targetClass,
String[] memberNames)
Sets the default order in which the attributes of the elements of a collection are to be rendered. |
void |
setMembersOrder(CollectionItem collection,
String viewName,
ClassItem targetClass,
String[] memberNames)
Sets the order in which the attributes of the elements of a collection are to be rendered for a given view. |
void |
setNumRowsPerPage(CollectionItem collection,
int numRows)
Sets the number of rows to display simultaneously for a collection. |
void |
setPreferredHeight(CollectionItem collection,
int height)
Tells the preferred height a table or list view of a collection should take, if possible. |
void |
setPreferredWidth(CollectionItem collection,
int width)
Tells the preferred width a table or list view of a collection should take, if possible. |
void |
setStyle(FieldItem field,
String style)
Set the style of a field |
void |
setTableView(FieldItem field)
Sets the render of a given field (more precisely a collection) to be rendered by a table. |
void |
setViewType(FieldItem field,
String viewName,
String viewType)
Sets the view type of a field instead of using the default one ("List" or "Table"). |
void |
setVisible(MemberItem member,
boolean visible)
Sets an item to be visible or not. |
void |
showRowNumbers(CollectionItem collection,
boolean value)
Tells the GUI wether to show row numbers for tables and lists. |
Method Detail |
public void setVisible(MemberItem member, boolean visible)
If a field of method item is not visible, it will not be displayed by the object views. If a class item is not visible, then it will not be possible to open a view on objects of this class.
By default, the RTTI does not define this property and every item is visble. Thus, the GUI aspect component programmer should overload the default contructor of this class to set some visible attributes to false.
member
- the member item (may be a method or a field name);
it can be null to set the whole class visible or notvisible
- whether the member must be visibleGuiAC.isVisible(MetaItem)
public void setEmbeddedEditors(ClassItem cl)
cl
- the class itemFieldEditor
public void setEmbeddedEditors(CollectionItem collection, String viewName, boolean embedded)
collection
- viewName
- embedded
- #setEmbeddedEditors(CollectionItem,String,MemberItem[])
public void setEmbeddedEditorColumns(CollectionItem collection, String viewName, MemberItem[] members)
collection
- viewName
- members
- setEmbeddedEditors(CollectionItem,String,boolean)
public void setEmbeddedEditor(MemberItem cl)
By default, each member of a class is editable with an "edit"
button or link that opens a popup that allows the user to edit
its value (see the FieldEditor
interface). If this
configuration method is called, then the editor will be embedded
into the object's view the member belongs to.
FieldEditor
public void setBorder(FieldItem field, String alignment, String style)
field
- the fieldalignment
- LEFT: title is on the left, RIGHT:
title is on the right, CENTER: title is centeredstyle
- LINE: the border is a line, ETCHED: the border is a
3D line, LOWERED: the border is a 3D effect that makes the
bordered element lowered, RAISED: the border is a 3D effect that
makes the bordered element raised.setBorder(FieldItem)
public void setBorder(FieldItem field)
field
- the fieldsetBorder(FieldItem,String,String)
public void setEditorWidth(FieldItem field, int width, int columns)
field
- the fieldwidth
- the editor width in pixel (typically used by
SWING)columns
- the editor width in character columns (typically
used by the WEB)setEmbeddedEditor(MemberItem)
,
setEditorHeight(FieldItem,int,int)
,
setDefaultEditorWidth(ClassItem,int,int)
public void setDefaultEditorWidth(VirtualClassItem type, int width, int columns)
width
- the editor width in pixel (typically used by
SWING)columns
- the editor width in character columns (typically
used by the WEB)setDefaultEditorWidth(ClassItem,int,int)
,
setDefaultEditorHeight(VirtualClassItem,int,int)
,
setEditorWidth(FieldItem,int,int)
public void setDefaultEditorWidth(ClassItem type, int width, int columns)
width
- the editor width in pixel (typically used by
SWING)columns
- the editor width in character columns (typically
used by the WEB)setDefaultEditorWidth(VirtualClassItem,int,int)
,
setDefaultEditorHeight(VirtualClassItem,int,int)
,
setEditorWidth(FieldItem,int,int)
public void setEditable(FieldItem field, boolean editable)
field
- the fieldeditable
- the flag (true is default)public void setEditorHeight(FieldItem field, int height, int rows)
field
- the fieldheight
- the editor height in pixelrows
- the editor height in character rowssetEmbeddedEditor(MemberItem)
,
setEditorWidth(FieldItem,int,int)
,
setDefaultEditorHeight(ClassItem,int,int)
public void setDefaultEditorHeight(VirtualClassItem type, int height, int rows)
height
- the editor height in pixelrows
- the editor height in character rowssetDefaultEditorHeight(ClassItem,int,int)
,
setDefaultEditorWidth(VirtualClassItem,int,int)
,
setEditorHeight(FieldItem,int,int)
public void setDefaultEditorHeight(ClassItem type, int height, int rows)
height
- the editor height in pixelrows
- the editor height in character rowssetDefaultEditorHeight(VirtualClassItem,int,int)
,
setDefaultEditorWidth(VirtualClassItem,int,int)
,
setEditorHeight(FieldItem,int,int)
public void setCategory(MemberItem member, String category)
The category must correspond to one of these defined on the
class with the setCategories
configuration method.
member
- the member to categorize (a method or a field)category
- the existing category namesetCategories(MemberItem,String[])
,
ClassAppearenceGuiConf.setCategories(ClassItem,String[])
public void setCategories(MemberItem member, String[] categories)
The category must correspond to one of these defined on the
class with the setCategories
configuration method.
member
- the member to categorize (a method or a field)categories
- the existing category namessetCategory(MemberItem,String)
,
ClassAppearenceGuiConf.setCategories(ClassItem,String[])
public void setEmbeddedView(MemberItem member)
member
- the member (reference field or method) that must
be embeddedpublic void setEmbeddedAdder(CollectionItem collection, boolean embedded)
collection
- the collectionembedded
- wether to use an embedded view for the adderpublic void setTableView(FieldItem field)
In a table view, each item of the displayed collection fills a table line. Each column represents one field of the objects whithin the collection (the item within the collection whould be of the same class --- or at least share a common superclass).
field
- the field that contains the collectionpublic void showRowNumbers(CollectionItem collection, boolean value)
collection
- the affected collectionvalue
- wether to show row numberssetDefaultShowRowNumbers(boolean)
public void setDefaultShowRowNumbers(boolean value)
value
- wether to show row numbersshowRowNumbers(CollectionItem,boolean)
public void setDefaultSortedColumn(CollectionItem collection, String column)
By default, collections are not sorted. You can precise a column to use to sort the collection by default. It will be used at the construction of the collection.
collection
- the collectioncolumn
- the column used to sort (it is a fieldItem, watch
out for case). You may preprend a '-' to use the reverse order
of that column.public void setMembersOrder(CollectionItem collection, ClassItem targetClass, String[] memberNames)
collection
- the collectiontargetClass
- the class of attributes to rendermemberNames
- the name of the members in the
rendering ordersetMembersOrder(CollectionItem,String,ClassItem,String[])
,
ClassAppearenceGuiConf.setTableMembersOrder(ClassItem,String[])
,
ClassAppearenceGuiConf.setAttributesOrder(ClassItem,String[])
public void setMembersOrder(CollectionItem collection, String viewName, ClassItem targetClass, String[] memberNames)
collection
- the collectionviewName
- the type for which to set the members ordertargetClass
- the class of attributes to rendermemberNames
- the name of the members in the
rendering ordersetMembersOrder(CollectionItem,ClassItem,String[])
public void setFieldChoice(FieldItem field, Boolean editable, String[] choice)
Most of the GUI will propose the choice within a ComboBox.
When the choices values can not be defined at programming
time but must be dynamically created, then the programmer can
use the setDynamicFieldChoice
method.
field
- the fieldchoice
- the values the user will have to choose from when
a edition of the field is performedsetDynamicFieldChoice(FieldItem,Boolean,ClassItem,String)
,
setFieldChoice(FieldItem,Boolean,String[])
,
setFieldEnum(FieldItem,String)
,
GuiConf.defineEnum(String,String[],int,int)
public void setFieldEnum(FieldItem field, String enum)
Declare a field as an enumeration.
field
- the fieldenum
- the name of the enumerationGuiConf.defineEnum(String,String[],int,int)
,
setFieldChoice(FieldItem,Boolean,String[])
,
setDynamicFieldChoice(FieldItem,Boolean,ClassItem,String)
public void setDynamicFieldChoice(FieldItem field, Boolean editable, ClassItem targetClass, String targetMethod)
setFieldChoice
but with dynamically defined values.
The values are dynamically defined at runtime by the invocation of a target method. This target method must return a collection of objects or an array of objects that contains the possible new values for the fields.
If the target method is static, it will be called with the object as the only parameter. If it's not static, it will called on the object with no parameters.
field
- the fieldtargetClass
- the class that contains the target methodtargetMethod
- name of a static method within the target
class that returns the values to choose from. It must take an
Object as parameter which will be the instance to which the
field belongs to.public void setDynamicFieldChoice(FieldItem field, Boolean editable, MethodItem targetMethod)
setFieldChoice
but with dynamically defined values.
field
- the fieldtargetMethod
- a static method that returns the values to
choose from. It must take an Object as parameter which will be
the instance to which the field belongs to.setDynamicFieldChoice(FieldItem,Boolean,ClassItem,String)
public void setCollectionType(CollectionItem collection, String type)
If this method is not used, the collection type can be dynamically found out by the GUI from the adder's argument types.
collection
- the collection within this classtype
- the type of this collection (an exiting class name)public void setPreferredHeight(CollectionItem collection, int height)
collection
- the collectionheight
- the preferred heightpublic void setPreferredWidth(CollectionItem collection, int width)
collection
- the collectionwidth
- the preferred widthpublic void setNumRowsPerPage(CollectionItem collection, int numRows)
collection
- the collectionnumRows
- the number of rows per pagepublic void setFileChooserView(MethodItem method, String[] fileExtensions, String fileDescription)
As logically expected, the type of the set field must be a string or an URL.
method
- the method item. It can be of the form
"methodName" or "methodName(URL
,
GuiAC.isFileChooserView(MethodItem)
public void setIcon(MemberItem field, String name)
name
- the icon's resource namepublic void hideTreeRelation(FieldItem field)
field
- the fieldpublic void setDefaultValue(FieldItem field, MethodItem method, String value)
The default value is dynamically calculated by the
method
parameter from the string value (result can
be an object). A default implementation for method is provided
by GuiAC
.
field
- the fieldmethod
- a static method that returns the default value
(prototype: Object m(FieldItem,String))value
- the string representation of the default valueGuiAC.getDefaultValue(FieldItem,String)
public void setDefaultValue(FieldItem field, String value)
Same as setDefaultValue(ClassItem, String, MethodItem, String)
using default MethodItem GuiAC.getDefaultValue
.
field
- the fieldvalue
- the string representation of the default valueGuiAC.getDefaultValue(FieldItem,String)
,
setDefaultValue(FieldItem,MethodItem,String)
public void setFloatFormat(FieldItem field, String format)
field
- the fieldformat
- the display format of the fieldDecimalFormat
public void setDescription(MemberItem member, String description)
member
- the memberdescription
- the description of the class memberpublic void setLabel(MemberItem member, String label)
member
- the memberlabel
- the label of the class membersetLabel(MemberItem,MemberItem,String)
public void setLabel(MemberItem member, MemberItem selector, String label)
member
- the memberlabel
- the label of the class membersetLabel(MemberItem,String)
public void setDisplayLabel(MemberItem member, boolean value)
member
- the membervalue
- boolean indicating wether to display the labelpublic void setStyle(FieldItem field, String style)
field
- the fieldstyle
- the CSS styleClassAppearenceGuiConf.setStyle(ClassItem,String)
public void setViewType(FieldItem field, String viewName, String viewType)
|
Contact JAC development team: Renaud Pawlak Lionel Seinturier Laurent Martelli |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |