1212
1313import java .io .IOException ;
1414import java .util .ArrayList ;
15+ import java .util .HashMap ;
1516
1617import org .openlowcode .design .action .DynamicActionDefinition ;
1718import org .openlowcode .design .data .ArgumentContent ;
@@ -48,8 +49,18 @@ public class UniqueIdentified
4849 Property <UniqueIdentified > {
4950 private NamedList <DynamicActionDefinition > actionsonobjectid ;
5051 private NamedList <DynamicActionDefinition > actionsonobjectidonmanagetab ;
52+ private HashMap <String ,ArrayList <DynamicActionDefinition >> actionsonspecifictab ;
53+ private ArrayList <String > specifictabs ;
5154 private StoredObject storedobject ;
5255
56+ public ArrayList <String > getSpecificTabList () {
57+ return this .specifictabs ;
58+ }
59+
60+ public ArrayList <DynamicActionDefinition > getActionsOnSpecifictab (String specifictabname ) {
61+ return this .actionsonspecifictab .get (specifictabname );
62+ }
63+
5364 /**
5465 * @return the list of actions on object id to be added to button band of the
5566 * object page
@@ -80,7 +91,8 @@ public UniqueIdentified() {
8091 super ("UNIQUEIDENTIFIED" );
8192 this .actionsonobjectid = new NamedList <DynamicActionDefinition >();
8293 this .actionsonobjectidonmanagetab = new NamedList <DynamicActionDefinition >();
83-
94+ this .actionsonspecifictab = new HashMap <String ,ArrayList <DynamicActionDefinition >>();
95+ specifictabs = new ArrayList <String >();
8496 }
8597
8698 @ Override
@@ -157,17 +169,18 @@ public void addActionOnObjectId(DynamicActionDefinition action) {
157169 addActionOnObjectId (action , false );
158170 }
159171
160- /**
161- * adds an action on the object, either in the main button band, or in the
162- * manage tab
163- *
164- * @param action adds an action on the object id. The action should
165- * have a single input attribute being the data object
166- * id
167- * @param actioninmanagetab if true, action is put in manage tabs, if false,
168- * action is directly in the action button
169- */
170- public void addActionOnObjectId (DynamicActionDefinition action , boolean actioninmanagetab ) {
172+ public void addActionOnObjectId (DynamicActionDefinition action ,String specialmenuname ) {
173+ validateActionOnObjectId (action );
174+ ArrayList <DynamicActionDefinition > actionsforspecialmenu = this .actionsonspecifictab .get (specialmenuname );
175+ if (actionsforspecialmenu ==null ) {
176+ actionsforspecialmenu = new ArrayList <DynamicActionDefinition >();
177+ this .actionsonspecifictab .put (specialmenuname ,actionsforspecialmenu );
178+ this .specifictabs .add (specialmenuname );
179+ }
180+ actionsforspecialmenu .add (action );
181+ }
182+
183+ private void validateActionOnObjectId (DynamicActionDefinition action ) {
171184 if (action .getInputArguments ().getSize () != 1 )
172185 throw new RuntimeException ("you can add an action on object id only if it has 1 argument, action "
173186 + action .getName () + " has " + action .getInputArguments ().getSize () + "." );
@@ -182,6 +195,20 @@ public void addActionOnObjectId(DynamicActionDefinition action, boolean actionin
182195 + objectforid .getOwnermodule ().getName () + "/" + objectforid .getName () + ", object parentid type = "
183196 + parent .getOwnermodule ().getName () + "/" + parent .getName ());
184197 }
198+ }
199+
200+ /**
201+ * adds an action on the object, either in the main button band, or in the
202+ * manage tab
203+ *
204+ * @param action adds an action on the object id. The action should
205+ * have a single input attribute being the data object
206+ * id
207+ * @param actioninmanagetab if true, action is put in manage tabs, if false,
208+ * action is directly in the action button
209+ */
210+ public void addActionOnObjectId (DynamicActionDefinition action , boolean actioninmanagetab ) {
211+ validateActionOnObjectId (action );
185212
186213 if (actioninmanagetab ) {
187214 this .actionsonobjectidonmanagetab .add (action );
0 commit comments