/** * Create the MarkupContainer for the <tbody> tag. Users may subclass it to provide their own * (modified) implementation. * * @param id * @return A new markup container */ protected WebMarkupContainer newBodyContainer(final String id) { return new WebMarkupContainer(id); }
WebMarkupContainer wmc = new WebMarkupContainer("listWmc"); add(wmc); // init your listView // ... wmc.add(listView);
/** * Factory method for the Modal's header * * @param id The component id * @return The header container */ protected MarkupContainer createHeader(String id) { return new WebMarkupContainer(id); }
protected Component newMenuIcon(MarkupContainer parent, String id, final TreeNode node) { return new WebMarkupContainer(id) { private static final long serialVersionUID = 1L; @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put("style", "background-image: url('" + RequestCycle.get().urlFor(getMenuIcon(node)) + "')"); } }; }
Component workspaceLink(String id, IModel itemModel) { IModel wsNameModel = LayerGroupProvider.WORKSPACE.getModel(itemModel); String wsName = (String) wsNameModel.getObject(); if (wsName != null) { return new SimpleBookmarkableLink( id, WorkspaceEditPage.class, new Model(wsName), "name", wsName); } else { return new WebMarkupContainer(id); } }
final WebMarkupContainer wmc = new WebMarkupContainer("wmc"); final EntityModel<Account> accModel = new EntityModel<Account>(Account.class, id); wmc.setVisible(false); wmc.setOutputMarkupPlaceholderTag(true); form.add(new AjaxCheckBox("cb", new PropertyModel<Boolean>(accModel, "enabled")) { @Override protected void onUpdate(AjaxRequestTarget target) { wmc.setVisible(accModel.isEnabled()); target.addComponent(wmc); // .. more code to write the entity } });
private void addContent(StringValue entryKey) { String id = "content"; if (entryKey == null || entryKey.isEmpty()) { form.add(new WebMarkupContainer(id)); } else { adminEntries.stream().filter(i -> entryKey.toString().equals(i.getKey())).findFirst().ifPresent(i -> { form.add(i.makePanel(id)); }); } }
protected Component createHint(final IModel<String> hintModel) { final WebMarkupContainer hintContainer = new WebMarkupContainer("hint-visual"); if (hintModel == null) { hintContainer.setVisible(false); } else { hintContainer.add(new Label("hint-text", hintModel)); hintContainer.add(HippoIcon.fromSprite("hint-image", Icon.INFO_CIRCLE)); } return hintContainer; }
private WebMarkupContainer newHead(String id) { WebMarkupContainer thisHead = new WebMarkupContainer(id); thisHead.add($b.visibleIf(() -> !ctx.getHint(HIDE_LABEL) || !this.instanceActionsProviders.actionList(this.list).isEmpty())); return thisHead; }
public CodeMirrorEditor(String id, IModel<String> model) { super(id, model); container = new WebMarkupContainer("editorContainer"); container.setOutputMarkupId(true); add(container); editor = new TextArea<String>("editor", new Model<String>((String) model.getObject())); container.add(editor); editor.setOutputMarkupId(true); editor.add(new CodeMirrorBehavior()); }
public NavigationComponent( @NotNull @NonNls String id, @NotNull final LinksDataView dataView, @Nullable ResourceReference styleSheetReference ) { super( id ); if ( styleSheetReference == null ) { add( new EmptyPanel( WicketConstants.ID_STYLE_SHEET ) ); } else { add( new StyleSheetReference( WicketConstants.ID_STYLE_SHEET, styleSheetReference ) ); } WebMarkupContainer container = new WebMarkupContainer( ID_NAVIGATION_UL ); add( container ); container.add( dataView ); } }
/** * @see org.apache.wicket.MarkupContainer#remove(org.apache.wicket.Component) */ @Override public void remove(Component component) { super.remove(component); if (component.getId().equals(getContentId())) { add(empty = new WebMarkupContainer(getContentId())); } }
MasterDetailNoRecordsToolbar(DataTable<?, ?> table) { super(table); final WebMarkupContainer td = new WebMarkupContainer("td"); add(td); td.add(AttributeModifier.replace("colspan", new AbstractReadOnlyModel<String>() { @Override public String getObject() { return String.valueOf(table.getColumns().size()).intern(); } })); td.add(new Label("msg", $m.ofValue("Nenhum item foi adicionado."))); }
@Override protected void onInitialize() { super.onInitialize(); add(new WebMarkupContainer("togglerButton") .add($b.attrAppender("class", "hide", " ", $m.ofValue(!withTogglerButton)))); add(new WebMarkupContainer("_TopAction") .add($b.attrAppender("class", "hide", " ", $m.ofValue(!withTopAction)))); add(configureTopMenu("_TopMenu")); add(new WebMarkupContainer("brandLogo")); }
@Test public void containsClassReturnsFalseForNotAddedBehavior() { final Behavior behavior = new CssClassNameAppender("classname"); final Component component = new WebMarkupContainer("container"); component.add(behavior); assertThat(Behaviors.contains(component, CssClassNameModifier.class), is(equalTo(false))); }
@Override protected void onInitialize() { super.onInitialize(); add(new WebMarkupContainer("togglerButton") .add($b.classAppender("hide", Model.of(!withTogglerButton)))); add(new WebMarkupContainer("_TopAction") .add($b.classAppender("hide"))); add(configureTopMenu("_TopMenu")); addBaseurlAnchor(); }
private WebMarkupContainer createTabPanel(String id, T tab, final int tabIndex, final IModel<Integer> activeTabIndexModel, String tabPanelId) { WebMarkupContainer tabPanel = new WebMarkupContainer(id); tabPanel.add(new AttributeModifier("class", () -> { int activeTab = activeTabIndexModel!=null? activeTabIndexModel.getObject():0; boolean isActive = (tabIndex == activeTab); return "tab" + tabIndex + (isActive?" active":""); })); WebMarkupContainer link = newTabLink("link", tabPanelId, tabIndex); tabPanel.add(link); link.add(newTabTitleLabel("title", wrap(tab.getTitle()), tabIndex)); return tabPanel; }
@Override protected void onBeforeRender() { super.onBeforeRender(); removeAll(); refresableContainer = new WebMarkupContainer("wmc"); add(refresableContainer.setOutputMarkupId(true)); refresableContainer.add(new Upload("panel", this)); }
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); }
@Override protected void onInitialize() { super.onInitialize(); WebMarkupContainer ownerLink = new WebMarkupContainer("ownerLink"); ownerLink.add(new AttributeModifier("href", new ResourceModel("footer.product.owner.addr"))); ownerLink.add(new AttributeModifier("title", new ResourceModel("footer.product.owner.title"))); add(new Label("version", Model.of(getVersion()))); add(ownerLink); }