/** * Sets the page this component belongs on. * Null to reset the page hierarchy for all children * <p> * * @param page * A Page * * @see com.jwebmp.core.base.interfaces.IComponentHierarchyBase#setPage(Page) */ @Override @SuppressWarnings("unchecked") public J setPage(Page page) { this.page = page; getChildren().forEach(child -> child.setPage(page)); return (J) this; }
/** * Add a new child to this component * <p> * * @param newChild * The child to be added * <p> * * @return The new child added */ @Override @SuppressWarnings("unchecked") @NotNull public J add(@NotNull C newChild) { newChild.setParent(this); newChild.setTiny(isTiny()); newChild.setPage(getPage()); getChildren().add(newChild); newChild.init(); newChild.preConfigure(); return (J) this; }
@Override public void preConfigure() { @SuppressWarnings("unchecked") Set<IComponentHierarchyBase> crumbChildren = this.crumbs.getChildren(); if (!crumbChildren.isEmpty()) { crumbChildren.forEach(next -> next.removeClass(BSComponentBreadcrumbOptions.Active)); List<IComponentHierarchyBase> sortedCrumbs = new ArrayList<>(crumbChildren); sortedCrumbs.get(sortedCrumbs.size() + (!sortedCrumbs.isEmpty() ? -1 : 0)) .addClass(BSComponentBreadcrumbOptions.Active); } super.preConfigure(); }
/** * Renders each child * * @return * * @see ComponentHTMLBase#renderChildren() */ @Override @NotNull protected StringBuilder renderChildren() { StringBuilder sb = new StringBuilder(); if (renderBeforeChildren() != null) { sb.append(renderBeforeChildren()); } getChildren().forEach(child -> sb.append(getNewLine()) .append(child.toString(child.asBase() .isTiny() ? 0 : getCurrentTabIndents() + 1))); if (renderAfterChildren() != null) { sb.append(renderAfterChildren()); } return sb; }
/** * Sets the contents * * @param contents */ public final void setContents(List contents) { this.contents = contents; if (contents != null) { contents.addClass(BSComponentDropDownOptions.Dropdown_Menu); contents.addClass(""); title.asAttributeBase() .addAttribute(ButtonAttributes.Data_Toggle.toString(), ToggleString); title.asAttributeBase() .addAttribute(ButtonAttributes.Data_Target.toString(), contents.getID(true)); } } }
@Override public void preConfigure() { if (!isConfigured()) { getChildren().forEach(a -> a.addClass("d-block")); } super.preConfigure(); } }
/** * Overrides this and all below components to set tiny false * * @param tiny * * @return super.tiny * * @see ComponentEventBase#setTiny(boolean) */ @Override @NotNull public J setTiny(boolean tiny) { getChildren().forEach(child -> child.setTiny(tiny)); return super.setTiny(tiny); }
/** * Adds the children of this component onto the array list coming in * <p> * <p> * <p> * * @param componentsToAddTo * The component Array List to add to * <p> * * @return original components added with * <p> * see com.jwebmp.core.base.interfaces.IComponentHierarchyBase#getChildrenHierarchy(Set ComponentHierarchyBase ?, ?, ?, ?, ? ) */ @Override @NotNull public Set<ComponentHierarchyBase<IComponentHierarchyBase, ?, ?, ?, ?>> getChildrenHierarchy(@NotNull Set<ComponentHierarchyBase<IComponentHierarchyBase, ?, ?, ?, ?>> componentsToAddTo) { getChildren().forEach(child -> { componentsToAddTo.add((ComponentHierarchyBase<IComponentHierarchyBase, ?, ?, ?, ?>) child); child.getChildrenHierarchy(componentsToAddTo); }); return componentsToAddTo; }
/** * Add a new child to this component * <p> * * @param newChild * The child to be added * <p> * * @return The new child added */ @Override @SuppressWarnings("unchecked") @NotNull public J add(@NotNull C newChild) { newChild.setParent(this); newChild.setTiny(isTiny()); newChild.setPage(getPage()); getChildren().add(newChild); newChild.init(); newChild.preConfigure(); return (J) this; }
/** * Renders each child * * @return * * @see ComponentHTMLBase#renderChildren() */ @Override @NotNull protected StringBuilder renderChildren() { StringBuilder sb = new StringBuilder(); if (renderBeforeChildren() != null) { sb.append(renderBeforeChildren()); } getChildren().forEach(child -> sb.append(getNewLine()) .append(child.toString(child.asBase() .isTiny() ? 0 : getCurrentTabIndents() + 1))); if (renderAfterChildren() != null) { sb.append(renderAfterChildren()); } return sb; }
@Override public void preConfigure() { @SuppressWarnings("unchecked") Set<IComponentHierarchyBase> crumbChildren = this.crumbs.getChildren(); if (!crumbChildren.isEmpty()) { crumbChildren.forEach(next -> next.removeClass(BSComponentBreadcrumbOptions.Active)); List<IComponentHierarchyBase> sortedCrumbs = new ArrayList<>(crumbChildren); sortedCrumbs.get(sortedCrumbs.size() + (!sortedCrumbs.isEmpty() ? -1 : 0)) .addClass(BSComponentBreadcrumbOptions.Active); } super.preConfigure(); }
/** * Sets the contents * * @param contents */ public final void setContents(List contents) { this.contents = contents; if (contents != null) { contents.addClass(BSComponentDropDownOptions.Dropdown_Menu); contents.addClass(""); title.asAttributeBase() .addAttribute(ButtonAttributes.Data_Toggle.toString(), ToggleString); title.asAttributeBase() .addAttribute(ButtonAttributes.Data_Target.toString(), contents.getID(true)); } } }
@Override public void preConfigure() { if (!isConfigured()) { getChildren().forEach(a -> a.addClass("d-block")); } super.preConfigure(); } }
/** * Sets the page this component belongs on. * Null to reset the page hierarchy for all children * <p> * * @param page * A Page * * @see com.jwebmp.core.base.interfaces.IComponentHierarchyBase#setPage(Page) */ @Override @SuppressWarnings("unchecked") public J setPage(Page page) { this.page = page; getChildren().forEach(child -> child.setPage(page)); return (J) this; }
/** * Overrides this and all below components to set tiny false * * @param tiny * * @return super.tiny * * @see ComponentEventBase#setTiny(boolean) */ @Override @NotNull public J setTiny(boolean tiny) { getChildren().forEach(child -> child.setTiny(tiny)); return super.setTiny(tiny); }
/** * Renders each child * * @return * * @see ComponentHTMLBase#renderChildren() */ @Override @NotNull protected StringBuilder renderChildren() { StringBuilder sb = new StringBuilder(); if (renderBeforeChildren() != null) { sb.append(renderBeforeChildren()); } getChildren().forEach(child -> sb.append(getNewLine()) .append(child.toString(child.asBase() .isTiny() ? 0 : getCurrentTabIndents() + 1))); if (renderAfterChildren() != null) { sb.append(renderAfterChildren()); } return sb; }
@Override public void preConfigure() { @SuppressWarnings("unchecked") Set<IComponentHierarchyBase> crumbChildren = this.crumbs.getChildren(); if (!crumbChildren.isEmpty()) { crumbChildren.forEach(next -> next.removeClass(BSComponentBreadcrumbOptions.Active)); List<IComponentHierarchyBase> sortedCrumbs = new ArrayList<>(crumbChildren); sortedCrumbs.get(sortedCrumbs.size() + (!sortedCrumbs.isEmpty() ? -1 : 0)) .addClass(BSComponentBreadcrumbOptions.Active); } super.preConfigure(); }
@Override public void preConfigure() { if (!isConfigured()) { getChildren().forEach(a -> a.addClass("d-block")); } super.preConfigure(); } }
/** * Sets the page this component belongs on. * Null to reset the page hierarchy for all children * <p> * * @param page * A Page * * @see com.jwebmp.core.base.interfaces.IComponentHierarchyBase#setPage(Page) */ @Override @SuppressWarnings("unchecked") public J setPage(Page page) { this.page = page; getChildren().forEach(child -> child.setPage(page)); return (J) this; }
/** * Overrides this and all below components to set tiny false * * @param tiny * * @return super.tiny * * @see ComponentEventBase#setTiny(boolean) */ @Override @NotNull public J setTiny(boolean tiny) { getChildren().forEach(child -> child.setTiny(tiny)); return super.setTiny(tiny); }