org.objectweb.jac.aspects.gui
Interface GuiConf

All Superinterfaces:
BehaviorGuiConf, ClassAppearenceGuiConf, FieldAppearenceGuiConf, MethodAppearenceGuiConf
All Known Implementing Classes:
GuiAC

public interface GuiConf
extends ClassAppearenceGuiConf, FieldAppearenceGuiConf, MethodAppearenceGuiConf, BehaviorGuiConf

This is the configuration interface of the Gui aspect.

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

Method Summary
 void addMenuItem(String gui, String menu, String[] menuPath, AbstractMethodItem method)
          Add a menu item to a menu bar.
 void addMenuItem(String gui, String menu, String[] menuPath, AbstractMethodItem method, String[] parameters)
          Add a menu item to a menu bar.
 void addMenuItem(String gui, String menu, String[] menuPath, String objectName, AbstractMethodItem method)
          Add a menu item to a menu bar.
 void addMenuItem(String gui, String menu, String[] menuPath, String objectName, AbstractMethodItem method, String[] parameters)
          Add a menu item to a menu bar.
 void addMenuSeparator(String gui, String menu, String[] menuPath)
          Add a separator in a menu.
 void addReferenceToPane(String gui, MemberItem member, String paneId)
          Specify in which pane to open the view of a reference, collection, or a method's result.
 void addReferenceToPane(String gui, MemberItem field, String viewType, String[] viewParams, Boolean small, String panePath)
          This configuration method delegates to the corresponding customized GUI.
 void addStatusBar(String gui, MethodItem method, String position)
          This configuration method allows the programmer to actually show a status bar in a declared personal UI.
 void addStatusBar(String gui, String position)
          This configuration method allows the programmer to actually show an empty status bar in a declared personal UI.
 void addStyleSheetURL(String url)
          Adds a style-sheet URL for the generated html pages (for WEB GUIs).
 void addStyleSheetURL(String gui, String url)
          Adds a style-sheet URL for the generated html pages (for WEB GUIs).
 void addToolbarAction(String gui, AbstractMethodItem method)
          Add a button in the toolbar
 void addToolbarAction(String gui, AbstractMethodItem method, String[] params)
          Add a button in the toolbar
 void addToolbarAction(String gui, String objectName, AbstractMethodItem method)
          Add a button in the toolbar
 void addToolbarSeparator(String gui)
          Add a separator in the toolbar
 void askForParameters(String classExpr)
          Essential method for GUI, which weaves InputWrapper.askForParameters on all methods with parameters.
 void declareCurrency(String currencyName, int precision, double rate)
          Declare a currency and it's change rate with the default currency
 void defineEnum(String name, String[] values, int start, int step)
          Define an enumeration.
 void defineResource(String type, String name, String path)
          This configuration method allows the user to define new resources that can be used by the GUI later-on.
 void registerCustomized(String name)
          This configuration method allows the user to create and register a new customized GUI.
 void setCustomizedIcon(String gui, String icon)
          Sets the icon of the window
 void setDateFormat(String dateFormat)
          Set the default date format used by date components.
 void setDefaultCurrency(String currencyName, int precision)
          Set the default currency
 void setDialogTimeout(long timeout)
          Sets the delay before a dialog times out.
 void setEncoding(String encoding)
          Sets the default charset encoding to use when interaction with the user's terminal.
 void setFontAttribute(String attribute, String value)
          This configuration method allows the programmer to define attributes for the default font.
 void setInvalidPane(String gui, String changedPane, String invalidPane)
          Set a pane to be invalidated (reload) when a given pane content changes.
 void setLabelAdd(String label)
           
 void setLabelAll(String label)
           
 void setLabelCancel(String label)
           
 void setLabelNew(String label)
           
 void setLabelNone(String label)
           
 void setLabelOK(String label)
           
 void setLoggingMethod(String gui, String objects, String classes, String methods, int paneId)
          Sets the given methods to be logging.
 void setMenuIcon(String gui, String menu, String[] menuPath, String icon)
          Set the icon for a menu.
 void setMenuPosition(String gui, String menu, String position)
          Sets the position of a menu
 void setNavBar(String gui, CollectionItem collection)
          Enables navigation bar for a collection.
 void setOnCloseHandler(String gui, AbstractMethodItem eventHandler)
          Set an event handler which is called when the window is closed.
 void setPaneContainer(String gui, String paneId, String type)
          Set the container type to use for a pane.
 void setPaneContent(String gui, String paneId, String type, String[] args)
          Defines the initial content of a pane.
 void setPosition(String gui, int left, int up, int width, int height)
          This configuration method delegates to the corresponding customized GUI.
 void setSplitterLocation(String gui, int splitterId, float location)
          This configuration method delegates to the corresponding customized GUI.
 void setSubPanesGeometry(String gui, int subPanesCount, String geometry)
          This configuration method delegates to setSubPanesGeometry(int,int,String[]) with all the panes scrollable.
 void setSubPanesGeometry(String gui, int subPanesCount, String geometry, boolean[] scrollings)
          This configuration method delegates to the corresponding customized GUI.
 void setTitle(String gui, String title)
          This configuration method sets the title of the GUI main window.
 void setViewConstructor(String guiType, String viewType, AbstractMethodItem constructor)
          Set the view constructor for a given gui type.
 void setWelcomeMessage(String gui, String title, String message, String icon)
          Sets a welcome message (in a popup) when a customized GUI is started.
 
