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