Beispiel #1
0
 /** Load data. */
 private ArrayList loadData() {
   try {
     ArrayList vos = new ArrayList();
     BufferedReader br =
         new BufferedReader(new InputStreamReader(new FileInputStream("orders.txt")));
     String line = null;
     SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
     OrdersVO vo = null;
     String[] t = null;
     while ((line = br.readLine()) != null) {
       t = line.split(";");
       vo = new OrdersVO();
       vos.add(vo);
       vo.setOrderDate(sdf.parse(t[0]));
       vo.setCategory(t[1]);
       vo.setSubCategory(t[2]);
       vo.setCountry(t[3]);
       vo.setZone(t[4]);
       vo.setAgent(t[5]);
       vo.setItem(t[6]);
       vo.setSellQty(new BigDecimal(t[7]));
       vo.setSellAmount(new BigDecimal(t[8]));
     }
     br.close();
     return vos;
   } catch (Exception ex) {
     ex.printStackTrace();
     return new ArrayList();
   }
 }
Beispiel #2
0
 public void prevPgButton_actionPerformed(ActionEvent e) {
   if (resultSetController != null) {
     for (int i = 0; i < beforeActionListeners.size(); i++)
       ((ActionListener) beforeActionListeners.get(i))
           .actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, PREV_PG_BUTTON));
     resultSetController.previousPage(this);
   }
 }
Beispiel #3
0
 public void firstButton_actionPerformed(ActionEvent e) {
   if (resultSetController != null) {
     for (int i = 0; i < beforeActionListeners.size(); i++)
       ((ActionListener) beforeActionListeners.get(i))
           .actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, FIRST_BUTTON));
     resultSetController.firstRow(this);
   }
 }
Beispiel #4
0
  public void nextButton_actionPerformed(ActionEvent e) {
    if (resultSetController != null) {
      for (int i = 0; i < beforeActionListeners.size(); i++)
        ((ActionListener) beforeActionListeners.get(i))
            .actionPerformed(
                new ActionEvent(this, ActionEvent.ACTION_PERFORMED, e.getActionCommand()));

      resultSetController.nextRow(this, e);
    }
  }
Beispiel #5
0
 /**
  * Remove the specified ActionListener.
  *
  * @param listener ActionListener to remove.
  */
 public final void removeBeforerActionListener(ActionListener listener) {
   beforeActionListeners.remove(listener);
 }
Beispiel #6
0
 /**
  * Add an ActionListener that will be called as the first instruction when a navigator button is
  * being pressed (BEFORE selecting row event).
  *
  * @param listener ActionListener to register.
  */
 public final void addBeforeActionListener(ActionListener listener) {
   beforeActionListeners.add(listener);
 }
Beispiel #7
0
 /**
  * Method invoked by the grid control when pressing a navigator button.
  *
  * @param buttonType possible values: NavigatorBar.xxx_BUTTON
  */
 public final void fireButtonPressedEvent(String buttonType) {
   for (int i = 0; i < afterActionListeners.size(); i++)
     ((ActionListener) afterActionListeners.get(i))
         .actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, buttonType));
 }
Beispiel #8
0
 /**
  * Remove the specified ActionListener.
  *
  * @param listener ActionListener to remove.
  */
 public final void removeAfterActionListener(ActionListener listener) {
   afterActionListeners.remove(listener);
 }
Beispiel #9
0
 /**
  * Add an ActionListener that will be called AFTER a navigator button has been pressed (AFTER
  * selecting row event).
  *
  * @param listener ActionListener to register.
  */
 public final void addAfterActionListener(ActionListener listener) {
   afterActionListeners.add(listener);
 }
Beispiel #10
0
 /** @return list of languages supported by the application */
 public ArrayList getLanguages() {
   ArrayList list = new ArrayList();
   list.add(new Language("EN", "English"));
   return list;
 }