protected ProgressComponent(String id, final IModel modelObject) { super(id); add(new AttributeModifier("style", new AbstractReadOnlyModel() { @Override public Object getObject() { Object obj = modelObject.getObject(); return generateNewAttributeString(getProgress(obj), obj); } })); }
public LegendGraphicAjaxUpdater( final String wmsURL, final Image image, final IModel<StyleInfo> styleInfoModel) { this.wmsURL = wmsURL; this.image = image; this.styleInfoModel = styleInfoModel; this.urlModel = new Model<String>(wmsURL); this.image.add(new AttributeModifier("src", urlModel)); updateStyleImage(null); }
@Override public void bind(Component component) { super.bind(component); component.setOutputMarkupId(true); component.add(new AttributeModifier("data-offset-top", offset)); component.add(new AttributeModifier("data-spy", "affix")); }
private WebMarkupContainer createContentPanel(String id, T tab, final int tabIndex, final IModel<Integer> activeTabIndexModel) { WebMarkupContainer panel = tab.getPanel(id); panel.setRenderBodyOnly(false); panel.add(new AttributeModifier("class", () -> { int activeTab = activeTabIndexModel!=null? activeTabIndexModel.getObject():0; boolean isActive = (tabIndex == activeTab); return "tab" + tabIndex + (isActive?" tab-pane fade in active":" tab-pane fade"); })); panel.setOutputMarkupId(true); return panel; }
@Override public void onInstantiation(final Component component) { if (component instanceof MarkupContainer) { component.add(new AttributeModifier(attribute, new MarkupSourceModel((MarkupContainer) component))); } }
private WebMarkupContainer createBorder(String cssClass) { WebMarkupContainer border = new WebMarkupContainer("border"); border.add(new AttributeModifier("class", getCssPrefix() + "-" + cssClass)); return border; }
public ListNavigationToolBar(DataTable table, IPagingDefinition pagingDefinition) { super(table); WebMarkupContainer span = new WebMarkupContainer("span"); add(span); span.add(new AttributeModifier("colspan", true, new Model(String.valueOf(table.getColumns().size())))); PagingNavigator pagingNavigator = newPagingNavigator("navigator", table, pagingDefinition); span.add(pagingNavigator); span.add(new NavigatorLabel("navigatorLabel", table)); }
protected void onInitialize() { super.onInitialize(); setOutputMarkupId(true); add(new AttributeModifier("tabindex", "-1")); add(new AttributeModifier("role", "dialog")); add(new AttributeModifier("aria-hidden", "true")); add(new CssClass(getBorderCssClass())); dialog.add(new CssClass(getDialogCssClass())); addToBorder(dialog); }
protected Item newGroupCellItem(String id, int index, IModel<T> model) { Item item = new Item<>(id, index, model); String colspan = String.valueOf(getColumns().size()); item.add(new AttributeModifier("colspan", colspan)); item.add(new CssClass("first-cell last-cell")); item.add(new JavascriptEvent("onclick", "GroupableTable.collapseExpand(this);")); return item; }
/** * * @param id * wicket-id */ public Recommendations(final String id) { super(id, "fb-recommendations"); add(new AttributeModifier("data-header", new PropertyModel<Boolean>(this, "showHeader"))); add(new AttributeModifier("data-linktarget", new EnumModel(new PropertyModel<LinkTarget>( this, "linkTarget")))); }
@Override protected void onInitialize() { super.onInitialize(); setOutputMarkupId(true); add(new AssertTagNameBehavior("input")); add(new AttributeModifier("type", "text")); }
@Override protected LoopItem newItem(int iteration) { LoopItem item = super.newItem(iteration); // add css for enable/disable link long pageIndex = getStartIndex() + iteration; item.add(new AttributeModifier("class", new BootstrapPageLinkCssModel( pageable, pageIndex, "active"))); return item; } };
protected Component createHeaderComponent(String id) { BootstrapModalDefaultHeader header = new BootstrapModalDefaultHeader(id, title); getBorder().add(new AttributeModifier( "aria-labelledby", header.getTitleLabel().getMarkupId())); return header; } protected abstract Component createBodyComponent(String id);
@Override protected void populateItem(ListItem<OrbitSliderContent> item) { item.add(new AttributeModifier("data-orbit-slide", item.getModelObject().getName())); item.add(new Label("heading", item.getModelObject().getHeading())); item.add(new Label("subheading", item.getModelObject().getSubheading())); } };
public NavigationToolbarWithDropDown(SortableTable table, int displayRequiredPageAmount) { super(table); this.displayRequiredPageAmount = displayRequiredPageAmount; WebMarkupContainer span = new WebMarkupContainer("span"); add(span); span.add(new AttributeModifier("colspan", table.getColumns().size())); span.add(newPagingNavigator("navigator", table)); span.add(newNavigatorLabel("navigatorLabel")); }
@Override protected void populateItem(ListItem<SubNavItem> item) { SubNavItem subNavItem = item.getModelObject(); if (subNavItem.isActive()) { item.add(new AttributeModifier("class", "active")); } AbstractLink subNavItemLink = createLink("subNavItemLink", item.getIndex()); item.add(subNavItemLink); subNavItemLink.add(new Label("subNavItemText", subNavItem.getTitle())); } });
protected Item<?> addCSSIcon(String icon) { WebMarkupContainer markupContainer = new WebMarkupContainer("css-icon"); item.add(markupContainer); markupContainer.add(new AttributeModifier("class", icon)); Image image = new Image("regular-image", "not-there.gif"); image.setVisible(false); item.add(image); return item; } }
public DragDropList(String id, IModel<? extends List<? extends T>> listModel, IChoiceRenderer<T> renderer) { super(id, listModel); this.renderer = renderer; add(new AttributeModifier("dojoType", "artifactory.dnd.Source")); add(new AttributeAppender("accept", new PropertyModel(this, "acceptedDndTypes"), ",")); add(new DndListView("list", listModel)); }
protected void populateItem(ListItem<T> item) { item.add(new AttributeModifier("dndType", new DndTypeModel())); item.add(new CssClass("dojoDndItem")); T itemObject = item.getModelObject(); item.add(new Label("name", getItemDisplayValue(itemObject))); LinksColumnPanel linksPanel = new LinksColumnPanel("actions"); item.add(linksPanel); List<? extends AbstractLink> links = getItemActions(itemObject, "link"); for (AbstractLink link : links) { linksPanel.addLink(link); } }
private void addTooltip(AttributeDefinition attribute) { Image tooltip = new Image("tooltip", new ResourceReference(AbstractField.class, "balloon.png")); if (attribute.hasDescription()) { tooltip.add(new AttributeModifier("title", true, new LocalizableStringModel(this, attribute .getDescription()))); } else { tooltip.setVisible(false); } add(tooltip); }