Ejemplo n.º 1
0
 /** {@inheritDoc} */
 @Override
 public String insertBefore(MarkupContainer component, MarkupContainer parent) {
   String script =
       insertBefore(
           getComponentTag(component).getName(), component.getMarkupId(), parent.getMarkupId());
   return script;
 }
Ejemplo n.º 2
0
 /** {@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");
   }
 }
Ejemplo n.º 3
0
 /** 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());
   }
 }
Ejemplo n.º 4
0
 /** {@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");
   }
 }
Ejemplo n.º 5
0
 /** {@inheritDoc} */
 @Override
 public String insertAfter(MarkupContainer c, MarkupContainer parent) {
   return insertAfter(getComponentTag(c).getName(), c.getMarkupId(), parent.getMarkupId());
 }
Ejemplo n.º 6
0
 /** {@inheritDoc} */
 @Override
 public String isComponentScrollBarAtBottom(MarkupContainer component) {
   return String.format("isComponentScrollBarAtBottom('%s');", component.getMarkupId());
 }