protected void generateReport() {
   log.debug("Generating");
   MainFrame.getInstance().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
   CurrencyValue currency = currencyBox.getSelectedCurrency();
   String[] platformRefs = null;
   boolean imp = false;
   boolean exp = false;
   Date from = fromField.getDateOrNull();
   Date to = toField.getDateOrNull();
   Object[] cs = platformChooser.getSelectedPlatforms().toArray(new String[0]);
   if (cs.length > 0) platformRefs = new String[cs.length];
   for (int i = 0, n = cs.length; i < n; i++) {
     platformRefs[i] = (String) cs[i];
     // platformRefs[i] = ((FacilityValue)cs[i]).getReference();
   }
   imp = this.importBox.isSelected();
   exp = this.exportBox.isSelected();
   try {
     // @war-pp
     if (typeBox.getSelectedItem().equals("ICC Manual Tracing Report")) {
       byte[] pdfStream =
           ReportService.getInstance()
               .getICCManualTracingReport(platformRefs, typeBox.getSelectedItem().toString());
       if (pdfStream != null) ReportFrame.openIccManualReport(pdfStream, "ICCManualTracingReport");
       else showInformationMessage("No data found "); // @war
     } else {
       byte[] pdfStream =
           ReportService.getInstance()
               .getCCReport(
                   from,
                   to,
                   currency,
                   platformRefs,
                   imp,
                   exp,
                   typeBox.getSelectedItem().toString());
       ReportFrame.openReport(
           pdfStream,
           typeBox.getSelectedItem().equals("Activity Report")
               ? "ActivityReport"
               : "PreliminaryReport");
     }
   } catch (Exception e) {
     log.error(this, e);
     MainFrame.getInstance().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
     MainFrame.handleException("Could not create " + typeBox.getSelectedItem(), e);
   }
   MainFrame.getInstance().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
 }
 public void refreshTitle() {
   if (getModel().getClientValueObjectProxy().isNew()) {
     setTitle(GUIConstants.ORDER_TITLE_NEW_ORDER);
   } else {
     setTitle(GUIConstants.ORDER_TITLE_PREFIX + ((OrderValue) getModel()).getDashedOrderNumber());
   }
   MainFrame.getInstance().refreshFrameMenuNames();
 }
  protected void modifyTableContent() {
    try {
      // selected lines
      Collection c = bargeTariffTable.getSelectedModel();
      if (c.size() < 1) {
        MainFrame.setDefaultCursor();
        JOptionPane.showInternalMessageDialog(
            MainFrame.getInstance().getContentPane(), "Please mark at least one line to modify.");
        return;
      }
      BargeTariffLineModificationFrame frame = new BargeTariffLineModificationFrame(c);
      frame.setVisible(true); // necessary as of 1.3
      MainFrame.getInstance().addInternalFrame(frame);
      try {
        frame.setSelected(true);
      } catch (java.beans.PropertyVetoException e) {
        log.debug("Exception caught and ignored:", e);
      }

    } catch (Exception e) {
      log.error(this, e);
    }
  }
 protected void doYouWantToSave() throws Exception {
   boolean refresh = false;
   if (((ContextTableModel) bargeTariffTable.getModel()).isContentUnsaved()) {
     MainFrame.setDefaultCursor();
     int answer =
         javax.swing.JOptionPane.showInternalConfirmDialog(
             MainFrame.getInstance().getContentPane(),
             "Do you want to close the window without saving the changes?",
             "",
             JOptionPane.YES_OPTION,
             JOptionPane.QUESTION_MESSAGE);
     if (answer == JOptionPane.NO_OPTION) {
       return;
     } else if (answer == JOptionPane.OK_OPTION) {
       refresh = true;
     }
   }
   super.doYouWantToSave();
   if (refresh) ((BargeTariffValue) getModel()).fillBargeTariffLines(null);
 }
 private void showInformationMessage(String message) { // @war-pp
   Container parent = MainFrame.getInstance().getContentPane();
   String title = "ICC Manual Tracing Report Creation";
   JOptionPane.showInternalMessageDialog(parent, message, title, JOptionPane.INFORMATION_MESSAGE);
 }
 public void refreshTitle() {
   setTitle("Timestamp");
   MainFrame.getInstance().refreshFrameMenuNames();
 }