// update the label to reflect the locked state
if (!isEditorRemovable(oldDefaultItem)) {
setLockedItemText(oldDefaultItem, oldDefaultItem.getText());
}
// Now set the new default
EditorDescriptor editor = (EditorDescriptor) items[0].getData(DATA_EDITOR);
getSelectedResourceType().setDefaultEditor(editor);
IContentType fromContentType = (IContentType) items[0].getData(DATA_FROM_CONTENT_TYPE);
items[0].dispose(); //Table is single selection
TableItem item = new TableItem(editorTable, SWT.NULL, 0);
item.setData(DATA_EDITOR, editor);
if (fromContentType != null) {
item.setData(DATA_FROM_CONTENT_TYPE, fromContentType);
}
item
.setText(editor.getLabel()
+ " " + WorkbenchMessages.FileEditorPreference_defaultLabel); //$NON-NLS-1$
item.setImage(getImage(editor));
if (!isEditorRemovable(item)) {
setLockedItemText(item, item.getText());
}