Package com.jalios.jcms.ajax
Class CtxMenuManager
java.lang.Object
com.jalios.jcms.ajax.CtxMenuManager
This manager provides a way to generate dynamically letters for specific new entries in contextual menus.
Its provides also convenient methods to insert letters at the good place in ctx menu letters array.
- Since:
- jcms-6.1.0
- Author:
- dissert
-
Method Summary
Modifier and TypeMethodDescriptionchar[]Create a new char array with the letter associated to this id the place after or before the one of the letter c.char[]Create a new char array with the letter associated to this id at the given index.char[]Create a new char array with the letter associated to this id the place after or before the one of the letter bounds to the idPreviousEntry.char[]addEntryAtBottom(char[] letters, Object id) Create a new char array with the letter associated to this id at the end.char[]addEntryAtTop(char[] letters, Object id) Create a new char array with the letter associated to this id at the top.charcreateMenuEntry(Object id, Class<? extends AbstractCtxMenu> ctxMenuClazz) Retrieve or create a letter and associates it with the id for this ctx menu.static CtxMenuManagerbooleanTell if the given id corresponds to the given letter in the menu.
-
Method Details
-
getInstance
-
createMenuEntry
Retrieve or create a letter and associates it with the id for this ctx menu.- Parameters:
id- an object to handle the new entryctxMenuClazz- the given ctx menu- Returns:
- the letter that will be used in for this entry
-
isCurrent
Tell if the given id corresponds to the given letter in the menu.- Parameters:
id-letter-- Returns:
- true if the letter is bounds to this id
-
addEntryAtBottom
Create a new char array with the letter associated to this id at the end.- Parameters:
letters- the previous char arrayid-- Returns:
- a new char array
-
addEntryAtTop
Create a new char array with the letter associated to this id at the top.- Parameters:
letters- the previous char arrayid-- Returns:
- a new char array
-
addEntry
Create a new char array with the letter associated to this id at the given index.- Parameters:
letters- the previous char arrayid-index- the index (from 0 to letters.length) of the new letter- Returns:
- a new char array
-
addEntry
Create a new char array with the letter associated to this id the place after or before the one of the letter c.- Parameters:
letters- the previous char arrayid-c- the letterafter- to place the new entry after the previous one (otherwise, before)- Returns:
- a new char array
-
addEntry
Create a new char array with the letter associated to this id the place after or before the one of the letter bounds to the idPreviousEntry.- Parameters:
letters- the previous char arrayid-idPreviousEntry- the id that bounds to the letterafter- to place the new entry after the previous one (otherwise, before)- Returns:
- a new char array
-