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

TextAttributeDescriptor

public class TextAttributeDescriptor extends AttributeDescriptor implements org.eclipse.ui.views.properties.IPropertyDescriptor
Describes a textual XML attribute.

Such an attribute has a tooltip and would typically be displayed by {@link UiTextAttributeNode} using a label widget and text field.

This is the "default" kind of attribute. If in doubt, use this.

Fields Summary
private String
mUiName
private String
mTooltip
Constructors Summary
public TextAttributeDescriptor(String xmlLocalName, String uiName, String nsUri, String tooltip)
Creates a new {@link TextAttributeDescriptor}

param
xmlLocalName The XML name of the attribute (case sensitive)
param
uiName The UI name of the attribute. Cannot be an empty string and cannot be null.
param
nsUri The URI of the attribute. Can be null if attribute has no namespace. See {@link SdkConstants#NS_RESOURCES} for a common value.
param
tooltip A non-empty tooltip string or null

        super(xmlLocalName, nsUri);
        mUiName = uiName;
        mTooltip = (tooltip != null && tooltip.length() > 0) ? tooltip : null;
    
Methods Summary
public org.eclipse.jface.viewers.CellEditorcreatePropertyEditor(org.eclipse.swt.widgets.Composite parent)

        return new TextValueCellEditor(parent);
    
public com.android.ide.eclipse.editors.uimodel.UiAttributeNodecreateUiNode(com.android.ide.eclipse.editors.uimodel.UiElementNode uiParent)

return
A new {@link UiTextAttributeNode} linked to this descriptor.

        return new UiTextAttributeNode(this, uiParent);
    
public java.lang.StringgetCategory()

        if (isDeprecated()) {
            return "Deprecated";
        }

        ElementDescriptor parent = getParent();
        if (parent != null) {
            return parent.getUiName();
        }

        return null;
    
public java.lang.StringgetDescription()

        return mTooltip;
    
public java.lang.StringgetDisplayName()

        return mUiName;
    
public java.lang.String[]getFilterFlags()

        return null;
    
public java.lang.ObjectgetHelpContextIds()

        return null;
    
public java.lang.ObjectgetId()

        return this;
    
public org.eclipse.jface.viewers.ILabelProvidergetLabelProvider()

        return AttributeDescriptorLabelProvider.getProvider();
    
public final java.lang.StringgetTooltip()
The tooltip string is either null or a non-empty string.

The tooltip is based on the Javadoc of the attribute and already processed via {@link DescriptorsUtils#formatTooltip(String)} to be displayed right away as a UI tooltip.

An empty string is converted to null, to match the behavior of setToolTipText() in {@link Control}.

return
A non-empty tooltip string or null

        return mTooltip;
    
public final java.lang.StringgetUiName()

return
The UI name of the attribute. Cannot be an empty string and cannot be null.

        return mUiName;
    
public booleanisCompatibleWith(org.eclipse.ui.views.properties.IPropertyDescriptor anotherProperty)

        return anotherProperty == this;