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

FlagAttributeDescriptor

public class FlagAttributeDescriptor extends TextAttributeDescriptor
Describes a text attribute that can only contains some predefined values. It is displayed by a {@link UiListAttributeNode}. Note: in Android resources, a "flag" is a list of fixed values where one or more values can be selected using an "or", e.g. "align='left|top'". By contrast, an "enum" is a list of fixed values of which only one can be selected at a given time, e.g. "gravity='right'".

This class handles the "flag" case. The "enum" case is done using {@link ListAttributeDescriptor}.

Fields Summary
private String[]
mNames
Constructors Summary
public FlagAttributeDescriptor(String xmlLocalName, String uiName, String nsUri, String tooltip)
Creates a new {@link FlagAttributeDescriptor} which automatically gets its values from the FrameworkResourceManager.

        super(xmlLocalName, uiName, nsUri, tooltip);
    
public FlagAttributeDescriptor(String xmlLocalName, String uiName, String nsUri, String tooltip, String[] names)
Creates a new {@link FlagAttributeDescriptor} which uses the provided values.

       super(xmlLocalName, uiName, nsUri, tooltip);
       mNames = names;
    
Methods Summary
public org.eclipse.jface.viewers.CellEditorcreatePropertyEditor(org.eclipse.swt.widgets.Composite parent)

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

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

        return new UiFlagAttributeNode(this, uiParent);
    
public java.lang.String[]getNames()

return
The initial names of the flags. Can be null, in which case the Framework resource parser should be checked.

        return mNames;