Exemplo n.º 1
0
  /** Inserts a new component above all other components on the page. */
  public WOComponent insertComponentAbove() {
    if (currentComponent == null) {
      return insertComponentAtIndex(0);
    }

    return insertComponentAtIndex(currentComponent.sortNumber().intValue());
  }
Exemplo n.º 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;
  }
Exemplo n.º 3
0
 /** Returns a color of red if the current component is not published. */
 public String tdBGColor() {
   return currentComponent.isPublished() ? null : "#ff6666";
 }
Exemplo n.º 4
0
 /** Inserts a new component above the current component */
 public WOComponent insertComponentBelow() {
   return insertComponentAtIndex(currentComponent.sortNumber().intValue() + 1);
 }
Exemplo n.º 5
0
 /** Moves the current component down by one */
 public WOComponent buturNidur() {
   currentComponent.changeSortOrder(1);
   session().defaultEditingContext().saveChanges();
   return null;
 }