esdoc/hal/ui/hal.ui.es6
/**
* A form bound to a model using well defined states and operations. The form contains a list of form items which are
* used to view and modify the attributes of the model. Form item can be bound or unbound. Bound form items show the
* attributes of the model (text input, check boxes or select boxes), whereas unbound form items have no relation to
* the model (static text or buttons).
*
* @param <T> The model for this form
*/
class Form {
get undefined() {}
get transient() {}
/**
* @return {T} the current model.
*/
get model() {}
/**
* Takes the specified model and updates the read-only state with the values from the model.
*
* @param {T} model the model to view.
*/
view(model) {}
/**
* Clears this form by removing the model reference and by clearing all form fields.
*/
clear() {}
/**
* Takes the specified model and populates the editing state with the values from the model.
*
* @param {T} model the model to edit.
*/
edit(model) {}
/**
* Validates the form and its fields and upon successful validation persists the changes to the model and
* calls the save callback.
*/
save() {}
/**
* Cancels any modifications to the model.
*/
cancel() {}
}
class Table {
get selectedRow() {}
bindForm(form) {}
clear() {}
onSelectionChange(handler) {}
}
class DialogBuilder {
/**
* Shortcut for a dialog with one 'Close' button.
*/
closeOnly() {}
/**
* Shortcut for a dialog with a 'Save' and 'Cancel' button. Clicking on save will execute the specified
* callback.
*/
saveCancel(saveCallback) {}
primary(label, callback) {}
cancel() {}
secondary(label, callback) {}
build() {}
add(element) {}
okCancel(okCallback) {}
size(size) {}
}
/**
* A modal dialog with optional secondary and primary buttons. Only one dialog can be open at a time. The buttons can
* be placed on the left or the right side. Each button has a callback. The callback is either a {@link Callback}
* which always closes the dialog or a {@link ResultCallback} with a boolean return value. A value of {@code true}
* indicates that the dialog should be closed whereas {@code false} keeps the dialog open. You can add as many buttons
* as you like, but only one of them should be the primary button.
* <p>
* There are convenience methods to add primary and secondary buttons which come with pre-defined placements. If
* you want to define the placement by yourself use negative numbers to place the buttons on the left side and positive
* numbers for the right side. On each side the buttons are ordered according to the placement.
*/
class Dialog {
show() {}
}
class TableBuilder {
column(attribute) {}
build() {}
add(type, template, attributes, callback) {}
remove(type, template, name, callback) {}
button(text, scope, handler) {}
columns(columns) {}
}
/**
* Builder useful to automatically inspect the read-resource-description and associate the
* attributes (by calling: include, customFormItem). Creates the required form items and help texts.
*/
class FormBuilder {
/**
* Use this flag if you just want to use the form to add model nodes. This will create a form with an
* {@link AddOnlyStateMachine}.
* <p>
* The attributes will be taken from the {@code ATTRIBUTES} child node.
*/
addOnly() {}
/**
* Use this flag if you just want to use the form to add model nodes. This will create a form with an
* {@link AddOnlyStateMachine}.
* <p>
* The attributes will be taken from the {@code REQUEST_PROPERTIES} node of the {@code ADD} operation.
*/
fromRequestProperties() {}
readOnly() {}
unsorted() {}
requiredOnly() {}
includeRuntime() {}
showDeprecated() {}
build() {}
include(attributes) {}
exclude(attributes) {}
onSave(callback) {}
}