* @return the format.
*/
public Format getFormat(String name, FormatNamespace namespace) {
Format format = null;
// Get the format scope.
FormatScope formatScope = null;
// Attempt to get it from the fragment first
final Fragment currentFragment = getCurrentFragment();
if (currentFragment != null) {
formatScope = currentFragment.getFormatScope();
}
// If it doesn't match a fragment, then try in the layout.
if (formatScope == null) {
formatScope = getDeviceLayout().getFormatScope();
}
if (formatScope != null) {
format = formatScope.retrieveFormat(name, namespace);
}
return format;
}