Package org.olat.ims.cp.objects

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


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


      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",
            new Exception());
      }
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.