Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.OrderLine$OrderLineNumberComparator


        .lazyLoad(
            articleType,
            new LazyLoadArticleTypeEnum[] { LazyLoadArticleTypeEnum.ARTICLE_TYPE_ARTICLE_TYPE });
    Set<ArticleTypeArticleType> articleRefs = articleType
        .getArticleTypeArticleTypes();
    OrderLine orderLine;
    Set<OrderLineAttribute> orderLineAttributes;
    Set<OrderLine> orderLineRefs = new HashSet<OrderLine>();
    if (articleRefs != null) {
      for (ArticleTypeArticleType articleRef : articleRefs) {
        orderLine = OrderLine
            .getInstance(
                (Order) presentationModelPackable
                    .getBufferedValue(ICostableModel.PROPERTY_ORDER),
                articleRef.getArticleTypeRef(),
                orderLineMain,
                (Deviation) presentationModelPackable
                    .getBufferedValue(ICostableModel.PROPERTY_DEVIATION));

        ArticleType articleTypeRef = articleRef.getArticleTypeRef();
        articleTypeManager
            .lazyLoad(
                articleTypeRef,
                new LazyLoadArticleTypeEnum[] { LazyLoadArticleTypeEnum.ATTRIBUTE });
        Set<ArticleTypeAttribute> attributes = articleTypeRef
            .getArticleTypeAttributes();

        if (attributes != null) {
          orderLineAttributes = new HashSet<OrderLineAttribute>();

          for (ArticleTypeAttribute attribute : attributes) {
            orderLineAttributes.add(new OrderLineAttribute(null,
                orderLine, null, null, attribute, null, null,
                attribute.getAttribute().getName()));
          }

          openAttributeView(orderLine, orderLineAttributes);

          orderLine.setOrderLineAttributes(orderLineAttributes);

          setOrderLineRefs(articleRef.getArticleTypeRef(), orderLine);
        }
        orderLineRefs.add(orderLine);
        orderLine.setArticlePath(orderLine.getGeneratedArticlePath());
      }
      orderLineMain.setOrderLines(orderLineRefs);
    }
  }
View Full Code Here


                  LazyLoadArticleTypeEnum.ATTRIBUTE,
                  LazyLoadArticleTypeEnum.ARTICLE_TYPE_ARTICLE_TYPE });
      Set<ArticleTypeAttribute> attributes = newArticleType
          .getArticleTypeAttributes();

      OrderLine orderLineMain = OrderLine.getInstance(abstractOrderModel
          .getOrder(), newArticleType, abstractOrderModel
          .getDeviation(), abstractOrderModel
          .getOrderModelPostShipment());

      if (attributes != null && attributes.size() != 0) {

        Set<OrderLineAttribute> orderLineAttributes = new HashSet<OrderLineAttribute>();
        for (ArticleTypeAttribute articleTypeAttribute : attributes) {
          createNewOrderLineAttribute(orderLineMain,
              orderLineAttributes, articleTypeAttribute);
        }

        orderLineMain.setOrderLineAttributes(orderLineAttributes);

        openAttributeView(orderLineMain, orderLineAttributes);
      } else {

        String metric = orderLineMain.getMetric();
        if (metric != null) {
          metric = "(" + metric + ")";
        } else {
          metric = "";
        }

        String numberOfValue = JOptionPane.showInputDialog(window
            .getComponent(), "Gi antall" + metric, orderLineMain
            .getNumberOfItems());

        if (numberOfValue != null && numberOfValue.length() != 0) {
          try {
            orderLineMain.setNumberOfItems(Integer
                .valueOf(numberOfValue.replace(',', '.')));
          } catch (NumberFormatException e) {
            orderLineMain.setNumberOfItems(Integer.valueOf(0));
            e.printStackTrace();
          }
        }

      }

      setOrderLineRefs(newArticleType, orderLineMain);

      orderLineMain.setArticlePath(orderLineMain
          .getGeneratedArticlePath());
      return orderLineMain;

    }
    return null;
