Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.OrderComment


    /**
     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
     */
    public void actionPerformed(ActionEvent arg0) {
      OrderComment orderComment = new OrderComment();
      orderComment.setUserName(login.getApplicationUser().getUserName());
      orderComment.setCommentDate(Util.getCurrentDate());
      orderComment
          .addCommentType(CommentTypeUtil.getCommentType("Ordre"));

      CommentViewHandler orderCommentViewHandler = new CommentViewHandler(
          login, (OrderManager) overviewManager);
      EditCommentView editDeviationCommentView = new EditCommentView(
          new OrderCommentModel(orderComment),
          orderCommentViewHandler);

      JDialog dialog = Util.getDialog(window, "Legg til kommentar", true);
      dialog.setName("EditDeviationCommentView");
      WindowInterface dialogWindow = new JDialogAdapter(dialog);
      dialogWindow.add(editDeviationCommentView.buildPanel(dialogWindow));
      dialog.pack();
      Util.locateOnScreenCenter(dialog);
      dialogWindow.setVisible(true);

      if (!orderCommentViewHandler.isCanceled()) {
        orderComment
            .setOrder(((OrderModel) presentationModel.getBean())
                .getObject());
        orderComments.add(0, orderComment);
        presentationModel.setBufferedValue(
            OrderModel.PROPERTY_COMMENTS, orderComments);
View Full Code Here


     * @see no.ugland.utransprod.gui.model.AbstractModel#getBufferedObjectModel(com.jgoodies.binding.PresentationModel)
     */
    @Override
    public OrderCommentModel getBufferedObjectModel(
            PresentationModel presentationModel) {
        OrderCommentModel model = new OrderCommentModel(new OrderComment());
        model.setUserName((String) presentationModel
                .getBufferedValue(PROPERTY_USER_NAME));
        model.setComment((String) presentationModel
                .getBufferedValue(PROPERTY_COMMENT));
        model.setForTransportBool((Boolean) presentationModel
View Full Code Here

    }

    public static OrderComment createOrderCommentWithUserAndDate(
            ApplicationUser applicationUser) {

        OrderComment orderComment = new OrderComment();
        orderComment.setUserName(applicationUser.getUserName());
        orderComment.setCommentDate(Util.getCurrentDate());
        orderComment.addCommentType(CommentTypeUtil.getCommentType("Ordre"));
        return orderComment;
    }
View Full Code Here

    /**
     * @return siste kommentar
     */
    public String getLastComment() {
        if (commentList.size() > 0) {
            OrderComment comment = commentList.get(0);

            return comment.getComment();
        }
        return null;
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public void actionPerformed(ActionEvent e) {
      OrderComment orderComment = new OrderComment();
      orderComment.setUserName(login.getApplicationUser().getUserName());
      orderComment.setCommentDate(Util.getCurrentDate());
      orderComment.addCommentType(CommentTypeUtil
          .getCommentType("Montering"));

      CommentViewHandler orderCommentViewHandler = new CommentViewHandler(
          login, managerRepository.getOrderManager());
      EditCommentView editDeviationCommentView = new EditCommentView(
          new OrderCommentModel(orderComment),
          orderCommentViewHandler);

      JDialog dialog = Util.getDialog(window, "Legg til kommentar", true);
      dialog.setName("EditDeviationCommentView");
      WindowInterface dialogWindow = new JDialogAdapter(dialog);
      dialogWindow.add(editDeviationCommentView.buildPanel(dialogWindow));
      dialog.pack();
      Util.locateOnScreenCenter(dialog);
      dialogWindow.setVisible(true);

      if (!orderCommentViewHandler.isCanceled()) {
        List<OrderComment> comments = new ArrayList<OrderComment>(
            (List<OrderComment>) presentationModel
                .getBufferedValue(AssemblyModel.PROPERTY_COMMENT_LIST));
        Order order = ((AssemblyModel) presentationModel.getBean())
            .getObject().getOrder();
        order.setCachedComment(null);
        orderComment.setOrder(order);
        comments.add(0, orderComment);
        presentationModel.setBufferedValue(
            AssemblyModel.PROPERTY_COMMENT_LIST, comments);

      }
View Full Code Here

          .getElementAt(tablePostShipment
              .convertRowIndexToModel(postShipmentSelectionList
                  .getSelectionIndex()));
      CommentViewHandler commentViewHandler = new CommentViewHandler(
          login, managerRepository.getOrderManager());
      OrderComment newOrderComment = commentViewHandler
          .showAndEditOrderComment(window, null, "orderManager");

      if (newOrderComment != null) {
        Order order = postShipment.getOrder();

        if (!Hibernate.isInitialized(order.getOrderComments())) {
          orderViewHandler
              .lazyLoadOrder(
                  order,
                  new LazyLoadOrderEnum[] { LazyLoadOrderEnum.COMMENTS });
        }
        order.addOrderComment(newOrderComment);
        order.cacheComments();
        newOrderComment.setDeviation(postShipment.getDeviation());
        try {
          orderViewHandler.getOrderManager().saveOrder(order);

        } catch (ProTransException e) {
          Util.showErrorDialog(window, "Feil", e.getMessage());
View Full Code Here

                  .getSelectionIndex()));

      Order order = managerRepository.getOrderManager().findByOrderNr(
          applyable.getOrderNr());
      if (order != null) {
        OrderComment orderComment = new OrderComment();
        orderComment.setUserName(login.getApplicationUser()
            .getUserName());
        orderComment.setCommentDate(Util.getCurrentDate());
        orderComment.addCommentType(CommentTypeUtil
            .getCommentType("Ordre"));

        CommentViewHandler orderCommentViewHandler = new CommentViewHandler(
            login, managerRepository.getOrderManager());
        EditCommentView editDeviationCommentView = new EditCommentView(
            new OrderCommentModel(orderComment),
            orderCommentViewHandler);

        JDialog dialog = Util.getDialog(window, "Legg til kommentar",
            true);
        dialog.setName("EditDeviationCommentView");
        WindowInterface dialogWindow = new JDialogAdapter(dialog);
        dialogWindow.add(editDeviationCommentView
            .buildPanel(dialogWindow));
        dialog.pack();
        Util.locateOnScreenCenter(dialog);
        dialogWindow.setVisible(true);

        if (!orderCommentViewHandler.isCanceled()) {
          orderComment.setOrder(order);
          managerRepository
              .getOrderManager()
              .lazyLoadOrder(
                  order,
                  new LazyLoadOrderEnum[] { LazyLoadOrderEnum.COMMENTS });
View Full Code Here

        new LazyLoadOrderEnum[] { LazyLoadOrderEnum.COMMENTS });

    Set<OrderComment> comments = order.getOrderComments();
    assertNotNull(comments);
    assertEquals(1, comments.size());
    OrderComment orderComment = comments.iterator().next();
    Set<OrderCommentCommentType> commentTypes = orderComment
        .getOrderCommentCommentTypes();
    assertNotNull(commentTypes);
    assertEquals(1, commentTypes.size());
    OrderCommentCommentType type = commentTypes.iterator().next();
    assertNotNull(type);
View Full Code Here

        new LazyLoadOrderEnum[] { LazyLoadOrderEnum.COMMENTS });

    Set<OrderComment> comments = order.getOrderComments();
    assertNotNull(comments);
    assertEquals(1, comments.size());
    OrderComment orderComment = comments.iterator().next();
    Set<OrderCommentCommentType> commentTypes = orderComment
        .getOrderCommentCommentTypes();
    assertNotNull(commentTypes);
    assertEquals(3, commentTypes.size());
    count = 0;
    List<OrderCommentCommentType> commentTypeList = new ArrayList<OrderCommentCommentType>();
View Full Code Here

    /**
     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
     */
    public void actionPerformed(ActionEvent arg0) {
      OrderComment orderComment = new OrderComment();
      orderComment.setUserName(login.getApplicationUser().getUserName());
      orderComment.setCommentDate(Util.getCurrentDate());
      orderComment
          .addCommentType(CommentTypeUtil.getCommentType("Ordre"));

      CommentViewHandler deviationCommentViewHandler = new CommentViewHandler(
          login, managerRepository.getOrderManager());
      EditCommentView editDeviationCommentView = new EditCommentView(
          new OrderCommentModel(orderComment),
          deviationCommentViewHandler);

      JDialog dialog = Util.getDialog(window, "Legg til kommentar", true);
      dialog.setName("EditDeviationCommentView");
      WindowInterface dialogWindow = new JDialogAdapter(dialog);
      dialogWindow.add(editDeviationCommentView.buildPanel(dialogWindow));
      dialog.pack();
      Util.locateOnScreenCenter(dialog);
      dialogWindow.setVisible(true);

      if (!deviationCommentViewHandler.isCanceled()) {
        orderComment.setDeviation(((DeviationModel) presentationModel
            .getBean()).getObject());
        orderComment.setOrder(((DeviationModel) presentationModel
            .getBean()).getObject().getOrder());
        orderComments.add(0, orderComment);
        presentationModel.setBufferedValue(
            DeviationModel.PROPERTY_COMMENTS, orderComments);
      }
View Full Code Here

TOP

Related Classes of no.ugland.utransprod.model.OrderComment

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.