Package net.sf.jpluck.jxl

Examples of net.sf.jpluck.jxl.JXL$DocumentComparator


    if (args.length!=2) {
      System.err.println("ERROR: invalid number of arguments: " + args.length);
      System.exit(ExitCodes.ERROR_INVALID_NUMBER_OF_ARGUMENTS);
    }

    JXL jxl = new JXL();
    File file = new File(args[0]);
    System.out.println("Reading Plucker INI: " + file.getAbsolutePath());
    IniFile ini = new IniFile(file);
    Document[] documents = ini.getDocuments();
    for (int i = 0; i < documents.length; i++) {
      if (documents[i].getURL().startsWith("http://")) {
        // Only imports HTTP URLs for now
        Element site = jxl.createSiteElement();
        documents[i].toJXLFormat(site);
        jxl.add(site);
      }
    }
    String s = args[1];
    if (!s.endsWith(".jxl")) {
      s+=".jxl";
    }
    File jxlFile = new File(s);
    System.out.println("Writing JXL: " + jxlFile.getAbsolutePath());
    jxl.save(jxlFile);
    System.out.println("Done!");
  }
View Full Code Here


      System.err.println("ERROR: filename does end with \".jxl\"");
      System.exit(-1);
    }
    File file = new File(filename);
    System.out.println("Reading " + file.getAbsolutePath());
    JXL jxl=new JXL(file);
    Document[] documents = jxl.getDocuments();
    ToPluck toPluck = new ToPluck();
    for (int i = 0; i < documents.length; i++) {
      Document document = documents[i];
      String category=null;
      if (document.getCategories().length>0) {
View Full Code Here

  public static void main(String[] args) throws Exception {
    File file = new File(args[0]);
    String filename = file.getAbsolutePath();
    long before = System.currentTimeMillis();
    JXL jxl = new JXL(file);
    long after = System.currentTimeMillis();
    System.out.println((after-before) + "ms");
    before = System.currentTimeMillis();
    jxl = new JXL(file);
    after = System.currentTimeMillis();
    System.out.println((after-before) + "ms");
    /*filename = filename.replaceAll("\\.jxl", "_new.jxl");
    jxl.save(new File(filename));*/
  }
 
View Full Code Here

  }

  public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel("com.jgoodies.plaf.plastic.PlasticXPLookAndFeel");
    AutoUpdateFrame dlg = new AutoUpdateFrame();
    JXL jxl = new JXL(new File(args[0]));
    Conversion conversion = new Conversion(jxl.getDocuments());
    conversion.addConversionListener(dlg);
    WindowUtil.center(dlg);
    dlg.show();
    dlg.runConversion(conversion);
View Full Code Here

      if (fileChooser.showOpenDialog(AutoUpdatePanel.this) == JFileChooser.APPROVE_OPTION) {
        File file = fileChooser.getSelectedFile();
        int idx = jxlList.indexOf(file);
        if (idx == -1) {
          try {
            new JXL(file);
            model.add(file);
            list.setSelectedIndex(jxlList.size() - 1);
          } catch (Exception e) {
            JOptionPane.showMessageDialog(AutoUpdatePanel.this,
                            "Not a valid JXL file: " + e.getMessage(), "Error",
View Full Code Here

      ListFrame listFrame = null;
            if (args.length > 0) {
                for (int i = 0; i < args.length; i++) {
                    try {
                        JXL jxl = new JXL(new File(args[i]).getAbsoluteFile());
                        listFrame = jpluckx.newListFrame(jxl);
                       
                    } catch (Exception e) {
                        ExceptionDialog.show(null, e);
                    }
                }
            } else {
                String s = ClientConfiguration.getDefault().getLastJXL();
                if (s != null) {
                    File f = new File(s);
                    if (f.exists()) {
                        try {
                            JXL jxl = new JXL(f);
                            listFrame = jpluckx.newListFrame(jxl);
                        } catch (Exception e) {
                            ExceptionDialog.show(jpluckx.activeListFrame, e);
                        }
                    }
View Full Code Here

                }
                filename = filename.replace('+', ' ');
                i++;
                if (filename.endsWith(".jxl") || filename.endsWith(".xml")) {
                    try {
                        JXL jxl = new JXL(new File(filename));
                        newListFrame(jxl).show();
                    } catch (Exception e) {
                        ExceptionDialog.show(activeListFrame, e);
                    }
                }
View Full Code Here

            listFrame.disablePasteAction();
        }
    }

    public ListFrame newListFrame() {
        return newListFrame(new JXL());
    }
View Full Code Here

        }
    }

    public void copyFromShowcase(Document document) {
        try {
            JXL jxl = activeListFrame.getJXL();
            jxl.addCopyOf(document);
            jxl.save();
        } catch (Exception e) {
            ExceptionDialog.show(activeListFrame, e);
        }
    }
View Full Code Here

            }
            File[] files = conf.getAutoUpdateJXLs();
            Map jxlMap = new HashMap();
            for (Iterator it = listFrameList.iterator(); it.hasNext();) {
                ListFrame listFrame = (ListFrame) it.next();
                JXL jxl = listFrame.getJXL();
                jxlMap.put(jxl.getFile(), jxl);
            }
            List documentList = new ArrayList();
            for (int i = 0; i < files.length; i++) {
                try {
                    File file = files[i];
                    JXL jxl = (JXL) jxlMap.get(file);
                    if (jxl == null) {
                        jxl = new JXL(file);
                    }
                    Document[] documents = jxl.getDueDocuments();
                    Arrays.sort(documents);
                    documentList.addAll(Arrays.asList(documents));
                } catch (Exception e) {
                    // TODO: Log exceptions
                }
View Full Code Here

TOP

Related Classes of net.sf.jpluck.jxl.JXL$DocumentComparator

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.