Search in sources :

Example 1 with OrionServiceRegistryOverlay

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);
        }
    });
}
Also used : JsArrayString(com.google.gwt.core.client.JsArrayString) JsArrayString(com.google.gwt.core.client.JsArrayString) OrionServiceRegistryOverlay(org.eclipse.che.ide.editor.orion.client.jso.OrionServiceRegistryOverlay) OperationException(org.eclipse.che.api.promises.client.OperationException)

Aggregations

JsArrayString (com.google.gwt.core.client.JsArrayString)1 OperationException (org.eclipse.che.api.promises.client.OperationException)1 OrionServiceRegistryOverlay (org.eclipse.che.ide.editor.orion.client.jso.OrionServiceRegistryOverlay)1