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