1 17 package org.alfresco.repo.action; 18 19 import java.util.ArrayList ; 20 import java.util.List ; 21 22 import org.alfresco.repo.action.executer.CompositeActionExecuter; 23 import org.alfresco.service.cmr.action.Action; 24 import org.alfresco.service.cmr.action.CompositeAction; 25 import org.alfresco.service.cmr.repository.NodeRef; 26 27 32 public class CompositeActionImpl extends ActionImpl implements CompositeAction 33 { 34 37 private static final long serialVersionUID = -5348203599304776812L; 38 39 42 private List <Action> actions = new ArrayList <Action>(); 43 44 49 public CompositeActionImpl(String id, NodeRef owningNodeRef) 50 { 51 super(id, CompositeActionExecuter.NAME, owningNodeRef); 52 } 53 54 57 public boolean hasActions() 58 { 59 return (this.actions.isEmpty() == false); 60 } 61 62 65 public void addAction(Action action) 66 { 67 this.actions.add(action); 68 } 69 70 73 public void addAction(int index, Action action) 74 { 75 this.actions.add(index, action); 76 } 77 78 81 public void setAction(int index, Action action) 82 { 83 this.actions.set(index, action); 84 } 85 86 89 public int indexOfAction(Action action) 90 { 91 return this.actions.indexOf(action); 92 } 93 94 97 public List <Action> getActions() 98 { 99 return this.actions; 100 } 101 102 105 public Action getAction(int index) 106 { 107 return this.actions.get(index); 108 } 109 110 113 public void removeAction(Action action) 114 { 115 this.actions.remove(action); 116 } 117 118 121 public void removeAllActions() 122 { 123 this.actions.clear(); 124 } 125 126 } 127 | Popular Tags |