Methods inherited from interface org.objectweb.jac.aspects.gui.ClassAppearenceGuiConf
selectWithIndexedField, setAttributesOrder, setAttributesOrder, setCategories, setCategoriesIcons, setCategoriesLabels, setCreationAttributesOrder, setDefaultsAttributesOrder, setDefaultSortedColumn, setDescription, setDesktopCustomizedView, setDisplayLabel, setDynamicClassChoice, setDynamicIcon, setFormat, setIcon, setLabel, setLineBreaks, setMenu, setMethodsOrder, setMethodsOrder, setMnemonics, setReadOnly, setStyle, setTableMembersOrder, setTableMembersOrder, setToolTipText, setToolTipText, setToolTipText, setToString, setToString, setToString, setTreeAttributesOrder
 
Methods inherited from interface org.objectweb.jac.aspects.gui.FieldAppearenceGuiConf
groupBy, hideTreeRelation, setAddable, setAdditionalRow, setAvailableNumRowsPerPage, setBorder, setBorder, setCategories, setCategory, setCellViewType, setChoiceView, setCollectionType, setDefaultEditorHeight, setDefaultEditorHeight, setDefaultEditorWidth, setDefaultEditorWidth, setDefaultShowRowNumbers, setDefaultSortedColumn, setDefaultValue, setDefaultValue, setDescription, setDisplayLabel, setDynamicFieldChoice, setDynamicFieldChoice, setDynamicFieldChoice, setEditable, setEditorHeight, setEditorWidth, setEmbeddedAdder, setEmbeddedEditor, setEmbeddedEditor, setEmbeddedEditorColumns, setEmbeddedEditors, setEmbeddedEditors, setEmbeddedEditors, setEmbeddedView, setEmbeddedView, setEnableLinks, setFieldChoice, setFieldEnum, setFileChooserView, setFloatFormat, setIcon, setLabel, setLabel, setMembersOrder, setMembersOrder, setMnemonics, setMultiLineCollection, setNumRowsPerPage, setPreferredHeight, setPreferredWidth, setRemovable, setStyle, setTableView, setViewableItems, setViewableItems, setViewType, setVisible, showColumnFilters, showRowNumbers
 
Methods inherited from interface org.objectweb.jac.aspects.gui.MethodAppearenceGuiConf
addPostInvoke, setCondition, setCreationAllowed, setCreationAllowedParameters, setDefaultValues, setDirectCollectionMethods, setDynamicIcon, setLinkedParameters, setMethodDynamicParameterChoice, setMethodDynamicParameterChoice, setMethodParametersHeight, setMethodParametersWidth, setMimeType, setParameterEnums, setParameterFields, setParameterNames, setPasswordParameters, setSlowOperation
 
