Package org.olat.ims.cp.objects

Examples of org.olat.ims.cp.objects.CPItem.addItemAt()


    if (parentElement instanceof CPItem) {
      // parent is a <item>
      if (newElement instanceof CPItem) {
        // only CPItems can be added to CPItems
        CPItem item = (CPItem) parentElement;
        item.addItemAt((CPItem) newElement, position);
        return true;
      } else {
        throw new OLATRuntimeException(CPOrganizations.class, "you can only add <item>  elements to an <item>-element", new Exception());
      }
View Full Code Here


      DefaultElement parent = beforeItem.getParentElement();
      if (!(newElement instanceof CPItem)) { throw new OLATRuntimeException(CPOrganizations.class, "only <item> element allowed",
          new Exception()); }
      if (parent instanceof CPItem) {
        CPItem p = (CPItem) parent;
        p.addItemAt((CPItem) newElement, beforeItem.getPosition() + 1);
      } else if (parent instanceof CPOrganization) {
        CPOrganization o = (CPOrganization) parent;
        o.addItemAt((CPItem) newElement, beforeItem.getPosition() + 1);
      } else {
        throw new OLATRuntimeException(CPOrganizations.class, "you cannot add an <item> element to a " + parent.getName() + " element",
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.