Examples of LayoutHelper


Examples of com.github.stephenc.javaisotools.iso9660.LayoutHelper

    }

    private void doBVD() throws HandlerException {
        super.startElement(new LogicalSectorElement("BR"));

        LayoutHelper helper = new ElToritoLayoutHelper(this);
        BootRecord br = new BootRecord(this, helper);
        br.setMetadata(config);
        br.doBR();

        // Remember Boot System Use (absolute pointer to first sector of Boot Catalog)
View Full Code Here

Examples of net.sf.jabref.export.layout.LayoutHelper

  public String layout(String layoutFile, String entry) throws Exception {

    BibtexEntry be = bibtexString2BibtexEntry(entry);
    StringReader sr = new StringReader(layoutFile.replaceAll("__NEWLINE__", "\n"));
    Layout layout = new LayoutHelper(sr).getLayoutFromText(Globals.FORMATTER_PACKAGE);
    StringBuffer sb = new StringBuffer();
    sb.append(layout.doLayout(be, null));

    return sb.toString();
  }
View Full Code Here

Examples of net.sf.jabref.export.layout.LayoutHelper

        ArrayList<String> missingFormatters = new ArrayList<String>(1);

        // Print header
        try {
      reader = getReader(lfFileName + ".begin.layout");
      LayoutHelper layoutHelper = new LayoutHelper(reader);
      beginLayout = layoutHelper
        .getLayoutFromText(Globals.FORMATTER_PACKAGE);
            reader.close();
    } catch (IOException ex) {
      // If an exception was cast, export filter doesn't have a begin
      // file.
    }
    // Write the header
    if (beginLayout != null) {
      ps.write(beginLayout.doLayout(database, encoding));
            missingFormatters.addAll(beginLayout.getMissingFormatters());
    }

    /*
     * Write database entries; entries will be sorted as they appear on the
     * screen, or sorted by author, depending on Preferences. We also supply
     * the Set entries - if we are to export only certain entries, it will
     * be non-null, and be used to choose entries. Otherwise, it will be
     * null, and be ignored.
     */
    List<BibtexEntry> sorted = FileActions.getSortedEntries(database,
      entryIds, false);

    // Load default layout
    reader = getReader(lfFileName + ".layout");

    LayoutHelper layoutHelper = new LayoutHelper(reader);
    Layout defLayout = layoutHelper
      .getLayoutFromText(Globals.FORMATTER_PACKAGE);
    reader.close();
        if (defLayout != null) {
            missingFormatters.addAll(defLayout.getMissingFormatters());
            System.out.println(defLayout.getMissingFormatters());
        }
    HashMap<String, Layout> layouts = new HashMap<String, Layout>();
    Layout layout;

        ExportFormats.entryNumber = 0;
    for (BibtexEntry entry : sorted) {
            ExportFormats.entryNumber++; // Increment entry counter.
      // Get the layout
      String type = entry.getType().getName().toLowerCase();
      if (layouts.containsKey(type))
        layout = layouts.get(type);
      else {
        try {
          // We try to get a type-specific layout for this entry.
          reader = getReader(lfFileName + "." + type + ".layout");
          layoutHelper = new LayoutHelper(reader);
          layout = layoutHelper
            .getLayoutFromText(Globals.FORMATTER_PACKAGE);
          layouts.put(type, layout);
          reader.close();
                    if (layout != null)
                        missingFormatters.addAll(layout.getMissingFormatters());

        } catch (IOException ex) {
          // The exception indicates that no type-specific layout
          // exists, so we
          // go with the default one.
          layout = defLayout;
        }
      }

      // Write the entry
      ps.write(layout.doLayout(entry, database));
    }

    // Print footer

    // changed section - begin (arudert)
    Layout endLayout = null;
    try {
      reader = getReader(lfFileName + ".end.layout");
      layoutHelper = new LayoutHelper(reader);
      endLayout = layoutHelper
        .getLayoutFromText(Globals.FORMATTER_PACKAGE);
      reader.close();
    } catch (IOException ex) {
      // If an exception was thrown, export filter doesn't have an end
      // file.
View Full Code Here

Examples of net.sf.jabref.export.layout.LayoutHelper

  }

  public void readLayout() throws Exception {
    StringReader sr = new StringReader(layoutFile.replaceAll("__NEWLINE__",
      "\n"));
    layout = new LayoutHelper(sr)
      .getLayoutFromText(Globals.FORMATTER_PACKAGE);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.