User guide

Basic Usage


Disable the design mode by setting this system property:

-Dxy.reflect.ui.infoCustomizationsToolsHidden=true

The GUI builder Online Documenation

Since the version 4.6.0 the GUI builder has an online documentation:

Demonstration Videos

Video Covered Subjects
  • Virtual fields
  • Windows background image
  • Buttons background image
  • Title bar removal
  • Design mode deactivation
  • Enumeration
  • Side menu
  • Method presets
  • Converting fields to method parameters
  • Menus
  • Windows background image
  • Design mode deactivation
  • Styled texts
  • Windows background image
  • Buttons background image
  • Toggle buttons
  • Form background
  • Button icon
  • Side menus
  • Type conversion
  • List columns
  • Form background image
  • Styled texts
  • Windows background color
  • Buttons background color
  • List colums
  • Image banner
  • Button icon
  • Design mode deactivation
  • Styled texts
  • Windows background image
  • Buttons background image
  • Field periodic auto-update
  • Styled texts
  • Windows background image
  • Getting started
  • Windows colors
  • Buttons colors
  • Windows background image
  • Undo management
  • Custom checkbox
  • Shared customizations
  • Multiple lines text
  • Image banner
  • Buttons colors
  • Banner
  • Button icon
  • Styled texts
  • List details view
  • Side menu
  • Image banner

Architecture

This UI is generated in 2 steps:

  1. Each object class informations are read and interpreted by the ReflectionUI object. The result is an abstract GUI model element: ITypeInfo.
  2. Then this abstract GUI model is passed to the SwingRenderer that will create the various GUI controls displaying the object values
(ReflectionUI) (SwingRenderer)
Class ——————–> ITypeInfo ——————–> UI

The ReflectionUI interpretation algorithm is based on the Java language coding standards (ex: getter/setter interpreted as a unique property, …).

Unfortunately, even when these standards are respected, there might not be enough information in every class definition to provide a UI that looks and behaves exactly as expected. This is why the ReflectionUI interpretation process will often need to be customized. This is where the InfoProxyFactory comes into play. It is not essential to the ReflectionUI customization, but it makes it easier by allowing to specify conveniently a proxy for each ITypeInfo object.

CustomUI provides the customizations editor by  using the following classes:

  • InfoCustomizations: declarative customizations persisted in XML.
  • InfoCustomizationsFactory: subclass of InfoProxyFactory generating proxies according to an InfoCustomizations instance.
  • CustomizedUI: ReflectionUI subclass compatible with InfoCustomizationsFactory
  • SwingCustomizer: subclass of SwingRenderer compatible with CustomizedUI
(CustomizedUI) (InfoCustomizationsFactory) (SwingCustomizer)
| | |
(ReflectionUI) (InfoProxyFactory) (SwingRenderer)
Class ——————–> ITypeInfo ——————–> ITypeInfo (proxy) ——————–> UI
^
             |_______  ____|

HelloWorld example

Tutorials

Tutorials have been written as class methods in the examples sub-project. You should read the comments first:

 

  • ReflectionUI tutorial: <DISTRIBUTION_DIRECTORY>/examples/src/main/java/xy/reflect/ui/example/ReflectionUITutorial.java


 

  • CustomUI tutorial: <DISTRIBUTION_DIRECTORY>/examples/src/main/java/xy/reflect/ui/example/CustomUITutorial.java

The GUI builder Documentation

