org.objectweb.jac.aspects.gui
Interface ClassAppearenceGuiConf

All Known Subinterfaces:
GuiConf
All Known Implementing Classes:
GuiAC

public interface ClassAppearenceGuiConf

This configuration interface of the Gui aspect defines all the methods that handle the appearence of the classes in the GUI.

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

Method Summary
 void selectWithIndexedField(ClassItem cl, CollectionItem collection, String repositoryName)
          Tells the gui to use a primary key field to select instances of a class, instead of a combobox.
 void setAttributesOrder(ClassItem cl, String[] attributeNames)
          Sets the order in which the attributes of a class are to be rendered.
 void setAttributesOrder(ClassItem cl, String viewName, String[] attributeNames)
          Sets the order in which the attributes of a class are to be rendered for a given view.
 void setCategories(ClassItem cl, String[] categories)
          This configuration method sets some categories for a class.
 void setCategoriesIcons(ClassItem cli, String[] icons)
          This configuration method sets categories icons for a class.
 void setCategoriesLabels(ClassItem cli, String[] labels)
          This configuration method sets categories labels for a class.
 void setCreationAttributesOrder(ClassItem cl, String[] attributeNames)
          Sets the order in which the attributes of a class are to be rendered when an instance is created.
 void setDefaultsAttributesOrder(ClassItem cl, String[] attributeNames)
          Sets the attributes to be displayed for editable default values in tables
 void setDefaultSortedColumn(ClassItem cl, String column)
          Sets a default sorted column for a class.
 void setDescription(ClassItem cl, String description)
          Sets the description of a class.
 void setDesktopCustomizedView(ClassItem classItem, ClassItem type)
          This configuration method allows the programmer to tell that the given class should be viewed with a given customized view when it is opened in a desktop panel.
 void setDisplayLabel(String virtualClass, boolean value)
          Wether to display a label containing the name of the field in views.
 void setDynamicClassChoice(String className, MethodItem targetMethod)
          Defines a method that returns instances of a class that should be displayed in comboboxes.
 void setDynamicIcon(ClassItem cli, MethodItem iconMethod)
          Defines a method to dynamically compute the icon for a class.
 void setFormat(String className, String format)
          Sets the display format of a class.
 void setIcon(ClassItem cli, String name)
          This configuration method attaches an icon to a given class so that the iconized instances of this class will be represented by this icon (for instance in a treeview).
 void setLabel(ClassItem cl, String label)
          Sets the label of a class.
 void setLineBreaks(ClassItem cli, String[] fields)
          Defines which fields should start on a new line.
 void setMenu(ClassItem classItem, String[] menu)
          This configuration method attaches a contextual menu to a given class so that the instances of this class will show the menu when the user performs a right click on it (by default the menu shows all the methods).
 void setMethodsOrder(ClassItem cl, String[] methodNames)
          Sets the order in which the methods of a class are to be rendered for the default view.
 void setMethodsOrder(ClassItem cl, String viewName, String[] methodNames)
          Sets the order in which the methods of a class are to be rendered for a view.
 void setMnemonics(ClassItem cli, String mnemonics)
          Defines preferred mnemonics for class.
 void setReadOnly(ClassItem cli, String viewName, boolean readOnly)
           
 void setStyle(ClassItem cli, String style)
          Set the style for a class
 void setTableMembersOrder(ClassItem cl, String[] memberNames)
          Sets the order in which the attributes of a class are to be rendered when their instance are placed within a table of the a default view.
 void setTableMembersOrder(ClassItem cl, String viewName, String[] memberNames)
          Sets the order in which the attributes of a class are to be rendered when their instance are placed within a table of a given view.
 void setToolTipText(ClassItem classItem, ClassItem selector, String formatExpression)
          Defines a contextual string tooltip for the instances of the class that will override the default one in some cases, depending on the selector parameter.
 void setToolTipText(ClassItem classItem, MemberItem selector, String formatExpression)
          Defines a contextual string tooltip for the instances of the class that will override the default one in some cases, depending on the selector parameter.
 void setToolTipText(ClassItem classItem, String formatExpression)
          Defines a contextual string tooltip for the instances of a class.
 void setToString(ClassItem classItem, ClassItem selector, String formatExpression)
          Defines a contextual string representation of the instances of the class that will override the default one in some cases, depending on the selector parameter.
 void setToString(ClassItem classItem, MemberItem selector, String formatExpression)
          Defines a contextual string representation of the instances of the class that will override the default one in some cases, depending on the selector parameter.
 void setToString(ClassItem classItem, String formatExpression)
          Defines the string representation of the instances of the class.
 void setTreeAttributesOrder(ClassItem cl, String[] attributeNames)
          Sets the order in which the attributes of a class are to be rendered when their instance are placed within a tree.
 

