|
|||||||||||
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 |
groupBy(CollectionItem collection,
String viewName,
FieldItem groupBy)
Groups cells of table. |
void |
hideTreeRelation(FieldItem field)
This configuration method allows not to use a node to represent a given relation (collection) in a treeview, even if the show relations mode is on . |
void |
setAddable(CollectionItem collection,
boolean addable)
Tells wether to show an add button for a collection |
void |
setAdditionalRow(CollectionItem collection,
String viewName,
String row)
Use a field as a row to be added at the end of a table |
void |
setAvailableNumRowsPerPage(CollectionItem collection,
int[] numRows)
Causes the view of a collection to let the user selects the number of rows to display simultaneously at runtime. |
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 |
setCellViewType(CollectionItem collection,
String viewName,
FieldItem column,
String viewType)
Sets the view type to use for cells of a column of table, instead of the default one. |
void |
setChoiceView(CollectionItem collection,
boolean external)
Sets the render of a collection to be rendered by a choice and an embedded view on the selected object. |
void |
setCollectionType(CollectionItem collection,
String type)
Set the type of the objects of a collection. |
void |
setDefaultEditorHeight(ClassItem type,
Length height)
Sets the default editor height for value of a given type. |
void |
setDefaultEditorHeight(VirtualClassItem type,
Length height)
Sets the default editor height for value of a given type. |
void |
setDefaultEditorWidth(ClassItem type,
Length width)
Sets the default editor width for value of a given type. |
void |
setDefaultEditorWidth(VirtualClassItem type,
Length width)
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 |
setDynamicFieldChoice(FieldItem field,
CollectionItem targetCollection)
Use objects from a collection as the available choices to edit a reference field. |
void |
setEditable(FieldItem field,
boolean editable)
Set a field to be editable. |
void |
setEditorHeight(FieldItem field,
Length height)
Sets the height of a field's editor. |
void |
setEditorWidth(FieldItem field,
Length width)
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 member)
This configuration method allows the programmer to set a class member to be internally edited for the default view. |
void |
setEmbeddedEditor(MemberItem member,
String viewName,
boolean embedded)
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 in a given view |
void |
setEmbeddedEditors(ClassItem cl)
Tells the GUI to use embedded editors in the default view for all fields of a class, whenever possible. |
void |
setEmbeddedEditors(ClassItem cl,
String viewName,
boolean embedded)
Tells the GUI wether to use embedded editors in a view for all fields of a class. |
void |
setEmbeddedEditors(CollectionItem collection,
String viewName,
boolean embedded)
Tells wether to use embedded editors for the cells of a table in a given view. |
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 |
setEmbeddedView(MemberItem member,
String viewName,
boolean embedded)
Tells the GUI to insert a referenced object to be displayed as an embedded view in its container object view. |
void |
setEnableLinks(CollectionItem collection,
String viewName,
boolean enable)
Enables or disables links for references in cells of a table |
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 member,
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 |
setMnemonics(MemberItem method,
String mnemonics)
Defines preferred mnemonics for field of method. |
void |
setMultiLineCollection(CollectionItem collection,
String viewName,
CollectionItem multiLine)
Creates subrows in some cells of a table. |
void |
setNumRowsPerPage(CollectionItem collection,
int numRows)
Sets the number of rows to display simultaneously for a collection. |
void |
setPreferredHeight(CollectionItem collection,
Length height)
Tells the preferred height a table or list view of a collection should take, if possible. |
void |
setPreferredWidth(CollectionItem collection,
Length width)
Tells the preferred width a table or list view of a collection should take, if possible. |
void |
setRemovable(CollectionItem collection,
boolean removable)
Tells wether to show remove buttons for items of a collection |
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 |
setViewableItems(CollectionItem collection,
boolean viewable)
Tells wether items in the default view of a collection have a "view" button to open a view of the item. |
void |
setViewableItems(CollectionItem collection,
String viewName,
boolean viewable)
Tells wether items in a given default view of a collection have a "view" button to open a view of the item. |
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 |
showColumnFilters(CollectionItem collection,
String[] columnNames)
Enables the user to filter a table by retaining only rows whose columns have a given value. |
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(ClassItem cl, String viewName, boolean embedded)
cl
- the class itemviewName
- the view nameembedded
- wether to use embedded editors by defaultFieldEditor
public void setEmbeddedEditors(CollectionItem collection, String viewName, boolean embedded)
collection
- the collection whose table view to configureviewName
- the view name for which to configureembedded
- wether to use embedded editors or not in the cells of the tablesetEmbeddedEditorColumns(CollectionItem,String,MemberItem[])
public void setEmbeddedEditorColumns(CollectionItem collection, String viewName, MemberItem[] members)
collection
- the collection whose table view to configureviewName
- the view name for which to configuremembers
- wether to use embedded editors or not in the cells of the tablesetEmbeddedEditors(CollectionItem,String,boolean)
public void setEmbeddedEditor(MemberItem member)
member
- the member item to be embedded (may be a
field or a method)FieldEditor
,
setEmbeddedEditor(MemberItem,String,boolean)
public void setEmbeddedEditor(MemberItem member, String viewName, boolean embedded)
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.
member
- the member item to be embedded (may be a
field or a method)viewName
- the view for which to use an embedded
editor. "default", "autocreate" or one of your own.embedded
- wether to use an editor or notFieldEditor
,
setEmbeddedEditor(MemberItem,String,boolean)
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, Length width)
field
- the fieldwidth
- the editor widthsetEmbeddedEditor(MemberItem)
,
setEditorHeight(FieldItem,Length)
,
setDefaultEditorWidth(ClassItem,Length)
public void setDefaultEditorWidth(VirtualClassItem type, Length width)
type
- the typewidth
- the editor widthsetDefaultEditorWidth(ClassItem,Length)
,
setDefaultEditorHeight(VirtualClassItem,Length)
,
setEditorWidth(FieldItem,Length)
public void setDefaultEditorWidth(ClassItem type, Length width)
type
- the typewidth
- the editor widthsetDefaultEditorWidth(VirtualClassItem,Length)
,
setDefaultEditorHeight(VirtualClassItem,Length)
,
setEditorWidth(FieldItem,Length)
public void setEditable(FieldItem field, boolean editable)
field
- the fieldeditable
- the flag (true is default)public void setEditorHeight(FieldItem field, Length height)
field
- the fieldheight
- the editor heightsetEmbeddedEditor(MemberItem)
,
setEditorWidth(FieldItem,Length)
,
setDefaultEditorHeight(ClassItem,Length)
public void setDefaultEditorHeight(VirtualClassItem type, Length height)
type
- the typeheight
- the editor heightsetDefaultEditorHeight(ClassItem,Length)
,
setDefaultEditorWidth(VirtualClassItem,Length)
,
setEditorHeight(FieldItem,Length)
public void setDefaultEditorHeight(ClassItem type, Length height)
type
- the typeheight
- the editor heightsetDefaultEditorHeight(VirtualClassItem,Length)
,
setDefaultEditorWidth(VirtualClassItem,Length)
,
setEditorHeight(FieldItem,Length)
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 embeddedsetEmbeddedView(MemberItem,String,boolean)
public void setEmbeddedView(MemberItem member, String viewName, boolean embedded)
member
- the member (reference field or method) that must
be embeddedviewName
- the view for which the member must be embeddedembedded
- wether to embedded the member or notsetEmbeddedView(MemberItem)
public 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 setChoiceView(CollectionItem collection, boolean external)
collection
- the collectionexternal
- tell if the object is embedded in the current view or if is is opened in an external panel (given by GuiConf.addReferenceToPane(String,MemberItem,String)
public 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.setDynamicFieldChoice(FieldItem,Boolean,MethodItem)
,
ClassAppearenceGuiConf.setDynamicClassChoice(String,MethodItem)
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)
,
ClassAppearenceGuiConf.setDynamicClassChoice(String,MethodItem)
public void setDynamicFieldChoice(FieldItem field, CollectionItem targetCollection)
field
- the edited reference fieldtargetCollection
- the collection. It belong to same class
as the field.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, Length height)
collection
- the collectionheight
- the preferred heightsetPreferredWidth(CollectionItem,Length)
public void setPreferredWidth(CollectionItem collection, Length width)
collection
- the collectionwidth
- the preferred widthsetPreferredHeight(CollectionItem,Length)
public void setNumRowsPerPage(CollectionItem collection, int numRows)
This is only used by the web GUI so that generated web pages are not too big. If the number of elements in the collection is bigger than numRows, a "previous" and a "next" button are displayed so that the user can see the rest of the collection. The default is 10. Use 0 to display all rows.
collection
- the collectionnumRows
- the number of rows per pagesetAvailableNumRowsPerPage(CollectionItem,int[])
public void setAvailableNumRowsPerPage(CollectionItem collection, int[] numRows)
collection
- the collectionnumRows
- the numbers of rows per page the user can choose from.setNumRowsPerPage(CollectionItem,int)
public void showColumnFilters(CollectionItem collection, String[] columnNames)
collection
- the collection to configurecolumnNames
- the field names (from the collection's
component type) that can be filteredpublic 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(fileExtensions
- allowed file extensions to choose fromfileDescription
- URL
,
GuiAC.isFileChooserView(MethodItem)
public void setIcon(MemberItem member, String name)
member
- the member (field or method)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 memberselector
- use the label when inside the view of his member itemlabel
- 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)
,
GuiConf.addStyleSheetURL(String)
,
GuiConf.addStyleSheetURL(String,String)
public void setAddable(CollectionItem collection, boolean addable)
collection
- the collection to configureaddable
- wether to show a button or notsetRemovable(CollectionItem,boolean)
public void setRemovable(CollectionItem collection, boolean removable)
collection
- the collection to configureremovable
- wether to show buttons or notsetAddable(CollectionItem,boolean)
public void setViewType(FieldItem field, String viewName, String viewType)
public void setViewableItems(CollectionItem collection, boolean viewable)
collection
- the collectionviewable
- wether items are viewablesetViewableItems(CollectionItem,String,boolean)
public void setViewableItems(CollectionItem collection, String viewName, boolean viewable)
collection
- the collectionviewName
- the view to configureviewable
- wether items have a view buttonsetViewableItems(CollectionItem,boolean)
public void setEnableLinks(CollectionItem collection, String viewName, boolean enable)
public void groupBy(CollectionItem collection, String viewName, FieldItem groupBy)
collection
- the collection whose table cells to groupviewName
- the view to configuregroupBy
- group adjacent cells with same values of columns
whose field start with this fieldsetMultiLineCollection(CollectionItem,String,CollectionItem)
public void setMultiLineCollection(CollectionItem collection, String viewName, CollectionItem multiLine)
collection
- the collection whose table cells to subdivideviewName
- the view to configuremultiLine
- subdivide cells of columns whose field start
with this fieldgroupBy(CollectionItem,String,FieldItem)
public void setAdditionalRow(CollectionItem collection, String viewName, String row)
public void setCellViewType(CollectionItem collection, String viewName, FieldItem column, String viewType)
collection
- the collection to configureviewName
- the view to configurecolumn
- the column to configureviewType
- the view type to use for that columnGuiConf.setViewConstructor(String,String,AbstractMethodItem)
public void setMnemonics(MemberItem method, String mnemonics)
method
- mnemonics
- the mnemonics
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |