/** 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(); } }
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); } }
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); } }
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); } }
/** * Remove the specified ActionListener. * * @param listener ActionListener to remove. */ public final void removeBeforerActionListener(ActionListener listener) { beforeActionListeners.remove(listener); }
/** * 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); }
/** * 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)); }
/** * Remove the specified ActionListener. * * @param listener ActionListener to remove. */ public final void removeAfterActionListener(ActionListener listener) { afterActionListeners.remove(listener); }
/** * 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); }
/** @return list of languages supported by the application */ public ArrayList getLanguages() { ArrayList list = new ArrayList(); list.add(new Language("EN", "English")); return list; }