Method Detail

setToString

public void setToString(ClassItem classItem,
                        String formatExpression)
Defines the string representation of the instances of the class.

Parameters:
classItem - the class
formatExpression - a string that contains field references of the form %field_name%. All the field references are replaced by their value when a string representation of the instance is needed. When you need to print out a %, then you must double it (%%).
See Also:
setToString(ClassItem,MemberItem,String), setToolTipText(ClassItem,MemberItem,String), setToolTipText(ClassItem,ClassItem,String)

setToString

public void setToString(ClassItem classItem,
                        MemberItem selector,
                        String formatExpression)
Defines a contextual string representation of the instances of the class that will override the default one in some cases, depending on the selector parameter.

Parameters:
classItem - the class
selector - tells when the formatExpression should be applied.
formatExpression - a string that contains field references of the form %field_name%. All the field references are replaced by their value when a string representation of the instance is needed. When you need to print out a %, then you must double it (%%).
See Also:
setToString(ClassItem,String), setToString(ClassItem,MemberItem,String), setToolTipText(ClassItem,MemberItem,String), setToolTipText(ClassItem,ClassItem,String)

setToString

public void setToString(ClassItem classItem,
                        ClassItem selector,
                        String formatExpression)
Defines a contextual string representation of the instances of the class that will override the default one in some cases, depending on the selector parameter.

Parameters:
classItem - the class
selector - tells when the formatExpression should be applied.
formatExpression - a string that contains field references of the form %field_name%. All the field references are replaced by their value when a string representation of the instance is needed. When you need to print out a %, then you must double it (%%).
See Also:
setToString(ClassItem,String), setToString(ClassItem,MemberItem,String), setToolTipText(ClassItem,MemberItem,String), setToolTipText(ClassItem,ClassItem,String)

setIcon

public void setIcon(ClassItem cli,
                    String name)
This configuration method attaches an icon to a given class so that the iconized instances of this class will be represented by this icon (for instance in a treeview).

Parameters:
cli - the class
name - the icon's resource name
See Also:
setDynamicIcon(ClassItem,MethodItem)

setDynamicIcon

public void setDynamicIcon(ClassItem cli,
                           MethodItem iconMethod)
Defines a method to dynamically compute the icon for a class.

Parameters:
cli - a class
iconMethod - a static method which must take an object as parameter and return a String or null. It will be invoked with the object for which an icon must be determined.
See Also:
setIcon(ClassItem,String)

setToolTipText

public void setToolTipText(ClassItem classItem,
                           String formatExpression)
Defines a contextual string tooltip for the instances of a class.

Parameters:
classItem - the class
formatExpression - a string that contains field references of the form %field_name%. All the field references are replaced by their value when a string representation of the instance is needed. When you need to print out a %, then you must double it (%%).
See Also:
setToolTipText(ClassItem,ClassItem,String), setToolTipText(ClassItem,MemberItem,String)

setToolTipText

public void setToolTipText(ClassItem classItem,
                           MemberItem selector,
                           String formatExpression)
Defines a contextual string tooltip for the instances of the class that will override the default one in some cases, depending on the selector parameter.

Parameters:
classItem - the class
selector - tells when the formatExpression should be applied.
formatExpression - a string that contains field references of the form %field_name%. All the field references are replaced by their value when a string representation of the instance is needed. When you need to print out a %, then you must double it (%%).
See Also:
setToolTipText(ClassItem,String), setToolTipText(ClassItem,ClassItem,String)

setToolTipText

public void setToolTipText(ClassItem classItem,
                           ClassItem selector,
                           String formatExpression)
Defines a contextual string tooltip for the instances of the class that will override the default one in some cases, depending on the selector parameter.

Parameters:
classItem - the class
selector - tells when the formatExpression should be applied.
formatExpression - a string that contains field references of the form %field_name%. All the field references are replaced by their value when a string representation of the instance is needed. When you need to print out a %, then you must double it (%%).
See Also:
setToolTipText(ClassItem,String), setToolTipText(ClassItem,MemberItem,String)

setMenu

public void setMenu(ClassItem classItem,
                    String[] menu)
This configuration method attaches a contextual menu to a given class so that the instances of this class will show the menu when the user performs a right click on it (by default the menu shows all the methods).

Parameters:
classItem - the class
menu - an array containing the names of the methods that form the menu (must be declared in the class item), if an element is an empty string, then a menu item separator is added

setCategories

public void setCategories(ClassItem cl,
                          String[] categories)
This configuration method sets some categories for a class.

The GUI will interpret this categories to split the views of this class instances to be separated into several subviews. For instance, the Swing GUI will show the object in several parts placed into several tabs.

When this method has been called, each meta-item of the class must be categorized with one of the categories by using the setCategory method.

Parameters:
cl - the class item
categories - the categories for this class
See Also:
FieldAppearenceGuiConf.setCategory(MemberItem,String)

setCategoriesIcons

public void setCategoriesIcons(ClassItem cli,
                               String[] icons)
This configuration method sets categories icons for a class. Each icon is associated with a category, so there must be the right number of icons (one by category)

Parameters:
cli - the class
icons - the icons for the categories
See Also:
setCategories(ClassItem,String[])

setCategoriesLabels

public void setCategoriesLabels(ClassItem cli,
                                String[] labels)
This configuration method sets categories labels for a class. Each label is associated with a category, so there must be the right number of labels (one by category)

Parameters:
cli - the class
labels - the labels for the categories
See Also:
setCategories(ClassItem,String[])

setDesktopCustomizedView

public void setDesktopCustomizedView(ClassItem classItem,
                                     ClassItem type)
This configuration method allows the programmer to tell that the given class should be viewed with a given customized view when it is opened in a desktop panel.

Parameters:
classItem - the class of the viewed objects
type - the class of the view component

setAttributesOrder

public void setAttributesOrder(ClassItem cl,
                               String[] attributeNames)
Sets the order in which the attributes of a class are to be rendered.

Attributes not listed here will not be rendered. This order is also used for tableView rendered collections if the setTableMembersOrder method is not used.

Parameters:
cl - the class
attributeNames - the name of the attributes in the rendering order
See Also:
setAttributesOrder(ClassItem,String,String[]), setTableMembersOrder(ClassItem,String[]), setMethodsOrder(ClassItem,String[]), FieldAppearenceGuiConf.setMembersOrder(CollectionItem,ClassItem,String[])

setAttributesOrder

public void setAttributesOrder(ClassItem cl,
                               String viewName,
                               String[] attributeNames)
Sets the order in which the attributes of a class are to be rendered for a given view.

Attributes not listed here will not be rendered. This order is also used for tableView rendered collections if the setTableMembersOrder method is not used.

Parameters:
cl - the class
viewName - the name of the view
attributeNames - the name of the attributes in the rendering order
See Also:
setAttributesOrder(ClassItem,String[]), setTableMembersOrder(ClassItem,String[]), FieldAppearenceGuiConf.setMembersOrder(CollectionItem,ClassItem,String[])

setDefaultsAttributesOrder

public void setDefaultsAttributesOrder(ClassItem cl,
                                       String[] attributeNames)
Sets the attributes to be displayed for editable default values in tables

Parameters:
cl - the class
attributeNames - the name of the attributes
See Also:
BehaviorGuiConf.setEditableDefaultValues(CollectionItem,boolean)

setLineBreaks

public void setLineBreaks(ClassItem cli,
                          String[] fields)
Defines which fields should start on a new line. By default, every fields start on a new line.

Parameters:
cli - the class
fields - the names fields which should start on a new line.

setMethodsOrder

public void setMethodsOrder(ClassItem cl,
                            String[] methodNames)
Sets the order in which the methods of a class are to be rendered for the default view.

Methods not listed here will not be rendered.

Parameters:
cl - the class name
methodNames - the name of the methods in the rendering order
See Also:
setMethodsOrder(ClassItem,String,String[])

setMethodsOrder

public void setMethodsOrder(ClassItem cl,
                            String viewName,
                            String[] methodNames)
Sets the order in which the methods of a class are to be rendered for a view.

Methods not listed here will not be rendered.

