From d60bf9b546bca3e479668de801e8821e19abbb9e Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 7 Apr 2019 12:44:36 +0200 Subject: Added layouts for rocker views --- src/main/resources/generated-views/fileview.java | 61 +++++++++++++++--------- 1 file changed, 38 insertions(+), 23 deletions(-) (limited to 'src/main/resources/generated-views/fileview.java') diff --git a/src/main/resources/generated-views/fileview.java b/src/main/resources/generated-views/fileview.java index 14b1a70..7400da2 100644 --- a/src/main/resources/generated-views/fileview.java +++ b/src/main/resources/generated-views/fileview.java @@ -11,6 +11,9 @@ import java.io.IOException; @SuppressWarnings("unused") public class fileview extends com.fizzed.rocker.runtime.DefaultRockerModel { + // argument @ [1:2] + private String filename; + static public com.fizzed.rocker.ContentType getContentType() { return com.fizzed.rocker.ContentType.HTML; } @@ -24,20 +27,20 @@ public class fileview extends com.fizzed.rocker.runtime.DefaultRockerModel { } static public String getHeaderHash() { - return "868254209"; + return "-79956506"; } static public long getModifiedAt() { - return 1554408818000L; - } - - static public String[] getArgumentNames() { - return new String[]{"content"}; + return 1554633681210L; } // argument @ [1:2] private String content; + static public String[] getArgumentNames() { + return new String[]{"content", "filename"}; + } + public fileview content(String content) { this.content = content; return this; @@ -47,9 +50,19 @@ public class fileview extends com.fizzed.rocker.runtime.DefaultRockerModel { return this.content; } - static public fileview template(String content) { + static public fileview template(String content, String filename) { return new fileview() - .content(content); + .content(content) + .filename(filename); + } + + public fileview filename(String filename) { + this.filename = filename; + return this; + } + + public String filename() { + return this.filename; } @Override @@ -60,19 +73,18 @@ public class fileview extends com.fizzed.rocker.runtime.DefaultRockerModel { static public class Template extends com.fizzed.rocker.runtime.DefaultRockerTemplate { - // \n\n\n \n \n \n Fileview\n\n\n + // \n static private final byte[] PLAIN_TEXT_0_0; - // \n\n\n - static private final byte[] PLAIN_TEXT_1_0; static { PlainTextUnloadedClassLoader loader = PlainTextUnloadedClassLoader.tryLoad(fileview.class.getClassLoader(), fileview.class.getName() + "$PlainText", "UTF-8"); PLAIN_TEXT_0_0 = loader.tryGet("PLAIN_TEXT_0_0"); - PLAIN_TEXT_1_0 = loader.tryGet("PLAIN_TEXT_1_0"); } // argument @ [1:2] protected final String content; + // argument @ [1:2] + protected final String filename; public Template(fileview model) { super(model); @@ -81,26 +93,29 @@ public class fileview extends com.fizzed.rocker.runtime.DefaultRockerModel { __internal.setTemplateName(getTemplateName()); __internal.setTemplatePackageName(getTemplatePackageName()); this.content = model.content(); + this.filename = model.filename(); } @Override protected void __doRender() throws IOException, RenderingException { - // PlainText @ [1:23] - __internal.aboutToExecutePosInTemplate(1, 23); - __internal.writeValue(PLAIN_TEXT_0_0); - // ValueExpression @ [13:5] - __internal.aboutToExecutePosInTemplate(13, 5); - __internal.renderValue(content, false); - // PlainText @ [13:13] - __internal.aboutToExecutePosInTemplate(13, 13); - __internal.writeValue(PLAIN_TEXT_1_0); + // ValueClosureBegin @ [3:1] + __internal.aboutToExecutePosInTemplate(3, 1); + __internal.renderValue(layout.template("File " + filename).__body(() -> { + // ValueExpression @ [4:1] + __internal.aboutToExecutePosInTemplate(4, 1); + __internal.renderValue(content, false); + // PlainText @ [4:9] + __internal.aboutToExecutePosInTemplate(4, 9); + __internal.writeValue(PLAIN_TEXT_0_0); + // ValueClosureEnd @ [3:1] + __internal.aboutToExecutePosInTemplate(3, 1); + }), false); // value closure end @ [3:1] } } private static class PlainText { - static private final String PLAIN_TEXT_0_0 = "\n\n\n \n \n \n Fileview\n\n\n "; - static private final String PLAIN_TEXT_1_0 = "\n\n\n"; + static private final String PLAIN_TEXT_0_0 = "\n"; } -- cgit v1.2.3