Java Code Examples for com.android.io.IAbstractFile#getOsLocation()

The following examples show how to use com.android.io.IAbstractFile#getOsLocation() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SingleResourceFile.java    From java-n-IDE-for-Android with Apache License 2.0 6 votes vote down vote up
public SingleResourceFile(IAbstractFile file, ResourceFolder folder) {
    super(file, folder);

    // we need to infer the type of the resource from the folder type.
    // This is easy since this is a single Resource file.
    List<ResourceType> types = FolderTypeRelationship.getRelatedResourceTypes(folder.getType());
    mType = types.get(0);

    // compute the resource name
    mResourceName = getResourceName(mType);

    // test if there's a density qualifier associated with the resource
    DensityQualifier qualifier = folder.getConfiguration().getDensityQualifier();

    if (qualifier == null) {
        mValue = new ResourceValue(mType, getResourceName(mType),
                file.getOsLocation(), isFramework());
    } else {
        mValue = new DensityBasedResourceValue(
                mType,
                getResourceName(mType),
                file.getOsLocation(),
                qualifier.getValue(),
                isFramework());
    }
}
 
Example 2
Source File: SingleResourceFile.java    From javaide with GNU General Public License v3.0 6 votes vote down vote up
public SingleResourceFile(IAbstractFile file, ResourceFolder folder) {
    super(file, folder);

    // we need to infer the type of the resource from the folder type.
    // This is easy since this is a single Resource file.
    List<ResourceType> types = FolderTypeRelationship.getRelatedResourceTypes(folder.getType());
    mType = types.get(0);

    // compute the resource name
    mResourceName = getResourceName(mType);

    // test if there's a density qualifier associated with the resource
    DensityQualifier qualifier = folder.getConfiguration().getDensityQualifier();

    if (qualifier == null) {
        mValue = new ResourceValue(mType, getResourceName(mType),
                file.getOsLocation(), isFramework());
    } else {
        mValue = new DensityBasedResourceValue(
                mType,
                getResourceName(mType),
                file.getOsLocation(),
                qualifier.getValue(),
                isFramework());
    }
}
 
Example 3
Source File: IdGeneratingResourceFile.java    From NBANDROID-V2 with Apache License 2.0 6 votes vote down vote up
/**
 * Returns the resource value associated with this whole file as a layout resource
 * @param file the file handler that represents this file
 * @param folder the folder this file is under
 * @return a resource value associated with this layout
 */
private ResourceValue getFileValue(IAbstractFile file, ResourceFolder folder) {
    // test if there's a density qualifier associated with the resource
    DensityQualifier qualifier = folder.getConfiguration().getDensityQualifier();

    ResourceValue value;
    if (!ResourceQualifier.isValid(qualifier)) {
        value =
                new ResourceValueImpl(
                        new ResourceReference(mFileType, mFileName, isFramework()),
                        file.getOsLocation());
    } else {
        value =
                new DensityBasedResourceValueImpl(
                        new ResourceReference(mFileType, mFileName, isFramework()),
                        file.getOsLocation(),
                        qualifier.getValue());
    }
    return value;
}
 
Example 4
Source File: SingleResourceFile.java    From NBANDROID-V2 with Apache License 2.0 5 votes vote down vote up
public SingleResourceFile(IAbstractFile file, ResourceFolder folder) {
    super(file, folder);

    // we need to infer the type of the resource from the folder type.
    // This is easy since this is a single Resource file.
    List<ResourceType> types = FolderTypeRelationship.getRelatedResourceTypes(folder.getType());
    mType = types.get(0);

    // compute the resource name
    mResourceName = getResourceName(mType);

    // test if there's a density qualifier associated with the resource
    DensityQualifier qualifier = folder.getConfiguration().getDensityQualifier();

    if (!ResourceQualifier.isValid(qualifier)) {
        mValue =
                new ResourceValueImpl(
                        new ResourceReference(mType, getResourceName(mType), isFramework()),
                        file.getOsLocation());
    } else {
        mValue =
                new DensityBasedResourceValueImpl(
                        new ResourceReference(mType, getResourceName(mType), isFramework()),
                        file.getOsLocation(),
                        qualifier.getValue());
    }
}