FileDocCategorySizeDatePackage
ConfigurableResourceItem.javaAPI DocAndroid 1.5 API2428Wed May 06 22:41:10 BST 2009com.android.ide.eclipse.editors.resources.manager

ConfigurableResourceItem

public class ConfigurableResourceItem extends ProjectResourceItem
Represents a resource item that can exist in multiple "alternate" versions.

Fields Summary
Constructors Summary
public ConfigurableResourceItem(String name)
Constructs a new Resource Item.

param
name the name of the resource as it appears in the XML and R.java files.

        super(name);
    
Methods Summary
public intgetAlternateCount()
Returns the number of alternate versions of this resource.

        int count = 0;
        for (ResourceFile file : mFiles) {
            if (file.getFolder().getConfiguration().isDefault() == false) {
                count++;
            }
        }

        return count;
    
public booleanhasAlternates()
Returns if the resource item has at least one non-default configuration.

        for (ResourceFile file : mFiles) {
            if (file.getFolder().getConfiguration().isDefault() == false) {
                return true;
            }
        }
        
        return false;
    
public booleanhasDefault()
Returns whether the resource has a default version, with no qualifier.

        for (ResourceFile file : mFiles) {
            if (file.getFolder().getConfiguration().isDefault()) {
                return true;
            }
        }
        
        // We only want to return false if there's no default and more than 0 items.
        return (mFiles.size() == 0);
    
public booleanisEditableDirectly()

        return hasAlternates() == false;