FileDocCategorySizeDatePackage
AttributeDescriptor.javaAPI DocAndroid 1.5 API3652Wed May 06 22:41:10 BST 2009com.android.ide.eclipse.editors.descriptors

AttributeDescriptor

public abstract class AttributeDescriptor extends Object
{@link AttributeDescriptor} describes an XML attribute with its XML attribute name.

An attribute descriptor also knows which UI node should be instantiated to represent this particular attribute (e.g. text field, icon chooser, class selector, etc.) Some attributes may be hidden and have no user interface at all.

This is an abstract class. Derived classes must implement data description and return the correct UiAttributeNode-derived class.

Fields Summary
private String
mXmlLocalName
private ElementDescriptor
mParent
private final String
mNsUri
private boolean
mDeprecated
Constructors Summary
public AttributeDescriptor(String xmlLocalName, String nsUri)
Creates a new {@link AttributeDescriptor}

param
xmlLocalName The XML name of the attribute (case sensitive)
param
nsUri The URI of the attribute. Can be null if attribute has no namespace. See {@link SdkConstants#NS_RESOURCES} for a common value.

        mXmlLocalName = xmlLocalName;
        mNsUri = nsUri;
    
Methods Summary
public abstract com.android.ide.eclipse.editors.uimodel.UiAttributeNodecreateUiNode(com.android.ide.eclipse.editors.uimodel.UiElementNode uiParent)

param
uiParent The {@link UiElementNode} parent of this UI attribute.
return
A new {@link UiAttributeNode} linked to this descriptor or null if this attribute has no user interface.

public org.eclipse.swt.graphics.ImagegetIcon()
Returns an optional icon for the attribute.

By default this tries to return an icon based on the XML name of the attribute. If this fails, it tries to return the default Android logo as defined in the plugin. If all fails, it returns null.

return
An icon for this element or null.

        IconFactory factory = IconFactory.getInstance();
        Image icon;
        icon = factory.getIcon(getXmlLocalName(), IconFactory.COLOR_RED, IconFactory.SHAPE_CIRCLE);
        return icon != null ? icon : AdtPlugin.getAndroidLogo();
    
public final java.lang.StringgetNamespaceUri()

        return mNsUri;
    
public final ElementDescriptorgetParent()

        return mParent;
    
public final java.lang.StringgetXmlLocalName()
Returns the XML local name of the attribute (case sensitive)

        return mXmlLocalName;
    
public booleanisDeprecated()

        return mDeprecated;
    
public voidsetDeprecated(boolean isDeprecated)

        mDeprecated = isDeprecated;
    
final voidsetParent(ElementDescriptor parent)

        mParent = parent;