_skinAdditionStyleSheets = _getSkinAdditionsStyleSheets(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 skin-addition style sheets on top of
// the skin's style sheet
if (_skinAdditionStyleSheets != null)
{
for (int i = 0; i < _skinAdditionStyleSheets.length; i++)
{
StyleSheetEntry entry = _skinAdditionStyleSheets[i];
if (entry != null)
{
// Merge the skin-addition's StyleSheetDocument on top of
// the current StyleSheetDocument.
StyleSheetDocument additionDocument = entry.getDocument();
if (additionDocument != null)
{
// Merge the skin-addition'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,
additionDocument);
}
}
}
}
// 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);
}