|
JAC project AOPSYS CEDRIC & LIP6 labs |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jac.core.AspectComponent | +--org.objectweb.jac.aspects.gui.GuiAC
This aspect component implements a very simple GUI that allows the user to browse the named object of the system and call methods on them.
It implements a MVC design pattern where the controllers are
implemented by ViewWrapper
instances.
ViewControlWrapper
,
InputWrapper
,
View
,
Serialized FormFields inherited from class org.objectweb.jac.core.AspectComponent |
application, blockKeywords, firstCall, NOT_SHARED, SHARED, startWeavingCCount, startWeavingCount, startWeavingMethod, startWeavingType, systemListener, wrappers |
Fields inherited from interface org.objectweb.jac.core.BaseProgramListener |
FOUND_OBJECT |
Constructor Summary | |
GuiAC()
The default constructor for the GUI aspect component. |
Method Summary | |
static void |
addDisplay(String displayID,
Display newDisplay)
Adds a new display for this GUI. |
void |
addMenuItem(String gui,
String menu,
String[] menuPath,
AbstractMethodItem callback)
Add a menu item to a menu bar. |
void |
addMenuItem(String gui,
String menu,
String[] menuPath,
AbstractMethodItem callback,
String[] parameters)
Add a menu item to a menu bar. |
void |
addMenuItem(String gui,
String menu,
String[] menuPath,
String objectName,
AbstractMethodItem callback)
Add a menu item to a menu bar. |
void |
addMenuItem(String gui,
String menu,
String[] menuPath,
String objectName,
AbstractMethodItem callback,
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 field,
String panePath)
Specify in which pane to open the view of a reference, collection, or a method's result. |
void |
addReferenceToPane(String gui,
MemberItem member,
String viewType,
String[] viewParams,
Boolean small,
String paneId)
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,
String objectName,
AbstractMethodItem method)
Add a button in the toolbar |
void |
addToolbarSeparator(String gui)
Add a separator in the toolbar |
void |
addViewFieldDependency(ClassItem cl,
String fieldName)
Specify that the object views of instances of a class depend on the value of a field. |
void |
afterApplicationStarted()
The default behavior of this BaseProgramListener
method is to notify the display with the
applicationStarted event. |
void |
askForParameters(String classExpr)
Essential method for GUI, which weaves InputWrapper.askForParameters on all methods with
parameters. |
void |
beforeReload()
|
void |
captureSystemErr()
Tells the swing administration gui to capture System.err so that it appears in a tab. |
void |
captureSystemOut()
Tells the swing gui to capture System.out so that it appears a in tab. |
void |
checkCategories(ClassItem cli,
int length)
|
static Display |
createDisplay(String displayID,
Class displayType,
ViewFactory factory)
This configuration method creates a new display and registers its. |
void |
createSwingDisplays(String[] customizedIDs)
|
void |
createWebDisplays(String[] customizedIDs)
|
void |
declareCurrency(String currencyName,
int precision,
double rate)
Declare a currency and it's change rate with the default currency |
void |
declareView(ClassItem cli,
String viewName)
|
void |
declareView(ClassItem cli,
String viewName,
String parentViewName)
|
void |
defineEnum(String name,
String[] values,
int start,
int step)
Define an enumeration. |
void |
defineResource(String type,
String name,
String path)
The wrapper that logs methods into a Swing console. |
static Border |
getBorder(FieldItem field)
|
static String[] |
getCategories(MemberItem field)
Get the category of a member as configured with setCategory(). |
static String[] |
getCategoriesIcons(ClassItem cl)
Get the categories icons (icons displayed in tabs). |
static String[] |
getCategoriesLabels(ClassItem cl)
Get the categories labels (text displayed in tabs). |
static boolean |
getCommitOnFocusLost()
|
static MethodItem |
getCondition(AbstractMethodItem method)
Gets the condition method associated with a method, or null if there's none. |
static Object |
getContextAttribute(MetaItem item,
String attribute,
Stack context,
Object defaultValue)
|
static FieldItem[] |
getCreationAttributesOrder(ClassItem cl)
Gets the field items to display when creation a new instance a class |
static Enumeration |
getCurrencies()
Returns an enumeration of all declared currencies, including the default currency. |
static Currency |
getCurrency(String currencyName)
Returns the Currency object associated with a currency name. |
static CustomizedGUI |
getCustomized(String customizedID)
Gets a display from its ID. |
static String |
getDateFormat()
Returns the date format as set by setDateFormat. |
static String |
getDateHourFormat()
Returns the date format for DateHours as set by setDateHourFormat. |
String[] |
getDefaultConfigs()
Returns defaults configuration files that must be loaded before the user's configuration |
static String |
getDefaultCurrency()
Returns the default currency |
protected String |
getDefaultProgramName()
The programmer of a new GUI aspect must overload this method to return the right default program name. |
static FieldItem[] |
getDefaultsAttributesOrder(ClassItem cl)
|
static String |
getDefaultSortedColumn(CollectionItem collection)
|
static Object |
getDefaultValue(FieldItem field,
String value)
Converts the a String into an object for the value of a field |
static Collection |
getDependentFields(ClassItem cli)
Returns the fields the views a class depend on. |
static String |
getDescription(Object object)
Returns the description of an object if it has been set. |
static String |
getDescription(Object object,
String beforeString,
String afterString)
|
static Display |
getDisplay(String displayID)
Gets a display from its ID. |
static int |
getEditorCols(FieldItem field)
Returns the editor's number of columns of a field or 0 if none was set. |
static int |
getEditorColumns(MetaItem type)
|
static int |
getEditorRows(FieldItem field)
Returns the editor's number of rows of a field or 0 if none was set. |
static int |
getEditorRows(MetaItem type)
|
static int |
getEditorWidth(FieldItem field)
Returns the editor width of a field or 0 if none was set. |
static int |
getEditorWidth(MetaItem type)
|
String |
getFileDescription(MethodItem setter)
Gets the file description for a given field that is view as a file chooser (more precisely, the field that is set by the given setter). |
String[] |
getFileExtensions(MethodItem setter)
Gets the file extensions for a given field that is view as a file chooser (more precisely, the field that is set by the given setter). |
static String |
getFloatFormat()
Returns the default display format of floats. |
static String |
getFloatFormat(MetaItem item)
Returns the display format of an item. |
static Map |
getFontAttributes()
|
static String |
getFormat(MetaItem item)
Returns the format of a ClassItem or VirtualClassItem. |
static Stack |
getGraphicContext()
|
static String |
getIcon(MetaItem item)
Returns the icon associated with this item. |
static MethodItem |
getInitiliazer(FieldItem field)
Returns the initializer method of a field, if any, or null. |
static MethodItem |
getInteractionHandler(AbstractMethodItem method)
|
static String |
getLabel(MetaItem item)
|
static String |
getLabel(MetaItem item,
Stack context)
Returns the label of an item, or an automatically computed string if none was set. |
static String |
getLabelAdd()
|
static String |
getLabelCancel()
|
static String |
getLabelClose()
|
static String |
getLabelNew()
|
static String |
getLabelOK()
|
static String |
getLocalSessionID()
Return a session id for the local display |
static MemberItem[] |
getMembersOrder(CollectionItem collection,
String viewName)
|
static MethodItem[] |
getMenu(ClassItem classItem)
|
static int[] |
getMethodParametersCols(AbstractMethodItem method)
Returns the parameters numbers of columns of a method or null if none was set. |
static int[] |
getMethodParametersHeight(AbstractMethodItem method)
Returns the parameters heights of a method or null if none was set. |
static int[] |
getMethodParametersRows(AbstractMethodItem method)
Returns the parameters numbers of rows of a method or null if none was set. |
static int[] |
getMethodParametersWidth(AbstractMethodItem method)
Returns the parameters widths of a method or null if none was set. |
String[] |
getModifyingBoxes(AbstractMethodItem method)
Get the modifying boxes for the given abstract method item (a method or a constructor). |
static int |
getNumRowsPerPage(CollectionItem collection)
|
static String[] |
getParameterNames(AbstractMethodItem method)
Returns the parameter names of a method. |
static Object |
getRepository(ClassItem cl)
Gets the repository object of a class |
static MethodItem |
getSelectionHandler(MemberItem member)
|
static int |
getStartIndex(CollectionItem collection)
Gets start index for collection view from the context |
static Vector |
getStyleSheetURLs()
|
static String |
getToolTip(Object o,
Stack context)
Gets the tooltip text of an object. |
static ObjectView |
getView(ClassItem cli,
String viewName)
Gets an object view by name. |
static CollectionItemView |
getView(CollectionItem collection,
String viewName)
Gets an object view by name. |
static MemberItemView |
getView(MemberItem member,
String viewName)
Gets an object view by name. |
static ViewFactory |
getViewFactory(String guiType)
Returns a ViewFactory for a given guiType |
static boolean |
getViewOnSelection(FieldItem field)
Tells wether VIEW_ON_SELECTION is set for a given field. |
static boolean |
hasDefaultValue(FieldItem field)
|
static boolean |
hasEditableDefaultValues(MetaItem metaItem)
|
static boolean |
hasEmbeddedEditors(ClassItem cli)
|
static boolean |
hasSetNavBar(CustomizedGUI gui,
CollectionItem coll)
|
void |
hideTreeRelation(FieldItem field)
This configuration method allows to hide a given relation (collection) in a treeview, even if the show relations mode is on . |
static boolean |
isAddable(CollectionItem collection)
Tells wether to show an add button for a collection |
static boolean |
isAddable(Object substance,
CollectionItem collection)
Tells wether to show an add button for a collection |
static boolean |
isAutoCreate(FieldItem field)
|
static boolean |
isAutoCreateParameters(AbstractMethodItem method)
|
static boolean |
isCreatable(ClassItem cli)
Wether to show "new" buttons for a class (defaults to true) |
static boolean |
isCreationAllowedParameter(AbstractMethodItem method,
int i)
Tells wether to display a "new" button for a parameter of a method |
static boolean |
isCreationAttribute(FieldItem field)
|
static boolean |
isEditable(FieldItem field)
Tells if a field is editable from the GUI. |
static boolean |
isEditable(Object substance,
FieldItem field)
Tells if a field is editable from the GUI. |
static boolean |
isEditableChoice(FieldItem field)
|
static boolean |
isEmbeddedEditor(MetaItem item)
|
static boolean |
isEmbeddedEditors()
Returns the value of the EMBEDDED_EDITORS atrribute from the current collaboration. |
static boolean |
isEnabled(AbstractMethodItem method,
Object substance)
Tells wether a method should be enabled |
boolean |
isFileChooserView(MethodItem setter)
Tells if the given method call by the GUI opens a file chooser dialog. |
static boolean |
isMemberInCategory(MemberItem member,
String category)
Tells wether a member item belong to category |
static boolean |
isRemovable(CollectionItem collection)
Tells wether to show a remove button for a collection |
static boolean |
isRemovable(Object substance,
CollectionItem collection)
Tells wether to show a remove button for a collection |
static boolean |
isShowRowNumbers(CollectionItem collection)
|
static boolean |
isTableView(CollectionItem collection)
Returns true if the given item must be displayed by the GUI as a table. |
static boolean |
isViewableItems(CollectionItem collection)
|
static boolean |
isVisible(MetaItem metaItem)
Tells if an item is visible (displayed by the GUI). |
static boolean |
isVisible(Object substance,
MetaItem metaItem)
Tells if an item is visible (displayed by the GUI). |
void |
newWindow(String gui,
String className,
String fieldName)
|
protected void |
notifyDisplaysForNewObject(Object newObject)
Notifies all the displays that a new object has just been created by upcalling the newObject method of the
displays. |
static MetaItem |
popGraphicContext()
|
static void |
pushGraphicContext(MetaItem value)
|
void |
registerCustomized(String name)
This configuration method allows the user to create and register a new customized GUI. |
static void |
registerDisplay(String name,
String displayType,
String guiType)
This configuration method allows the user to register a new display. |
static void |
removeDisplay(Display display)
Removes a display for this GUI. |
static void |
removeStartIndex(CollectionItem collection)
|
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 |
setAddable(String cl,
String collectionName,
boolean addable)
|
void |
setAttributesOrder(ClassItem cli,
String[] attributeNames)
Sets the order in which the attributes of a class are to be rendered. |
void |
setAttributesOrder(ClassItem cli,
String viewName,
String[] attributeNames)
|
void |
setAutoCreate(FieldItem field)
This configuration method tells the GUI to automatically create a new instance of the field type when a setter or an adder is invoke on the object that owns this field. |
void |
setAutoCreateAll(ClassItem cl)
This configuration method tells that all the class methods must be in auto-creation mode. |
void |
setAutoCreateInitializer(FieldItem field,
MethodItem initializer)
Defines a method to initialize new objects created by the auto-create behaviour. |
void |
setAutoCreateParameters(AbstractMethodItem method)
This configuration method tells which parameters of the given method should be autocreated. |
void |
setAutoCreateParametersEx(ClassItem cli,
String[] excludedMethods)
This configuration method tells that all the class methods must be in auto-creation mode except the excluded ones. |
void |
setAutoCreateState(ClassItem cli,
String[] fields)
This configuration method tells which fields of the given class should be auto-created. |
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(ClassItem cli,
String[] categories)
This configuration method sets some categories for a class. |
void |
setCategories(MemberItem member,
String[] categories)
Sets the categories of an item of 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 |
setCategory(MemberItem member,
String category)
Sets the category of an item of a class. |
void |
setClosingMethod(ClassItem classItem,
String methodName)
Sets the given method to be closing (ie, when the user press the corresponding button, it performs the call and closes the current object view). |
void |
setCollectionType(CollectionItem collection,
String type)
Set the type of the objects of a collection. |
void |
setCommitOnFocusLost(boolean value)
Set the commit method to use when attibutes are edited. |
void |
setCondition(AbstractMethodItem method,
String condition)
Sets a condition on a method. |
void |
setCreationAllowed(FieldItem field,
boolean allow)
Tells wether should be allowed to create a new instance when editing the value of a field. |
void |
setCreationAllowedParameters(AbstractMethodItem method,
boolean[] create)
Tells if JAC object-typed (references) arguments of a method can be created while the method's invocation or if they should be choosen in existing instances list. |
void |
setCreationAttributesOrder(ClassItem cli,
String[] attributeNames)
Sets the order in which the attributes of a class are to be rendered when an instance is created. |
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 |
setDateHourFormat(String dateFormat)
|
void |
setDefaultCurrency(String currencyName,
int precision)
Set the default currency |
void |
setDefaultEditorHeight(ClassItem type,
int height,
int rows)
Sets the default editor height for value of a given type. |
void |
setDefaultEditorHeight(VirtualClassItem type,
int height,
int rows)
Sets the default editor height for value of a given type. |
void |
setDefaultEditorWidth(ClassItem type,
int width,
int columns)
Sets the default editor width for value of a given type. |
void |
setDefaultEditorWidth(VirtualClassItem type,
int width,
int columns)
Sets the default editor width for value of a given type. |
void |
setDefaults()
Defines the visible property to false for some JAC system items. |
void |
setDefaultsAttributesOrder(ClassItem cl,
String[] attributeNames)
Sets the attributes to be displayed for editable default values in tables |
void |
setDefaultShowRowNumbers(boolean value)
Tells the GUI wether to show row numbers for tables and lists by default. |
void |
setDefaultSortedColumn(ClassItem cl,
String column)
Sets a default sorted column for a class. |
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 |
setDefaultValues(AbstractMethodItem method,
Object[] values)
Sets the default value for argument names of a given method item so that they can be used by GUI aspect components. |
void |
setDescription(ClassItem classItem,
String description)
Sets the description of a class. |
void |
setDescription(MemberItem member,
String description)
Sets the description of a class member (field of method). |
void |
setDesktopCustomizedView(ClassItem classItem,
ClassItem type)
Tells if a field item's value must be displayed embbeded. |
void |
setDialogTimeout(long timeout)
Sets the delay before a dialog times out. |
void |
setDirectCollectionMethods(CollectionItem collection,
String[] methods)
This configuration method allows the programmer to tell the GUI to add some buttons to the collection that will invoke the corresponding methods on the currently selected collection element. |
void |
setDisplayLabel(MemberItem member,
boolean displayLabel)
Wether to display a label containing the name of the field in views. |
void |
setDisplayLabel(String itemName,
boolean displayLabel)
Wether to display a label containing the name of the field in views. |
void |
setDynamicFieldChoice(FieldItem field,
Boolean editable,
ClassItem targetClass,
String targetMethod)
Same as setFieldChoice but with dynamically defined values. |
void |
setDynamicFieldChoice(FieldItem field,
Boolean editable,
MethodItem targetMethod)
Same as setFieldChoice but with dynamically defined values. |
void |
setEditable(FieldItem field,
boolean editable)
Set a field to be editable. |
void |
setEditableDefaultValues(CollectionItem collection,
boolean editable)
Tells if the default values of an item can be editable from the GUI. |
void |
setEditorHeight(FieldItem field,
int height,
int rows)
Sets the height of the field's embedded editor when exist. |
void |
setEditorWidth(FieldItem field,
int width,
int columns)
Sets the width of the field's embedded editor when exist. |
void |
setEmbeddedAdder(CollectionItem collection,
boolean embedded)
Tells the GUI wether to use an embedded view for the adder of a collection. |
void |
setEmbeddedEditor(MemberItem member)
This configuration method allows the programmer to set a class member to be internally edited. |
void |
setEmbeddedEditorColumns(CollectionItem collection,
String viewName,
MemberItem[] members)
Tells to use embedded editors for the cells of some columns |
void |
setEmbeddedEditors(ClassItem cli)
Tells the GUI to use embedded editors for all fields of a class, whenever possible. |
void |
setEmbeddedEditors(CollectionItem collection,
String viewName,
boolean embedded)
Tells wether to use embedded editors for the cells of a table |
void |
setEmbeddedView(MemberItem member)
Tells the GUI to insert a referenced object to be displayed as an embedded view in its container object view. |
void |
setEmbeddedView(MemberItem member,
boolean embedded)
|
void |
setEmbeddedView(MemberItem member,
String viewName,
boolean embedded)
|
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 enumName)
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 |
setFontAttribute(String attribute,
String value)
This configuration method allows the programmer to define attributes for the default font. |
void |
setFormat(String className,
String format)
Sets the display format of a class. |
void |
setIcon(ClassItem classItem,
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 |
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 |
setIndexNotFoundHandler(ClassItem cl,
MethodItem handler)
Defines a method to be called when an object referred to by it's indexed field is not found. |
void |
setInteractionHandler(MethodItem method,
MethodItem handler)
Sets a method to be used to handler user interaction when a method is called, instead of the standard "ask for parameters stuffs". |
void |
setInvalidPane(String gui,
String changedPane,
String invalidPane)
Set a pane to be invalidated (reload) when a given pane content changes. |
void |
setLabel(ClassItem classItem,
String label)
Sets the label of a class. |
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 |
setLabelAdd(String label)
|
void |
setLabelCancel(String label)
|
void |
setLabelClose(String label)
|
void |
setLabelNew(String label)
|
void |
setLabelOK(String label)
|
void |
setLineBreaks(ClassItem cli,
String[] fields)
Defines which fields should start on a new line. |
void |
setLinkedParameters(AbstractMethodItem method,
String[] collections)
Declares some reference parameters (non-primitive object-typed parameters) of the method to be linked with a collection that gives the choices of the object in the GUI combobox. |
void |
setLoggingMethod(String gui,
String objects,
String classes,
String methods,
int paneID)
Sets the given methods to be logging. |
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 |
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 |
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 |
setMethodDynamicParameterChoice(MethodItem method,
ClassItem[] targetClasses,
String[] targetMethods,
boolean[] editable)
Same as setDynamicFieldChoice but for method parameters
|
void |
setMethodParametersHeight(AbstractMethodItem method,
int[] height,
int[] rows)
Sets the height for all parameters of one method. |
void |
setMethodParametersWidth(AbstractMethodItem method,
int[] width,
int[] columns)
Sets the width for all parameters of one method. |
void |
setMethodsOrder(ClassItem cli,
String[] methodNames)
Sets the order in which the methods of a class are to be rendered. |
void |
setMethodsOrder(ClassItem cli,
String viewName,
String[] methodNames)
|
void |
setModifyingBoxes(ClassItem classItem,
String methodName,
String[] modifyingBoxes)
|
void |
setNavBar(String gui,
CollectionItem collection)
Enables navigation bar for a collection. |
void |
setNonViewableItems(CollectionItem collection)
Set a collection's items to be not viewable (no 'view') |
void |
setNumRowsPerPage(CollectionItem collection,
int numRows)
Sets the number of rows to display simultaneously for a collection. |
void |
setOnCloseHandler(String gui,
AbstractMethodItem eventHandler)
Set an event handler which is called when the window is closed. |
void |
setOnSelection(CollectionItem collection,
MethodItem eventHandler)
Sets the event handler to be called when an item of the collection is selected. |
void |
setOpenViewMethod(ClassItem cli,
String methodName)
This configuration method allows the programmer to specify that the result of a given method (should be a wrappe) opens a new view on this result instead of treating it as a simple result. |
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 |
setParameterEnums(AbstractMethodItem method,
String[] enumNames)
Declares some parameters of method as enums. |
void |
setParameterFields(AbstractMethodItem method,
String[] parameterFields)
Specify that a parameter of a method corresponds to a field within the invoked object. |
void |
setParameterNames(AbstractMethodItem method,
String[] parameterNames)
Sets the argument names of a given method item so that they can be used by GUI aspect components. |
void |
setPasswordParameters(AbstractMethodItem method,
String[] params)
Specify that a parameter of a method is a pasword method. |
void |
setPosition(String gui,
int left,
int up,
int width,
int height)
This configuration method delegates to the corresponding customized GUI. |
void |
setPreferredHeight(CollectionItem collection,
int height)
Tells the preferred height a table or list view of a collection should take, if possible. |
void |
setPreferredWidth(CollectionItem collection,
int width)
Tells the preferred width a table or list view of a collection should take, if possible. |
void |
setRemovable(String cl,
String collectionName,
boolean removable)
|
void |
setSelectionTarget(CollectionItem collection,
ClassItem targetClass,
String targetField)
Sets the field to be displayed when an item of the collection is selected, instead of the item itself. |
void |
setSmallEditorHeight(FieldItem field,
int height,
int rows)
|
void |
setSmallEditorWidth(FieldItem field,
int width,
int columns)
|
void |
setSplitterLocation(String gui,
int splitterId,
float location)
This configuration method delegates to the corresponding customized GUI. |
static void |
setStartIndex(CollectionItem collection,
int index)
Sets the start index for a collection view in the context |
void |
setStyle(ClassItem cli,
String style)
Set the style for a class |
void |
setStyle(FieldItem field,
String style)
Set the style of a field |
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 |
setTableMembersOrder(ClassItem cli,
String[] memberNames)
Sets the order in which the attributes of a class are to be rendered when their instance are placed within a table. |
void |
setTableView(FieldItem field)
Sets the render of a given field (more precisely a collection) to be rendered by a table. |
void |
setTitle(String gui,
String title)
This configuration method sets the title of the GUI main window. |
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 cli,
String[] attributeNames)
Sets the order in which the attributes of a class are to be rendered when their instance are placed within a tree. |
void |
setURLSelectionMode(String cl,
String fieldName,
String mode,
String[] extensions,
String extensionsDescription)
Sets the selection mode for an URL. |
void |
setViewConstructor(String guiType,
String viewType,
AbstractMethodItem constructor)
Set the view constructor for a given gui type. |
void |
setViewOnSelection(CollectionItem collection)
This configuration method allows the programmer to specify that the view on an object contained in a collection will be automatically opened by the GUI when the user selects it. |
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(ClassItem cl,
String[] itemNames,
boolean visible)
|
void |
setVisible(MemberItem member,
boolean visible)
Sets an item to be visible or not. |
void |
setWelcomeMessage(String gui,
String title,
String message,
String icon)
Sets a welcome message (in a popup) when a customized GUI is started. |
void |
showCustomizedSwing(String displayName,
String gui)
|
void |
showCustomizedSwing(String displayName,
String gui,
String host)
|
void |
showRowNumbers(CollectionItem collection,
boolean value)
Tells the GUI wether to show row numbers for tables and lists. |
static String |
toString(FieldItem field,
int value)
Gets the string representation of the field of an object. |
static String |
toString(FieldItem field,
Object value)
Gets the string representation of the field of an object. |
static String |
toString(Object o)
|
static String |
toString(Object o,
Stack context)
Gets the string representation of an object. |
void |
whenCloseDisplay(Display display)
Catch this event and remove the display from the handled list if exists. |
void |
whenReload()
Called when the aspect's configuration is reloaded |
void |
whenRemoteInstantiation(Wrappee newInstance,
String name)
This method updates the objects browser view when a new instance is created from a remote host. |
void |
whenUsingNewInstance(Interaction interaction)
This method updates the objects browser view when a new instance is created. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String DEFAULT_VIEW
protected static Hashtable displays
protected static Hashtable cguis
public static final String VIEWS
public static final String CREATION_ATTRIBUTES_ORDER
public static final String DEFAULTS_ATTRIBUTES_ORDER
public static final String MEMBERS_ORDERS
public static final String TABLE_MEMBERS_ORDER
public static final String TREE_ATTRIBUTES_ORDER
public static final String METHODS_ORDER
public static final String INTERACTION_HANDLER
public static final String AUTO_CREATE
public static final String AUTO_CREATE_INITIALIZER
public static final String NO_AUTO_CREATE
public static final String SORT_CRITERIA
public static final String TABLE_VIEW
public static final String SHOW_ROW_NUMBERS
public static final String EDITABLE_DEFAULT_VALUES
public static final String TO_STRING
public static final String CONTEXTUAL_TO_STRING
public static final String TOOLTIP
public static final String CONTEXTUAL_TOOLTIP
public static final String EMBEDDED_EDITOR
public static final String VISIBLE
public static final String EDITABLE
public static final String ADDABLE
public static final String REMOVABLE
public static final String CREATABLE
public static final String CATEGORIES
public static final String CATEGORIES_ICONS
public static final String CATEGORIES_LABELS
public static final String FIELD_CHOICE
public static final String FIELD_ENUM
public static final String PARAMETER_ENUMS
public static final String EDITABLE_CHOICE
public static final String EDITABLE_CHOICES
public static final String PARAMETER_CHOICES
public static final String COLLECTION_TYPE
public static final String VIEW_ON_SELECTION
public static final String SELECTION_HANDLER
public static final String SELECTION_TARGET
public static final String PARAMETER_NAMES
public static final String LINKED_PARAMETERS
public static final String PASSWORD_PARAMETERS
public static final String CREATION_ALLOWED_PARAMETERS
public static final String DEFAULT_VALUES
public static final String DYN_DEFAULT_VALUE
public static final String PARAMETER_FIELDS
public static final String CONDITION
public static final String VIEW_HEIGHT
public static final String VIEW_WIDTH
public static final String EDITOR_HEIGHT
public static final String EDITOR_WIDTH
public static final String EDITOR_COLS
public static final String EDITOR_ROWS
public static final String EDITOR_SMALL_WIDTH
public static final String EDITOR_SMALL_COLS
public static final String EDITOR_SMALL_HEIGHT
public static final String EDITOR_SMALL_ROWS
public static final String HIDDEN_TREE_RELATION
public static final String BORDER
public static final String DESCRIPTION
public static final String ICON
public static final String MENU
public static final String DISPLAY_LABEL
public static final String LABEL
public static final String CONTEXTUAL_LABEL
public static final String STYLE
public static final String NEW_WINDOW
public static final String NONVIEWABLE_ITEMS
public static final String NUM_ROWS_PER_PAGE
public static final String AUTO_CREATED_STATE
public static final String SMALL_TARGET_CONTAINER
public static final String NAVBAR
public static final String FIELD_DEPENDENCIES
public static final String LINE_BREAKS
public static final String DIRECT_COLLECTION_METHODS
public static final String DATE_FORMAT
public static final String DATEHOUR_FORMAT
public static final String FLOAT_FORMAT
public static final String FORMAT
public static final String ASKING_SEQUENCE
public static final String DESKTOP_VIEW
public static final String FILE_SELECTION_MODE
public static final String FILE_EXTENSIONS
public static final String FILE_EXTENSIONS_DESCRIPTION
public static final String FILE_CHOOSER_VIEW
public static final String INDEXED_FIELD_SELECTOR
public static final String INDEX_NOT_FOUND_HANDLER
public static final String REPOSITORY_NAME
public static final String DISPLAY_CONTEXT
public static final String ASK_FOR_PARAMETERS
public static final String AUTO_CREATION
public static final String EMBEDDED_EDITORS
public static final String SMALL_VIEW
public static final String OPPOSITE_ROLE
public static final String VIEW
public static final String OPEN_VIEW
public static final String GRAPHIC_CONTEXT
public static final String START_INDEXES
public static final int THUMB_MAX_WIDTH
public static final int THUMB_MAX_HEIGHT
public static final int THUMB_QUALITY
public static final String SORT_COLUMN
public static final String DEF_SORT
public static final String NO_COMMIT
public static final String SUBSTANCE
protected static boolean defaultShowRowNumbers
public static long dialogTimeout
Constructor Detail |
public GuiAC()
By default it defines the visible property to false for some JAC system items.
Method Detail |
public static String toString(Object o)
public static String toString(Object o, Stack context)
o
- the object
setToString(ClassItem,String)
public static String getToolTip(Object o, Stack context)
context
- a stack of meta items representing the contexto
- the object
setToolTipText(ClassItem,String)
public static Object getContextAttribute(MetaItem item, String attribute, Stack context, Object defaultValue)
item
- item holding the rulesattribute
- name of attribute holding the rulesdefaultValue
- this value is returned if there is not matching contextpublic static void pushGraphicContext(MetaItem value)
public static MetaItem popGraphicContext()
public static Stack getGraphicContext()
public static String toString(FieldItem field, Object value)
field
- the fieldvalue
- the value of the field
public static String toString(FieldItem field, int value)
field
- the fieldvalue
- the value of the field
public static final Display getDisplay(String displayID)
displayID
- the id of the displayDisplay
public static final CustomizedGUI getCustomized(String customizedID)
Display
public static Display createDisplay(String displayID, Class displayType, ViewFactory factory)
displayType
- the display typepublic void createSwingDisplays(String[] customizedIDs)
public void createWebDisplays(String[] customizedIDs)
public static void addDisplay(String displayID, Display newDisplay)
newDisplay
- the display to addDisplay
public static void removeDisplay(Display display)
display
- the display to removeDisplay
public static void registerDisplay(String name, String displayType, String guiType)
It instantiates a new display from its class name and registers its.
name
- the display namedisplayType
- the display typepublic void registerCustomized(String name)
GuiConf
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.
registerCustomized
in interface GuiConf
name
- the new customized GUI namepublic void showCustomizedSwing(String displayName, String gui, String host)
public void showCustomizedSwing(String displayName, String gui)
public void setWelcomeMessage(String gui, String title, String message, String icon)
GuiConf
setWelcomeMessage
in interface GuiConf
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 setStyle(FieldItem field, String style)
FieldAppearenceGuiConf
setStyle
in interface FieldAppearenceGuiConf
field
- the fieldstyle
- the CSS styleClassAppearenceGuiConf.setStyle(ClassItem,String)
public void setStyle(ClassItem cli, String style)
ClassAppearenceGuiConf
setStyle
in interface ClassAppearenceGuiConf
cli
- the classstyle
- the CSS styleFieldAppearenceGuiConf.setStyle(FieldItem,String)
public void setOnCloseHandler(String gui, AbstractMethodItem eventHandler)
GuiConf
setOnCloseHandler
in interface GuiConf
gui
- the customized gui IDeventHandler
- the event handlerpublic void addStatusBar(String gui, MethodItem method, String position)
GuiConf
addStatusBar
in interface GuiConf
gui
- the name of the customized GUImethod
- the method that returns the textposition
- UP||BOTTOMpublic void addStatusBar(String gui, String position)
GuiConf
showStatus
method.
addStatusBar
in interface GuiConf
gui
- the name of the customized GUIposition
- UP||BOTTOMGuiConf.addStatusBar(String,MethodItem,String)
public void setSubPanesGeometry(String gui, int subPanesCount, String geometry)
GuiConf
setSubPanesGeometry(int,int,String[])
with all the
panes scrollable.
The GUI must have been declared.
setSubPanesGeometry
in interface GuiConf
gui
- the GUI namesubPanesCount
- the number of subpanes in the windowgeometry
- the geometry = VERTICAL || HORIZONTAL ||
VERTICAL_LEFT || VERTICAL_RIGHT || HORIZONTAL_UP ||
HORIZONTAL_DOWN || NONE
GuiConf.registerCustomized(String)
,
GuiConf.setSubPanesGeometry(String,int,String,boolean[])
public void setSubPanesGeometry(String gui, int subPanesCount, String geometry, boolean[] scrollings)
GuiConf
The GUI must have been declared.
setSubPanesGeometry
in interface GuiConf
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 scrollableGuiConf.registerCustomized(String)
,
GuiConf.setSubPanesGeometry(String,int,String)
public void setPaneContent(String gui, String paneId, String type, String[] args)
GuiConf
The GUI must have been declared.
setPaneContent
in interface GuiConf
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 viewGuiConf.registerCustomized(String)
,
GuiConf.setViewConstructor(String,String,AbstractMethodItem)
public void setPaneContainer(String gui, String paneId, String type)
GuiConf
setPaneContainer
in interface GuiConf
gui
- the GUI namepaneId
- the panel id (see the geometry to know its
placement)type
- the type of the containerGuiConf.registerCustomized(String)
,
GuiConf.setViewConstructor(String,String,AbstractMethodItem)
public void setInvalidPane(String gui, String changedPane, String invalidPane)
GuiConf
setInvalidPane
in interface GuiConf
gui
- the GUI namechangedPane
- the pane to watchinvalidPane
- the pane to invalidate when the watched
pane's content changespublic void addReferenceToPane(String gui, MemberItem field, String panePath)
GuiConf
Note that, for a method member, a displayabe object should be returned by the method. Otherwise, a runtime error will happen.
addReferenceToPane
in interface GuiConf
gui
- the GUI namefield
- the member (reference, collection, or method)panePath
- the ID of the pane where the view must be openedGuiConf.registerCustomized(String)
,
#addReferenceToPane(String,FieldItem,,String,Boolean,String)
public void addReferenceToPane(String gui, MemberItem member, String viewType, String[] viewParams, Boolean small, String paneId)
GuiConf
The GUI must have been declared.
addReferenceToPane
in interface GuiConf
gui
- the GUI namemember
- the field (reference of collection)viewType
- the type of the view to opensmall
- tell if the viewed object in this pane should be
smallpaneId
- the path of the panel where the view must be
opened (GuiConf.registerCustomized(String)
,
#addReferenceToPane(String,FieldItem,String)
,
CustomizedGUI#addReferenceToPane(FieldItem,String,String)
public void newWindow(String gui, String className, String fieldName)
public void setCustomizedIcon(String gui, String icon)
GuiConf
setCustomizedIcon
in interface GuiConf
icon
- the name of the iconpublic void setPosition(String gui, int left, int up, int width, int height)
GuiConf
The GUI must have been declared.
setPosition
in interface GuiConf
gui
- the GUI nameleft
- left-border pixelup
- upper-border pixelwidth
- in percentage regarding the screenheight
- in percentage regarding the screenGuiConf.registerCustomized(String)
,
CustomizedGUI.setPosition(int,int,int,int)
public void addMenuItem(String gui, String menu, String[] menuPath, AbstractMethodItem callback)
GuiConf
addMenuItem
in interface GuiConf
gui
- the GUI namemenu
- the menu namemenuPath
- the path of the menu item.callback
- the callback method for that menu item. It must be
a static method with no arguments.GuiConf.registerCustomized(String)
,
#addMenuItem(String,String[],String,AbstractMethodItem)
,
#addMenuItem(String,String[],String,AbstractMethodItem,String[])
public void addMenuItem(String gui, String menu, String[] menuPath, String objectName, AbstractMethodItem callback)
GuiConf
addMenuItem
in interface GuiConf
gui
- the GUI namemenu
- the menu namemenuPath
- the path of the menu item.objectName
- the name of the object on which to invoke the methodcallback
- the callback method for that menu item. It must be
an instance method with no arguments.GuiConf.registerCustomized(String)
,
#addMenuItem(String,String[],AbstractMethodItem)
,
#addMenuItem(String,String[],AbstractMethodItem,String[])
public void addMenuItem(String gui, String menu, String[] menuPath, AbstractMethodItem callback, String[] parameters)
GuiConf
addMenuItem
in interface GuiConf
gui
- the GUI namemenu
- the menu namemenuPath
- the path of the menu item.callback
- 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 calledGuiConf.registerCustomized(String)
,
#addMenuItem(String,String[],AbstractMethodItem)
,
#addMenuItem(String,String[],String,AbstractMethodItem)
,
#addMenuItem(String,String[],String,AbstractMethodItem,String[])
public void addMenuItem(String gui, String menu, String[] menuPath, String objectName, AbstractMethodItem callback, String[] parameters)
GuiConf
addMenuItem
in interface GuiConf
gui
- the GUI namemenu
- the menu namemenuPath
- the path of the menu item.objectName
- the name of the object on which to invoke the methodcallback
- 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 calledGuiConf.registerCustomized(String)
,
#addMenuItem(String,String[],AbstractMethodItem)
,
#addMenuItem(String,String[],AbstractMethodItem,String[])
,
#addMenuItem(String,String[],String,AbstractMethodItem)
public void addMenuSeparator(String gui, String menu, String[] menuPath)
GuiConf
addMenuSeparator
in interface GuiConf
gui
- the GUI namemenuPath
- the path of the menu item separator.GuiConf.registerCustomized(String)
public void setMenuPosition(String gui, String menu, String position)
GuiConf
setMenuPosition
in interface GuiConf
gui
- the customized GUImenu
- the menu nameposition
- the position of the menu (TOP, BOTTOM, LEFT or RIGHT)public void setMenuIcon(String gui, String menu, String[] menuPath, String icon)
GuiConf
setMenuIcon
in interface GuiConf
gui
- the GUI namemenuPath
- the path of the menuicon
- the name of the iconGuiConf.registerCustomized(String)
public void addToolbarAction(String gui, AbstractMethodItem method)
GuiConf
addToolbarAction
in interface GuiConf
gui
- the GUI namemethod
- the callback method for that button. It must be a
static method with no arguments.GuiConf.addToolbarAction(String,String,AbstractMethodItem)
,
GuiConf.registerCustomized(String)
public void addToolbarAction(String gui, String objectName, AbstractMethodItem method)
GuiConf
addToolbarAction
in interface GuiConf
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.GuiConf.addToolbarAction(String,AbstractMethodItem)
,
GuiConf.registerCustomized(String)
public void addToolbarSeparator(String gui)
GuiConf
addToolbarSeparator
in interface GuiConf
gui
- the GUI nameGuiConf.registerCustomized(String)
public void setSplitterLocation(String gui, int splitterId, float location)
GuiConf
The GUI must have been declared.
setSplitterLocation
in interface GuiConf
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
componentsGuiConf.registerCustomized(String)
,
CustomizedGUI.setSplitterLocation(int,float)
public void setTitle(String gui, String title)
GuiConf
The GUI must have been declared.
setTitle
in interface GuiConf
gui
- the GUI nametitle
- the window titleGuiConf.registerCustomized(String)
public void addStyleSheetURL(String gui, String url)
GuiConf
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)
addStyleSheetURL
in interface GuiConf
gui
- the customized GUI the style sheets applies tourl
- the URL stringGuiConf.addStyleSheetURL(String)
public void addStyleSheetURL(String url)
GuiConf
addStyleSheetURL
in interface GuiConf
url
- the URL stringGuiConf.addStyleSheetURL(String,String)
public static Vector getStyleSheetURLs()
public void setLoggingMethod(String gui, String objects, String classes, String methods, int paneID)
GuiConf
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.
setLoggingMethod
in interface GuiConf
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)GuiConf.registerCustomized(String)
,
GuiConf.setSubPanesGeometry(String,int,String)
public void defineResource(String type, String name, String path)
defineResource
in interface GuiConf
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 setIcon(ClassItem classItem, String name)
ClassAppearenceGuiConf
setIcon
in interface ClassAppearenceGuiConf
classItem
- the classname
- the icon's resource namepublic void setIcon(MemberItem member, String name)
FieldAppearenceGuiConf
setIcon
in interface FieldAppearenceGuiConf
name
- the icon's resource namepublic static String getIcon(MetaItem item)
setIcon(ClassItem,String)
,
setIcon(MemberItem,String)
public void hideTreeRelation(FieldItem field)
FieldAppearenceGuiConf
hideTreeRelation
in interface FieldAppearenceGuiConf
field
- the fieldpublic void setMenu(ClassItem classItem, String[] menu)
ClassAppearenceGuiConf
setMenu
in interface ClassAppearenceGuiConf
classItem
- the classmenu
- 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 addedpublic static MethodItem[] getMenu(ClassItem classItem)
public void whenCloseDisplay(Display display)
whenCloseDisplay
in interface BaseProgramListener
whenCloseDisplay
in class AspectComponent
display
- the closing displaypublic void whenReload()
AspectComponent
whenReload
in class AspectComponent
public void beforeReload()
beforeReload
in class AspectComponent
public void setDefaults()
public void askForParameters(String classExpr)
GuiConf
InputWrapper.askForParameters
on all methods with
parameters.
It permits to dynamically call methods, and so display something when user clicks on buttons.
askForParameters
in interface GuiConf
classExpr
- the classesprotected void notifyDisplaysForNewObject(Object newObject)
newObject
method of the
displays.
newObject
- the newly created objectDisplay
public void afterApplicationStarted()
BaseProgramListener
method is to notify the display with the
applicationStarted
event.
afterApplicationStarted
in interface BaseProgramListener
afterApplicationStarted
in class AspectComponent
Display.applicationStarted()
public static String getLocalSessionID()
protected String getDefaultProgramName()
By default, it returns the package path name of the current GUI aspect (must be right most of the time).
public void whenUsingNewInstance(Interaction interaction)
If it does not exist yet, this method also creates a main GUI window when the first drawable instance is created.
whenUsingNewInstance
in interface BaseProgramListener
whenUsingNewInstance
in class AspectComponent
AspectComponent.weave()
public void whenRemoteInstantiation(Wrappee newInstance, String name)
If it does not exist yet, this method also creates a main GUI window when the first drawable instance is created.
whenRemoteInstantiation
in interface BaseProgramListener
whenRemoteInstantiation
in class AspectComponent
newInstance
- the instance that have been created by a
remote hostNamingAC.whenRemoteInstantiation(Wrappee,String)
public void setVisible(MemberItem member, boolean visible)
FieldAppearenceGuiConf
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.
setVisible
in interface FieldAppearenceGuiConf
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 visibleisVisible(MetaItem)
public void setEditable(FieldItem field, boolean editable)
FieldAppearenceGuiConf
setEditable
in interface FieldAppearenceGuiConf
field
- the fieldeditable
- the flag (true is default)public void setAddable(String cl, String collectionName, boolean addable)
public void setRemovable(String cl, String collectionName, boolean removable)
public void setEditableDefaultValues(CollectionItem collection, boolean editable)
BehaviorGuiConf
setEditableDefaultValues
in interface BehaviorGuiConf
public static boolean hasEditableDefaultValues(MetaItem metaItem)
public static boolean isVisible(Object substance, MetaItem metaItem)
substance
- the object holding the meta itemmetaItem
- the meta item to check
setVisible(MemberItem,boolean)
,
isVisible(Object,MetaItem)
public static boolean isVisible(MetaItem metaItem)
metaItem
- the meta item to check
setVisible(MemberItem,boolean)
,
isVisible(MetaItem)
public static boolean isEditable(Object substance, FieldItem field)
substance
- the object holding the field itemfield
- the field item to check
public static boolean isEditable(FieldItem field)
field
- the field item to check
public static boolean isCreatable(ClassItem cli)
cli
- the classpublic static boolean isAddable(CollectionItem collection)
collection
- the collection item to check
public static boolean isAddable(Object substance, CollectionItem collection)
substance
- the object holding the field itemcollection
- the collection item to check
public static boolean isRemovable(CollectionItem collection)
collection
- the collection item to check
public static boolean isRemovable(Object substance, CollectionItem collection)
substance
- the object holding the field itemcollection
- the collection item to check
public void setVisible(ClassItem cl, String[] itemNames, boolean visible)
public void setEmbeddedEditors(ClassItem cli)
FieldAppearenceGuiConf
setEmbeddedEditors
in interface FieldAppearenceGuiConf
cli
- the class itemFieldEditor
public void setEmbeddedEditor(MemberItem member)
FieldAppearenceGuiConf
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.
setEmbeddedEditor
in interface FieldAppearenceGuiConf
FieldEditor
public void setEmbeddedEditors(CollectionItem collection, String viewName, boolean embedded)
FieldAppearenceGuiConf
setEmbeddedEditors
in interface FieldAppearenceGuiConf
collection
- viewName
- embedded
- #setEmbeddedEditors(CollectionItem,String,MemberItem[])
public void setEmbeddedEditorColumns(CollectionItem collection, String viewName, MemberItem[] members)
FieldAppearenceGuiConf
setEmbeddedEditorColumns
in interface FieldAppearenceGuiConf
collection
- viewName
- members
- FieldAppearenceGuiConf.setEmbeddedEditors(CollectionItem,String,boolean)
public void setViewType(FieldItem field, String viewName, String viewType)
FieldAppearenceGuiConf
setViewType
in interface FieldAppearenceGuiConf
public static boolean isEmbeddedEditor(MetaItem item)
hasEmbeddedEditors(ClassItem)
,
setEmbeddedEditor(MemberItem)
public static boolean isEmbeddedEditors()
public static boolean hasEmbeddedEditors(ClassItem cli)
isEmbeddedEditor(MetaItem)
,
setEmbeddedEditor(MemberItem)
public void setBorder(FieldItem field, String alignment, String style)
FieldAppearenceGuiConf
setBorder
in interface FieldAppearenceGuiConf
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.FieldAppearenceGuiConf.setBorder(FieldItem)
public void setBorder(FieldItem field)
FieldAppearenceGuiConf
setBorder
in interface FieldAppearenceGuiConf
field
- the fieldFieldAppearenceGuiConf.setBorder(FieldItem,String,String)
public static Border getBorder(FieldItem field)
public void setCondition(AbstractMethodItem method, String condition)
MethodAppearenceGuiConf
setCondition
in interface MethodAppearenceGuiConf
method
- the method to put a condition oncondition
- the condition. It must be the name of method of
the same class as method which returns a boolean.public static MethodItem getCondition(AbstractMethodItem method)
public static boolean isEnabled(AbstractMethodItem method, Object substance)
public void setMethodParametersWidth(AbstractMethodItem method, int[] width, int[] columns) throws Exception
MethodAppearenceGuiConf
setMethodParametersWidth
in interface MethodAppearenceGuiConf
method
- the methodwidth
- width in pixels of all parameterscolumns
- width in columns of all parameters
Exception
public static int[] getMethodParametersWidth(AbstractMethodItem method)
method
- the methodsetMethodParametersWidth(AbstractMethodItem,int[],int[])
public static int[] getMethodParametersCols(AbstractMethodItem method)
method
- the methodsetMethodParametersWidth(AbstractMethodItem,int[],int[])
public void setMethodParametersHeight(AbstractMethodItem method, int[] height, int[] rows) throws Exception
MethodAppearenceGuiConf
setMethodParametersHeight
in interface MethodAppearenceGuiConf
method
- the methodheight
- height in pixels of all parametersrows
- height in columns of all parameters
Exception
public static int[] getMethodParametersHeight(AbstractMethodItem method)
method
- the methodsetMethodParametersHeight(AbstractMethodItem,int[],int[])
public static int[] getMethodParametersRows(AbstractMethodItem method)
method
- the methodsetMethodParametersHeight(AbstractMethodItem,int[],int[])
public void setDefaultEditorWidth(VirtualClassItem type, int width, int columns)
FieldAppearenceGuiConf
setDefaultEditorWidth
in interface FieldAppearenceGuiConf
width
- the editor width in pixel (typically used by
SWING)columns
- the editor width in character columns (typically
used by the WEB)FieldAppearenceGuiConf.setDefaultEditorWidth(ClassItem,int,int)
,
FieldAppearenceGuiConf.setDefaultEditorHeight(VirtualClassItem,int,int)
,
FieldAppearenceGuiConf.setEditorWidth(FieldItem,int,int)
public void setDefaultEditorWidth(ClassItem type, int width, int columns)
FieldAppearenceGuiConf
setDefaultEditorWidth
in interface FieldAppearenceGuiConf
width
- the editor width in pixel (typically used by
SWING)columns
- the editor width in character columns (typically
used by the WEB)FieldAppearenceGuiConf.setDefaultEditorWidth(VirtualClassItem,int,int)
,
FieldAppearenceGuiConf.setDefaultEditorHeight(VirtualClassItem,int,int)
,
FieldAppearenceGuiConf.setEditorWidth(FieldItem,int,int)
public static int getEditorWidth(MetaItem type)
public static int getEditorColumns(MetaItem type)
public void setEditorWidth(FieldItem field, int width, int columns)
FieldAppearenceGuiConf
setEditorWidth
in interface FieldAppearenceGuiConf
field
- the fieldwidth
- the editor width in pixel (typically used by
SWING)columns
- the editor width in character columns (typically
used by the WEB)FieldAppearenceGuiConf.setEmbeddedEditor(MemberItem)
,
FieldAppearenceGuiConf.setEditorHeight(FieldItem,int,int)
,
FieldAppearenceGuiConf.setDefaultEditorWidth(ClassItem,int,int)
public static int getEditorWidth(FieldItem field)
field
- the fieldsetEditorWidth(FieldItem,int,int)
public static int getEditorCols(FieldItem field)
field
- the fieldsetEditorWidth(FieldItem,int,int)
public static int getEditorRows(FieldItem field)
field
- the fieldsetEditorHeight(FieldItem,int,int)
public static int getEditorRows(MetaItem type)
public void setSmallEditorWidth(FieldItem field, int width, int columns)
public void setDefaultEditorHeight(VirtualClassItem type, int height, int rows)
FieldAppearenceGuiConf
setDefaultEditorHeight
in interface FieldAppearenceGuiConf
height
- the editor height in pixelrows
- the editor height in character rowsFieldAppearenceGuiConf.setDefaultEditorHeight(ClassItem,int,int)
,
FieldAppearenceGuiConf.setDefaultEditorWidth(VirtualClassItem,int,int)
,
FieldAppearenceGuiConf.setEditorHeight(FieldItem,int,int)
public void setDefaultEditorHeight(ClassItem type, int height, int rows)
FieldAppearenceGuiConf
setDefaultEditorHeight
in interface FieldAppearenceGuiConf
height
- the editor height in pixelrows
- the editor height in character rowsFieldAppearenceGuiConf.setDefaultEditorHeight(VirtualClassItem,int,int)
,
FieldAppearenceGuiConf.setDefaultEditorWidth(VirtualClassItem,int,int)
,
FieldAppearenceGuiConf.setEditorHeight(FieldItem,int,int)
public void setEditorHeight(FieldItem field, int height, int rows)
FieldAppearenceGuiConf
setEditorHeight
in interface FieldAppearenceGuiConf
field
- the fieldheight
- the editor height in pixelrows
- the editor height in character rowsFieldAppearenceGuiConf.setEmbeddedEditor(MemberItem)
,
FieldAppearenceGuiConf.setEditorWidth(FieldItem,int,int)
,
FieldAppearenceGuiConf.setDefaultEditorHeight(ClassItem,int,int)
public void setSmallEditorHeight(FieldItem field, int height, int rows)
public void setFontAttribute(String attribute, String value)
GuiConf
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:
setFontAttribute
in interface GuiConf
attribute
- the name of the attributevalue
- the value for the attributepublic static Map getFontAttributes()
public void setCategories(ClassItem cli, String[] categories)
ClassAppearenceGuiConf
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.
setCategories
in interface ClassAppearenceGuiConf
cli
- the class itemcategories
- the categories for this classFieldAppearenceGuiConf.setCategory(MemberItem,String)
public void setCategory(MemberItem member, String category)
FieldAppearenceGuiConf
The category must correspond to one of these defined on the
class with the setCategories
configuration method.
setCategory
in interface FieldAppearenceGuiConf
member
- the member to categorize (a method or a field)category
- the existing category nameFieldAppearenceGuiConf.setCategories(MemberItem,String[])
,
ClassAppearenceGuiConf.setCategories(ClassItem,String[])
public void setCategories(MemberItem member, String[] categories)
FieldAppearenceGuiConf
The category must correspond to one of these defined on the
class with the setCategories
configuration method.
setCategories
in interface FieldAppearenceGuiConf
member
- the member to categorize (a method or a field)categories
- the existing category namesFieldAppearenceGuiConf.setCategory(MemberItem,String)
,
ClassAppearenceGuiConf.setCategories(ClassItem,String[])
public static String[] getCategories(MemberItem field)
public static boolean isMemberInCategory(MemberItem member, String category)
setCategory(MemberItem,String)
,
setCategories(MemberItem,String[])
public void checkCategories(ClassItem cli, int length)
public void setCategoriesIcons(ClassItem cli, String[] icons)
ClassAppearenceGuiConf
setCategoriesIcons
in interface ClassAppearenceGuiConf
icons
- the icons for the categoriesClassAppearenceGuiConf.setCategories(ClassItem,String[])
public static String[] getCategoriesIcons(ClassItem cl)
cl
- the class.
public void setCategoriesLabels(ClassItem cli, String[] labels)
ClassAppearenceGuiConf
setCategoriesLabels
in interface ClassAppearenceGuiConf
ClassAppearenceGuiConf.setCategories(ClassItem,String[])
public static String[] getCategoriesLabels(ClassItem cl)
cl
- the class
public void setEmbeddedView(MemberItem member)
FieldAppearenceGuiConf
setEmbeddedView
in interface FieldAppearenceGuiConf
member
- the member (reference field or method) that must
be embeddedpublic void setEmbeddedView(MemberItem member, boolean embedded)
public void setEmbeddedView(MemberItem member, String viewName, boolean embedded)
public void setEmbeddedAdder(CollectionItem collection, boolean embedded)
FieldAppearenceGuiConf
setEmbeddedAdder
in interface FieldAppearenceGuiConf
collection
- the collectionembedded
- wether to use an embedded view for the adderpublic void setDesktopCustomizedView(ClassItem classItem, ClassItem type)
setDesktopCustomizedView
in interface ClassAppearenceGuiConf
classItem
- the class of the viewed objectstype
- the class of the view component
public void setTableView(FieldItem field)
FieldAppearenceGuiConf
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).
setTableView
in interface FieldAppearenceGuiConf
field
- the field that contains the collectionpublic void showRowNumbers(CollectionItem collection, boolean value)
FieldAppearenceGuiConf
showRowNumbers
in interface FieldAppearenceGuiConf
collection
- the affected collectionvalue
- wether to show row numbersFieldAppearenceGuiConf.setDefaultShowRowNumbers(boolean)
public void setDefaultShowRowNumbers(boolean value)
FieldAppearenceGuiConf
setDefaultShowRowNumbers
in interface FieldAppearenceGuiConf
value
- wether to show row numbersFieldAppearenceGuiConf.showRowNumbers(CollectionItem,boolean)
public static boolean isShowRowNumbers(CollectionItem collection)
public void setToString(ClassItem classItem, String formatExpression)
ClassAppearenceGuiConf
setToString
in interface ClassAppearenceGuiConf
classItem
- the classformatExpression
- 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 (%%
).ClassAppearenceGuiConf.setToString(ClassItem,MemberItem,String)
,
ClassAppearenceGuiConf.setToolTipText(ClassItem,MemberItem,String)
,
ClassAppearenceGuiConf.setToolTipText(ClassItem,ClassItem,String)
public void setToString(ClassItem classItem, MemberItem selector, String formatExpression)
ClassAppearenceGuiConf
setToString
in interface ClassAppearenceGuiConf
classItem
- the classselector
- 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 (%%
).ClassAppearenceGuiConf.setToString(ClassItem,String)
,
ClassAppearenceGuiConf.setToString(ClassItem,MemberItem,String)
,
ClassAppearenceGuiConf.setToolTipText(ClassItem,MemberItem,String)
,
ClassAppearenceGuiConf.setToolTipText(ClassItem,ClassItem,String)
public void setToString(ClassItem classItem, ClassItem selector, String formatExpression)
ClassAppearenceGuiConf
setToString
in interface ClassAppearenceGuiConf
classItem
- the classselector
- 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 (%%
).ClassAppearenceGuiConf.setToString(ClassItem,String)
,
ClassAppearenceGuiConf.setToString(ClassItem,MemberItem,String)
,
ClassAppearenceGuiConf.setToolTipText(ClassItem,MemberItem,String)
,
ClassAppearenceGuiConf.setToolTipText(ClassItem,ClassItem,String)
public void setToolTipText(ClassItem classItem, String formatExpression)
ClassAppearenceGuiConf
setToolTipText
in interface ClassAppearenceGuiConf
classItem
- the classformatExpression
- 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 (%%
).ClassAppearenceGuiConf.setToolTipText(ClassItem,ClassItem,String)
,
ClassAppearenceGuiConf.setToolTipText(ClassItem,MemberItem,String)
public void setToolTipText(ClassItem classItem, MemberItem selector, String formatExpression)
ClassAppearenceGuiConf
setToolTipText
in interface ClassAppearenceGuiConf
classItem
- the classselector
- 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 (%%
).ClassAppearenceGuiConf.setToolTipText(ClassItem,String)
,
ClassAppearenceGuiConf.setToolTipText(ClassItem,ClassItem,String)
public void setToolTipText(ClassItem classItem, ClassItem selector, String formatExpression)
ClassAppearenceGuiConf
setToolTipText
in interface ClassAppearenceGuiConf
classItem
- the classselector
- 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 (%%
).ClassAppearenceGuiConf.setToolTipText(ClassItem,String)
,
ClassAppearenceGuiConf.setToolTipText(ClassItem,MemberItem,String)
public void setDefaultSortedColumn(CollectionItem collection, String column)
FieldAppearenceGuiConf
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.
setDefaultSortedColumn
in interface FieldAppearenceGuiConf
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 setDefaultSortedColumn(ClassItem cl, String column)
ClassAppearenceGuiConf
setDefaultSortedColumn
in interface ClassAppearenceGuiConf
cl
- the classcolumn
- 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 static String getDefaultSortedColumn(CollectionItem collection)
public void setAutoCreate(FieldItem field)
BehaviorGuiConf
This features makes the GUI more usable in many cases (otherwhise, a intermediate step is asked to the user for creating or picking an existing instance).
setAutoCreate
in interface BehaviorGuiConf
field
- the field to be auto-createdpublic static boolean isAutoCreate(FieldItem field)
public void setAutoCreateInitializer(FieldItem field, MethodItem initializer)
BehaviorGuiConf
setAutoCreateInitializer
in interface BehaviorGuiConf
field
- the field whose autocreate behaviour is consideredinitializer
- method used to initialize new objects. It
must be a method of the field's owning class that takes an
instance of the auto created object as parameter.BehaviorGuiConf.setAutoCreate(FieldItem)
public static MethodItem getInitiliazer(FieldItem field)
field
- the fieldsetAutoCreateInitializer(FieldItem,MethodItem)
public void setAutoCreateParameters(AbstractMethodItem method)
BehaviorGuiConf
It does not use the constructor view but the actual modal view on an empty created object that needs to be filled by the user.
setAutoCreateParameters
in interface BehaviorGuiConf
method
- the methodpublic static boolean isAutoCreateParameters(AbstractMethodItem method)
public void setAutoCreateAll(ClassItem cl)
BehaviorGuiConf
setAutoCreateAll
in interface BehaviorGuiConf
cl
- the classpublic void setAutoCreateParametersEx(ClassItem cli, String[] excludedMethods)
BehaviorGuiConf
setAutoCreateParametersEx
in interface BehaviorGuiConf
cli
- the classexcludedMethods
- the excluded methods namespublic void setAutoCreateState(ClassItem cli, String[] fields)
BehaviorGuiConf
When a wrappee of the given class is auto-created using the
setAutoCreateParameters
method, all the fields
mentioned here are also autocreated afterwards and a modal view
is shown to the user so that he can fill the values. The given
fields should be references (on other wrappees).
setAutoCreateState
in interface BehaviorGuiConf
cli
- the classfields
- the fields to autocreateBehaviorGuiConf.setAutoCreateParameters(AbstractMethodItem)
public void setOpenViewMethod(ClassItem cli, String methodName)
BehaviorGuiConf
setOpenViewMethod
in interface BehaviorGuiConf
cli
- the classmethodName
- the method nameDisplay.openView(Object)
public void declareView(ClassItem cli, String viewName, String parentViewName)
public void declareView(ClassItem cli, String viewName)
public static ObjectView getView(ClassItem cli, String viewName)
public static MemberItemView getView(MemberItem member, String viewName)
public static CollectionItemView getView(CollectionItem collection, String viewName)
public void setAttributesOrder(ClassItem cli, String[] attributeNames)
ClassAppearenceGuiConf
Attributes not listed here will not be rendered. This order
is also used for tableView rendered collections if the
setTableMembersOrder
method is not used.
setAttributesOrder
in interface ClassAppearenceGuiConf
cli
- the classattributeNames
- the name of the attributes in the
rendering orderClassAppearenceGuiConf.setTableMembersOrder(ClassItem,String[])
,
FieldAppearenceGuiConf.setMembersOrder(CollectionItem,ClassItem,String[])
public void setAttributesOrder(ClassItem cli, String viewName, String[] attributeNames)
public void setLineBreaks(ClassItem cli, String[] fields)
ClassAppearenceGuiConf
setLineBreaks
in interface ClassAppearenceGuiConf
cli
- the classfields
- the names fields which should start on a
new line.public void setMethodsOrder(ClassItem cli, String[] methodNames)
ClassAppearenceGuiConf
Methods not listed here will not be rendered.
setMethodsOrder
in interface ClassAppearenceGuiConf
cli
- the class namemethodNames
- the name of the methods in the
rendering orderpublic void setMethodsOrder(ClassItem cli, String viewName, String[] methodNames)
public void setCreationAttributesOrder(ClassItem cli, String[] attributeNames)
ClassAppearenceGuiConf
setCreationAttributesOrder
in interface ClassAppearenceGuiConf
cli
- the class nameattributeNames
- the name of the attributes in the
rendering orderClassAppearenceGuiConf.setAttributesOrder(ClassItem,String[])
public static FieldItem[] getCreationAttributesOrder(ClassItem cl)
public static boolean isCreationAttribute(FieldItem field)
public void setMembersOrder(CollectionItem collection, ClassItem targetClass, String[] memberNames)
FieldAppearenceGuiConf
setMembersOrder
in interface FieldAppearenceGuiConf
collection
- the collectiontargetClass
- the class of attributes to rendermemberNames
- the name of the members in the
rendering orderFieldAppearenceGuiConf.setMembersOrder(CollectionItem,String,ClassItem,String[])
,
ClassAppearenceGuiConf.setTableMembersOrder(ClassItem,String[])
,
ClassAppearenceGuiConf.setAttributesOrder(ClassItem,String[])
public void setMembersOrder(CollectionItem collection, String viewName, ClassItem targetClass, String[] memberNames)
FieldAppearenceGuiConf
setMembersOrder
in interface FieldAppearenceGuiConf
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 orderFieldAppearenceGuiConf.setMembersOrder(CollectionItem,ClassItem,String[])
public static MemberItem[] getMembersOrder(CollectionItem collection, String viewName)
public void setTableMembersOrder(ClassItem cli, String[] memberNames)
ClassAppearenceGuiConf
Attributes not listed here will not be rendered.
setTableMembersOrder
in interface ClassAppearenceGuiConf
cli
- the class namememberNames
- the name of the member in the
rendering orderClassAppearenceGuiConf.setAttributesOrder(ClassItem,String[])
,
FieldAppearenceGuiConf.setMembersOrder(CollectionItem,ClassItem,String[])
public void setTreeAttributesOrder(ClassItem cli, String[] attributeNames)
ClassAppearenceGuiConf
Attributes not listed here will not be rendered.
setTreeAttributesOrder
in interface ClassAppearenceGuiConf
cli
- the class nameattributeNames
- the name of the attributes in the
rendering orderClassAppearenceGuiConf.setAttributesOrder(ClassItem,String[])
,
FieldAppearenceGuiConf.setMembersOrder(CollectionItem,ClassItem,String[])
public void setFieldChoice(FieldItem field, Boolean editable, String[] choice)
FieldAppearenceGuiConf
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.
setFieldChoice
in interface FieldAppearenceGuiConf
field
- the fieldchoice
- the values the user will have to choose from when
a edition of the field is performedFieldAppearenceGuiConf.setDynamicFieldChoice(FieldItem,Boolean,ClassItem,String)
,
FieldAppearenceGuiConf.setFieldChoice(FieldItem,Boolean,String[])
,
FieldAppearenceGuiConf.setFieldEnum(FieldItem,String)
,
GuiConf.defineEnum(String,String[],int,int)
public void setFieldEnum(FieldItem field, String enumName)
FieldAppearenceGuiConf
Declare a field as an enumeration.
setFieldEnum
in interface FieldAppearenceGuiConf
field
- the fieldenumName
- the name of the enumerationGuiConf.defineEnum(String,String[],int,int)
,
FieldAppearenceGuiConf.setFieldChoice(FieldItem,Boolean,String[])
,
FieldAppearenceGuiConf.setDynamicFieldChoice(FieldItem,Boolean,ClassItem,String)
public void setParameterEnums(AbstractMethodItem method, String[] enumNames) throws Exception
MethodAppearenceGuiConf
setParameterEnums
in interface MethodAppearenceGuiConf
method
- the methodenumNames
- the name of enums, for each parameter of the
method. Use null to leave a parameter unaffected.
Exception
public void setLinkedParameters(AbstractMethodItem method, String[] collections) throws Exception
MethodAppearenceGuiConf
setLinkedParameters
in interface MethodAppearenceGuiConf
method
- the methodcollections
- the entire names of the collections that
should be linked to the corresponding parameters (empty string
if unlinked)
Exception
public void setDefaultValue(FieldItem field, MethodItem method, String value)
FieldAppearenceGuiConf
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
.
setDefaultValue
in interface FieldAppearenceGuiConf
field
- the fieldmethod
- a static method that returns the default value
(prototype: Object m(FieldItem,String))value
- the string representation of the default valuegetDefaultValue(FieldItem,String)
public void setDefaultValue(FieldItem field, String value)
FieldAppearenceGuiConf
Same as setDefaultValue(ClassItem, String, MethodItem, String)
using default MethodItem GuiAC.getDefaultValue
.
setDefaultValue
in interface FieldAppearenceGuiConf
field
- the fieldvalue
- the string representation of the default valuegetDefaultValue(FieldItem,String)
,
FieldAppearenceGuiConf.setDefaultValue(FieldItem,MethodItem,String)
public static boolean hasDefaultValue(FieldItem field)
public static boolean isEditableChoice(FieldItem field)
public void setDynamicFieldChoice(FieldItem field, Boolean editable, ClassItem targetClass, String targetMethod)
FieldAppearenceGuiConf
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.
setDynamicFieldChoice
in interface FieldAppearenceGuiConf
field
- the fieldtargetClass
- the class that contains the target methodtargetMethod
- name of a static method within the target
class that returns the values to choose from. It must take an
Object as parameter which will be the instance to which the
field belongs to.public void setDynamicFieldChoice(FieldItem field, Boolean editable, MethodItem targetMethod)
FieldAppearenceGuiConf
setFieldChoice
but with dynamically defined values.
setDynamicFieldChoice
in interface FieldAppearenceGuiConf
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.FieldAppearenceGuiConf.setDynamicFieldChoice(FieldItem,Boolean,ClassItem,String)
public void setMethodDynamicParameterChoice(MethodItem method, ClassItem[] targetClasses, String[] targetMethods, boolean[] editable)
MethodAppearenceGuiConf
setDynamicFieldChoice
but for method parameters
The values are dynamically defined at runtime by the invocation of a static target method. This target method must return an array of objects that contains the possible new values for the fields.
setMethodDynamicParameterChoice
in interface MethodAppearenceGuiConf
method
- the methodtargetClasses
- the array of classes that contains the
target method for each parameter (elements of this array may be null)targetMethods
- the static methods within the target
classes that returns the values to choose from (elements of this
array may be null). The prototype is
callback(Object)
where the given object is the
substance.editable
- tells if the values can be edited (new values
can be manually entered)public void setCollectionType(CollectionItem collection, String type)
FieldAppearenceGuiConf
If this method is not used, the collection type can be dynamically found out by the GUI from the adder's argument types.
setCollectionType
in interface FieldAppearenceGuiConf
collection
- the collection within this classtype
- the type of this collection (an exiting class name)public void setURLSelectionMode(String cl, String fieldName, String mode, String[] extensions, String extensionsDescription)
cl
- the class namefieldName
- the field within this class (URL type)mode
- the selection mode (DIRECTORIES_ONLY ||
FILES_AND_DIRECTORIES), default is FILES_ONLYextensions
- the selection extensions (gif, ps, etc.)public void setViewOnSelection(CollectionItem collection)
BehaviorGuiConf
setViewOnSelection
in interface BehaviorGuiConf
collection
- the collectionBehaviorGuiConf.setOnSelection(CollectionItem,MethodItem)
,
BehaviorGuiConf.setSelectionTarget(CollectionItem,ClassItem,String)
public static boolean getViewOnSelection(FieldItem field)
field
- the field
setViewOnSelection(CollectionItem)
public void setOnSelection(CollectionItem collection, MethodItem eventHandler)
BehaviorGuiConf
setOnSelection
in interface BehaviorGuiConf
collection
- the collectioneventHandler
- the event handler method. It must be static
method. It will be called with the following parameters : the
CustomizedGUI, the CollectionItem and the selected Object. If
the handler returns an object, it will be used as the selected
object.public void setSelectionTarget(CollectionItem collection, ClassItem targetClass, String targetField)
BehaviorGuiConf
If the user selects an object o, o.<targetField> will be displayed instead of o.
setSelectionTarget
in interface BehaviorGuiConf
collection
- the collectiontargetClass
- the class owning the target fieldtargetField
- the field to displayBehaviorGuiConf.setViewOnSelection(CollectionItem)
public static MethodItem getSelectionHandler(MemberItem member)
public void setPreferredHeight(CollectionItem collection, int height)
FieldAppearenceGuiConf
setPreferredHeight
in interface FieldAppearenceGuiConf
collection
- the collectionheight
- the preferred heightpublic void setPreferredWidth(CollectionItem collection, int width)
FieldAppearenceGuiConf
setPreferredWidth
in interface FieldAppearenceGuiConf
collection
- the collectionwidth
- the preferred widthpublic void setNumRowsPerPage(CollectionItem collection, int numRows)
FieldAppearenceGuiConf
setNumRowsPerPage
in interface FieldAppearenceGuiConf
collection
- the collectionnumRows
- the number of rows per pagepublic static int getNumRowsPerPage(CollectionItem collection)
public static int getStartIndex(CollectionItem collection)
collection
- the collection to get the start index ofpublic static void setStartIndex(CollectionItem collection, int index)
collection
- the collectionindex
- the start indexpublic static void removeStartIndex(CollectionItem collection)
public void setFileChooserView(MethodItem method, String[] fileExtensions, String fileDescription)
FieldAppearenceGuiConf
As logically expected, the type of the set field must be a string or an URL.
setFileChooserView
in interface FieldAppearenceGuiConf
method
- the method item. It can be of the form
"methodName" or "methodName(URL
,
isFileChooserView(MethodItem)
public boolean isFileChooserView(MethodItem setter)
setter
- the setter for the field
getFileExtensions(MethodItem)
,
getFileDescription(MethodItem)
public String[] getFileExtensions(MethodItem setter)
For instance, the file extensions can be a strings array like {"gif", "jpg", "png"} or {"txt", "doc"}.
setter
- the setter for the field
isFileChooserView(MethodItem)
public String getFileDescription(MethodItem setter)
For instance, the file description can be a string like "Image files" or "Text files".
setter
- the setter for the field
isFileChooserView(MethodItem)
public static boolean isTableView(CollectionItem collection)
public void setCreationAllowedParameters(AbstractMethodItem method, boolean[] create)
MethodAppearenceGuiConf
setCreationAllowedParameters
in interface MethodAppearenceGuiConf
method
- the method item. It can be of the form
"methodName" or "methodName(create
- a flags arrays that tells for each parameters
whether it can be created (true) or not (false). It has no
effect if the parameter is not a JAC object (a reference)MethodAppearenceGuiConf.setCreationAllowed(FieldItem,boolean)
public void setCreationAllowed(FieldItem field, boolean allow)
MethodAppearenceGuiConf
setCreationAllowed
in interface MethodAppearenceGuiConf
field
- the fieldallow
- wether to allow or notsetCreationAllowedParameters(AbstractMethodItem,boolean)
public static boolean isCreationAllowedParameter(AbstractMethodItem method, int i)
method
- the methodi
- index of the parameter
setCreationAllowedParameters(AbstractMethodItem,boolean[])
public void setParameterNames(AbstractMethodItem method, String[] parameterNames)
MethodAppearenceGuiConf
The GUI aspect can automatically fill some default parameter names for all the setters to lighten the GUI aspect programmer work (however, these automatically generated names can be overloaded if needed).
setParameterNames
in interface MethodAppearenceGuiConf
method
- the method item. It can be of the form
"methodName" or "methodName(public static String[] getParameterNames(AbstractMethodItem method)
setParameterNames
, try some naming convention
heuristic.
method
- the method
setParameterNames(AbstractMethodItem,String[])
,
setParameterNames(AbstractMethodItem,String[])
public void setParameterFields(AbstractMethodItem method, String[] parameterFields)
MethodAppearenceGuiConf
setParameterFields
in interface MethodAppearenceGuiConf
method
- the methodparameterFields
- an array that contains the corresponding
field for each parameter of the methodpublic void setPasswordParameters(AbstractMethodItem method, String[] params)
MethodAppearenceGuiConf
A password parameter will be rendered with stars instead of the actual characters.
setPasswordParameters
in interface MethodAppearenceGuiConf
method
- the methodpublic void setDirectCollectionMethods(CollectionItem collection, String[] methods)
MethodAppearenceGuiConf
setDirectCollectionMethods
in interface MethodAppearenceGuiConf
collection
- the collectionmethods
- the names of the methods that can be invoked on
the selected elementpublic void setDefaultValues(AbstractMethodItem method, Object[] values)
MethodAppearenceGuiConf
setDefaultValues
in interface MethodAppearenceGuiConf
method
- the method item. It can be of the form
"methodName" or "methodName(values
- the default parameter valuespublic void setDefaultsAttributesOrder(ClassItem cl, String[] attributeNames)
ClassAppearenceGuiConf
setDefaultsAttributesOrder
in interface ClassAppearenceGuiConf
cl
- the classattributeNames
- the name of the attributesBehaviourGuiConf#setEditableDefaultValues(CollectionItem,boolean)
public static FieldItem[] getDefaultsAttributesOrder(ClassItem cl)
public void setClosingMethod(ClassItem classItem, String methodName)
BehaviorGuiConf
setClosingMethod
in interface BehaviorGuiConf
classItem
- the class the contains the methodmethodName
- the method item name. It can be of the form
"methodName" or "methodName(public void setModifyingBoxes(ClassItem classItem, String methodName, String[] modifyingBoxes)
public String[] getModifyingBoxes(AbstractMethodItem method)
public void captureSystemOut()
captureSystemOut
in interface BehaviorGuiConf
public void captureSystemErr()
BehaviorGuiConf
captureSystemErr
in interface BehaviorGuiConf
public void setDefaultCurrency(String currencyName, int precision)
GuiConf
setDefaultCurrency
in interface GuiConf
currencyName
- the name of the default currencyprecision
- number of decimals to displaypublic static String getDefaultCurrency()
public void declareCurrency(String currencyName, int precision, double rate)
GuiConf
declareCurrency
in interface GuiConf
currencyName
- the name of currencyprecision
- number of decimals to display for the currencyrate
- the change rate for the currencypublic static Enumeration getCurrencies()
public static Currency getCurrency(String currencyName)
public static ViewFactory getViewFactory(String guiType)
guiType
- the type of the gui ("swing","web",...)public void setViewConstructor(String guiType, String viewType, AbstractMethodItem constructor)
setViewConstructor
in interface GuiConf
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)
GuiConf
setDateFormat
in interface GuiConf
dateFormat
- the date formatSimpleDateFormat
public static String getDateFormat()
public void setDateHourFormat(String dateFormat)
public static String getDateHourFormat()
public static String getFloatFormat()
public void setFloatFormat(FieldItem field, String format)
FieldAppearenceGuiConf
setFloatFormat
in interface FieldAppearenceGuiConf
field
- the fieldformat
- the display format of the fieldDecimalFormat
public void setFormat(String className, String format)
ClassAppearenceGuiConf
setFormat
in interface ClassAppearenceGuiConf
public static String getFormat(MetaItem item)
setFormat(String,String)
public static String getFloatFormat(MetaItem item)
public void setCommitOnFocusLost(boolean value)
BehaviorGuiConf
setCommitOnFocusLost
in interface BehaviorGuiConf
value
- If true, attribute changes are committed when the
widget loses focus. Otherwise, a commit and a cancel button are
displayed in each object view.public static boolean getCommitOnFocusLost()
public void setDescription(ClassItem classItem, String description)
ClassAppearenceGuiConf
setDescription
in interface ClassAppearenceGuiConf
description
- the description of the classpublic void setDescription(MemberItem member, String description)
FieldAppearenceGuiConf
setDescription
in interface FieldAppearenceGuiConf
member
- the memberdescription
- the description of the class memberpublic static String getDescription(Object object)
public static String getDescription(Object object, String beforeString, String afterString)
public void setLabel(ClassItem classItem, String label)
ClassAppearenceGuiConf
setLabel
in interface ClassAppearenceGuiConf
public void setLabel(MemberItem member, String label)
FieldAppearenceGuiConf
setLabel
in interface FieldAppearenceGuiConf
member
- the memberlabel
- the label of the class memberFieldAppearenceGuiConf.setLabel(MemberItem,MemberItem,String)
public void setLabel(MemberItem member, MemberItem selector, String label)
FieldAppearenceGuiConf
setLabel
in interface FieldAppearenceGuiConf
member
- the memberlabel
- the label of the class memberFieldAppearenceGuiConf.setLabel(MemberItem,String)
public static String getLabel(MetaItem item)
public static String getLabel(MetaItem item, Stack context)
item
- the MetaItem
public void defineEnum(String name, String[] values, int start, int step)
GuiConf
defineEnum
in interface GuiConf
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 setDisplayLabel(MemberItem member, boolean displayLabel)
FieldAppearenceGuiConf
setDisplayLabel
in interface FieldAppearenceGuiConf
member
- the memberdisplayLabel
- boolean indicating wether to display the labelpublic void setDisplayLabel(String itemName, boolean displayLabel)
ClassAppearenceGuiConf
setDisplayLabel
in interface ClassAppearenceGuiConf
displayLabel
- boolean indicating wether to display the labelpublic void setNonViewableItems(CollectionItem collection)
ClassAppearenceGuiConf
setNonViewableItems
in interface ClassAppearenceGuiConf
collection
- the collectionpublic static boolean isViewableItems(CollectionItem collection)
public static Object getDefaultValue(FieldItem field, String value)
field
- the field for which to convert the valuevalue
- the string to convert
public String[] getDefaultConfigs()
AspectComponent
getDefaultConfigs
in class AspectComponent
public void setNavBar(String gui, CollectionItem collection)
GuiConf
Navigation bar is a set of buttons (previous element, next element, remove element) used to navigate in a collection
setNavBar
in interface GuiConf
gui
- the guicollection
- the collectionpublic static boolean hasSetNavBar(CustomizedGUI gui, CollectionItem coll)
public void addViewFieldDependency(ClassItem cl, String fieldName)
BehaviorGuiConf
addViewFieldDependency
in interface BehaviorGuiConf
cl
- the classfieldName
- the field namepublic void setInteractionHandler(MethodItem method, MethodItem handler)
BehaviorGuiConf
setInteractionHandler
in interface BehaviorGuiConf
method
- handler
- It should be a static method taking as arguments
(Interaction,DisplayContext)public static MethodItem getInteractionHandler(AbstractMethodItem method)
public static Collection getDependentFields(ClassItem cli)
cli
- the class
addViewFieldDependency(ClassItem,String)
public void setDialogTimeout(long timeout)
GuiConf
setDialogTimeout
in interface GuiConf
timeout
- the timeout delay in millisecondspublic void setLabelAdd(String label)
public static String getLabelAdd()
public void setLabelNew(String label)
public static String getLabelNew()
public void setLabelCancel(String label)
public static String getLabelCancel()
public void setLabelOK(String label)
public static String getLabelOK()
public void setLabelClose(String label)
public static String getLabelClose()
public void selectWithIndexedField(ClassItem cl, CollectionItem collection, String repositoryName)
ClassAppearenceGuiConf
selectWithIndexedField
in interface ClassAppearenceGuiConf
cl
- the class whose instance to selectcollection
- the collection whose indexed field to userepositoryName
- name of the object holding the collectionRttiAC.setIndexedField(CollectionItem,FieldItem)
public void setIndexNotFoundHandler(ClassItem cl, MethodItem handler)
BehaviorGuiConf
setIndexNotFoundHandler
in interface BehaviorGuiConf
cl
- the class of which the instance is not foundhandler
- the method to be called. It must be a static
method taking 2 parameters: a ClassItem, which is the class of
the object which could not be found, and an Object which is the
value of the indexed field. And it should return an Object,
which if not null will used as the found object.ClassAppearenceGuiConf.selectWithIndexedField(ClassItem,CollectionItem,String)
public static Object getRepository(ClassItem cl)
cl
- the classselectWithIndexedField(ClassItem,CollectionItem,String)
|
Contact JAC development team: Renaud Pawlak Lionel Seinturier Laurent Martelli |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |