A resource dictionary is a container that maps resource IDs to resources. More...
Public Member Functions | |
| ObjectRef< Resource > | acquire (ResourceID key) |
| Gets from the resource dictionary the resource with the resource ID that you pass to the function. | |
| void | add (ResourceDictionary resourceDictionary) |
| Adds a nested resource dictionary to a resource dictionary. | |
| void | add (ResourceID key, Resource resource) |
| Adds a resource ID to a resource handle mapping to a resource dictionary. | |
| void | add (ResourceID key, String url) |
| Adds a resource ID to a resource URL mapping to a resource dictionary. | |
| void | addAnonymousResource (Resource resource) |
| Adds an anonymous resource to a resource dictionary. | |
| ObjectRef< ResourceDictionary > | clone () |
| Duplicates a resource dictionary. | |
| boolean | contains (ResourceID key) |
| Returns whether a resource dictionary contains a mapping for the resource ID that you pass to the function. | |
| ResourceDictionary | findDictionary (String name) |
| Searches for a nested dictionary with the specified name and returns a handle to it. | |
| Resource | findStoredResource (ResourceID key) |
| Finds an explicitly stored resource handle from a dictionary. | |
| int | getDictionaryCount () |
| Gets the number of nested resource dictionaries in a resource dictionary. | |
| void | merge (ResourceDictionary preferredDictionary) |
| Copies into this resource dictionary the contents of the resource dictionary that you pass to the function. | |
| void | remove (ResourceID key) |
| Removes a resource ID mapping from a resource dictionary. | |
| void | removeAnonymousResource (Resource resource) |
| Removes an anonymous resource from the resource dictionary. | |
| void | removeDictionary (int index) |
| Removes a nested resource dictionary from a resource dictionary. | |
Public Member Functions inherited from ResourceProxy | |
| String | getName () |
| Gets the resource name. | |
| String | getUrl () |
| Gets the resource URL. | |
| void | setKeepAlive (boolean keepAlive) |
| Sets the keep alive flag. | |
Public Member Functions inherited from KanziObject | |
| boolean | equals (Object object) |
| Domain | getDomain () |
| Returns the domain the object belongs to. | |
| Metaclass | getDynamicMetaclass () |
| Returns the metaclass of the dynamic type of the object. | |
| long | getNative () |
| Gets a pointer to the backing C++ instance. | |
| TDataType | getOptionalProperty (PropertyType< TDataType > propertyType) |
| Returns the current value of a property type, but does not use the default value if there are no inputs to the property value. | |
| TDataType | getProperty (PropertyType< TDataType > propertyType) |
| Returns the current value of a property type. | |
| int | hashCode () |
| boolean | hasValue (PropertyType< TDataType > propertyType) |
| Evaluates whether there are any inputs into the property value. | |
| boolean | isStale () |
| Test if the object is stale i.e. | |
| void | removeLocalValue (PropertyType< TDataType > propertyType) |
| Removes the local value associated with the property. | |
| void | setFlagKeepDuringPatching (PropertyType< TDataType > propertyType) |
| Sets the flag to indicate that the property was loaded from KZB. | |
| void | setProperty (PropertyType< TDataType > propertyType, TDataType value) |
| Sets the local value of a property type. | |
| ObjectRef< TType > | tryCreateObjectRef (Class< TType > clazz) |
| Tries to create an owning ObjectRef instance to this KanziObject. | |
Static Public Member Functions | |
| static< T extends KanziObject > ObjectRef< T > | create (Domain domain, String name) |
| Creates a resource dictionary. | |
Static Public Attributes | |
| static final Metaclass | metaclass |
| The Metaclass for the class. | |
Static Public Attributes inherited from Resource | |
| static final Metaclass | metaclass |
| The Metaclass for the class. | |
Static Public Attributes inherited from ResourceProxy | |
| static final Metaclass | metaclass |
| The Metaclass for the class. | |
Static Public Attributes inherited from KanziObject | |
| static final Metaclass | metaclass = new AbstractMetaclass("Kanzi.Object") |
| The Metaclass for the class. | |
Additional Inherited Members | |
Public Attributes inherited from ResourceMetadata | |
| AbstractMetaclass | metaclass = new AbstractMetaclass("Kanzi.Resource") |
| Metaclass for Resource. | |
Public Attributes inherited from ResourceDictionaryMetadata | |
| AbstractMetaclass | metaclass = new AbstractMetaclass("Kanzi.ResourceDictionary") |
| Metaclass for ResourceDictionary. | |
A resource dictionary is a container that maps resource IDs to resources.
A node can refer to resources by setting resource IDs to resource ID properties. You can set a resource dictionary to the node or to any of its parent nodes to define which resources the node uses. You can use a resource dictionary to group similar resources to logical entity, such as themes or locales, and change a resource dictionary of a node to change multiple resources at the same time.
| ObjectRef< Resource > acquire | ( | ResourceID | key | ) |
Gets from the resource dictionary the resource with the resource ID that you pass to the function.
The function forwards the resource URL mappings to ResourceManager.acquireResource. Classes that derive from ResourceDictionary can override the behavior of acquire by implementing acquireOverride.
| key | The resource ID of the resource that you want to get. |
Reimplemented in ResourceDictionary.
| void add | ( | ResourceDictionary | resourceDictionary | ) |
Adds a nested resource dictionary to a resource dictionary.
You can add to multiple resource dictionaries the same resource dictionary as a nested resource dictionary. Do not form cycles with the nested resource dictionaries.
| resourceDictionary | The nested resource dictionary that you want to add to the resource dictionary. |
| void add | ( | ResourceID | key, |
| Resource | resource ) |
Adds a resource ID to a resource handle mapping to a resource dictionary.
| key | The resource ID to add. |
| resource | The resource handle to map to the resource ID.. |
| void add | ( | ResourceID | key, |
| String | url ) |
Adds a resource ID to a resource URL mapping to a resource dictionary.
| key | The resource ID to add. |
| url | The URL that points to the resource to map to the resource ID. |
Adds an anonymous resource to a resource dictionary.
| resource | The anonymous resource that you want to add to the resource dictionary. |
| ObjectRef< ResourceDictionary > clone | ( | ) |
Duplicates a resource dictionary.
When you duplicate a resource dictionary that contains nested resource dictionaries, the function creates a shallow copy: it copies the handles to the nested resource dictionaries, not the contents of the nested resource dictionaries. A class that derives from ResourceDictionary must override the cloning implementation in cloneOverride.
| boolean contains | ( | ResourceID | key | ) |
Returns whether a resource dictionary contains a mapping for the resource ID that you pass to the function.
| key | The resource ID for which you want to check whether there is a mapping in the resource dictionary. |
|
static |
Creates a resource dictionary.
| domain | The domain to which the resource dictionary belongs. |
| name | The name of the resource dictionary. |
Reimplemented in ResourceDictionarySelector.
| ResourceDictionary findDictionary | ( | String | name | ) |
Searches for a nested dictionary with the specified name and returns a handle to it.
| name | The name of the dictionary to find. |
| Resource findStoredResource | ( | ResourceID | key | ) |
Finds an explicitly stored resource handle from a dictionary.
Does not try to acquire a resource from the resource manager. To acquire a resource, use acquire().
| key | The resource ID of the resource that you want to get. |
| int getDictionaryCount | ( | ) |
Gets the number of nested resource dictionaries in a resource dictionary.
| void merge | ( | ResourceDictionary | preferredDictionary | ) |
Copies into this resource dictionary the contents of the resource dictionary that you pass to the function.
The function adds to this resource dictionary: If there are duplicate values for the resource ID mappings, prefers the values from the resource directory that you pass to the function.
| preferredDictionary | The resource dictionary that you want to merge to this resource dictionary. |
| void remove | ( | ResourceID | key | ) |
Removes a resource ID mapping from a resource dictionary.
| key | The resource ID that you want to remove. |
Removes an anonymous resource from the resource dictionary.
If the resource does not exist in the resource dictionary, the function does not do anything.
| resource | The anonymous resource you want to remove from the resource dictionary. |
Removes a nested resource dictionary from a resource dictionary.
| index | The index of the nested resource dictionary that you want to remove. |