Models and Views for Form Controls

From Apache OpenOffice Wiki
Jump to: navigation, search



Form controls follow the model-view paradigm. This means if you have a form document that contains a control, there is a model describing the control's behavior and appearance, and a view that is the component the user sees.

Documentation note.png Note that the term "control" is ambiguous here. Usually, from the user's perspective, it is what is seen in the document. As the model-view paradigm may not be obvious to the user, the user tends to consider the visible representation and the underlying model of the control as one thing, that is, a user who refers to the control usually means the combination of the view and the model. As opposed to the user's perspective, when the UNO API for the form layer refers to a control, this means the view of a form element, if not stated otherwise.

The base for the controls and models used in the form layer are found in the module com.sun.star.awt, the com.sun.star.awt.UnoControl and com.sun.star.awt.UnoControlModel services. As discussed later, the model hierarchy in com.sun.star.form.component extends the hierarchy of com.sun.star.awt, whereas the control hierarchy in com.sun.star.form.control is small.

Everything from the model-view interaction for form controls is true for other UNO controls and UNO control models, as well. Another example for components that use the model-view paradigm are the controls and control models in OpenOffice.org Basic dialogs (Dialog Controls).

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages