/*
 * Copyright (c) 2008 Haulmont Technology Ltd. All Rights Reserved.
 * Haulmont Technology proprietary and confidential.
 * Use is subject to license terms.

 * Author: Dmitry Abramov
 * Created: 22.12.2008 18:20:37
 * $Id$
 */
package com.haulmont.cuba.gui.xml.layout.loaders;

import com.haulmont.cuba.gui.components.Component;
import com.haulmont.cuba.gui.components.Label;
import com.haulmont.cuba.gui.xml.layout.*;
import org.dom4j.Element;

public class LabelLoader extends ComponentLoader {
    public LabelLoader(Context context) {
        super(context);
    }

    public Component loadComponent(ComponentsFactory factory, Element element) throws InstantiationException, IllegalAccessException {
        final Label component = factory.createComponent("label");

        assignXmlDescriptor(component, element);
        loadId(component, element);
        final String caption = element.attributeValue("value");
        component.setValue(caption);

        addAssignWindowTask(component);

        return component;
    }
}

@@ -456,16 +456,61 @@
 lement;%0D
+%0Aimport org.apache.commons.lang.StringUtils;%0D
 %0A%0D%0Apubli
@@ -925,29 +925,25 @@
 ment);%0D%0A
- 
+%0D%0A
        
-final
  String 
@@ -998,36 +998,264 @@
     
-component.setValue(caption);
+if (!StringUtils.isEmpty(caption)) %7B%0D%0A            if (caption.startsWith(%22res://%22) && resourceBundle != null) %7B%0D%0A                caption = resourceBundle.getString(caption.substring(6));%0D%0A            %7D%0D%0A            component.setCaption(caption);%0D%0A        %7D
 %0D%0A%0D%0A

load lable value from res://