Parameters:
cl - the class name
viewName - the view for which to set the methods order
methodNames - the name of the methods in the rendering order
See Also:
setMethodsOrder(ClassItem,String[]), setAttributesOrder(ClassItem,String,String[])

setCreationAttributesOrder

public void setCreationAttributesOrder(ClassItem cl,
                                       String[] attributeNames)
Sets the order in which the attributes of a class are to be rendered when an instance is created.

Parameters:
cl - the class name
attributeNames - the name of the attributes in the rendering order
See Also:
setAttributesOrder(ClassItem,String[])

setTableMembersOrder

public void setTableMembersOrder(ClassItem cl,
                                 String[] memberNames)
Sets the order in which the attributes of a class are to be rendered when their instance are placed within a table of the a default view.

Attributes not listed here will not be rendered.

Parameters:
cl - the class name
memberNames - the name of the member in the rendering order
See Also:
setTableMembersOrder(ClassItem,String,String[]), setAttributesOrder(ClassItem,String[]), FieldAppearenceGuiConf.setMembersOrder(CollectionItem,ClassItem,String[])

setTableMembersOrder

public void setTableMembersOrder(ClassItem cl,
                                 String viewName,
                                 String[] memberNames)
Sets the order in which the attributes of a class are to be rendered when their instance are placed within a table of a given view.

Attributes not listed here will not be rendered.

Parameters:
cl - the class name
viewName - the name of the view
memberNames - the name of the member in the rendering order
See Also:
setTableMembersOrder(ClassItem,String[]), FieldAppearenceGuiConf.setMembersOrder(CollectionItem,ClassItem,String[])

setTreeAttributesOrder

public void setTreeAttributesOrder(ClassItem cl,
                                   String[] attributeNames)
Sets the order in which the attributes of a class are to be rendered when their instance are placed within a tree.

Attributes not listed here will not be rendered.

Parameters:
cl - the class name
attributeNames - the name of the attributes in the rendering order
See Also:
setAttributesOrder(ClassItem,String[]), FieldAppearenceGuiConf.setMembersOrder(CollectionItem,ClassItem,String[])

setDefaultSortedColumn

public void setDefaultSortedColumn(ClassItem cl,
                                   String column)
Sets a default sorted column for a class.

Parameters:
cl - the class
column - 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.

setDescription

public void setDescription(ClassItem cl,
                           String description)
Sets the description of a class.

Parameters:
cl - the class
description - the description of the class

setLabel

public void setLabel(ClassItem cl,
                     String label)
Sets the label of a class.

Parameters:
cl - the class
label - the label of the class

setDisplayLabel

public void setDisplayLabel(String virtualClass,
                            boolean value)
Wether to display a label containing the name of the field in views.

Parameters:
virtualClass - the name of the class
value - boolean indicating wether to display the label or not

setFormat

public void setFormat(String className,
                      String format)
Sets the display format of a class.


selectWithIndexedField

public void selectWithIndexedField(ClassItem cl,
                                   CollectionItem collection,
                                   String repositoryName)
Tells the gui to use a primary key field to select instances of a class, instead of a combobox. This is usefull when there are two many instances of the class.

Parameters:
cl - the class whose instance to select
collection - the collection whose indexed field to use
repositoryName - name of the object holding the collection
See Also:
RttiAC.setIndexedField(CollectionItem,FieldItem)

setStyle

public void setStyle(ClassItem cli,
                     String style)
Set the style for a class

Parameters:
cli - the class
style - the CSS style
See Also:
FieldAppearenceGuiConf.setStyle(FieldItem,String), GuiConf.addStyleSheetURL(String), GuiConf.addStyleSheetURL(String,String)

setReadOnly

public void setReadOnly(ClassItem cli,
                        String viewName,
                        boolean readOnly)

setDynamicClassChoice

public void setDynamicClassChoice(String className,
                                  MethodItem targetMethod)
Defines a method that returns instances of a class that should be displayed in comboboxes.

Parameters:
className - the class to configure (ClassItem or VirtualClassItem)
targetMethod - the static method that returns instances of the class. It should take a ClassItem as a parameter and return a Collection
See Also:
FieldAppearenceGuiConf.setDynamicFieldChoice(FieldItem,Boolean,MethodItem)

setMnemonics

public void setMnemonics(ClassItem cli,
                         String mnemonics)
Defines preferred mnemonics for class.

Parameters:
cli -
mnemonics - the mnemonics