Exemplo n.º 1
0
    /** @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */
    public void actionPerformed(ActionEvent arg0) {
      Batchable batch = (Batchable) batchSelectionList.getSelection();
      ExcelUtil excelUtil =
          new ExcelUtil(
              tableModel, "Avstemmingsrapport - " + batch.getFileName(), "Avstemmingsrapport");
      try {
        excelUtil.showDataInExcel(
            directory + "/" + applUser.getUserName() + "/",
            "Avstemming.xls",
            (List<Integer>) null,
            (List<Integer>) null,
            (JLabel) null);

        GuiUtil.showMsgFrame(
            window.getComponent(),
            "Excefil",
            "Dersom ikke excel starter automatisk, ligger excelfil med navn Avstemming.xls"
                + " under katalog "
                + directory
                + "/"
                + applUser.getUserName()
                + "/");
      } catch (FrafException e) {
        e.printStackTrace();
        GuiUtil.showErrorMsgDialog(window.getComponent(), "Feil", e.getMessage());
      }
    }
Exemplo n.º 2
0
    /** @see java.awt.event.ComponentListener#componentShown(java.awt.event.ComponentEvent) */
    @Override
    public void componentShown(ComponentEvent evt) {
      Bunt bunt = deductBatchViewHandler.getSelectedBatch();

      if (lastBunt == null || !lastBunt.equals(bunt)) {
        lastBunt = bunt;
        if (bunt != null) {
          GuiUtil.setWaitCursor(FrafMain.getInstance());
          loadImport(bunt);
          GuiUtil.setDefaultCursor(FrafMain.getInstance());
        }
      }
    }
Exemplo n.º 3
0
  /**
   * Viser rapport
   *
   * @param window
   */
  void showReport(WindowInterface window) {
    GuiUtil.setWaitCursor(window);
    Batchable batch = (Batchable) batchSelectionList.getSelection();
    if (batch != null) {
      List<ReconcilVInterface> lines = reconcilVManager.findByBatchId(batch.getBatchId());

      if (lines != null) {
        reportList.clear();
        reportList.addAll(lines);
      }
    }
    table.packAll();
    GuiUtil.setDefaultCursor(window);
  }
Exemplo n.º 4
0
 /** Laster data */
 protected void loadData() {
   if (!guiInitiated) {
     init();
   }
   Threadable loadClass = getLoadClass();
   if (loadClass != null) {
     if (runInWheel) {
       GuiUtil.runInThreadWheel(departmentFrame.getRootPane(), loadClass, null);
     } else {
       GuiUtil.runInThread(
           departmentFrame,
           getHeading(),
           "Henter " + getHeading().toLowerCase() + "...",
           loadClass,
           null);
     }
   }
 }
Exemplo n.º 5
0
  /**
   * @see no.ica.fraf.gui.model.interfaces.Threadable#doWork(java.lang.Object[], javax.swing.JLabel)
   */
  public Object doWork(Object[] params, JLabel labelInfo) {
    try {
      final ExcelUtil excelUtil = new ExcelUtil(getExcelTableModel(), "", "Sheet1");
      final String dir = excelUtil.prepare(currentApplUser, departmentFrame);

      excelUtil.showDataInExcel(dir, "tmp.xls", getSumColumns(), getNumberCols(), labelInfo);
    } catch (FrafException e) {
      GuiUtil.showErrorMsgFrame(departmentFrame, "Feil", e.getMessage());
      e.printStackTrace();
    }
    return new Boolean(true);
  }
Exemplo n.º 6
0
 /** Eksporterer data til excel */
 public void showInExcel() {
   GuiUtil.runInThread(departmentFrame, "Excel", "Generer excel-fil", this, null);
 }