1 16 package org.apache.cocoon.forms.formmodel; 17 18 import java.util.Locale ; 19 20 import org.xml.sax.ContentHandler ; 21 import org.xml.sax.SAXException ; 22 23 28 public class RowAction extends Action { 29 public RowAction(RowActionDefinition definition) { 30 super(definition); 31 } 32 33 public static class MoveUpAction extends RowAction { 34 public MoveUpAction(RowActionDefinition.MoveUpDefinition definition) { 35 super(definition); 36 } 37 38 public void generateSaxFragment(ContentHandler contentHandler, Locale locale) throws SAXException { 39 40 Repeater.RepeaterRow row = Repeater.getParentRow(this); 42 if (((Repeater)row.getParent()).indexOf(row) > 0) { 43 super.generateSaxFragment(contentHandler, locale); 44 } 45 } 46 } 47 48 public static class MoveDownAction extends RowAction { 49 public MoveDownAction(RowActionDefinition.MoveDownDefinition definition) { 50 super(definition); 51 } 52 53 public void generateSaxFragment(ContentHandler contentHandler, Locale locale) throws SAXException { 54 55 Repeater.RepeaterRow row = Repeater.getParentRow(this); 57 Repeater repeater = (Repeater)row.getParent(); 58 59 if (repeater.indexOf(row) < repeater.getSize() - 1) { 60 super.generateSaxFragment(contentHandler, locale); 61 } 62 } 63 } 64 } 65 66 | Popular Tags |