Package net.sf.jabref

Examples of net.sf.jabref.BibtexEntryType


//    return bibtex;
//  }
 
  public BibtexEntryType mapMSBibToBibtexType(String msbib)
  {
    BibtexEntryType bibtex = BibtexEntryType.OTHER;
    if(msbib.equals("Book"))
      bibtex = BibtexEntryType.BOOK;
    else if(msbib.equals("BookSection"))
      bibtex = BibtexEntryType.INBOOK;
    else if(msbib.equals("JournalArticle"))
View Full Code Here


            name.equals("bibtex:phdthesis") ||
            name.equals("bibtex:techreport") ||
            name.equals("bibtex:unpublished") ||
            name.equals("bibtex:misc") ||
            name.equals("bibtex:other")) {
            BibtexEntryType tp = BibtexEntryType.getType(local);
            b.setType(tp);
        }
        currentChars = "";
    }
View Full Code Here

        int[] selected = list.getSelectedIndices();
        if (selected.length > 0)
            changesMade = true;
        for (int i=0; i<selected.length; i++) {
            String typeName = (String)listModel.get(selected[selected.length-1-i]);
            BibtexEntryType type = BibtexEntryType.getType(typeName);
           
            // If it is a custom entry type, we can remove it. If type == null, it means
            // the user must have added it and not yet applied it, so we can remove it
            // in this case as well. If it is a standard type it cannot be removed.
            if ((type != null) && (type instanceof CustomEntryType)) {
View Full Code Here

          }
        }
      }
     
      // clean up publication field
      BibtexEntryType type = entry.getType();
      String sourceField = "";
    if (type.getName() == "Article") {
          sourceField = "journal";
      entry.clearField("booktitle");
    } else if (type.getName() == "Inproceedings"){
            sourceField = "booktitle";
    }
        String fullName = entry.getField(sourceField);
        if (fullName != null) {
          if (type.getName() == "Article") {
            int ind = fullName.indexOf(": Accepted for future publication");
        if (ind > 0) {
          fullName = fullName.substring(0, ind);
          entry.setField("year", "to be published");
          entry.clearField("month");
          entry.clearField("pages");
        }
            String[] parts = fullName.split("[\\[\\]]"); //[see also...], [legacy...]
            fullName = parts[0];
            if (parts.length == 3) {
          fullName += parts[2];
        }
          } else {
            fullName = fullName.replace("Conference Proceedings", "Proceedings").
                replace("Proceedings of", "Proceedings").replace("Proceedings.", "Proceedings");
            fullName = fullName.replaceAll("International", "Int.");
            fullName = fullName.replaceAll("Symposium", "Symp.");
            fullName = fullName.replaceAll("Conference", "Conf.");
            fullName = fullName.replaceAll(" on", " ").replace("  ", " ");
          }
         
          Matcher m1 = publicationPattern.matcher(fullName);
      if (m1.find()) {
        String prefix = m1.group(2).trim();
        String postfix = m1.group(1).trim();
        String abrv = "";
        String[] parts = prefix.split("\\. ", 2);
        if (parts.length == 2) {
          if (parts[0].matches(abrvPattern)) {
            prefix = parts[1];
            abrv = parts[0];
          } else {
            prefix = parts[0];
            abrv = parts[1];
          }
        }
        if (prefix.matches(abrvPattern) == false) {
          fullName = prefix + " " + postfix + " " + abrv;
          fullName = fullName.trim();
        } else {
          fullName = postfix + " " + prefix;
        }
      }
      if (type.getName() == "Article") {
        fullName = fullName.replace("- ", "-"); //IEE Proceedings-
       
        fullName = fullName.trim();
        if (Globals.prefs.getBoolean("useIEEEAbrv")) {
          String id = Globals.journalAbbrev.getAbbreviatedName(fullName, false);
          if (id != null)
            fullName = id;
        }
          }
      if (type.getName() == "Inproceedings") {
              Matcher m2 = proceedingPattern.matcher(fullName);
        if (m2.find()) {
          String prefix = m2.group(2);
          String postfix = m2.group(1).replaceAll("\\.$", "");
          if (prefix.matches(abrvPattern) == false) {
View Full Code Here

        if (index >= 0 && endIndex > 0) {
          endIndex += 6;
          piv = endIndex;
          String text = allText.substring(index, endIndex);
           
            BibtexEntryType type = null;
            String sourceField = null;
           
            String typeName = "";
            Matcher typeMatcher = typePattern.matcher(text);
            if (typeMatcher.find()) {
View Full Code Here

    s = s.replaceAll("<par>", ""); // What is <par> ????
    String[] fields = s.split(SEPARATOR);
    // Check type and create entry:
    if (fields.length < 2)
        continue lines; // Avoid ArrayIndexOutOfBoundsException
    BibtexEntryType typ = BibtexEntryType
        .getType(fields[1].toLowerCase());
    if (typ == null){
        String type = "";
        if (fields[1].equals("Masterthesis")) type = "mastersthesis";
        if (fields[1].equals("PhD-Thesis")) type = "phdthesis";
View Full Code Here

        boolean found = consumeUncritically('@');
        if (!found)
          break;
        skipWhitespace();
        String entryType = parseTextToken();
        BibtexEntryType tp = BibtexEntryType.getType(entryType);
        boolean isEntry = (tp != null);
        // Util.pr(tp.getName());
        if (!isEntry) {
          // The entry type name was not recognized. This can mean
          // that it is a string, preamble, or comment. If so,
View Full Code Here

      if (be.getType() instanceof UnknownEntryType) {
        // Look up the unknown type name in our map of parsed types:

        Object o = entryTypes.get(be.getType().getName().toLowerCase());
        if (o != null) {
          BibtexEntryType type = (BibtexEntryType) o;
          be.setType(type);
        } else {
          // System.out.println("Unknown entry type:
          // "+be.getType().getName());
          _pr
View Full Code Here

        exceptionCause = be;

        // Check if we must write the type definition for this
        // entry, as well. Our criterion is that all non-standard
        // types (*not* customized standard types) must be written.
        BibtexEntryType tp = be.getType();

        if (BibtexEntryType.getStandardType(tp.getName()) == null) {
          types.put(tp.getName(), tp);
        }

        // Check if the entry should be written.
        boolean write = true;

        if (checkSearch && !nonZeroField(be, BibtexFields.SEARCH)) {
          write = false;
        }

        if (checkGroup && !nonZeroField(be, BibtexFields.GROUPSEARCH)) {
          write = false;
        }

        if (write) {
          be.write(fw, ff, true);
          fw.write(Globals.NEWLINE);
        }
      }

      // Write meta data.
      if (metaData != null) {
        metaData.writeMetaData(fw);
      }

      // Write type definitions, if any:
      if (types.size() > 0) {
        for (Iterator<String> i = types.keySet().iterator(); i
          .hasNext();) {
                    BibtexEntryType type = types.get(i.next());
                    if (type instanceof CustomEntryType) {
                        CustomEntryType tp = (CustomEntryType)type;
                        tp.save(fw);
                        fw.write(Globals.NEWLINE);
                    }
View Full Code Here

                be = (i.next());

        // Check if we must write the type definition for this
        // entry, as well. Our criterion is that all non-standard
        // types (*not* customized standard types) must be written.
        BibtexEntryType tp = be.getType();
        if (BibtexEntryType.getStandardType(tp.getName()) == null) {
            types.put(tp.getName(), tp);
        }

        be.write(fw, ff, true);
        fw.write(Globals.NEWLINE);
        }

            // Write meta data.
            if (metaData != null)
            {
                metaData.writeMetaData(fw);
            }

        // Write type definitions, if any:
        if (types.size() > 0) {
        for (Iterator<String> i=types.keySet().iterator(); i.hasNext();) {
            CustomEntryType tp = (CustomEntryType)types.get(i.next());
            tp.save(fw);
            fw.write(Globals.NEWLINE);
        }

        }

View Full Code Here

TOP

Related Classes of net.sf.jabref.BibtexEntryType

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.