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

ProjectResourceItem

public abstract class ProjectResourceItem extends com.android.ide.eclipse.common.resources.ResourceItem
Base class for Resource Item coming from an Android Project.

Fields Summary
private static final Comparator
sComparator
protected final ArrayList
mFiles
List of files generating this ResourceItem.
Constructors Summary
public ProjectResourceItem(String name)
Constructs a new ResourceItem.

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


                             
       
        super(name);
    
Methods Summary
protected voidadd(ResourceFile file)
Adds a new version of this resource item, by adding its {@link ResourceFile}.

param
file the {@link ResourceFile} object.

        mFiles.add(file);
    
public ResourceFile[]getSourceFileArray()
Returns the sorted list of {@link ResourceItem} objects for this resource item.

        ArrayList<ResourceFile> list = new ArrayList<ResourceFile>();
        list.addAll(mFiles);
        
        Collections.sort(list, sComparator);
        
        return list.toArray(new ResourceFile[list.size()]);
    
public java.util.ListgetSourceFileList()
Returns the list of {@link ResourceItem} objects for this resource item.

        return Collections.unmodifiableList(mFiles);
    
public abstract booleanisEditableDirectly()
Returns whether the resource item is editable directly.

This is typically the case for resources that don't have alternate versions, or resources of type {@link ResourceType#ID} that aren't declared inline.

protected voidreplaceWith(com.android.ide.eclipse.editors.resources.manager.ProjectResourceItem item)
Replaces the content of the receiver with the ResourceItem received as parameter.

param
item

        mFiles.clear();
        mFiles.addAll(item.mFiles);
    
protected voidreset()
Reset the item by emptying its version list.

        mFiles.clear();