use of org.eclipse.core.runtime.IConfigurationElement in project eclipse.platform.text by eclipse.
the class ReconcilerRegistry method syncHighlight.
private void syncHighlight() {
Set<IConfigurationElement> toRemoveExtensions = new HashSet<>(this.extensions.keySet());
for (IConfigurationElement extension : Platform.getExtensionRegistry().getConfigurationElementsFor(HIGHLIGHT_EXTENSION_POINT_ID)) {
toRemoveExtensions.remove(extension);
if (!this.highlightExtensions.containsKey(extension)) {
try {
this.highlightExtensions.put(extension, new GenericContentTypeRelatedExtension<IReconciler>(extension));
} catch (Exception ex) {
GenericEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID, ex.getMessage(), ex));
}
}
}
for (IConfigurationElement toRemove : toRemoveExtensions) {
this.highlightExtensions.remove(toRemove);
}
this.highlightOutOfSync = false;
}
use of org.eclipse.core.runtime.IConfigurationElement in project eclipse.platform.text by eclipse.
the class ReconcilerRegistry method sync.
private void sync() {
Set<IConfigurationElement> toRemoveExtensions = new HashSet<>(this.extensions.keySet());
for (IConfigurationElement extension : Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_POINT_ID)) {
toRemoveExtensions.remove(extension);
if (!this.extensions.containsKey(extension)) {
try {
this.extensions.put(extension, new GenericContentTypeRelatedExtension<IReconciler>(extension));
} catch (Exception ex) {
GenericEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID, ex.getMessage(), ex));
}
}
}
for (IConfigurationElement toRemove : toRemoveExtensions) {
this.extensions.remove(toRemove);
}
this.outOfSync = false;
}
use of org.eclipse.core.runtime.IConfigurationElement in project eclipse.platform.text by eclipse.
the class TextHoverRegistry method sync.
private void sync() {
Set<IConfigurationElement> toRemoveExtensions = new HashSet<>();
Map<IConfigurationElement, TextHoverExtension> ext = new HashMap<>();
if (this.extensions != null) {
ext = this.extensions.stream().collect(Collectors.toMap(TextHoverExtension::getConfigurationElement, Function.identity()));
toRemoveExtensions = ext.keySet();
}
for (IConfigurationElement extension : Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_POINT_ID)) {
toRemoveExtensions.remove(extension);
if (!ext.containsKey(extension)) {
try {
ext.put(extension, new TextHoverExtension(extension));
} catch (Exception ex) {
GenericEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, GenericEditorPlugin.BUNDLE_ID, ex.getMessage(), ex));
}
}
}
for (IConfigurationElement toRemove : toRemoveExtensions) {
ext.remove(toRemove);
}
OrderedExtensionComparator comparator = new OrderedExtensionComparator(ext.values());
this.extensions = new TreeSet<>(comparator);
this.extensions.addAll(ext.values());
this.outOfSync = false;
}
use of org.eclipse.core.runtime.IConfigurationElement in project eclipse.platform.text by eclipse.
the class AnnotationTypeHierarchy method readTypes.
private Map<String, String> readTypes() {
HashMap<String, String> allTypes = new HashMap<>();
// $NON-NLS-1$
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(EditorsUI.PLUGIN_ID, "annotationTypes");
if (extensionPoint != null) {
IConfigurationElement[] elements = extensionPoint.getConfigurationElements();
for (int i = 0; i < elements.length; i++) {
IConfigurationElement element = elements[i];
// $NON-NLS-1$
String name = element.getAttribute("name");
if (name == null || name.trim().length() == 0)
continue;
// $NON-NLS-1$
String parent = element.getAttribute("super");
if (parent == null || parent.trim().length() == 0)
// $NON-NLS-1$
parent = "";
allTypes.put(name, parent);
}
}
return allTypes;
}
use of org.eclipse.core.runtime.IConfigurationElement in project eclipse.platform.text by eclipse.
the class CodeMiningProviderRegistry 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() {
List<CodeMiningProviderDescriptor> descriptors = new ArrayList<>();
IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(TextEditorPlugin.PLUGIN_ID, CODEMINING_PROVIDERS_EXTENSION_POINT);
for (int i = 0; i < elements.length; i++) {
IConfigurationElement element = elements[i];
try {
CodeMiningProviderDescriptor descriptor = new CodeMiningProviderDescriptor(element);
descriptors.add(descriptor);
} catch (CoreException e) {
TextEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, element.getNamespaceIdentifier(), e.getMessage()));
}
}
fDescriptors = descriptors.toArray(new CodeMiningProviderDescriptor[descriptors.size()]);
fLoaded = true;
}
Aggregations