// determine the current partition
if (document != null) {
String contentTypeID = getContentType(document);
String partitionType = getPartitionType(document, offset);
IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeID);
while (openOn == null && contentType != null) {
// Query OpenOnBuilder and get the list of OpenOns for the
// current partition
OpenOnDefinition[] defs = OpenOnBuilder.getInstance().getOpenOnDefinitions(contentType.getId(), partitionType);
contentType = contentType.getBaseType();
// If more than 1 openon is returned, need to further check
// which OpenOn is the appropriate one to return
// for now just returning the first one
if (defs != null && defs.length > 0) {