Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.ExternalOrderLine


  @SuppressWarnings("unchecked")
  @Override
  public ExternalOrderLineModel getBufferedObjectModel(
      PresentationModel presentationModel) {
    ExternalOrderLineModel model = new ExternalOrderLineModel(
        new ExternalOrderLine());
    model.setArticleName((String) presentationModel
        .getBufferedValue(PROPERTY_ARTICLE_NAME));
    model.setNumberOfItems((Integer) presentationModel
        .getBufferedValue(PROPERTY_NUMBER_OF_ITEMS));
    model
View Full Code Here


     * @param rowIndex
     * @param columnIndex
     * @return verdi
     */
    public Object getValueAt(int rowIndex, int columnIndex) {
      ExternalOrderLine externalOrderLine = (ExternalOrderLine) getRow(rowIndex);
      switch (columnIndex) {
      case 0:
        return externalOrderLine.getOrderLine().getArticleName();
      case 1:
        return externalOrderLine.getNumberOfItems();
      case 2:
        return externalOrderLine.getAttributeInfo();
      default:
        throw new IllegalStateException("Unknown column");
      }

    }
View Full Code Here

    public void actionPerformed(ActionEvent arg0) {
      OrderLine orderLine = (OrderLine) orderArticleSelectionList
          .getElementAt(tableArticleOrders
              .convertRowIndexToModel(orderArticleSelectionList
                  .getSelectionIndex()));
      ExternalOrderLine externalOrderLine = new ExternalOrderLine(null,
          orderLine.getArticleName(), orderLine,
          ((ExternalOrderModel) presentationModel.getBean())
              .getObject(), orderLine.getAttributeInfo(), null,
          orderLine.getNumberOfItems());
      orderLineManager
          .lazyLoad(
              orderLine,
              new LazyLoadOrderLineEnum[] { LazyLoadOrderLineEnum.ORDER_LINE_ATTRIBUTE });
      Set<OrderLineAttribute> orderLineAttributes = orderLine
          .getOrderLineAttributes();
      Set<ExternalOrderLineAttribute> externalOrderLineAttributes = new HashSet<ExternalOrderLineAttribute>();
      ExternalOrderLineAttribute externalOrderLineAttribute;
      if (orderLineAttributes != null) {
        for (OrderLineAttribute orderLineAttribute : orderLineAttributes) {
          externalOrderLineAttribute = new ExternalOrderLineAttribute(
              null, externalOrderLine, orderLineAttribute
                  .getAttributeValue(), orderLineAttribute
                  .getAttributeName());
          externalOrderLineAttributes.add(externalOrderLineAttribute);
        }
      }
      externalOrderLine
          .setExternalOrderLineAttributes(externalOrderLineAttributes);

      boolean isCanceled = openEditExternalOrderLine(externalOrderLine,
          window);

      if (!isCanceled) {
        externalOrderLine.setAttributeInfo(externalOrderLine
            .getExternalOrderLineAttributesAsString());
        Set<ExternalOrderLine> orderLines = (Set<ExternalOrderLine>) presentationModel
            .getBufferedValue(ExternalOrderModel.PROPERTY_EXTERNAL_ORDER_LINES);
        if (orderLines == null) {
          orderLines = new HashSet<ExternalOrderLine>();
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    public void actionPerformed(ActionEvent arg0) {
      Set<ExternalOrderLine> orderLines = (Set<ExternalOrderLine>) presentationModel
          .getBufferedValue(ExternalOrderModel.PROPERTY_EXTERNAL_ORDER_LINES);
      ExternalOrderLine externalOrderLine = (ExternalOrderLine) externalArticleSelectionList
          .getElementAt(tableExternalOrders
              .convertRowIndexToModel(externalArticleSelectionList
                  .getSelectionIndex()));
      openEditExternalOrderLine(externalOrderLine, window);
      externalOrderLine.setAttributeInfo(externalOrderLine
          .getExternalOrderLineAttributesAsString());

      presentationModel.setBufferedValue(
          ExternalOrderModel.PROPERTY_EXTERNAL_ORDER_LINES,
          orderLines);
View Full Code Here

    /**
     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
     */
    @SuppressWarnings("unchecked")
    public void actionPerformed(ActionEvent e) {
      ExternalOrderLine externalOrderLine = (ExternalOrderLine) externalArticleSelectionList
          .getElementAt(tableExternalOrders
              .convertRowIndexToModel(externalArticleSelectionList
                  .getSelectionIndex()));

      Set<ExternalOrderLine> orderLines = (Set<ExternalOrderLine>) presentationModel
          .getBufferedValue(ExternalOrderModel.PROPERTY_EXTERNAL_ORDER_LINES);
      if (orderLines != null) {

        orderLines.remove(externalOrderLine);
        externalArticleList.remove(externalOrderLine);
        OrderLine orderLine = externalOrderLine.getOrderLine();
        if (orderLine != null) {
          orderLine.setExternalOrderLine(null);

        }
        presentationModel.setBufferedValue(
View Full Code Here

    /**
     * @see javax.swing.table.TableModel#getValueAt(int, int)
     */
    public Object getValueAt(int row, int column) {
      ExternalOrderLine externalOrderLine = (ExternalOrderLine) getRow(row);
      switch (column) {
      case 0:
        return externalOrderLine.getExternalOrder().getSupplier()
            .getSupplierName();
      case 1:
        return externalOrderLine.getExternalOrder().getAtt();
      case 2:
        return externalOrderLine.getExternalOrder().getOurRef();
      case 3:
        return externalOrderLine.getExternalOrder().getPhoneNr();
      case 4:
        return externalOrderLine.getExternalOrder().getFaxNr();
      case 5:
        return externalOrderLine.getExternalOrder().getMarkedWith();
      case 6:
        return externalOrderLine.getExternalOrder().getDeliveryDate();
      case 7:
        return externalOrderLine.getArticleName() + " "
            + externalOrderLine.getAttributeInfo();
      case 8:
        return externalOrderLine.getNumberOfItems();
      default:
        throw new IllegalStateException("Unknown column");
      }
    }
View Full Code Here

        if (attributeValue == null || attributeValue.length() == 0) {
          Util.showErrorDialog(window.getComponent(), "Feil",
              "Attributt m� ha verdi");
        } else {
          ExternalOrderLine externalOrderLine = ((ExternalOrderLineModel) presentationModel
              .getBean()).getObject();
          ExternalOrderLineAttribute externalOrderLineAttribute = new ExternalOrderLineAttribute(
              null, externalOrderLine, attributeValue, att
                  .getName());
          attributes.add(externalOrderLineAttribute);
View Full Code Here

TOP

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

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.