use of org.eclipse.che.ide.editor.orion.client.jso.OrionServiceRegistryOverlay in project che by eclipse.
the class OrionContentTypeRegistrant method registerFileType.
public void registerFileType(final OrionContentTypeOverlay contentType, final OrionHighlightingConfigurationOverlay config) {
// register content type and configure orion
JsArrayString extensions = contentType.getExtensions();
for (int i = 0; i < extensions.length(); i++) {
String extension = extensions.get(i);
fileTypeIdentifier.registerNewExtension(extension, newArrayList(contentType.getId()));
}
editorModule.getInitializerPromise().then(new Operation<Void>() {
@Override
public void apply(Void arg) throws OperationException {
OrionServiceRegistryOverlay serviceRegistry = codeEditWidgetProvider.get().getServiceRegistry();
serviceRegistry.doRegisterService("orion.core.contenttype", JavaScriptObject.createObject(), contentType.toServiceObject());
serviceRegistry.doRegisterService("orion.edit.highlighter", JavaScriptObject.createObject(), config);
}
});
}
Aggregations