Class StockToAdjustController
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
de.hybris.platform.warehousingbackoffice.widgets.stocks.StockToAdjustController
- All Implemented Interfaces:
com.hybris.cockpitng.core.WidgetController,com.hybris.cockpitng.dnd.WidgetDragAndDropAware,com.hybris.cockpitng.engine.WidgetInstanceManagerAware,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 StockToAdjustController
extends com.hybris.cockpitng.util.DefaultWidgetController
This controller creates a pop-up to create one or several stock level adjustment(s).
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intprotected static final Objectprotected static final Stringprotected static final StringFields inherited from class org.zkoss.zk.ui.util.GenericAutowireComposer
_separator, application, applicationScope, arg, componentScope, desktop, desktopScope, execution, page, pageScope, param, requestScope, self, session, sessionScope, spaceOwner, spaceScopeFields inherited from class org.zkoss.zk.ui.util.GenericComposer
_applied -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a new row of stock adjustment reason.protected voidaddButtonListeners(org.zkoss.zk.ui.Component myComponent) Add listeners on the buttons for each lineprotected voidaddListComponentListeners(org.zkoss.zk.ui.Component component) Adds a listener according to the type of component inside a vertical boxprotected voidAdd listeners on Intbox, Combobox and Textbox so that when a change happens on one of these components, we are catching it.protected voidaddStockAdjustment(org.zkoss.zk.ui.event.Event event) Adds an individual stock adjustment.voidConfirm the creation of the listed stock level adjustmentsprotected voideditStockAdjustment(org.zkoss.zk.ui.event.Event event) Edits an individual stock adjustment.protected BackofficeLocaleServiceprotected EnumerationServiceprotected Localeprotected ModelServiceprotected com.hybris.backoffice.widgets.notificationarea.NotificationServiceorg.zkoss.zul.Gridprotected StockLevelModelprotected StockLevelAdjustmentDatagetStockLevelAdjustmentData(StockAdjustmentDto stockAdjustmentDto) Instantiate aStockLevelAdjustmentDataand populate it from the givenStockAdjustmentDtoprotected voidhandleIndividualReason(org.zkoss.zk.ui.event.Event event) Updates an individual entry with the selected reasonvoidinitStockLevelAdjustmentForm(StockLevelModel inputObject) Initialize the popup to create stock level adjustment(s)protected voidmanageButtonsVisibility(boolean isEditable, org.zkoss.zk.ui.Component myComponent) Handles the display of the buttons according to the situation (editable or not)protected voidmanageFieldsVisibility(org.zkoss.zul.Row myRow, StockAdjustmentDto stockAdjustmentDto) Handles buttons visibilityprotected Optional<StockLevelAdjustmentReason>matchingComboboxStockAdjustmentReason(String stockAdjustmentReasonLabel) Retrieve theStockLevelAdjustmentReasonaccording to the selected label in the comboboxprotected voidRefresh the rendering of the grid of stock adjustment to createprotected voidremoveStockAdjustment(org.zkoss.zk.ui.event.Event event) Removes an individual stock adjustment.voidreset()Reinitialize the popup.voidsetStockLevel(StockLevelModel stockLevel) protected voidCheck if the data provided by the form are compliant with the validation rulesMethods 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, initialize, initWidgetSetting, initWidgetSetting, initWidgetSetting, initWidgetSetting, initWidgetSetting, invokeListenerMethod, onSocketInput, preInitialize, sendOutput, sendOutputAfterOperation, sendOutputAfterOperation, sendOutputAfterOperation, setValue, setWidgetInstanceManager, setWidgetTitleMethods inherited from class com.hybris.cockpitng.util.ViewAnnotationAwareComposer
scanEventListenersMethods inherited from class org.zkoss.zk.ui.util.GenericAutowireComposer
alert, didActivate, getPage, willClone, willPassivateMethods inherited from class org.zkoss.zk.ui.util.GenericComposer
doCatch, doFinallyMethods inherited from class org.zkoss.zk.ui.event.GenericEventListener
bindComponent, getController, onEvent, unbindComponent
-
Field Details
-
IN_SOCKET
- See Also:
-
OUT_CONFIRM
- See Also:
-
COMPLETED
-
COLUMN_INDEX_REASON
protected static final int COLUMN_INDEX_REASON- See Also:
-
COLUMN_INDEX_QTY
protected static final int COLUMN_INDEX_QTY- See Also:
-
-
Constructor Details
-
StockToAdjustController
public StockToAdjustController()
-
-
Method Details
-
initStockLevelAdjustmentForm
Initialize the popup to create stock level adjustment(s)- Parameters:
inputObject- theStockLevelModelfor which we want to create one or several stock level adjustment(s)
-
addAdjustment
public void addAdjustment()Add a new row of stock adjustment reason. -
reset
public void reset()Reinitialize the popup. -
refreshGrid
protected void refreshGrid()Refresh the rendering of the grid of stock adjustment to create -
addListeners
protected void addListeners()Add listeners on Intbox, Combobox and Textbox so that when a change happens on one of these components, we are catching it. -
addListComponentListeners
protected void addListComponentListeners(org.zkoss.zk.ui.Component component) Adds a listener according to the type of component inside a vertical box- Parameters:
component- the vertical box component containing the element to target to add a listener
-
handleIndividualReason
protected void handleIndividualReason(org.zkoss.zk.ui.event.Event event) Updates an individual entry with the selected reason- Parameters:
event- the event that triggered the change
-
matchingComboboxStockAdjustmentReason
protected Optional<StockLevelAdjustmentReason> matchingComboboxStockAdjustmentReason(String stockAdjustmentReasonLabel) Retrieve theStockLevelAdjustmentReasonaccording to the selected label in the combobox- Parameters:
stockAdjustmentReasonLabel- aString- Returns:
- the
StockLevelAdjustmentReasoncorresponding to the label
-
addButtonListeners
protected void addButtonListeners(org.zkoss.zk.ui.Component myComponent) Add listeners on the buttons for each line- Parameters:
myComponent- the initial component
-
addStockAdjustment
protected void addStockAdjustment(org.zkoss.zk.ui.event.Event event) Adds an individual stock adjustment.- Parameters:
event- the click event triggered by the user
-
removeStockAdjustment
protected void removeStockAdjustment(org.zkoss.zk.ui.event.Event event) Removes an individual stock adjustment.- Parameters:
event- the click event triggered by the user
-
editStockAdjustment
protected void editStockAdjustment(org.zkoss.zk.ui.event.Event event) Edits an individual stock adjustment.- Parameters:
event- the click event triggered by the user
-
manageFieldsVisibility
protected void manageFieldsVisibility(org.zkoss.zul.Row myRow, StockAdjustmentDto stockAdjustmentDto) Handles buttons visibility- Parameters:
myRow- the row for which the visibility change is requestedstockAdjustmentDto- the stock adjustment dto containing informations about the reason selected
-
manageButtonsVisibility
protected void manageButtonsVisibility(boolean isEditable, org.zkoss.zk.ui.Component myComponent) Handles the display of the buttons according to the situation (editable or not)- Parameters:
isEditable- the line is editable or notmyComponent- the component containing the buttons
-
confirmStockAdjustmentCreation
Confirm the creation of the listed stock level adjustments- Throws:
InterruptedException
-
validateStockAdjustmentCreation
protected void validateStockAdjustmentCreation()Check if the data provided by the form are compliant with the validation rules -
getStockLevelAdjustmentData
protected StockLevelAdjustmentData getStockLevelAdjustmentData(StockAdjustmentDto stockAdjustmentDto) Instantiate aStockLevelAdjustmentDataand populate it from the givenStockAdjustmentDto- Parameters:
stockAdjustmentDto- the stock adjustment DTO to use for population- Returns:
- the new instance of
StockLevelAdjustmentData
-
getLocale
-
getStockLevel
-
setStockLevel
-
getCockpitLocaleService
-
getEnumerationService
-
getModelService
-
getStockAdjustments
public org.zkoss.zul.Grid getStockAdjustments() -
getWarehousingStockLevelFacade
-
getNotificationService
protected com.hybris.backoffice.widgets.notificationarea.NotificationService getNotificationService()
-