_extensionStyleSheets = _getExtensionStyleSheets(context);
}
// Now merge all of the documents provided by all of our
// entries into a single StyleSheetDocument.
StyleSheetDocument document = null;
if (_skinStyleSheet != null)
document = _skinStyleSheet.getDocument();
// Merge in any UIExtension style sheets on top of
// the skin's style sheet
if (_extensionStyleSheets != null)
{
for (int i = 0; i < _extensionStyleSheets.length; i++)
{
StyleSheetEntry entry = _extensionStyleSheets[i];
if (entry != null)
{
// add the icons and properties that are in the
// extensionDocument's StyleSheetEntry
_registerIconsAndPropertiesFromStyleSheetEntry(entry);
// now merge the css properties
StyleSheetDocument extensionDocument = entry.getDocument();
if (extensionDocument != null)
{
// Merge the UIExtension's StyleSheetDocument on top of
// the current StyleSheetDocument. Note: This is not
// exactly efficient - we would be better off creating
// an array of StyleSheetDocuments and merging them all
// in one pass. But since this code should rarely be
// executed, this shouldn't be a bottleneck...
document = StyleSheetDocumentUtils.mergeStyleSheetDocuments(
document,
extensionDocument);
}
}
}
}
// We're done!
if (document != null)
return document;
// If we weren't able to produce a StyleSheetDocument for whatever
// reason (maybe we don't have any style sheet, maybe there were
// I/O problems), create a empty StyleSheetDocument so that we
// don't repeatedly try to re-create the document.
return new StyleSheetDocument(null,
null,
StyleSheetDocument.UNKNOWN_TIMESTAMP);
}