@Override protected IStatus run(IProgressMonitor monitor) { logger.debug("Running language added job for {}", language); final Display display = Display.getDefault(); // Add editor associations final ResourceExtensionFacet resourceExtensionsFacet = language.facet(ResourceExtensionFacet.class); if (resourceExtensionsFacet == null) { final String message = String.format( "Cannot create editor association for %s, no resource extensions facet was found", language); logger.error(message); } else { final Iterable<String> extensions = resourceExtensionsFacet.extensions(); logger.debug( "Associating extension(s) {} to Spoofax editor", Joiner.on(", ").join(extensions)); display.asyncExec( new Runnable() { @Override public void run() { EditorMappingUtils.set(editorRegistry, SpoofaxEditor.id, extensions); } }); } // Enable editors final Iterable<SpoofaxEditor> spoofaxEditors = spoofaxEditorListener.openEditors(); for (SpoofaxEditor editor : spoofaxEditors) { editor.enable(); } return StatusUtils.success(); }