Search in sources :

Example 1 with ElementLabel

use of com.revolsys.ui.html.view.ElementLabel in project com.revolsys.open by revolsys.

the class HtmlUiBuilder method getAttributeLabel.

public Decorator getAttributeLabel(final String key, final Element element) {
    final Map<String, Decorator> fieldLabels = getAttributeLabels();
    Decorator fieldLabel = fieldLabels.get(key);
    if (fieldLabel == null) {
        final String label = getLabel(key, element);
        final String instructions = getAttributeInstruction(key);
        if (element instanceof Field) {
            fieldLabel = new FieldLabelDecorator(label, instructions);
        } else {
            fieldLabel = new ElementLabel(label, instructions);
        }
        fieldLabels.put(key, fieldLabel);
    }
    return fieldLabel;
}
Also used : FieldLabelDecorator(com.revolsys.ui.html.decorator.FieldLabelDecorator) FormGroupDecorator(com.revolsys.ui.html.decorator.FormGroupDecorator) Decorator(com.revolsys.ui.html.decorator.Decorator) LongField(com.revolsys.ui.html.fields.LongField) TextField(com.revolsys.ui.html.fields.TextField) Field(com.revolsys.ui.html.fields.Field) FieldLabelDecorator(com.revolsys.ui.html.decorator.FieldLabelDecorator) ElementLabel(com.revolsys.ui.html.view.ElementLabel)

Aggregations

Decorator (com.revolsys.ui.html.decorator.Decorator)1 FieldLabelDecorator (com.revolsys.ui.html.decorator.FieldLabelDecorator)1 FormGroupDecorator (com.revolsys.ui.html.decorator.FormGroupDecorator)1 Field (com.revolsys.ui.html.fields.Field)1 LongField (com.revolsys.ui.html.fields.LongField)1 TextField (com.revolsys.ui.html.fields.TextField)1 ElementLabel (com.revolsys.ui.html.view.ElementLabel)1