private void installCharacterPairing() {
IStructuredModel model = getInternalModel();
if (model != null) {
IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(SSEUIPlugin.ID, "characterPairing"); //$NON-NLS-1$
IContentTypeManager mgr = Platform.getContentTypeManager();
IContentType type = mgr.getContentType(model.getContentTypeIdentifier());
if (type != null) {
for (int i = 0; i < elements.length; i++) {
// Create the inserter
IConfigurationElement element = elements[i];
try {
IConfigurationElement[] contentTypes = element.getChildren("contentTypeIdentifier");
for (int j = 0; j < contentTypes.length; j++) {
String id = contentTypes[j].getAttribute("id");
if (id != null) {
IContentType targetType = mgr.getContentType(id);
int priority = calculatePriority(type, targetType, 0);
if (priority >= 0) {
final CharacterPairing pairing = new CharacterPairing();
pairing.priority = priority;
String[] partitions = StringUtils.unpack(contentTypes[j].getAttribute("partitions"));