/** * Construct. * * @param id * @param child * child component that will control the visibility of the enclosure */ public EnclosureContainer(final String id, final Component child) { super(id); if (child == null) { throw new NullPointerException("Parameter 'child' must not be null"); } this.child = child; // Usually we don't want this extra tag setRenderBodyOnly(true); }
/** * Construct. * * @param componentId The non-null id of this component * @param model The component's model */ public Navbar(final String componentId, final IModel<?> model) { super(componentId, model); BootstrapResourcesBehavior.addTo(this); final TransparentWebMarkupContainer container = newContainer("container"); final TransparentWebMarkupContainer collapse = newCollapseContainer("collapse"); final TransparentWebMarkupContainer collapseButton = newCollapseButton("collapseButton", "#" + collapse.getMarkupId()); this.brandNameLink = newBrandNameLink("brandName"); final Component leftAlignedComponentListView = newNavigation("navLeftList", newPositionDependedComponentModel(components, POSITION_FILTER_LEFT)); final Component rightAlignedComponentListView = newNavigation("navRightList", newPositionDependedComponentModel(components, POSITION_FILTER_RIGHT)); extraItems = new RepeatingView("extraItems"); collapse.add(extraItems); activeStateAppender = new CssClassNameAppender("active"); invertModel = Model.of(""); EnclosureContainer navLeftListEnclosure = new EnclosureContainer("navLeftListEnclosure", leftAlignedComponentListView); navLeftListEnclosure.add(leftAlignedComponentListView); navLeftListEnclosure.setRenderBodyOnly(false).setOutputMarkupPlaceholderTag(true); EnclosureContainer navRightListEnclosure = new EnclosureContainer("navRightListEnclosure", rightAlignedComponentListView); navRightListEnclosure.add(rightAlignedComponentListView); navRightListEnclosure.setRenderBodyOnly(false).setOutputMarkupPlaceholderTag(true); collapse.add(navLeftListEnclosure, navRightListEnclosure); container.add(collapse, collapseButton, brandNameLink); collapseButton.add(newToggleNavigationLabel("toggleNavigationLabel")); add(container); }
/** * Overriden to set the visibility depending on childs {@link #determineVisibility()}. */ @Override protected void onConfigure() { super.onConfigure(); child.configure(); setVisible(child.determineVisibility()); } }
/** * Overriden to set the visibility depending on childs {@link #determineVisibility()}. */ @Override protected void onConfigure() { super.onConfigure(); child.configure(); setVisible(child.determineVisibility()); } }
/** * Construct. * * @param id * @param child * child component that will control the visibility of the enclosure */ public EnclosureContainer(final String id, final Component child) { super(id); Args.notNull(child, "child"); this.child = child; // Usually we don't want this extra tag setRenderBodyOnly(true); }
/** * Construct. * * @param id * @param child * child component that will control the visibility of the enclosure */ public EnclosureContainer(final String id, final Component child) { super(id); Args.notNull(child, "child"); this.child = child; // Usually we don't want this extra tag setRenderBodyOnly(true); }