Search in sources :

Example 1 with HtmlPrettyPrinterVisitor

use of org.whole.lang.html.visitors.HtmlPrettyPrinterVisitor in project whole by wholeplatform.

the class LegacyContributionExtensionsDeployer method deploy.

public void deploy(ReflectionFactory platform) {
    try {
        InterpreterOperation.interpret(XmlBuilderPersistenceKit.instance().readModel(new ClasspathPersistenceProvider("org/whole/lang/html/HTML5Semantics.xwl")));
        InterpreterOperation.interpret(XmlBuilderPersistenceKit.instance().readModel(new ClasspathPersistenceProvider("org/whole/lang/html/HTML5Actions.xwl")));
        InterpreterOperation.interpret(XmlBuilderPersistenceKit.instance().readModel(new ClasspathPersistenceProvider("org/whole/lang/javascript/JavaScriptSemantics.xwl")));
        InterpreterOperation.interpret(XmlBuilderPersistenceKit.instance().readModel(new ClasspathPersistenceProvider("org/whole/lang/javascript/JavaScriptActions.xwl")));
        InterpreterOperation.interpret(XmlBuilderPersistenceKit.instance().readModel(new ClasspathPersistenceProvider("org/whole/lang/mediawiki/MediaWikiActions.xwl")));
        InterpreterOperation.interpret(XmlBuilderPersistenceKit.instance().readModel(new ClasspathPersistenceProvider("org/whole/lang/ui/CaretActionsSemantics.xwl")));
    } catch (Exception e) {
        throw new IllegalStateException(e);
    }
    platform.addPersistenceKit("org.whole.lang.html.Html5Editor", HtmlPersistenceKit.instance());
    platform.addOperationFactory(LegacyMetaModelsDeployer.HTML5_URI, PrettyPrinterOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return new HtmlPrettyPrinterVisitor((PrettyPrinterOperation) operation);
        }
    });
    platform.addOperationFactory(JavaScriptLanguageKit.URI, InterpreterOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            if (stage == 0)
                return new JavaScriptInterpreterVisitor();
            else
                return null;
        }
    });
}
Also used : IOperation(org.whole.lang.operations.IOperation) PrettyPrinterOperation(org.whole.lang.operations.PrettyPrinterOperation) IVisitor(org.whole.lang.visitors.IVisitor) ClasspathPersistenceProvider(org.whole.lang.codebase.ClasspathPersistenceProvider) JavaScriptInterpreterVisitor(org.whole.lang.javascript.visitors.JavaScriptInterpreterVisitor) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) HtmlPrettyPrinterVisitor(org.whole.lang.html.visitors.HtmlPrettyPrinterVisitor)

Aggregations

ClasspathPersistenceProvider (org.whole.lang.codebase.ClasspathPersistenceProvider)1 HtmlPrettyPrinterVisitor (org.whole.lang.html.visitors.HtmlPrettyPrinterVisitor)1 JavaScriptInterpreterVisitor (org.whole.lang.javascript.visitors.JavaScriptInterpreterVisitor)1 IOperation (org.whole.lang.operations.IOperation)1 PrettyPrinterOperation (org.whole.lang.operations.PrettyPrinterOperation)1 IVisitor (org.whole.lang.visitors.IVisitor)1 IVisitorFactory (org.whole.lang.visitors.IVisitorFactory)1