@Import(stack = "internal") void beginRender() { } }
@Import(stylesheet = "service-status.css") void onAfterRenderFromServices() { } }
/** * Page class to test <a href="https://issues.apache.org/jira/browse/TAP5-2197">TAP5-2197</a>. */ @Import(stylesheet = "context:css/via-import.css") public class AtImportWithoutStackButWithStylesheet { }
/** * Demonstrates the use of expressions within a javascript function. See TAP5-1620 */ @Import(stack = "core", library = "ExpressionInJsFunction.js") public class ExpressionInJsFunction { }
/** * Start page of the test app. * */ @Import(stack = "core") public class Index { }
/** * @since 5.3 */ @Import(module = "client-console-demo") public class ClientConsoleDemo { }
@Import(stack = "core", library = "PublishEventDemo.js") public class PublishEventDemo { @PublishEvent JSONObject onAction() { return new JSONObject("origin", "pageAction"); } @OnEvent("answer") @PublishEvent JSONObject answer() { return new JSONObject("origin", "pageAnswer"); } }
@Import(stack = "core") public class Layout { }
@Import(library = { "context:qunit/qunit-1.9.0.js", "qunit-config.js", "test-dom.js", "test-messages.js", "test-validation.js", "test-utils.js", // This must come last: "qunit-driver.js"}, stylesheet = "context:qunit/qunit-1.9.0.css") public class JavaScriptTests { }
/** * This mixin allows you change the look of the original checkboxes. * * @since 2.1.1 * @see <a href="http://access.aol.com/csun2011">http://access.aol.com/csun2011</a> * * @tapestrydoc */ @Import(stylesheet = {"${jquery.assets.root}/vendor/components/checkbox/jquery.ui.checkbox.css"}) public class Checkbox extends org.apache.tapestry5.corelib.components.Checkbox{ @Environmental private JavaScriptSupport javaScriptSupport; void afterRender() { JSONObject data = new JSONObject(); data.put("id", getClientId()); javaScriptSupport.require("tjq/checkbox").with(data); } }
@Import(module = {"validate-in-error"}) public class ValidateInErrorEvent { @Property private String value; }
@Import(stack = "core") public class OnPrepareDemo { @Property private User user; void onPrepare() { user = new User(); } }
@Import(stylesheet = "${jquery.assets.root}/vendor/mixins/jscrollpane/jquery.jscrollpane.css") public class JScrollPane { /** * The JSON parameter for your widget */ @Parameter(defaultPrefix=BindingConstants.LITERAL) private JSONObject options; @InjectContainer private ClientElement clientElement; @Inject private JavaScriptSupport js; void afterRender() { if(options == null) options = new JSONObject(); JSONObject opt = new JSONObject(); opt.put("id", clientElement.getClientId()); opt.put("params", options); js.require("tjq/jscrollpane").with(opt); } }
/** * Renders out an object using the @{@link Primary} {@link ObjectRenderer} service. Used primarily on the * {@link ExceptionReport} page. * This is focused on objects that have a specific {@link ObjectRenderer} strategy. The {@link BeanDisplay} component is * used for displaying the contents of arbitrary objects in terms of a series of property names and values. * * @tapestrydoc */ @Import(stylesheet = "RenderObject.css") public class RenderObject { @Parameter(required = true) private Object object; @Inject @Primary private ObjectRenderer<Object> renderer; boolean beginRender(MarkupWriter writer) { renderer.render(object, writer); return false; } }
@Import(stack = "core") public class ClientValidationDemo { @Property @Persist private TestEntity testEntity; public StringValueEncoder getStringValueEncoder() { return new StringValueEncoder(); } }
@Import(stylesheet="typeahead-bootstrap3.css") void afterRender() { Link link = resources.createEventLink(EVENT_NAME, context); JSONObject spec = new JSONObject("id", field.getClientId(), "url", link.toString()).put("minChars", minChars).put("limit", maxSuggestions); jsSupport.require("t5/core/autocomplete").with(spec); }
@Import(stack = "core") public class BeanEditFormValidationDemo { @Property @Persist private User user; }
/** * A default layout for a number of internal pages in Tapestry, such as {@link org.apache.tapestry5.corelib.pages.ServiceStatus} and {@link org.apache.tapestry5.corelib.pages.PageCatalog}. * <strong>This component is not intended for use in user applications, and may change at any time.</strong> * * @tapestrydoc * @since 5.3 */ @Import(stack="core") public class InternalLayout { @Property @Parameter private Block leftNav; @Property @Parameter(required = true, defaultPrefix = BindingConstants.LITERAL) private String title; @Inject @Symbol(SymbolConstants.TAPESTRY_VERSION) @Property private String frameworkVersion; }
@Import(stack = "core") public class InjectValidatorDemo { @NotNull(groups=Bar.class) @Validate("minlength=5") @Property @Persist private String userName; @Inject private Validator validator; @InjectComponent private Form form; void onValidateFromForm() { Set<ConstraintViolation<InjectValidatorDemo>> violations = validator.validate(this, Bar.class); for (ConstraintViolation<InjectValidatorDemo> next : violations) { form.recordError("User Name "+next.getMessage()); } } }
@Import(stylesheet = "context:css/via-import.css") void afterRender() { javascriptSupport.importStylesheet(new StylesheetLink(ieOnly, new StylesheetOptions(null, "IE"))); javascriptSupport.importJavaScriptLibrary(getAssetWithWrongChecksumUrl()); }