User guide

Basic Usage


Disable the design mode by setting this system property:

-Dxy.reflect.ui.infoCustomizationsToolsHidden=true

Default Operation

  • Only public fields and methods are considered.
  • A public getter (public <Type> (get|is|has)Something()) and its eventual associated public setter (public void setSomething(<Type> object)) are considered as a unique public field (public <Type> something).
  • A final field or a getter without an associated setter are considered as a “get-only” field that may not be editable (depends on the field type).
  • A field control (text component, list view, combo-box, …) is generated for each field.
  • A button is generated for each method.
  • Field changes can be undone.
  • Method calls invalidate the modification stack and cannot be undone. Note that IMethodInfo.isReadOnly() or IMethodInfo.getNextInvocationUndoJob(…) can be overridden in order to make a method call harmless for the modification stack or undoable.

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

The 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