View Full Code Here

      if (refreshing) {
        return null;
      }
      Util.setWaitCursor(window.getComponent());
      if (orderLineSelectionList.getSize() != 0) {
        OrderLine orderLine = (OrderLine) getRow(rowIndex);

        if (orderLine.getHasArticle() == null
            || orderLine.getAttributeInfo() == null
            || orderLine.getIsDefault() == null) {
          orderLineManager1.lazyLoadTree(orderLine);

          orderLine.hasArticle();
          orderLine.setAttributeInfo(orderLine
              .getAttributesAsString());
          orderLine.isDefault();

          orderLineManager1.saveOrderLine(orderLine);
        }

        Util.setDefaultCursor(window.getComponent());
        switch (columnIndex) {
        case 0:
          return orderLine.getArticleName();
        case 1:
          String metric = orderLine.getMetric();
          StringBuilder builder = new StringBuilder();
          if (orderLine.getNumberOfItems() != null) {
            builder.append(orderLine.getNumberOfItems());
            if (metric != null) {
              builder.append(" ").append(metric);
            }
          }
          return builder.toString();
        case 2:
          return checkStatusOrderLine(orderLine);

        case 3:
          if (orderLine.getOrdln() != null) {
            return orderLine.getOrdln().getDescription();
          }
          return Util
              .removeNoAttributes(orderLine.getAttributeInfo());
        case 4:
          if (orderLine.getColli() != null) {
            return orderLine.getColli().toString();
          }
          return "---";
        case 5:
          return Util.convertBooleanToString(orderLine
              .hasTopLevelArticle());
        case 6:
          return Util.convertBooleanToString(orderLine.hasArticle());
        case 7:
          if (orderLine.getActionStarted() != null) {
            return Util.SHORT_DATE_FORMAT.format(orderLine
                .getActionStarted());
          }
          return "---";
        default:
          throw new IllegalStateException("Unknown column");
View Full Code Here

      if (abstractOrderModel != null) {
        OverviewManager overviewManager = (OverviewManager) ModelUtil
            .getBean(abstractOrderModel.getManagerName());
        overviewManager.refreshObject(abstractOrderModel.getObject());

        OrderLine newOrderLine = addArticle(window, abstractOrderModel);
        if (newOrderLine != null) {
          abstractOrderModel.setColliesDone(0);
          newOrderLine.setAttributeInfo(newOrderLine
              .getAttributesAsString());
          try {
            managerRepository.getOrderLineManager().saveOrderLine(
                newOrderLine);
            overviewManager.saveObject(abstractOrderModel
View Full Code Here

    @SuppressWarnings("unchecked")
    public void actionPerformed(ActionEvent arg0) {
      if (JOptionPane.showConfirmDialog(window.getComponent(),
          "Vil du virkelig slette artikkel?", "Slette",
          JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
        OrderLine orderLine = (OrderLine) orderLineSelectionList
            .getElementAt(tableOrderLines
                .convertRowIndexToModel(orderLineSelectionList
                    .getSelectionIndex()));
        if (orderLine != null) {
          AbstractOrderModel abstractOrderModel = (AbstractOrderModel) presentationModelPackable
View Full Code Here

     */
    public void propertyChange(PropertyChangeEvent arg0) {
      buttonRemoveArticle.setEnabled(false);
      if (orderLineSelectionList.hasSelection()) {

        OrderLine orderLine = null;
        orderLine = (OrderLine) orderLineSelectionList
            .getElementAt(tableOrderLines
                .convertRowIndexToModel(orderLineSelectionList
                    .getSelectionIndex()));

        if (orderLine.getArticleType() != null
            && orderLine.getArticleType().isExtra()) {
          buttonRemoveArticle.setEnabled(true);
        }
      }

    }
View Full Code Here

    }

    private void handleMouseClick(MouseEvent mouseEvent, Packable packable) {
      ArticlePacker articlePacker = new ArticlePacker(
          colliViewHandlerProvider, colliSetup, vismaFileCreator);
      OrderLine orderLine = getSelectedOrderLine();
      if (SwingUtilities.isLeftMouseButton(mouseEvent)
          && mouseEvent.getClickCount() == 2 && hasWriteAccess()) {
        if (orderLine != null) {
          orderLineSelectionList.clearSelection();

          packOrderLine(orderLine, packable, window, articlePacker,
              true);

        }
      } else if (SwingUtilities.isRightMouseButton(mouseEvent)
          && hasWriteAccess()) {
        if (articlePacker.canPack(orderLine.getArticleName())) {
          popupMenuOrderLine.show((JXTable) mouseEvent.getSource(),
              mouseEvent.getX(), mouseEvent.getY());
        }
      }
    }
View Full Code Here

     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
     */
    public void actionPerformed(ActionEvent arg0) {
      ArticlePacker articlePacker = new ArticlePacker(
          colliViewHandlerProvider, colliSetup, vismaFileCreator);
      OrderLine orderLine = getSelectedOrderLine();
      Packable packable = (Packable) presentationModelPackable.getBean();
      packOrderLine(orderLine, packable, window, articlePacker, false);
    }
View Full Code Here

    postOrderLines.clear();

    Iterator<OrderLine> it = orderLines.iterator();
    while (it.hasNext()) {
      OrderLine orderLine = it.next();
      orderLine.setPostShipment(postShipment);
      orderLine.setDeviation(null);
      postOrderLines.add(orderLine);
    }
    postShipment.setOrderLines(postOrderLines);
    postShipment.setOrder(deviationOrder);
View Full Code Here

TOP

Related Classes of no.ugland.utransprod.model.OrderLine$OrderLineNumberComparator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.