Methods inherited from interface org.objectweb.jac.aspects.gui.BehaviorGuiConf
addViewFieldDependency, captureSystemErr, captureSystemOut, setAutoCreate, setAutoCreateAll, setAutoCreateInitializer, setAutoCreateParameters, setAutoCreateParametersEx, setAutoCreateState, setClosingMethod, setCommitOnFocusLost, setEditableDefaultValues, setIndexNotFoundHandler, setInteractionHandler, setOnSelection, setOpenViewMethod, setSelectionTarget, setViewOnSelection
 

Method Detail

askForParameters

public void askForParameters(String classExpr)
Essential method for GUI, which weaves InputWrapper.askForParameters on all methods with parameters.

It permits to dynamically call methods, and so display something when user clicks on buttons.

Parameters:
classExpr - the classes

registerCustomized

public void registerCustomized(String name)
This configuration method allows the user to create and register a new customized GUI.

A configuration file should first use this method, then configure the customized GUI, and then call the showCustomized method when the GUI configuration is finished.

Parameters:
name - the new customized GUI name

setCustomizedIcon

public void setCustomizedIcon(String gui,
                              String icon)
Sets the icon of the window

Parameters:
gui - the gui ID
icon - the name of the icon

setOnCloseHandler

public void setOnCloseHandler(String gui,
                              AbstractMethodItem eventHandler)
Set an event handler which is called when the window is closed.

Parameters:
gui - the customized gui ID
eventHandler - the event handler

setWelcomeMessage

public void setWelcomeMessage(String gui,
                              String title,
                              String message,
                              String icon)
Sets a welcome message (in a popup) when a customized GUI is started.

Parameters:
gui - the gui ID
title - the popup's title
message - the welcome message
icon - an icon (defined as a resource) placed before the message (can be null)

addStatusBar

public void addStatusBar(String gui,
                         MethodItem method,
                         String position)
This configuration method allows the programmer to actually show a status bar in a declared personal UI.

Parameters:
gui - the name of the customized GUI
method - the method that returns the text
position - UP||BOTTOM

addStatusBar

public void addStatusBar(String gui,
                         String position)
This configuration method allows the programmer to actually show an empty status bar in a declared personal UI. The text should be set with the showStatus method.

Parameters:
gui - the name of the customized GUI
position - UP||BOTTOM
See Also:
addStatusBar(String,MethodItem,String)

setSubPanesGeometry

public void setSubPanesGeometry(String gui,
                                int subPanesCount,
                                String geometry)
This configuration method delegates to setSubPanesGeometry(int,int,String[]) with all the panes scrollable.

The GUI must have been declared.

Parameters:
gui - the GUI name
subPanesCount - the number of subpanes in the window
geometry - the geometry = VERTICAL || HORIZONTAL || VERTICAL_LEFT || VERTICAL_RIGHT || HORIZONTAL_UP || HORIZONTAL_DOWN || NONE
See Also:
registerCustomized(String), setSubPanesGeometry(String,int,String,boolean[]), setPaneContent(String,String,String,String[])

setSubPanesGeometry

public void setSubPanesGeometry(String gui,
                                int subPanesCount,
                                String geometry,
                                boolean[] scrollings)
This configuration method delegates to the corresponding customized GUI.

The GUI must have been declared.