Type Customization

  • Dispaly Style: Specifies how categories are displayed.
  • Background Color: Allows to specify the background color of the categories control of this type form.
  • Foreground Color: Allows to specify the text color of the categories control of this type form.
  • Hide Undo/Redo Options (windows reloading required): If checked, undo/redo options will
    not be available for objects of this type.
  • Include Persistence Methods (save, load): If chcecked, the current type persistence
    methods (save() and load()) will be available
    for objects of this type.
  • Include Oject Class Members (getClass, toString, equals, …): If chcecked, default object fieds and
    methods (getClass(), toString(), …) will
    be available for objects of this type.
  • Custom Type Caption (windows reloading required): Custom display name of this type.
    If not set, a default display name is provided.
  • Immutable: If checked, this type objects will
    be considered as immutable
    and then not editable.
  • Abstract: If checked, this type objects will
    be considered as abstract
    and then not instanciable.
  • Fields Layout: Allows to change this type fields layout.
  • Methods Layout: Allows to change this type methods layout.
  • Default Form Width: Allows to specify the default width of this type form.
  • Default Form Height: Allows to specify the default height of this type form.
  • Form Background Color: Allows to specify the background color of this type form.
  • Form Foreground Color: Allows to specify the text color of this type form.
  • Form Border Color: Allows to specify the border color of this type form.
  • Form Background Image Path: Allows to specify a background image of this type form.
  • Form Editors Color: Allows to specify the background color of the editable parts of this type form.
  • Form Editors Text Color: Allows to specify the text color of the editable parts of this type form.
  • Form Button Background Color (windows reloading required to update the bottom button bar): Allows to specify the background color of the buttons of this type form.
  • Form Button Foreground Color (windows reloading required to update the bottom button bar): Allows to specify the text color of the buttons of this type form.
  • Form Button Border Color (windows reloading required to update the bottom button bar): Allows to specify the border color of the buttons of this type form.
  • Form Button Background Image Path (windows reloading required to update the bottom button bar): Allows to specify the background image of the buttons of this type form.
  • Online Help: Help message displayed for the type.
  • Icon Image Path (windows reloading required): Icon image displayed for this type.
  • Allow to Classify Fields and Methods: List of categories in which
    fields and methods of this type
    can be put in order to make this
    type window more intuitive and
    usable.
  • Specify (Additional) Sub-Types: List of sub-types declared for this type.
    These will be proposed during the
    instanciation of this type.
  • Customize Fields Display: List of discovered fields of this type.
  • Declare Virtual Fields: List of virtual fields of this type.
  • Customize Methods Display: List of methods of this type.

Field Customization

  • Allow To Set Null: Specifies that this field display should
    allows to set the null value.
  • Null Value Label: Text to be displayed when
    this field value is null.
  • Default Value (Replace Null By): If specified, this value will be
    displayed when this field value
    is null.
  • Export Null Status: Specifies that a new boolean field
    should be generated to reflect the
    null status of this field.
  • Import Null Status: Specifies a boolean field that
    should be used to simulate a
    null value (when false) for this
    field whwther or not this field
    value is actually null or not.
  • Generate Display Method: Generates a method which return
    value will be the value of this field.
  • Generate Update Method: Generates a method that will
    allow to set the value of this field.
  • Use Custom Setter: Specifies a method that will be
    used to set this field value.
  • Custom Field Caption: Allows to specify the display name of this field.
    If not set a default display name is provided.
  • Hide: Allows to hide this field.
  • Get-Only: Allows to specify that this field value
    (the reference or the primitive value)
    cannot be set. Note that it does not
    mean that the field is read-only unless
    its value is immutable.
  • Online Help: Allows to specify a help message
    to be displayed for this field.
  • Category: Allows to specify the category in
    which this field will be put.
    Note that the possible categories
    are declared at the type level.
  • Category: Allows to specify the category in
    which this field will be put.
    Note that the possible categories
    are declared at the type level.
  • Use Generic Control: Forces this field to be displayed
    by a generic control (a form or
    a button that will display a child
    dialog containing the form).
  • Expand Generic Control: Forces this field form to be embedded
    (no child dialog access button will be
    displayed).
    Note that this is significant only if this field
    value is displayed as a form.
  • Display Area Weights: Allows to specify the display weights
    of this field control relatively to the
    sibling field controls.
  • Encapsulate (Move Into A Sibling Sub-Form): Specifies the name of the generated
    field that will encapsulate this field.
  • Convert: Specifies that this field value should
    be converted and how the conversion
    will be managed.
  • Value As Singleton List: Specifies that this field value
    must be converted to a list
    containing this value.
  • Enumerate Value Options: Specifies that this field value
    will be chosen among enumerated
    values,
  • Value Access Mode: Specifies the way the value of this field
    is obtained. It will affect how the field
    is updated and refreshed.
    Typically calculated values cannot really
    be modified and then are systematically
    refreshed.
  • Duplicate: Allows to duplicate this field.
  • Auto-Update: Specifies a periodic delay after which
    this field value will be automatically
    refreshed.

