Class NavigationHistoryController
- java.lang.Object
-
- org.zkoss.zk.ui.event.GenericEventListener
-
- org.zkoss.zk.ui.util.GenericComposer<T>
-
- org.zkoss.zk.ui.util.GenericAutowireComposer<T>
-
- org.zkoss.zk.ui.util.GenericForwardComposer<org.zkoss.zk.ui.Component>
-
- com.hybris.cockpitng.util.ViewAnnotationAwareComposer
-
- com.hybris.cockpitng.util.DefaultWidgetController
-
- com.hybris.cockpitng.widgets.navigation.NavigationHistoryController
-
- All Implemented Interfaces:
WidgetController,WidgetDragAndDropAware,WidgetInstanceManagerAware,java.io.Serializable,org.zkoss.zk.ui.event.EventListener,org.zkoss.zk.ui.event.SerializableEventListener,org.zkoss.zk.ui.util.ComponentActivationListener,org.zkoss.zk.ui.util.ComponentCloneListener,org.zkoss.zk.ui.util.Composer<org.zkoss.zk.ui.Component>,org.zkoss.zk.ui.util.ComposerExt<org.zkoss.zk.ui.Component>
public class NavigationHistoryController extends DefaultWidgetController
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classNavigationHistoryController.EmptyHistoryElementprotected static classNavigationHistoryController.HistoryElement
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MAX_HISTORY_LENGTHstatic java.lang.StringINPUT_EMPTY_HISTORY_EVAL_TARGETstatic java.lang.StringINPUT_RESETstatic java.lang.StringMODEL_CURRENT_ITEMstatic java.lang.StringMODEL_EMPTY_HISTORY_EVAL_TARGETstatic java.lang.StringMODEL_HISTORYprotected static java.lang.StringSCLASS_MENU_NO_ICONprotected static java.lang.StringSCLASS_NAVIGATION_HISTORY_BACK_DISABLEDprotected static java.lang.StringSCLASS_NAVIGATION_STACK_DISABLEDstatic java.lang.StringSETTING_DEFAULT_OUTPUTstatic java.lang.StringSETTING_DISPLAY_EMPTY_HISTORY_ELEMENT_IN_POPUPstatic java.lang.StringSETTING_EMPTY_HISTORY_OUTPUT_VALUE_EVALstatic java.lang.StringSETTING_HISTORY_LENGTHstatic java.lang.StringSETTING_OUTPUT_PATTERNstatic java.lang.StringSETTING_PROXYstatic java.lang.StringSOCKET_INPUT_DO_BACKstatic java.lang.StringSOCKET_INPUT_REMOVE_ITEMstatic java.lang.StringSOCKET_OUT_EMPTY_HISTORY_BACK_BUTTON_PRESSED
-
Constructor Summary
Constructors Constructor Description NavigationHistoryController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddHistoryMenuItem(NavigationHistoryController.HistoryElement obj)Appends ui representation of given history element at the beginning of historyStack (LIFO)protected voidaddToHistory(NavigationHistoryController.HistoryElement obj)voidbackButtonClicked()protected NavigationHistoryController.HistoryElementcreateHistoryElement(java.lang.String socket, java.lang.Object item)voiddoBackOnSocket()protected java.util.List<java.lang.Integer>findDuplicatesInNeighborhoodInHistory()org.zkoss.zul.AgetBackButton()protected java.lang.ObjectgetBackButtonEvaluatedValue()org.zkoss.zul.DivgetCurrentItem()org.zkoss.zul.LabelgetCurrentItemLabel()protected java.lang.StringgetEmptyHistoryOutputValueEval()protected java.lang.StringgetGlobalLabel(java.lang.String labelKey)protected java.lang.StringgetHistoryElementLabel(NavigationHistoryController.HistoryElement historyElement)org.zkoss.zul.MenupopupgetHistoryStack()protected LabelServicegetLabelService()protected java.lang.StringgetObjectLabel(NavigationHistoryController.HistoryElement object)protected java.lang.StringgetOutputSocket(java.lang.String input)org.zkoss.zul.AgetStackButton()voidhandleObjectUpdatedEvent(CockpitEvent event)protected booleanhasAtLeastOneNotEmptyHistoryElement()voidinitialize(org.zkoss.zk.ui.Component comp)Override this method to do initialization stuff for your widget, like initialize widget settings, restore view state from viewmodel, etc.protected voidinitializeVirtualSockets(org.zkoss.zk.ui.Component comp)protected booleanisEmptyBackElementAvailable()protected voiditemClicked(int position)protected intlookupMenuPosition(org.zkoss.zul.Menuitem menuitem)protected voidmessageReceived(java.lang.String socket, java.lang.Object item)protected voidonEmptyHistoryBackButtonPressed()protected voidreduceStack(int index)protected voidrefreshEmptyHistoryElement()protected voidremoveCurrentObject()protected voidremoveDuplicatesInNeighborhoodFromHistory()protected voidremoveElementsFromHistory(NavigationHistoryController.HistoryElement toRemove)protected voidremoveExistingEmptyHistoryElements()voidremoveItem(java.lang.Object inputObject)protected <T> voidremoveOverflow(java.util.List<T> history)voidresetHistory(java.lang.Object object)protected voidrestoreCurrentItem()protected voidrestoreHistory()protected voidsendOutputMessage(java.lang.String input, java.lang.Object message)protected voidsetCurrentObject(java.lang.String socket, java.lang.Object item)voidsetEmptyHistoryEvalTarget(java.lang.Object object)protected voidupdateElement(java.lang.Object data)protected voidupdateHistoryStackEnabled()-
Methods inherited from class com.hybris.cockpitng.util.DefaultWidgetController
doAfterCompose, doBeforeCompose, doBeforeComposeChildren, executeOperation, getDragAndDropStrategy, getLabel, getLabel, getModel, getValue, getWidgetDragAndDropStrategyRepository, getWidgetInstanceManager, getWidgetRoot, getWidgetSettings, getWidgetslot, getWidgetTitle, getWidgetUtils, initDragAndDropAwareness, initWidgetSetting, initWidgetSetting, initWidgetSetting, initWidgetSetting, initWidgetSetting, invokeListenerMethod, onSocketInput, preInitialize, sendOutput, sendOutputAfterOperation, sendOutputAfterOperation, sendOutputAfterOperation, setValue, setWidgetInstanceManager, setWidgetTitle
-
Methods inherited from class com.hybris.cockpitng.util.ViewAnnotationAwareComposer
scanEventListeners
-
Methods inherited from class org.zkoss.zk.ui.util.GenericAutowireComposer
alert, didActivate, getPage, willClone, willPassivate
-
-
-
-
Field Detail
-
INPUT_RESET
public static final java.lang.String INPUT_RESET
- See Also:
- Constant Field Values
-
INPUT_EMPTY_HISTORY_EVAL_TARGET
public static final java.lang.String INPUT_EMPTY_HISTORY_EVAL_TARGET
- See Also:
- Constant Field Values
-
SOCKET_INPUT_REMOVE_ITEM
public static final java.lang.String SOCKET_INPUT_REMOVE_ITEM
- See Also:
- Constant Field Values
-
SOCKET_INPUT_DO_BACK
public static final java.lang.String SOCKET_INPUT_DO_BACK
- See Also:
- Constant Field Values
-
SOCKET_OUT_EMPTY_HISTORY_BACK_BUTTON_PRESSED
public static final java.lang.String SOCKET_OUT_EMPTY_HISTORY_BACK_BUTTON_PRESSED
- See Also:
- Constant Field Values
-
SETTING_DISPLAY_EMPTY_HISTORY_ELEMENT_IN_POPUP
public static final java.lang.String SETTING_DISPLAY_EMPTY_HISTORY_ELEMENT_IN_POPUP
- See Also:
- Constant Field Values
-
SETTING_HISTORY_LENGTH
public static final java.lang.String SETTING_HISTORY_LENGTH
- See Also:
- Constant Field Values
-
SETTING_EMPTY_HISTORY_OUTPUT_VALUE_EVAL
public static final java.lang.String SETTING_EMPTY_HISTORY_OUTPUT_VALUE_EVAL
- See Also:
- Constant Field Values
-
SETTING_DEFAULT_OUTPUT
public static final java.lang.String SETTING_DEFAULT_OUTPUT
- See Also:
- Constant Field Values
-
SETTING_OUTPUT_PATTERN
public static final java.lang.String SETTING_OUTPUT_PATTERN
- See Also:
- Constant Field Values
-
SETTING_PROXY
public static final java.lang.String SETTING_PROXY
- See Also:
- Constant Field Values
-
MODEL_EMPTY_HISTORY_EVAL_TARGET
public static final java.lang.String MODEL_EMPTY_HISTORY_EVAL_TARGET
- See Also:
- Constant Field Values
-
MODEL_CURRENT_ITEM
public static final java.lang.String MODEL_CURRENT_ITEM
- See Also:
- Constant Field Values
-
MODEL_HISTORY
public static final java.lang.String MODEL_HISTORY
- See Also:
- Constant Field Values
-
DEFAULT_MAX_HISTORY_LENGTH
public static final int DEFAULT_MAX_HISTORY_LENGTH
- See Also:
- Constant Field Values
-
SCLASS_NAVIGATION_HISTORY_BACK_DISABLED
protected static final java.lang.String SCLASS_NAVIGATION_HISTORY_BACK_DISABLED
- See Also:
- Constant Field Values
-
SCLASS_NAVIGATION_STACK_DISABLED
protected static final java.lang.String SCLASS_NAVIGATION_STACK_DISABLED
- See Also:
- Constant Field Values
-
SCLASS_MENU_NO_ICON
protected static final java.lang.String SCLASS_MENU_NO_ICON
- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
public void initialize(org.zkoss.zk.ui.Component comp)
Description copied from class:DefaultWidgetControllerOverride this method to do initialization stuff for your widget, like initialize widget settings, restore view state from viewmodel, etc. This method will be invoked byDefaultWidgetController.doAfterCompose(Component)everytime your widget view is created. SeeGenericForwardComposer.doAfterCompose(Component)for more details.- Overrides:
initializein classDefaultWidgetController
-
restoreHistory
protected void restoreHistory()
-
restoreCurrentItem
protected void restoreCurrentItem()
-
initializeVirtualSockets
protected void initializeVirtualSockets(org.zkoss.zk.ui.Component comp)
-
messageReceived
protected void messageReceived(java.lang.String socket, java.lang.Object item)
-
addHistoryMenuItem
protected void addHistoryMenuItem(NavigationHistoryController.HistoryElement obj)
Appends ui representation of given history element at the beginning of historyStack (LIFO)- Parameters:
obj- history element for which element on history stack will be created.
-
lookupMenuPosition
protected int lookupMenuPosition(org.zkoss.zul.Menuitem menuitem)
-
addToHistory
protected void addToHistory(NavigationHistoryController.HistoryElement obj)
-
removeOverflow
protected <T> void removeOverflow(java.util.List<T> history)
-
isEmptyBackElementAvailable
protected boolean isEmptyBackElementAvailable()
-
updateHistoryStackEnabled
protected void updateHistoryStackEnabled()
-
resetHistory
public void resetHistory(java.lang.Object object)
-
createHistoryElement
protected NavigationHistoryController.HistoryElement createHistoryElement(java.lang.String socket, java.lang.Object item)
-
setCurrentObject
protected void setCurrentObject(java.lang.String socket, java.lang.Object item)
-
doBackOnSocket
public void doBackOnSocket()
-
removeItem
public void removeItem(java.lang.Object inputObject)
-
removeCurrentObject
protected void removeCurrentObject()
-
hasAtLeastOneNotEmptyHistoryElement
protected boolean hasAtLeastOneNotEmptyHistoryElement()
-
removeElementsFromHistory
protected void removeElementsFromHistory(NavigationHistoryController.HistoryElement toRemove)
-
removeDuplicatesInNeighborhoodFromHistory
protected void removeDuplicatesInNeighborhoodFromHistory()
-
findDuplicatesInNeighborhoodInHistory
protected java.util.List<java.lang.Integer> findDuplicatesInNeighborhoodInHistory()
-
backButtonClicked
public void backButtonClicked()
-
setEmptyHistoryEvalTarget
public void setEmptyHistoryEvalTarget(java.lang.Object object)
-
onEmptyHistoryBackButtonPressed
protected void onEmptyHistoryBackButtonPressed()
-
refreshEmptyHistoryElement
protected void refreshEmptyHistoryElement()
-
removeExistingEmptyHistoryElements
protected void removeExistingEmptyHistoryElements()
-
getBackButtonEvaluatedValue
protected java.lang.Object getBackButtonEvaluatedValue()
-
getEmptyHistoryOutputValueEval
protected java.lang.String getEmptyHistoryOutputValueEval()
-
itemClicked
protected void itemClicked(int position)
-
sendOutputMessage
protected void sendOutputMessage(java.lang.String input, java.lang.Object message)
-
getOutputSocket
protected java.lang.String getOutputSocket(java.lang.String input)
-
reduceStack
protected void reduceStack(int index)
-
handleObjectUpdatedEvent
public void handleObjectUpdatedEvent(CockpitEvent event)
-
updateElement
protected void updateElement(java.lang.Object data)
-
getHistoryElementLabel
protected java.lang.String getHistoryElementLabel(NavigationHistoryController.HistoryElement historyElement)
-
getObjectLabel
protected java.lang.String getObjectLabel(NavigationHistoryController.HistoryElement object)
-
getGlobalLabel
protected java.lang.String getGlobalLabel(java.lang.String labelKey)
-
getLabelService
protected LabelService getLabelService()
-
getHistoryStack
public org.zkoss.zul.Menupopup getHistoryStack()
-
getCurrentItem
public org.zkoss.zul.Div getCurrentItem()
-
getCurrentItemLabel
public org.zkoss.zul.Label getCurrentItemLabel()
-
getBackButton
public org.zkoss.zul.A getBackButton()
-
getStackButton
public org.zkoss.zul.A getStackButton()
-
-