Parameters:
gui - the GUI name
subPanesCount - the number of subpanes in the window
geometry - the geometry = VERTICAL || HORIZONTAL || VERTICAL_LEFT || VERTICAL_RIGHT || HORIZONTAL_UP || HORIZONTAL_DOWN
scrollings - a set of string that tells if the sub-panes must be srollable or not (use setSubPanesGeometry(String,int,String) to make all the sub-panes scrollable
See Also:
registerCustomized(String), setSubPanesGeometry(String,int,String), setPaneContent(String,String,String,String[])

setPaneContent

public void setPaneContent(String gui,
                           String paneId,
                           String type,
                           String[] args)
Defines the initial content of a pane.

The GUI must have been declared.

Parameters:
gui - the GUI name
paneId - the panel id (see the geometry to know its placement)
type - the type of the view
args - arguments to pass to the constructor of the view
See Also:
registerCustomized(String), setViewConstructor(String,String,AbstractMethodItem), setSubPanesGeometry(String,int,String), setSubPanesGeometry(String,int,String,boolean[])

setPaneContainer

public void setPaneContainer(String gui,
                             String paneId,
                             String type)
Set the container type to use for a pane. The default is "SingleSlotContainer".

Parameters:
gui - the GUI name
paneId - the panel id (see the geometry to know its placement)
type - the type of the container
See Also:
registerCustomized(String), setViewConstructor(String,String,AbstractMethodItem)

setInvalidPane

public void setInvalidPane(String gui,
                           String changedPane,
                           String invalidPane)
Set a pane to be invalidated (reload) when a given pane content changes.

Parameters:
gui - the GUI name
changedPane - the pane to watch
invalidPane - the pane to invalidate when the watched pane's content changes

addReferenceToPane

public void addReferenceToPane(String gui,
                               MemberItem member,
                               String paneId)
Specify in which pane to open the view of a reference, collection, or a method's result. The default view for an object will be used.

Note that, for a method member, a displayabe object should be returned by the method. Otherwise, a runtime error will happen.

Parameters:
gui - the GUI name
member - the member (reference, collection, or method)
paneId - the ID of the pane where the view must be opened
See Also:
registerCustomized(String), addReferenceToPane(String,MemberItem,,String,String[],Boolean,String)

addReferenceToPane

public void addReferenceToPane(String gui,
                               MemberItem field,
                               String viewType,
                               String[] viewParams,
                               Boolean small,
                               String panePath)
This configuration method delegates to the corresponding customized GUI.

The GUI must have been declared.

Parameters:
gui - the GUI name
field - the field (reference of collection)
viewType - the type of the view to open
small - tell if the viewed object in this pane should be small
panePath - the path of the panel where the view must be opened (/)
See Also:
registerCustomized(String), addReferenceToPane(String,MemberItem,String), CustomizedGUI.addReferenceToPane(MemberItem,String,String[],String)

setPosition

public void setPosition(String gui,
                        int left,
                        int up,
                        int width,
                        int height)
This configuration method delegates to the corresponding customized GUI.

The GUI must have been declared.

Parameters:
gui - the GUI name
left - left-border pixel
up - upper-border pixel
width - in percentage regarding the screen
height - in percentage regarding the screen
See Also:
registerCustomized(String), CustomizedGUI.setPosition(int,int,int,int)

setMenuPosition

public void setMenuPosition(String gui,
                            String menu,
                            String position)
Sets the position of a menu

Parameters:
gui - the customized GUI
menu - the menu name
position - the position of the menu (TOP, BOTTOM, LEFT or RIGHT)

addMenuItem

public void addMenuItem(String gui,
                        String menu,
                        String[] menuPath,
                        AbstractMethodItem method)
Add a menu item to a menu bar.

Parameters:
gui - the GUI name
menu - the menu name
menuPath - the path of the menu item.
method - the callback method for that menu item. It must be a static method with no arguments.
See Also:
registerCustomized(String), addMenuItem(String,String,String[],String,AbstractMethodItem), addMenuItem(String,String,String[],String,AbstractMethodItem,String[])

addMenuItem

public void addMenuItem(String gui,
                        String menu,
                        String[] menuPath,
                        String objectName,
                        AbstractMethodItem method)
Add a menu item to a menu bar.

Parameters:
gui - the GUI name
menu - the menu name
menuPath - the path of the menu item.
objectName - the name of the object on which to invoke the method
method - the callback method for that menu item. It must be an instance method with no arguments.
See Also:
registerCustomized(String), addMenuItem(String,String,String[],AbstractMethodItem), addMenuItem(String,String,String[],AbstractMethodItem,String[])

addMenuItem

public void addMenuItem(String gui,
                        String menu,
                        String[] menuPath,
                        AbstractMethodItem method,
                        String[] parameters)
Add a menu item to a menu bar.

Parameters:
gui - the GUI name
menu - the menu name
menuPath - the path of the menu item.
method - the callback method for that menu item. It must be a static method.
parameters - the arguments to pass to the callback method when it is called
See Also:
registerCustomized(String), addMenuItem(String,String,String[],AbstractMethodItem), addMenuItem(String,String,String[],String,AbstractMethodItem), addMenuItem(String,String,String[],String,AbstractMethodItem,String[])

addMenuItem

public void addMenuItem(String gui,
                        String menu,
                        String[] menuPath,
                        String objectName,
                        AbstractMethodItem method,
                        String[] parameters)
Add a menu item to a menu bar.

Parameters:
gui - the GUI name
menu - the menu name
menuPath - the path of the menu item.
objectName - the name of the object on which to invoke the method
method - the callback method for that menu item. It must be an instance method.
parameters - the arguments to pass to the callback method when it is called
See Also:
registerCustomized(String), addMenuItem(String,String,String[],AbstractMethodItem), addMenuItem(String,String,String[],AbstractMethodItem,String[]), addMenuItem(String,String,String[],String,AbstractMethodItem)

addMenuSeparator

public void addMenuSeparator(String gui,
                             String menu,
                             String[] menuPath)
Add a separator in a menu.

Parameters:
gui - the GUI name
menuPath - the path of the menu item separator.
See Also:
registerCustomized(String)

setMenuIcon

public void setMenuIcon(String gui,
                        String menu,
                        String[] menuPath,
                        String icon)
Set the icon for a menu.

Parameters:
gui - the GUI name
menuPath - the path of the menu
icon - the name of the icon
See Also:
registerCustomized(String)

addToolbarAction

public void addToolbarAction(String gui,
                             AbstractMethodItem method)
Add a button in the toolbar

Parameters:
gui - the GUI name
method - the callback method for that button. It must be a static method with no arguments.
See Also:
addToolbarAction(String,String,AbstractMethodItem), addToolbarAction(String,AbstractMethodItem,String[]), registerCustomized(String)

addToolbarAction

public void addToolbarAction(String gui,
                             String objectName,
                             AbstractMethodItem method)
Add a button in the toolbar

Parameters:
gui - the GUI name
objectName - name of the object on which to invoke the method
method - the callback method for that button. It must be a static method with no arguments.
See Also:
addToolbarAction(String,AbstractMethodItem), addToolbarAction(String,AbstractMethodItem,String[]), registerCustomized(String)

addToolbarAction

public void addToolbarAction(String gui,
                             AbstractMethodItem method,
                             String[] params)
Add a button in the toolbar

Parameters:
gui - the GUI name
method - a static method to invoke when the button is clicked
params - some parameters to pass the method
See Also:
addToolbarAction(String,String,AbstractMethodItem), addToolbarAction(String,AbstractMethodItem), registerCustomized(String)

addToolbarSeparator

public void addToolbarSeparator(String gui)
Add a separator in the toolbar

Parameters:
gui - the GUI name
See Also:
registerCustomized(String)

setSplitterLocation

public void setSplitterLocation(String gui,
                                int splitterId,
                                float location)
This configuration method delegates to the corresponding customized GUI.

The GUI must have been declared.

Parameters:
gui - the GUI name
splitterId - the splitter's index
location - the position as a percentage between 0 and 1, regarding to the top/left component, a negative value means that the splitter should be set at the preferred sized of the inner components
See Also:
registerCustomized(String), CustomizedGUI.setSplitterLocation(int,float)

setTitle

public void setTitle(String gui,
                     String title)
This configuration method sets the title of the GUI main window.

The GUI must have been declared.

Parameters:
gui - the GUI name
title - the window title
See Also:
registerCustomized(String)

setLoggingMethod

public void setLoggingMethod(String gui,
                             String objects,
                             String classes,
                             String methods,
                             int paneId)
Sets the given methods to be logging.

When it is called, the argument --- that must be a string --- is written into a text area added at the end of a subpanel defined by a customized GUI.

Parameters:
gui - the customized gui (must be registered and configured with at least setSubPanesGeometry)
objects - the objects that contain the method (pointcut expression)
classes - the class the contains the method (pointcut expression)
methods - the method item names (pointcut expression)
paneId - the subpanel id
See Also:
registerCustomized(String), setSubPanesGeometry(String,int,String)

defineResource

public void defineResource(String type,
                           String name,
                           String path)
This configuration method allows the user to define new resources that can be used by the GUI later-on.

Parameters:
type - the resource type (ICON) -- other types should be supported soon
name - the identifier of the resource (should be unique)
path - the path where the resource is located (can be classpath relative)
See Also:
ClassAppearenceGuiConf.setIcon(ClassItem,String)

setFontAttribute

public void setFontAttribute(String attribute,
                             String value)
This configuration method allows the programmer to define attributes for the default font. It currently is only used by the swing display.

The specified font will be used by all the UI components.

Note: this method sets a global font that will be active for all the configured GUIs. It is not possible to have different font configurations when running several GUIs on the same container.

Configurable font attributes are:

family
serif,sans-serif or monospace
weight
normal or bold
style
normal or italic
size
the size of the font

Parameters:
attribute - the name of the attribute
value - the value for the attribute

addStyleSheetURL

public void addStyleSheetURL(String gui,
                             String url)
Adds a style-sheet URL for the generated html pages (for WEB GUIs).

By default, the style-sheets are the one defined in the org/objectweb/jac/aspects/gui/web directory but the user can override some of their characteristics by adding customized ones (last added overrides)

Parameters:
gui - the customized GUI the style sheets applies to
url - the URL string
See Also:
addStyleSheetURL(String)

addStyleSheetURL

public void addStyleSheetURL(String url)
Adds a style-sheet URL for the generated html pages (for WEB GUIs).

Parameters:
url - the URL string
See Also:
addStyleSheetURL(String,String)

setDialogTimeout

public void setDialogTimeout(long timeout)
Sets the delay before a dialog times out. Dialogs only time out on the web GUI, to avoid locking threads on the server for ever.

Parameters:
timeout - the timeout delay in milliseconds

setDefaultCurrency

public void setDefaultCurrency(String currencyName,
                               int precision)
Set the default currency

Parameters:
currencyName - the name of the default currency
precision - number of decimals to display

declareCurrency

public void declareCurrency(String currencyName,
                            int precision,
                            double rate)
Declare a currency and it's change rate with the default currency

Parameters:
currencyName - the name of currency
precision - number of decimals to display for the currency
rate - the change rate for the currency

setViewConstructor

public void setViewConstructor(String guiType,
                               String viewType,
                               AbstractMethodItem constructor)
Set the view constructor for a given gui type.

Parameters:
guiType - the type of the gui ("swing","web",...)
viewType - the type of the view
constructor - the view constructor for this gui type and view type

setDateFormat

public void setDateFormat(String dateFormat)
Set the default date format used by date components. It must be a valid format as defined by java.text.SimpleDateFormat

Parameters:
dateFormat - the date format
See Also:
SimpleDateFormat

defineEnum

public void defineEnum(String name,
                       String[] values,
                       int start,
                       int step)
Define an enumeration. It associates integer values with strings.

Parameters:
name - the name of enumeration to define
values - the labels of the values
start - the integer value of the first item.
step -
See Also:
FieldAppearenceGuiConf.setFieldEnum(FieldItem,String), FieldAppearenceGuiConf.setFieldChoice(FieldItem,Boolean,String[])

setNavBar

public void setNavBar(String gui,
                      CollectionItem collection)
Enables navigation bar for a collection.

Navigation bar is a set of buttons (previous element, next element, remove element) used to navigate in a collection

Parameters:
gui - the gui
collection - the collection

setLabelOK

public void setLabelOK(String label)

setLabelCancel

public void setLabelCancel(String label)

setLabelNew

public void setLabelNew(String label)

setLabelAdd

public void setLabelAdd(String label)

setLabelNone

public void setLabelNone(String label)

setLabelAll

public void setLabelAll(String label)

setEncoding

public void setEncoding(String encoding)
Sets the default charset encoding to use when interaction with the user's terminal. Defaults to "UTF-8". Used by the WEB diplay.

Parameters:
encoding - the charset encoding
See Also:
Charset