Method Customization

  • Value Return Mode: Specifies the way the return value of this method
    is obtained. It will affect how this value
    is updated and refreshed.
    Typically calculated values cannot really
    be modified and then are systematically
    refreshed.
  • Confirmation Message: If provided, then a confirmation message
    will be displayed before performimg the
    method action.
  • Parameters Validation Custom Caption: Allows to change the ‘OK’ butoon
    text of this method parameters
    dialog.
  • Generate Return Value Field: Allows to generate a field that
    will reflect the return value of
    this method.
  • Menu Location: Allows to choose a menu location
    for this method.
    Note that menu locations are
    declared at the type level.
  • Null Return Value Label: Allows to specify a text to be used
    when displaying null return values
    of this method.
  • Move Into Sub-Form: Specifies the name of the generated
    field that will encapsulate this method.
  • Custom Method Caption: The display name of this method.
    If not set, a default display name
    is provided.
  • Hide: Allows to hide this method.
  • Read-Only: Allows to specify if this method
    is read-only or not. Read-only
    methods will not affect the undo
    management.
  • Presets: Allows to generate methods from
    this one that will use predefined
    sets of parameter values.
  • Fields Displayed As Parameters: Allows to specify a list of parameters
    of this method that will be displayed
    as sibling fields.
  • Online Help: Allows to display a help message
    for this method.
  • Icon Image Path: Specifies a icon image to be used
    for the display of this method.
  • Category: Allows to specify the category in
    which this method will be put.
    Note that the possible categories
    are declared at the type level.
  • Category: Allows to specify the category in
    which this method will be put.
    Note that the possible categories
    are declared at the type level.
  • Detached Return Value: If checked, then the return value
    dialog will not be blocking.
  • Ignore Return Value: If checked, then the return value
    dialog will not be displayed.
  • Validating: Specifies that this method should
    be used to validate the owner
    object.
  • Duplicate: Allows to duplicate this method.
  • Run When Instance Shown: If chcecked, then this method
    will be executed when the owner
    object is shown.
  • Run When Instance Hidden: If chcecked, then this method
    will be executed when the owner
    object is hidden.

List Customization

  • Allow To Select Item Constructor: Specifies that the item constructor
    should be asked when the user
    requests the instanciation of an item.
    Note that known sub-classes
    constructors will be proposed too.
  • Disable Details View: Allows to remove the ability
    to view item details.
  • Item Field Shortcuts: Allows to specify item fields that will
    be quickly editable from the toolbar
    when the the corresponding item is
    selected.
  • Item Method Shortcuts: Allows to specify item methods that will
    be quickly accessible from the toolbar
    when the the corresponding item is
    selected.
  • Fields Excluded From Details View: Allows to specify item fields that will
    be excluded from the details view.
    IMPORTANT: the field name is
    expected for each field to exclude.
  • Methods Excluded From Details View: Allows to specify item methods that will
    be excluded from the details view.
    IMPORTANT: the method signature is
    expected for each method to exclude.
  • Details View Mode: Allows to select the layout of
    the item details view.
  • Add Field Columns: Allows to add columns from
    the item type fields.
  • Add Item Type Column: Allows to add a column containing
    the item type name.
  • Add Item position Column: Allows to add a column containing
    the item position.
  • Add toString() Column: Allows to add a column containing
    the item toString() return value.
  • Customize Columns Display: Lists discovered customizable columns.
  • Auto-Discover Tree Structure: Allows to display the tree structure
    (sub-lists) of the list. Ideally the
    caption of the fields holding the
    sub-lists should be the same as
    the caption of the root field.
  • Editable: Specifies if this list is editable
    and at what extent.
  • Custom Length: Specifies a custom length (vertical)
    of this list.
  • Sort Items: SPecifies that items of this list
    should be sorted.

Enumeration Customization

  • Dynamic Enumeration: If chcecked, then the enumerated
    value list will be regularly refreshed.
  • Customize Items: List discovered customizable enumeration items.