Class ComponentsHelper
java.lang.Object
de.hybris.platform.cockpit.components.ComponentsHelper
Helper class for creating same components across cockpits
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcreateMenuWithUsers(org.zkoss.zul.Menupopup parentMenupopup, PrincipalModel parentPrincipal, Collection<PrincipalModel> checkedUsers, org.zkoss.zk.ui.event.EventListener listener) Creates tree-like structure of menu positions containing users' groups and users, so that user can check/uncheck themstatic org.zkoss.zul.PopupcreateSimpleRenamePopup(String defaultNameValue, org.zkoss.zk.ui.Component parent, org.zkoss.zk.ui.event.EventListener onOkListener) static voiddisplayConfirmationPopup(String title, String message, org.zkoss.zk.ui.event.EventListener onYesListener) Displays yes/no confirmation popup.static voiddisplayConfirmationPopup(org.zkoss.zk.ui.event.EventListener onYesListener) Displays yes/no confirmation popup.static voiddisplayCustomNotification(String title, String messageKey, Object... messageAttrs) Displays notification with given title and messageKey.static voiddisplayNotification(String captionKey, String messageKey, Object... messageAttrs) Displays notification with given captionKey title and message
-
Field Details
-
PRINCIPAL
under this constant models are set in menu items- See Also:
-
-
Constructor Details
-
ComponentsHelper
public ComponentsHelper()
-
-
Method Details
-
createMenuWithUsers
public static void createMenuWithUsers(org.zkoss.zul.Menupopup parentMenupopup, PrincipalModel parentPrincipal, Collection<PrincipalModel> checkedUsers, org.zkoss.zk.ui.event.EventListener listener) Creates tree-like structure of menu positions containing users' groups and users, so that user can check/uncheck them- Parameters:
parentMenupopup- to attach toparentPrincipal- top lever user/group to down traversecheckedUsers- users that should be marked as checkedlistener- to handle menu checks
-
displayNotification
public static void displayNotification(String captionKey, String messageKey, Object... messageAttrs) Displays notification with given captionKey title and message -
displayCustomNotification
public static void displayCustomNotification(String title, String messageKey, Object... messageAttrs) Displays notification with given title and messageKey. Title is given direclty as String (not resource key) -
createSimpleRenamePopup
public static org.zkoss.zul.Popup createSimpleRenamePopup(String defaultNameValue, org.zkoss.zk.ui.Component parent, org.zkoss.zk.ui.event.EventListener onOkListener) - Parameters:
defaultNameValue- default value typed in popupparent- component to which this popup will be attached and displayed directly under itonOkListener- listener to catch onOk event.- Returns:
- popup for changing text value e.g. of item name
-
displayConfirmationPopup
public static void displayConfirmationPopup(String title, String message, org.zkoss.zk.ui.event.EventListener onYesListener) Displays yes/no confirmation popup.- Parameters:
onYesListener- listener to handle clicks on 'yes' buttontitle- displayed messagemessage- displayed title
-
displayConfirmationPopup
public static void displayConfirmationPopup(org.zkoss.zk.ui.event.EventListener onYesListener) Displays yes/no confirmation popup.- Parameters:
onYesListener- listener to handle clicks on 'yes' button
-