コード例 #1
0
  /**
   * Creates a new component and inserts it at the specified index
   *
   * @param anInt The index to insert the component at.
   */
  public WOComponent insertComponentAtIndex(int anInt) {
    SWComponent c = new SWComponent();
    session().defaultEditingContext().insertObject(c);

    selectedPage.insertComponentAtIndex(c, anInt);
    session().defaultEditingContext().saveChanges();

    ((ERXSession) session()).objectStore().takeValueForKey(new NSMutableArray(c), "SWComponent");

    return null;
  }
コード例 #2
0
  /** Deletes the current component */
  public WOComponent deleteComponent() {
    EOEditingContext ec = session().defaultEditingContext();
    Enumeration<SWPictureLink> e = currentComponent.swPictureLinks().objectEnumerator();
    while (e.hasMoreElements()) {
      ec.deleteObject(e.nextElement());
    }
    selectedPage.removeComponent(currentComponent);
    ec.deleteObject(currentComponent);
    ec.saveChanges();

    return null;
  }
コード例 #3
0
 public void setSelectedPage(SWPage page) {
   selectedPage = page;
   customInfo = page.customInfo();
 }