AD Windows architecture

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.

AD stands for Application Directory. The application directory is used extensively in Adempiere and allows us to without a great effort create new input/data-windows and modify existing windows.

Forms and Windows

In this context a window is a form that is created using the Application Directory. This means that the structure of the window is stored in the Application Directory. If the application directory definition changes, so does the window.

As a contrast to windows we also have forms. Forms are different to windows since they are not defined in the Application Directory. Forms are special purpose windows that for some reason are not practical to create as a window.

To be concrete, forms are found in

org.compiere.apps.form

and windows are created using the class

org.compiere.apps.AWindow

(not completely sure about this yet)

Components in Windows

The window is a frame that have a standard menubar. The window's tabs are defined in the AD. The tabs are layed out by the org.compiere.grid.GridController which in turn creates editor fields using the org.compiere.grid.ed.VEditorFactory class.

The VEditorFactory.class returns different kinds of editors depending on what field the editor represents.

I.e. if the AD defines a field to be a date field, an editor of type org.compiere.grid.ed.VDate is returned. If the field is numeric, an editor of type org.compiere.grid.ed.VNumber is returned etc.

Datatypes

Every field in a tab have an associated datatype. The datatype determines how the field will be represented on the screen. As mentioned, the appropriate editor for each field is selected by the org.compiere.grid.ed.VEditorFactory, which in turn looks at the datatype.

The datatypes are defined in the Application Directory table AD_Reference. Each datatype have a corresponding datatype defined in org.compiere.util.DisplayType.