use of org.eclipse.ui.texteditor.quickdiff.ReferenceProviderDescriptor in project eclipse.platform.text by eclipse.
the class QuickDiffExtensionsRegistry method reloadExtensions.
/**
* Reads all extensions.
* <p>
* This method can be called more than once in
* order to reload from a changed extension registry.
* </p>
*/
public synchronized void reloadExtensions() {
fDefaultDescriptor = null;
IExtensionRegistry registry = Platform.getExtensionRegistry();
List<ReferenceProviderDescriptor> list = new ArrayList<>();
IConfigurationElement[] elements = registry.getConfigurationElementsFor(TextEditorPlugin.PLUGIN_ID, TextEditorPlugin.REFERENCE_PROVIDER_EXTENSION_POINT);
for (int i = 0; i < elements.length; i++) {
ReferenceProviderDescriptor desc = new ReferenceProviderDescriptor(elements[i]);
if (// $NON-NLS-1$
desc.getId().equals("org.eclipse.ui.internal.editors.quickdiff.LastSaveReferenceProvider"))
fDefaultDescriptor = desc;
list.add(desc);
}
// make sure the default is the first one in the list
if (fDefaultDescriptor != null) {
list.remove(fDefaultDescriptor);
list.add(0, fDefaultDescriptor);
}
fDescriptors = Collections.unmodifiableList(list);
}
use of org.eclipse.ui.texteditor.quickdiff.ReferenceProviderDescriptor in project eclipse.platform.text by eclipse.
the class QuickDiffConfigurationBlock method createQuickDiffReferenceListModel.
private String[][] createQuickDiffReferenceListModel() {
List<ReferenceProviderDescriptor> descriptors = new QuickDiff().getReferenceProviderDescriptors();
ArrayList<String[]> listModelItems = new ArrayList<>();
for (Iterator<ReferenceProviderDescriptor> it = descriptors.iterator(); it.hasNext(); ) {
ReferenceProviderDescriptor descriptor = it.next();
String label = LegacyActionTools.removeMnemonics(descriptor.getLabel());
listModelItems.add(new String[] { descriptor.getId(), label });
}
String[][] items = new String[listModelItems.size()][];
listModelItems.toArray(items);
return items;
}
Aggregations