@@ -48,19 +48,20 @@ public class UniqueIdentified
4848 extends
4949 Property <UniqueIdentified > {
5050 private NamedList <DynamicActionDefinition > actionsonobjectid ;
51- private NamedList <DynamicActionDefinition > actionsonobjectidonmanagetab ;
52- private HashMap <String ,ArrayList <DynamicActionDefinition >> actionsonspecifictab ;
53- private ArrayList <String > specifictabs ;
51+ private NamedList <DynamicActionDefinition > actionsonobjectidonmanagemenu ;
52+ private ArrayList <String > menucommentinmanagetabs ;
53+ private HashMap <String , ArrayList <DynamicActionDefinition >> actionsonspecificmenu ;
54+ private ArrayList <String > specificmenus ;
5455 private StoredObject storedobject ;
5556
56- public ArrayList <String > getSpecificTabList () {
57- return this .specifictabs ;
57+ public ArrayList <String > getSpecificMenuList () {
58+ return this .specificmenus ;
5859 }
59-
60- public ArrayList <DynamicActionDefinition > getActionsOnSpecifictab (String specifictabname ) {
61- return this .actionsonspecifictab .get (specifictabname );
60+
61+ public ArrayList <DynamicActionDefinition > getActionsOnSpecificMenu (String specifictabname ) {
62+ return this .actionsonspecificmenu .get (specifictabname );
6263 }
63-
64+
6465 /**
6566 * @return the list of actions on object id to be added to button band of the
6667 * object page
@@ -70,11 +71,19 @@ public NamedList<DynamicActionDefinition> getActionListonObjectId() {
7071 }
7172
7273 /**
73- * @return the list of actions on object id to be added to the manage tab of the
74+ * @return the list of actions on object id to be added to the manage menu of the
7475 * object page
7576 */
76- public NamedList <DynamicActionDefinition > getActionListonObjectIdForManageTab () {
77- return actionsonobjectidonmanagetab ;
77+ public NamedList <DynamicActionDefinition > getActionListonObjectIdForManageMenu () {
78+ return actionsonobjectidonmanagemenu ;
79+ }
80+
81+ /**
82+ * @return the list of menu comment to print
83+ */
84+ @ SuppressWarnings ("unchecked" )
85+ public ArrayList <String > getMenuCommentListOnActionForManageTab () {
86+ return (ArrayList <String >)(this .menucommentinmanagetabs .clone ());
7887 }
7988
8089 /**
@@ -90,9 +99,10 @@ public StoredObject getStoredObject() {
9099 public UniqueIdentified () {
91100 super ("UNIQUEIDENTIFIED" );
92101 this .actionsonobjectid = new NamedList <DynamicActionDefinition >();
93- this .actionsonobjectidonmanagetab = new NamedList <DynamicActionDefinition >();
94- this .actionsonspecifictab = new HashMap <String ,ArrayList <DynamicActionDefinition >>();
95- specifictabs = new ArrayList <String >();
102+ this .actionsonobjectidonmanagemenu = new NamedList <DynamicActionDefinition >();
103+ this .menucommentinmanagetabs = new ArrayList <String >();
104+ this .actionsonspecificmenu = new HashMap <String , ArrayList <DynamicActionDefinition >>();
105+ specificmenus = new ArrayList <String >();
96106 }
97107
98108 @ Override
@@ -169,17 +179,17 @@ public void addActionOnObjectId(DynamicActionDefinition action) {
169179 addActionOnObjectId (action , false );
170180 }
171181
172- public void addActionOnObjectId (DynamicActionDefinition action ,String specialmenuname ) {
182+ public void addActionOnObjectId (DynamicActionDefinition action , String specialmenuname ) {
173183 validateActionOnObjectId (action );
174- ArrayList <DynamicActionDefinition > actionsforspecialmenu = this .actionsonspecifictab .get (specialmenuname );
175- if (actionsforspecialmenu == null ) {
184+ ArrayList <DynamicActionDefinition > actionsforspecialmenu = this .actionsonspecificmenu .get (specialmenuname );
185+ if (actionsforspecialmenu == null ) {
176186 actionsforspecialmenu = new ArrayList <DynamicActionDefinition >();
177- this .actionsonspecifictab .put (specialmenuname ,actionsforspecialmenu );
178- this .specifictabs .add (specialmenuname );
187+ this .actionsonspecificmenu .put (specialmenuname , actionsforspecialmenu );
188+ this .specificmenus .add (specialmenuname );
179189 }
180190 actionsforspecialmenu .add (action );
181191 }
182-
192+
183193 private void validateActionOnObjectId (DynamicActionDefinition action ) {
184194 if (action .getInputArguments ().getSize () != 1 )
185195 throw new RuntimeException ("you can add an action on object id only if it has 1 argument, action "
@@ -196,7 +206,7 @@ private void validateActionOnObjectId(DynamicActionDefinition action) {
196206 + parent .getOwnermodule ().getName () + "/" + parent .getName ());
197207 }
198208 }
199-
209+
200210 /**
201211 * adds an action on the object, either in the main button band, or in the
202212 * manage tab
@@ -211,13 +221,27 @@ public void addActionOnObjectId(DynamicActionDefinition action, boolean actionin
211221 validateActionOnObjectId (action );
212222
213223 if (actioninmanagetab ) {
214- this .actionsonobjectidonmanagetab .add (action );
224+ this .actionsonobjectidonmanagemenu .add (action );
225+ this .menucommentinmanagetabs .add (null );
215226 } else {
216227 actionsonobjectid .add (action );
217228
218229 }
219230 }
220231
232+ /**
233+ * adds an action on the object, either in the main button band, or in the
234+ * manage tab
235+ *
236+ * @param action adds an action on the object id. The action should have a
237+ * single input attribute being the data object id
238+ * @param comment a comment to add before the content in manage menu
239+ */
240+ public void addActionOnObjectIdOnManageMenu (DynamicActionDefinition action , String comment ) {
241+ this .actionsonobjectidonmanagemenu .add (action );
242+ this .menucommentinmanagetabs .add (comment );
243+ }
244+
221245 @ Override
222246 public String [] getPropertyInitMethod () {
223247 return new String [0 ];
0 commit comments