@Override
 public void clearArticlePfListBox() {
   articlePfValueListBox.clearValueListBox();
   List<ArticlePf> emptyArticlePfList = new ArrayList<>();
   emptyArticlePfList.add(EmptyObject.getEmptyArticlePf());
   articlePfValueListBox.addComplexAcceptableValues(emptyArticlePfList, MESSAGES.tous());
 }
 @Override
 public void clearPlatformListBox() {
   platformValueListBox.clearValueListBox();
   List<Platform> emptyPlatformList = new ArrayList<>();
   emptyPlatformList.add(EmptyObject.getEmptyPlatform());
   platformValueListBox.addComplexAcceptableValues(emptyPlatformList, MESSAGES.toutes());
 }
  @Override
  public void addListPlatformListBox(
      List<Platform> platformList, boolean isPlatformView, boolean isStock) {
    platformValueListBox.setVisible(true);
    if (isPlatformView) {
      addPlatformGroupValue(MESSAGES.group_element_platform(), platformList);

    } else {
      if (isStock) {
        if (!isOutStockPlatformListFill) {
          stockPlatformList.addAll(platformList);
          isStockPlatformListFill = true;
        } else {
          addPlatformGroupValue(MESSAGES.stock_stock(), platformList);
          addPlatformGroupValue(MESSAGES.stock_horsstock(), outStockPlatformList);
          clearPlatformLists();
        }
      } else {
        if (!isStockPlatformListFill) {
          outStockPlatformList.addAll(platformList);
          isOutStockPlatformListFill = true;
        } else {
          addPlatformGroupValue(MESSAGES.stock_stock(), stockPlatformList);
          addPlatformGroupValue(MESSAGES.stock_horsstock(), platformList);
          clearPlatformLists();
        }
      }
    }
    platformValueListBox.setIndex(0);
    if (!platformList.isEmpty()) {
      lastPlatformChoice = platformList.get(0);
    }
  }
 @Override
 public void backValuePlatform() {
   int index = platformValueListBox.getIndex();
   int size = platformValueListBox.getListSize();
   platformValueListBox.setFocus(false);
   if (index - 1 > 0) {
     platformValueListBox.setIndex(index - 1);
     arrowStatus(index - 1, size);
     Platform platform = platformValueListBox.getValue();
     presenter.getEventBus().searchForArticlePf(platform, false);
     lastPlatformChoice = platform;
   }
 }
 @Override
 public void backValueArticle() {
   int index = articlePfValueListBox.getIndex();
   int size = articlePfValueListBox.getListSize();
   articlePfValueListBox.setFocus(false);
   if (index - 1 > 0) {
     articlePfValueListBox.setIndex(index - 1);
     arrowStatus(index - 1, size);
     ArticlePf article = articlePfValueListBox.getValue();
     presenter.getEventBus().searchForStock(article, false);
     lastArticleChoice = article;
     presenter.setParamSessionArticlePf(article);
   }
 }
 @Override
 public void addListArticlePfListBox(
     List<ArticlePf> articlePfList, boolean isStock, boolean isResp) {
   if (isResp) {
     addArticleGroupValue(MESSAGES.fournisseur_resp_produit(), articlePfList);
   } else {
     if (isStock) {
       if (!isOutStockArticlePfListFill) {
         stockArticlePfList.addAll(articlePfList);
         isStockArticlePfListFill = true;
       } else {
         addArticleGroupValue(MESSAGES.stock_stock(), articlePfList);
         addArticleGroupValue(MESSAGES.stock_horsstock(), outStockArticlePfList);
         clearArticleLists();
       }
     } else {
       if (!isStockArticlePfListFill) {
         outStockArticlePfList.addAll(articlePfList);
         isOutStockArticlePfListFill = true;
       } else {
         addArticleGroupValue(MESSAGES.stock_stock(), stockArticlePfList);
         addArticleGroupValue(MESSAGES.stock_horsstock(), articlePfList);
         clearArticleLists();
       }
     }
   }
   articlePfValueListBox.setIndex(0);
   if (!articlePfList.isEmpty()) {
     lastArticleChoice = articlePfList.get(0);
     presenter.setParamSessionArticlePf(articlePfList.get(0));
   }
 }
 @Override
 public void setPlatformValue(Platform platform) {
   if (platform != null) {
     platformValueListBox.setValueForced(platform);
     lastPlatformChoice = platform;
   }
 }
 @Override
 public void setArticlePfValue(ArticlePf article) {
   if (article != null) {
     articlePfValueListBox.setValueForced(article);
     lastArticleChoice = article;
     presenter.setParamSessionArticlePf(article);
   }
 }
 private void addPlatformValueChangeHandler() {
   platformValueListBox.addValueChangeHandler(
       new ValueChangeHandler<Platform>() {
         @Override
         public void onValueChange(ValueChangeEvent<Platform> valueChangeEvent) {
           Platform platform = valueChangeEvent.getValue();
           if (!platform.equals(EmptyObject.getEmptyPlatform())
               || !articlePfValueListBox.getValue().equals(EmptyObject.getEmptyArticlePf())) {
             int index = platformValueListBox.getIndex();
             int size = platformValueListBox.getListSize();
             arrowStatus(index, size);
             presenter.getEventBus().searchForArticlePf(platform, false);
             platformValueListBox.setFocus(false);
             lastPlatformChoice = platform;
           } else {
             presenter.getEventBus().showBothBoxAtAllMessage();
             setPlatformValue(lastPlatformChoice);
           }
         }
       });
 }
Example #10
0
 private void addArticleValueChangeHandler() {
   articlePfValueListBox.addValueChangeHandler(
       new ValueChangeHandler<ArticlePf>() {
         @Override
         public void onValueChange(ValueChangeEvent<ArticlePf> valueChangeEvent) {
           ArticlePf articlePf = valueChangeEvent.getValue();
           if (!articlePf.equals(EmptyObject.getEmptyArticlePf())
               || !platformValueListBox.getValue().equals(EmptyObject.getEmptyPlatform())) {
             int index = articlePfValueListBox.getIndex();
             int size = articlePfValueListBox.getListSize();
             arrowStatus(index, size);
             presenter.getEventBus().searchForStock(articlePf, false);
             articlePfValueListBox.setFocus(false);
             lastArticleChoice = articlePf;
             presenter.setParamSessionArticlePf(articlePf);
           } else {
             presenter.getEventBus().showBothBoxAtAllMessage();
             setArticlePfValue(lastArticleChoice);
           }
         }
       });
 }
Example #11
0
 private void addPlatformGroupValue(String groupTitle, List<Platform> platformList) {
   if (!platformList.isEmpty()) {
     platformValueListBox.addComplexAcceptableValues(platformList, groupTitle);
   }
 }
Example #12
0
 private void addArticleGroupValue(String groupTitle, List<ArticlePf> articlePfList) {
   if (!articlePfList.isEmpty()) {
     articlePfValueListBox.addComplexAcceptableValues(articlePfList, groupTitle);
   }
 }