/** {@inheritDoc} */ @Override public String insertBefore(MarkupContainer component, MarkupContainer parent) { String script = insertBefore( getComponentTag(component).getName(), component.getMarkupId(), parent.getMarkupId()); return script; }
/** {@inheritDoc} */ @Override public final void outPutMarkupIdNotTrue(IQuickView quickView) { Args.notNull(quickView, "quickview"); MarkupContainer container = quickView.getParent(); if (container.getOutputMarkupId() == false && container.getOutputMarkupPlaceholderTag() == false) { throw new OutputMarkupIdNotTrueException("parent doesn't have setOutputMarkupId to true"); } }
/** Make sure components are iterated in the order they were added. Required e.g. for Repeaters */ @Test public void iteratorOrder() { MarkupContainer container = new WebMarkupContainer("component"); for (int i = 0; i < 10; i++) { container.add(new WebComponent(Integer.toString(i))); } int i = 0; for (Component component : container) { assertEquals(Integer.toString(i++), component.getId()); } }
/** {@inheritDoc} */ @Override public final void parentNotSuitable(IQuickView quickView) { Args.notNull(quickView, "quickview"); if (!quickView.getReuseStrategy().isAddItemsSupported()) { return; } MarkupContainer parent = quickView.getParent(); if (parent == null) { throw new QuickViewNotAddedToParentException("add quickview to a markupcontainer"); } if (parent instanceof Page) { throw new QuickViewNotAddedToParentException("add quickview to a markupcontainer"); } if (parent.size() > 1) { throw new ParentNotUnaryException( "the markupcontainer to which quickview is attached should have quickview as its only child"); } }
/** {@inheritDoc} */ @Override public String insertAfter(MarkupContainer c, MarkupContainer parent) { return insertAfter(getComponentTag(c).getName(), c.getMarkupId(), parent.getMarkupId()); }
/** {@inheritDoc} */ @Override public String isComponentScrollBarAtBottom(MarkupContainer component) { return String.format("isComponentScrollBarAtBottom('%s');", component.getMarkupId()); }