com.android.ide.common.rendering.api
Class ItemResourceValue

java.lang.Object
  extended by com.android.ide.common.rendering.api.ResourceReference
      extended by com.android.ide.common.rendering.api.ResourceValue
          extended by com.android.ide.common.rendering.api.ItemResourceValue
All Implemented Interfaces:
IResourceValue

public class ItemResourceValue
extends ResourceValue

Represents each item in the android style resource.


Field Summary
 
Fields inherited from class com.android.ide.common.rendering.api.ResourceValue
mValue
 
Constructor Summary
ItemResourceValue(java.lang.String name, boolean isFrameworkAttr, boolean isFrameworkStyle)
           
ItemResourceValue(java.lang.String attributeName, boolean isFrameworkAttr, java.lang.String value, boolean isFrameworkStyle)
          If the value is a reference to a framework resource or not is NOT represented with a boolean! but can be deduced with:
 
Method Summary
 boolean isFrameworkAttr()
           
 
Methods inherited from class com.android.ide.common.rendering.api.ResourceValue
equals, getRawXmlValue, getResourceType, getType, getValue, hashCode, replaceWith, setValue, toString
 
Methods inherited from class com.android.ide.common.rendering.api.ResourceReference
getName, isFramework
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.android.layoutlib.api.IResourceValue
getName, isFramework
 

Constructor Detail

ItemResourceValue

public ItemResourceValue(java.lang.String name,
                         boolean isFrameworkAttr,
                         boolean isFrameworkStyle)
See Also:
ItemResourceValue(String, boolean, String, boolean)

ItemResourceValue

public ItemResourceValue(java.lang.String attributeName,
                         boolean isFrameworkAttr,
                         java.lang.String value,
                         boolean isFrameworkStyle)
If the value is a reference to a framework resource or not is NOT represented with a boolean! but can be deduced with:
 boolean isFrameworkValue = item.isFramework() ||
            item.getValue().startsWith(SdkConstants.ANDROID_PREFIX) ||
            item.getValue().startsWith(SdkConstants.ANDROID_THEME_PREFIX);
  
For <item name="foo">bar</item>, item in a style resource, the values of the parameters will be as follows:

Parameters:
attributeName - foo
isFrameworkAttr - is foo in framework namespace.
value - bar (in case of a reference, the value may include the namespace. if the namespace is absent, default namespace is assumed based on isFrameworkStyle (android namespace when isFrameworkStyle=true and app namespace when isFrameworkStyle=false))
isFrameworkStyle - if the style is a framework file or project file.
Method Detail

isFrameworkAttr

public boolean isFrameworkAttr()