|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the configuration interface of the Gui aspect.
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.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 |
public void askForParameters(String classExpr)
InputWrapper.askForParameters
on all methods with
parameters.
It permits to dynamically call methods, and so display something when user clicks on buttons.
classExpr
- the classespublic void registerCustomized(String name)
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.
name
- the new customized GUI namepublic void setCustomizedIcon(String gui, String icon)
gui
- the gui IDicon
- the name of the iconpublic void setOnCloseHandler(String gui, AbstractMethodItem eventHandler)
gui
- the customized gui IDeventHandler
- the event handlerpublic void setWelcomeMessage(String gui, String title, String message, String icon)
gui
- the gui IDtitle
- the popup's titlemessage
- the welcome messageicon
- an icon (defined as a resource) placed before the
message (can be null)public void addStatusBar(String gui, MethodItem method, String position)
gui
- the name of the customized GUImethod
- the method that returns the textposition
- UP||BOTTOMpublic void addStatusBar(String gui, String position)
showStatus
method.
gui
- the name of the customized GUIposition
- UP||BOTTOMaddStatusBar(String,MethodItem,String)
public void setSubPanesGeometry(String gui, int subPanesCount, String geometry)
setSubPanesGeometry(int,int,String[])
with all the
panes scrollable.
The GUI must have been declared.
gui
- the GUI namesubPanesCount
- the number of subpanes in the windowgeometry
- the geometry = VERTICAL || HORIZONTAL ||
VERTICAL_LEFT || VERTICAL_RIGHT || HORIZONTAL_UP ||
HORIZONTAL_DOWN || NONE
registerCustomized(String)
,
setSubPanesGeometry(String,int,String,boolean[])
,
setPaneContent(String,String,String,String[])
public void setSubPanesGeometry(String gui, int subPanesCount, String geometry, boolean[] scrollings)
The GUI must have been declared.
gui
- the GUI namesubPanesCount
- the number of subpanes in the windowgeometry
- 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 scrollableregisterCustomized(String)
,
setSubPanesGeometry(String,int,String)
,
setPaneContent(String,String,String,String[])
public void setPaneContent(String gui, String paneId, String type, String[] args)
The GUI must have been declared.
gui
- the GUI namepaneId
- the panel id (see the geometry to know its placement)type
- the type of the viewargs
- arguments to pass to the constructor of the viewregisterCustomized(String)
,
setViewConstructor(String,String,AbstractMethodItem)
,
setSubPanesGeometry(String,int,String)
,
setSubPanesGeometry(String,int,String,boolean[])
public void setPaneContainer(String gui, String paneId, String type)
gui
- the GUI namepaneId
- the panel id (see the geometry to know its
placement)type
- the type of the containerregisterCustomized(String)
,
setViewConstructor(String,String,AbstractMethodItem)
public void setInvalidPane(String gui, String changedPane, String invalidPane)
gui
- the GUI namechangedPane
- the pane to watchinvalidPane
- the pane to invalidate when the watched
pane's content changespublic void addReferenceToPane(String gui, MemberItem member, String paneId)
Note that, for a method member, a displayabe object should be returned by the method. Otherwise, a runtime error will happen.
gui
- the GUI namemember
- the member (reference, collection, or method)paneId
- the ID of the pane where the view must be openedregisterCustomized(String)
,
addReferenceToPane(String,MemberItem,,String,String[],Boolean,String)
public void addReferenceToPane(String gui, MemberItem field, String viewType, String[] viewParams, Boolean small, String panePath)
The GUI must have been declared.
gui
- the GUI namefield
- the field (reference of collection)viewType
- the type of the view to opensmall
- tell if the viewed object in this pane should be
smallpanePath
- the path of the panel where the view must be
opened (registerCustomized(String)
,
addReferenceToPane(String,MemberItem,String)
,
CustomizedGUI.addReferenceToPane(MemberItem,String,String[],String)
public void setPosition(String gui, int left, int up, int width, int height)
The GUI must have been declared.
gui
- the GUI nameleft
- left-border pixelup
- upper-border pixelwidth
- in percentage regarding the screenheight
- in percentage regarding the screenregisterCustomized(String)
,
CustomizedGUI.setPosition(int,int,int,int)
public void setMenuPosition(String gui, String menu, String position)
gui
- the customized GUImenu
- the menu nameposition
- the position of the menu (TOP, BOTTOM, LEFT or RIGHT)public void addMenuItem(String gui, String menu, String[] menuPath, AbstractMethodItem method)
gui
- the GUI namemenu
- the menu namemenuPath
- the path of the menu item.method
- the callback method for that menu item. It must be
a static method with no arguments.registerCustomized(String)
,
addMenuItem(String,String,String[],String,AbstractMethodItem)
,
addMenuItem(String,String,String[],String,AbstractMethodItem,String[])
public void addMenuItem(String gui, String menu, String[] menuPath, String objectName, AbstractMethodItem method)
gui
- the GUI namemenu
- the menu namemenuPath
- the path of the menu item.objectName
- the name of the object on which to invoke the methodmethod
- the callback method for that menu item. It must be
an instance method with no arguments.registerCustomized(String)
,
addMenuItem(String,String,String[],AbstractMethodItem)
,
addMenuItem(String,String,String[],AbstractMethodItem,String[])
public void addMenuItem(String gui, String menu, String[] menuPath, AbstractMethodItem method, String[] parameters)
gui
- the GUI namemenu
- the menu namemenuPath
- 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 calledregisterCustomized(String)
,
addMenuItem(String,String,String[],AbstractMethodItem)
,
addMenuItem(String,String,String[],String,AbstractMethodItem)
,
addMenuItem(String,String,String[],String,AbstractMethodItem,String[])
public void addMenuItem(String gui, String menu, String[] menuPath, String objectName, AbstractMethodItem method, String[] parameters)
gui
- the GUI namemenu
- the menu namemenuPath
- the path of the menu item.objectName
- the name of the object on which to invoke the methodmethod
- 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 calledregisterCustomized(String)
,
addMenuItem(String,String,String[],AbstractMethodItem)
,
addMenuItem(String,String,String[],AbstractMethodItem,String[])
,
addMenuItem(String,String,String[],String,AbstractMethodItem)
public void addMenuSeparator(String gui, String menu, String[] menuPath)
gui
- the GUI namemenuPath
- the path of the menu item separator.registerCustomized(String)
public void setMenuIcon(String gui, String menu, String[] menuPath, String icon)
gui
- the GUI namemenuPath
- the path of the menuicon
- the name of the iconregisterCustomized(String)
public void addToolbarAction(String gui, AbstractMethodItem method)
gui
- the GUI namemethod
- the callback method for that button. It must be a
static method with no arguments.addToolbarAction(String,String,AbstractMethodItem)
,
addToolbarAction(String,AbstractMethodItem,String[])
,
registerCustomized(String)
public void addToolbarAction(String gui, String objectName, AbstractMethodItem method)
gui
- the GUI nameobjectName
- name of the object on which to invoke the methodmethod
- the callback method for that button. It must be a
static method with no arguments.addToolbarAction(String,AbstractMethodItem)
,
addToolbarAction(String,AbstractMethodItem,String[])
,
registerCustomized(String)
public void addToolbarAction(String gui, AbstractMethodItem method, String[] params)
gui
- the GUI namemethod
- a static method to invoke when the button is clickedparams
- some parameters to pass the methodaddToolbarAction(String,String,AbstractMethodItem)
,
addToolbarAction(String,AbstractMethodItem)
,
registerCustomized(String)
public void addToolbarSeparator(String gui)
gui
- the GUI nameregisterCustomized(String)
public void setSplitterLocation(String gui, int splitterId, float location)
The GUI must have been declared.
gui
- the GUI namesplitterId
- the splitter's indexlocation
- 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
componentsregisterCustomized(String)
,
CustomizedGUI.setSplitterLocation(int,float)
public void setTitle(String gui, String title)
The GUI must have been declared.
gui
- the GUI nametitle
- the window titleregisterCustomized(String)
public void setLoggingMethod(String gui, String objects, String classes, String methods, int paneId)
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.
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 idregisterCustomized(String)
,
setSubPanesGeometry(String,int,String)
public void defineResource(String type, String name, String path)
type
- the resource type (ICON) -- other types should be
supported soonname
- the identifier of the resource (should be unique)path
- the path where the resource is located (can be
classpath relative)ClassAppearenceGuiConf.setIcon(ClassItem,String)
public void setFontAttribute(String attribute, String value)
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:
attribute
- the name of the attributevalue
- the value for the attributepublic void addStyleSheetURL(String gui, String url)
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)
gui
- the customized GUI the style sheets applies tourl
- the URL stringaddStyleSheetURL(String)
public void addStyleSheetURL(String url)
url
- the URL stringaddStyleSheetURL(String,String)
public void setDialogTimeout(long timeout)
timeout
- the timeout delay in millisecondspublic void setDefaultCurrency(String currencyName, int precision)
currencyName
- the name of the default currencyprecision
- number of decimals to displaypublic void declareCurrency(String currencyName, int precision, double rate)
currencyName
- the name of currencyprecision
- number of decimals to display for the currencyrate
- the change rate for the currencypublic void setViewConstructor(String guiType, String viewType, AbstractMethodItem constructor)
guiType
- the type of the gui ("swing","web",...)viewType
- the type of the viewconstructor
- the view constructor for this gui type and view typepublic void setDateFormat(String dateFormat)
dateFormat
- the date formatSimpleDateFormat
public void defineEnum(String name, String[] values, int start, int step)
name
- the name of enumeration to definevalues
- the labels of the valuesstart
- the integer value of the first item.step
- FieldAppearenceGuiConf.setFieldEnum(FieldItem,String)
,
FieldAppearenceGuiConf.setFieldChoice(FieldItem,Boolean,String[])
public void setNavBar(String gui, CollectionItem collection)
Navigation bar is a set of buttons (previous element, next element, remove element) used to navigate in a collection
gui
- the guicollection
- the collectionpublic void setLabelOK(String label)
public void setLabelCancel(String label)
public void setLabelNew(String label)
public void setLabelAdd(String label)
public void setLabelNone(String label)
public void setLabelAll(String label)
public void setEncoding(String encoding)
encoding
- the charset encodingCharset
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |