Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.ProcentDone


    }

    @Override
    public ProcentDoneModel getBufferedObjectModel(PresentationModel presentationModel) {
        ProcentDoneModel procentDoneModel = new ProcentDoneModel(
                new ProcentDone());
        procentDoneModel.setProcentDoneYear((Integer) presentationModel
                .getBufferedValue(PROPERTY_PROCENT_DONE_YEAR));
        procentDoneModel.setProcentDoneWeek((Integer) presentationModel
                .getBufferedValue(PROPERTY_PROCENT_DONE_WEEK));
        procentDoneModel.setProcentString((String) presentationModel
View Full Code Here


    public final Component getTableCellRendererComponent(final JTable table,
            final Object object, final boolean isSelected,
            final boolean hasFocus, final int row, final int column) {
        setBorder(BorderFactory.createEmptyBorder());
        if (object != null) {
            ProcentDone procentDone = (ProcentDone) object;
           
            StringBuffer toolTip = new StringBuffer();
            setText(Util.convertIntegerToString(procentDone.getProcent()) + "%");
            setCommentAsTooltip(procentDone.getProcentDoneComment(), toolTip);

            if (toolTip.length() > 0) {
                toolTip.insert(0, "<html>");
                toolTip.append("</html>");
                setToolTipText(toolTip.toString());
View Full Code Here

    int row = -1;
    boolean orderNotFound = true;

    Transportable transportable = null;

    ProcentDone procentDone;
    while (orderNotFound) {
      row++;
      transportable = ((ProductionOverviewTableModel) tableFixture.target
          .getModel()).getObjectAtRow(row);

      if (transportable instanceof Order) {
        // content = tableFixture.cell(row(row).column(12)).contents();
        procentDone = (ProcentDone) tableFixture.target.getValueAt(row,
            12);
        if (procentDone == null || procentDone.getProcent() == 0) {
          orderNotFound = false;
        }

      }

    }
    assertEquals(false, orderNotFound);
    ((JXTable) tableFixture.target).scrollRowToVisible(row);
    ((JXTable) tableFixture.target).scrollColumnToVisible(12);
    tableFixture.cell(row(row).column(2)).click();
    tableFixture.cell(row(row).column(12)).rightClick();
    JPopupMenuFixture popupMenuFixture = new JPopupMenuFixture(
        dialogFixture.robot, (JPopupMenu) dialogFixture.robot.finder()
            .findByName("PopupMenuProduction"));
    popupMenuFixture.menuItem("MenuItemSetProcent").click();

    DialogFixture procentdialog = WindowFinder.findDialog(
        "EditProcentDoneView").using(dialogFixture.robot);

    procentdialog.textBox("TextFieldProcent").enterText("30");
    procentdialog.textBox("TextAreaProcentDoneComment").enterText(
        "kommentar");
    procentdialog.button("ButtonOk").click();

    tableFixture.cell(row(row).column(12)).click();
    procentDone = (ProcentDone) tableFixture.target.getValueAt(row, 12);
    assertNotNull(procentDone);
    assertEquals(Integer.valueOf(30), procentDone.getProcent());
    dialogFixture.button("ButtonCancel").click();
  }
View Full Code Here

    int row = 0;
    boolean orderNotFound = true;

    Transportable transportable = null;
    ProcentDone procentDone;
    while (orderNotFound) {
      row++;
      transportable = ((ProductionOverviewTableModel) tableFixture.target
          .getModel()).getObjectAtRow(row);

      if (transportable instanceof Order) {
        // content = tableFixture.cell(row(row).column(12)).contents();
        procentDone = (ProcentDone) tableFixture.target.getValueAt(row,
            12);
        if (procentDone == null || procentDone.getProcent() == 0) {
          orderNotFound = false;
        }

      }

    }
    assertEquals(false, orderNotFound);
    ((JXTable) tableFixture.target).scrollRowToVisible(row);
    ((JXTable) tableFixture.target).scrollColumnToVisible(12);
    tableFixture.cell(row(row).column(2)).click();
    tableFixture.cell(row(row).column(12)).rightClick();
    JPopupMenuFixture popupMenuFixture = new JPopupMenuFixture(
        dialogFixture.robot, (JPopupMenu) dialogFixture.robot.finder()
            .findByName("PopupMenuProduction"));
    popupMenuFixture.menuItem("MenuItemSetProcent").click();

    DialogFixture procentdialog = WindowFinder.findDialog(
        "EditProcentDoneView").using(dialogFixture.robot);

    procentdialog.textBox("TextFieldProcent").enterText("200");
    procentdialog.textBox("TextAreaProcentDoneComment").enterText(
        "kommentar");
    procentdialog.button("ButtonOk").click();

    JOptionPaneFixture optionPane = JOptionPaneFinder.findOptionPane()
        .using(dialogFixture.robot);
    optionPane.buttonWithText("OK").click();

    procentdialog.textBox("TextFieldProcent").deleteText();
    procentdialog.textBox("TextFieldProcent").enterText("40");
    procentdialog.button("ButtonOk").click();

    procentDone = (ProcentDone) tableFixture.target.getValueAt(row, 12);
    assertNotNull(procentDone);
    assertEquals(Integer.valueOf(40), procentDone.getProcent());
    dialogFixture.button("ButtonCancel").click();
  }
View Full Code Here

    int row = 0;
    boolean orderNotFound = true;

    Transportable transportable = null;
    ProcentDone procentDone;
    while (orderNotFound) {
      row++;
      transportable = ((ProductionOverviewTableModel) tableFixture.target
          .getModel()).getObjectAtRow(row);

      if (transportable instanceof Order) {
        // content = tableFixture.cell(row(row).column(12)).contents();
        procentDone = (ProcentDone) tableFixture.target.getValueAt(row,
            12);
        if (procentDone == null || procentDone.getProcent() == 0) {
          orderNotFound = false;
        }

      }

    }
    assertEquals(false, orderNotFound);
    ((JXTable) tableFixture.target).scrollRowToVisible(row);
    ((JXTable) tableFixture.target).scrollColumnToVisible(12);
    tableFixture.cell(row(row).column(2)).click();
    tableFixture.cell(row(row).column(12)).rightClick();
    JPopupMenuFixture popupMenuFixture = new JPopupMenuFixture(
        dialogFixture.robot, (JPopupMenu) dialogFixture.robot.finder()
            .findByName("PopupMenuProduction"));
    popupMenuFixture.menuItem("MenuItemSetProcent").click();

    DialogFixture procentdialog = WindowFinder.findDialog(
        "EditProcentDoneView").using(dialogFixture.robot);

    procentdialog.textBox("TextFieldProcent").enterText("30");
    procentdialog.textBox("TextAreaProcentDoneComment").enterText(
        "kommentar");
    procentdialog.button("ButtonOk").click();

    tableFixture.cell(row(row).column(2)).click();
    tableFixture.cell(row(row).column(12)).rightClick();
    popupMenuFixture = new JPopupMenuFixture(dialogFixture.robot,
        (JPopupMenu) dialogFixture.robot.finder().findByName(
            "PopupMenuProduction"));
    popupMenuFixture.menuItem("MenuItemSetProcent").click();

    procentdialog = WindowFinder.findDialog("EditProcentDoneView").using(
        dialogFixture.robot);

    procentdialog.textBox("TextFieldProcent").deleteText();
    procentdialog.textBox("TextFieldProcent").enterText("40");
    procentdialog.button("ButtonOk").click();

    JOptionPaneFixture optionPane = JOptionPaneFinder.findOptionPane()
        .using(dialogFixture.robot);
    optionPane.buttonWithText("Ja").click();

    procentDone = (ProcentDone) tableFixture.target.getValueAt(row, 12);
    assertNotNull(procentDone);
    assertEquals(Integer.valueOf(40), procentDone.getProcent());
    dialogFixture.button("ButtonCancel").click();
  }
View Full Code Here

    int row = 0;
    boolean orderNotFound = true;

    Transportable transportable = null;
    ProcentDone procentDone;
    while (orderNotFound) {
      row++;
      transportable = ((ProductionOverviewTableModel) tableFixture.target
          .getModel()).getObjectAtRow(row);

      if (transportable instanceof Order) {
        // content = tableFixture.cell(row(row).column(12)).contents();
        procentDone = (ProcentDone) tableFixture.target.getValueAt(row,
            12);
        if (procentDone == null || procentDone.getProcent() == 0) {
          orderNotFound = false;
        }

      }

    }
    assertEquals(false, orderNotFound);
    ((JXTable) tableFixture.target).scrollRowToVisible(row);
    ((JXTable) tableFixture.target).scrollColumnToVisible(12);
    tableFixture.cell(row(row).column(2)).click();
    tableFixture.cell(row(row).column(12)).rightClick();
    JPopupMenuFixture popupMenuFixture = new JPopupMenuFixture(
        dialogFixture.robot, (JPopupMenu) dialogFixture.robot.finder()
            .findByName("PopupMenuProduction"));
    popupMenuFixture.menuItem("MenuItemSetProcent").click();

    DialogFixture procentdialog = WindowFinder.findDialog(
        "EditProcentDoneView").using(dialogFixture.robot);

    procentdialog.textBox("TextFieldProcent").enterText("30");
    procentdialog.textBox("TextAreaProcentDoneComment").enterText(
        "kommentar");
    procentdialog.button("ButtonOk").click();

    tableFixture.cell(row(row).column(2)).click();
    tableFixture.cell(row(row).column(12)).rightClick();
    popupMenuFixture = new JPopupMenuFixture(dialogFixture.robot,
        (JPopupMenu) dialogFixture.robot.finder().findByName(
            "PopupMenuProduction"));
    popupMenuFixture.menuItem("MenuItemSetProcent").click();

    procentdialog = WindowFinder.findDialog("EditProcentDoneView").using(
        dialogFixture.robot);

    procentdialog.comboBox("ComboBoxWeek").selectItem(
        Util.getCurrentWeek() + 1);
    procentdialog.textBox("TextFieldProcent").deleteText();
    procentdialog.textBox("TextFieldProcent").enterText("20");
    procentdialog.button("ButtonOk").click();

    JOptionPaneFixture optionPane = JOptionPaneFinder.findOptionPane()
        .using(dialogFixture.robot);
    optionPane.buttonWithText("Ja").click();

    procentDone = (ProcentDone) tableFixture.target.getValueAt(row, 12);
    assertNotNull(procentDone);
    assertEquals(Integer.valueOf(20), procentDone.getProcent());
    dialogFixture.button("ButtonCancel").click();
  }
View Full Code Here


  private void setProcentForOrder(final Order order,
      final WindowInterface aWindow) {
    ProcentDoneModel procentDoneModel = new ProcentDoneModel(
        new ProcentDone(null, null, null, null, order, null, null, null));
    ProcentDoneViewHandler procentDoneViewHandler = new ProcentDoneViewHandler(
        userType, managerRepository.getProcentDoneManager());
    EditProcentDoneView procentDoneView = new EditProcentDoneView(false,
        procentDoneModel, procentDoneViewHandler);
    Util.showEditViewable(procentDoneView, aWindow);
View Full Code Here

  }

  private void handleProcentDone(final Order order,
      final WindowInterface aWindow,
      final ProcentDoneModel procentDoneModel) {
    ProcentDone newProcentDone = procentDoneModel.getObject();
    CheckObject checkObject = checkProcentDone(newProcentDone, order);

    if (checkObject != null) {
      if (Util.showConfirmDialog(aWindow.getComponent(), "Lagre?",
          checkObject.getMsg())) {
        if (checkObject.getRefObject() != null) {
          newProcentDone = (ProcentDone) checkObject.getRefObject();
          order.clearProcentDoneCache();
        } else {
          order.addProcentDone(newProcentDone);
        }

      } else {
        return;
      }
    } else {
      order.addProcentDone(newProcentDone);
    }

    newProcentDone.setProcent(procentDoneModel.getProcent());
    newProcentDone.setProcentDoneComment(procentDoneModel
        .getProcentDoneComment());

    newProcentDone.setChangeDate(Util.getCurrentDate());
    newProcentDone.setUserName(login.getApplicationUser().getUserName());
    try {
      ((OrderManager) overviewManager).saveOrder(order);
    } catch (ProTransException e) {
      Util.showErrorDialog(window, "Feil", e.getMessage());
      e.printStackTrace();
View Full Code Here

    }

  }

  private CheckObject checkProcentDone(ProcentDone newProcentDone, Order order) {
    ProcentDone procentDone = order.getProcentDone(newProcentDone);
    CheckObject checkObject = null;
    if (procentDone != null) {
      checkObject = new CheckObject(
          "Det er allerde registert en prosent "
              + procentDone.getProcent()
              + " for denne uken. Vil du overskrive denne?",
          true, procentDone);
    } else if (order.getLastProcentDone() != null
        && order.getLastProcentDone().getProcent() > newProcentDone
            .getProcent()) {
View Full Code Here

        super("Prosent ferdig", procentDoneManager, aUserType, true);
    }

    public ProcentDone checkSave(ProcentDoneModel procentDoneModel,
            WindowInterface window) {
        ProcentDone procentDone = procentDoneModel.getObject();
        CheckObject checkObject = checkSaveObject(procentDoneModel, null,
                window);
       
        if (checkObject != null && checkObject.getMsg() != null) {
            if (handleSaveCheckObject(window, checkObject)) {
View Full Code Here

TOP

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

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.