Package net.sf.nfp.mini.data

Examples of net.sf.nfp.mini.data.Exporter


  public void setView(Displayable view) {
    view.addCommand(new NavigationCommand("quit", "${quit}", Command.SCREEN, 9));
    //#ifdef FILE_API
    view.addCommand(new ActionCommand("${export}", Command.SCREEN, 8) {
      public Navigation execute(Displayable d) throws Exception {
        Exporter exporter = new Exporter();
       
        javax.microedition.io.file.FileConnection fc =
          (javax.microedition.io.file.FileConnection) Connector.open(CSV_PATH, Connector.READ_WRITE);
        try {
          if (fc.exists())
            fc.delete();
          fc.create();
          exporter.exportToCSV(fc.openOutputStream(), controler);
        } finally {
          fc.close();
        }
        return null;
      }
    });
    view.addCommand(new ActionCommand("${import}", Command.SCREEN, 8) {
      public Navigation execute(Displayable d) throws Exception {
        Exporter exporter = new Exporter();
       
        javax.microedition.io.file.FileConnection fc =
          (javax.microedition.io.file.FileConnection) Connector.open(CSV_PATH,
            Connector.READ);
        try {
          exporter.importFromCSV(fc.openDataInputStream(), fc.fileSize(), controler);
        } finally {
          fc.close();
        }
        return null;
      }
View Full Code Here

TOP

Related Classes of net.sf.nfp.mini.data.Exporter

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.