public class HomePage extends WebPage { public HomePage() { add(new Label("label", "<ul><li>test</li><li>test</li><li>test</li><li>test</li><li>test</li></ul>") .setEscapeModelStrings(false)); add(new WebComponent("html") { @Override protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { Response response = getRequestCycle().getResponse(); response.write("<ul>"); for (int i = 0; i < 5; i++) response.write("<li>test</li>"); response.write("</ul>"); } }); } }
WebComponent base = new WebComponent("base"); add(base); base.add(new AttributeModifier("href", "<the url>"));
@Override public Component resolve(MarkupContainer container, MarkupStream markupStream, ComponentTag tag) { // localize any raw markup that has wicket:message attrs if ((tag != null) && (tag.getId().startsWith(getWicketMessageIdPrefix(markupStream)))) { Component wc; String id = tag.getId(); if (tag.isOpenClose()) { wc = new WebComponent(id); } else { wc = new TransparentWebMarkupContainer(id); } return wc; } return null; }
@Override public Component resolve(MarkupContainer container, MarkupStream markupStream, ComponentTag tag) { // localize any raw markup that has wicket:message attrs if ((tag != null) && (tag.getId().startsWith(getWicketMessageIdPrefix(markupStream)))) { Component wc; String id = tag.getId(); if (tag.isOpenClose()) { wc = new WebComponent(id); } else { wc = new TransparentWebMarkupContainer(id); } return wc; } return null; }
editor = new WebComponent("tile-editor"); add(editor); tileName = new Label("tile-name", "");
if (tag.isOpenClose()) wc = new WebComponent(id);
public TopPlugin(final IPluginContext context, final IPluginConfig config) { super(context, config); final WebMarkupContainer logo = new WebMarkupContainer("logo"); logo.add(TitleAttribute.set("Hippo Release Version: " + SYSTEM_INFO.getReleaseVersion())); add(logo); final WebComponent toolbar = new WebComponent(BAR_STYLES); final String style = obtainBreadcrumbStyle(config); if (StringUtils.isNotBlank(style)) { toolbar.add(AttributeModifier.replace("style", style)); } add(toolbar); }
if (tag.isOpenClose()) wc = new WebComponent(id);
/** * Adds components. */ private final void initComps() { WebComponent meta = new WebComponent("meta"); PageParameters parameters = new PageParameters(); parameters.put("cto", continueTo); CharSequence url = urlFor(new BookmarkablePageRequestTarget(BrowserInfoPage.class, parameters)); meta.add(new AttributeModifier("content", true, new Model<String>("0; url=" + url))); add(meta); WebMarkupContainer link = new WebMarkupContainer("link"); link.add(new AttributeModifier("href", true, new Model<Serializable>((Serializable)url))); add(link); add(new BrowserInfoForm("postback") { private static final long serialVersionUID = 1L; /** * @see org.apache.wicket.markup.html.pages.BrowserInfoForm#afterSubmit() */ @Override protected void afterSubmit() { continueToPrevious(); } }); }
/** * Adds components. */ private final void initComps() { WebComponent meta = new WebComponent("meta"); PageParameters parameters = new PageParameters(); parameters.put("cto", continueTo); CharSequence url = urlFor(new BookmarkablePageRequestTarget(BrowserInfoPage.class, parameters)); meta.add(new AttributeModifier("content", true, new Model("0; url=" + url))); add(meta); WebMarkupContainer link = new WebMarkupContainer("link"); link.add(new AttributeModifier("href", true, new Model((Serializable)url))); add(link); add(new BrowserInfoForm("postback") { private static final long serialVersionUID = 1L; /** * @see org.apache.wicket.markup.html.pages.BrowserInfoForm#afterSubmit() */ protected void afterSubmit() { continueToPrevious(); } }); }
/** * Constructor * * @param id * @param model * @param max * max number of files a user can upload * */ public MultiFileUploadField(String id, IModel model, int max) { super(id, model); this.max = max; upload = new WebComponent("upload"); upload.setOutputMarkupId(true); add(upload); container = new WebMarkupContainer("container"); container.setOutputMarkupId(true); add(container); container.add(new Label("caption", new CaptionModel())); }
/** * Constructor * * @param id * @param model * @param max * max number of files a user can upload * */ @SuppressWarnings("unchecked") public MultiFileUploadField(String id, IModel<? extends Collection<FileUpload>> model, int max) { super(id, (IModel<Collection<FileUpload>>)model); this.max = max; upload = new WebComponent("upload"); upload.setOutputMarkupId(true); add(upload); container = new WebMarkupContainer("container"); container.setOutputMarkupId(true); add(container); container.add(new Label("caption", new CaptionModel())); }
/** * * @see org.apache.wicket.markup.resolver.IComponentResolver#resolve(org.apache.wicket.MarkupContainer, * org.apache.wicket.markup.MarkupStream, org.apache.wicket.markup.ComponentTag) */ public boolean resolve(MarkupContainer container, MarkupStream markupStream, ComponentTag tag) { // localize any raw markup that has wicket:message attrs if (WICKET_MESSAGE_CONTAINER_ID.equals(tag.getId())) { Component wc = null; if (tag.isOpenClose()) { wc = new WebComponent(WICKET_MESSAGE_CONTAINER_ID + container.getPage().getAutoIndex()); } else { wc = new TransparentContainer(WICKET_MESSAGE_CONTAINER_ID + container.getPage().getAutoIndex()); } container.autoAdd(wc, markupStream); return true; } return false; }
/** * * @see org.apache.wicket.markup.resolver.IComponentResolver#resolve(org.apache.wicket.MarkupContainer, * org.apache.wicket.markup.MarkupStream, org.apache.wicket.markup.ComponentTag) */ public boolean resolve(MarkupContainer container, MarkupStream markupStream, ComponentTag tag) { // localize any raw markup that has wicket:message attrs if (WICKET_MESSAGE_CONTAINER_ID.equals(tag.getId())) { Component wc = null; if (tag.isOpenClose()) { wc = new WebComponent(WICKET_MESSAGE_CONTAINER_ID + container.getPage().getAutoIndex()); } else { wc = new WebMarkupContainer(WICKET_MESSAGE_CONTAINER_ID + container.getPage().getAutoIndex()); } container.autoAdd(wc, markupStream); return true; } return false; } }
public ProgressPanel(String id, ProgressionModel model) { super(id, model); this.model = model; feedbackPanel = new CustomFeedbackPanel("feedbackPanel"); //$NON-NLS-1$ add(feedbackPanel); container = new WebMarkupContainer("container"); //$NON-NLS-1$ add(container); WebComponent bar = new WebComponent("bar"); //$NON-NLS-1$ bar.add(new AttributeModifier("style", getWidthModel(model))); //$NON-NLS-1$ container.add(bar); Label taskname = new Label("taskname", getTaskNameModel(model)); //$NON-NLS-1$ container.add(taskname); Label subtask = new Label("subtask", getSubTaskModel(model)); //$NON-NLS-1$ container.add(subtask); setVisible(false); container.add(new AjaxLink<Void>("cancel") { private static final long serialVersionUID = 3623515953111747368L; @Override public void onClick(AjaxRequestTarget target) { Activator.getDefault().getProgressService().cancel(ProgressPanel.this.model.getId()); } }); }
@Override protected void onInitialize() { super.onInitialize(); add(dataField = new TextField<String>("data", Model.of(getModelObject()))); WebComponent fileInput = new WebComponent("fileInput"); fileInput.setOutputMarkupId(true); add(fileInput); add(new WebMarkupContainer("fileLabel") { @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put("for", fileInput.getMarkupId()); } }); add(behavior = new AbstractPostAjaxBehavior() { @Override protected void respond(AjaxRequestTarget target) { send(AvatarUploadField.this, Broadcast.BUBBLE, new AvatarFileSelected(target)); } }); }
private void addImageHistoryFLow() { WebComponent imageHistFlow; if (requirementPK != null) { String classCss = " col-md-12 "; FlowInstance flowInstance = requirementService.getRequirement(requirementPK).getFlowInstance(); flowInstance.getTasksOlderFirst(); if (flowInstance.getFlowDefinition().getFlowMap().getAllTasks().size() <= QUANTIDADE_MAX_TAKS_TO_MIDDLE_SIZE) { classCss = " col-md-6 col-md-offset-3 "; } byte[] bytes = generateHistImage(flowInstance); DynamicImageResource imageResource = new DynamicImageResource() { @Override protected byte[] getImageData(IResource.Attributes attributes) { return bytes; } }; imageHistFlow = new Image("imageHist", imageResource); imageHistFlow.setVisible(bytes.length != 0); imageHistFlow.add(new AttributeAppender("class", classCss)); } else { imageHistFlow = new WebComponent("imageHist"); imageHistFlow.setVisible(false); } add(imageHistFlow); }
public LinksColumnPanel(String id) { super(id); add(ResourcePackage.forJavaScript(LinksColumnPanel.class)); linksPanel = new LinksPanel("links"); linksPanel.setOutputMarkupId(true); add(linksPanel); WebComponent icon = new WebComponent("icon"); icon.setOutputMarkupId(true); add(icon); HtmlTemplate initScript = new HtmlTemplate("initScript"); initScript.setParameter("iconId", new PropertyModel(icon, "markupId")); initScript.setParameter("panelId", new PropertyModel(linksPanel, "markupId")); add(initScript); }
Component linkImage = new WebComponent("searchLinkImage").setVisible(false); if (pBuilder.imageResource != null || pBuilder.imageResourceReference != null)