FileDocCategorySizeDatePackage
UiItemElementNode.javaAPI DocAndroid 1.5 API2310Wed May 06 22:41:10 BST 2009com.android.ide.eclipse.editors.resources.uimodel

UiItemElementNode

public class UiItemElementNode extends com.android.ide.eclipse.editors.uimodel.UiElementNode
{@link UiItemElementNode} is apecial version of {@link UiElementNode} that customizes the element display to include the item type attribute if present.

Fields Summary
Constructors Summary
public UiItemElementNode(com.android.ide.eclipse.editors.resources.descriptors.ItemElementDescriptor elementDescriptor)
Creates a new {@link UiElementNode} described by a given {@link ItemElementDescriptor}.

param
elementDescriptor The {@link ItemElementDescriptor} for the XML node. Cannot be null.

        super(elementDescriptor);
    
Methods Summary
public java.lang.StringgetShortDescription()

        Node xmlNode = getXmlNode();
        if (xmlNode != null && xmlNode instanceof Element && xmlNode.hasAttributes()) {

            Element elem = (Element) xmlNode;
            String type = elem.getAttribute(ResourcesDescriptors.TYPE_ATTR);
            String name = elem.getAttribute(ResourcesDescriptors.NAME_ATTR);
            if (type != null && name != null && type.length() > 0 && name.length() > 0) {
                type = DescriptorsUtils.capitalize(type);
                return String.format("%1$s (%2$s %3$s)", name, type, getDescriptor().getUiName());
            }
        }

        return super.getShortDescription();