예제 #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();
 }