debian/jabref/branches/upstream/current.
#Build Number for ANT. Do not edit!
-#Thu Feb 02 19:19:17 CET 2006
-build.number=186
+#Tue May 09 22:53:43 CEST 2006
+build.number=108
Compiler: Ant
Authors: Joerg K. Wegner, wegnerj@informatik.uni-tuebingen.de
Morten O. Alver
- Version: $Revision: 1.54.2.3 $
- $Date: 2006/02/02 09:31:59 $
- $Author: mortenalver $
+ Version: $Revision: 1.59 $
+ $Date: 2006/04/26 08:38:44 $
+ $Author: kiar $
modified:
28.07.2005 r.nagel
<!-- some version information -->
<property name="jabref.bin" value="jabref" />
- <property name="jabref.version" value="2.0.1" />
+ <property name="jabref.version" value="2.1 beta" />
<property name="jabref.placeholder.version" value="@version@" /> <!-- used by replace task -->
<property name="build.resource" value="${build.dir}/resource" />
<property name="build.help" value="${build.dir}/help" />
<property name="build.javadocs" value="${build.dir}/docs/API" />
+ <property name="build.extensions" value="${build.dir}/extensions" />
+ <property name="build.extension-javadocs" value="${build.extensions}/API" />
+ <property name="build.extension-layout" value="${build.extensions}/layout" />
<property name="build.openoffice.meta" value="${build.resource}/openoffice"/>
<!-- Set the properties for source directories -->
<property name="images.dir" value="${src.dir}/images" />
<property name="fonts.dir" value="${src.dir}/images/font" />
<property name="help.dir" value="${src.dir}/help" />
+ <property name="extensions.dir" value="${src.dir}/extensions" />
+ <property name="layout.dir" value="${src.dir}/resource/layout" />
<!-- Set the properties for library directories -->
<!--<pathelement location="${library.directory}/commons-httpclient-2.0.jar" />
<pathelement location="${library.directory}/commons-logging.jar" />-->
<pathelement location="${library.directory}/antlr.jar" />
- <pathelement location="${library.directory}/looks-1.2.2.jar" />
+ <pathelement location="${library.directory}/looks-2.0.1.jar" />
<pathelement location="${library.directory}/forms-1.0.4.jar" />
- <pathelement location="${library.directory}/spin.jar" />
+ <pathelement location="${library.directory}/spin-1.4.jar" />
<pathelement location="${library.directory}/glazedlists-1.5.0_java14.jar" />
</classpath>
</java>
<classpath>
<pathelement location="${build.lib}/jabref.jar"/>
<pathelement location="${library.directory}/antlr.jar" />
- <pathelement location="${library.directory}/looks-1.2.2.jar" />
+ <pathelement location="${library.directory}/looks-2.0.1.jar" />
<pathelement location="${library.directory}/forms-1.0.4.jar" />
<pathelement location="${library.directory}/spin.jar" />
<pathelement location="${library.directory}/glazedlists-1.5.0_java14.jar" />
<classpath>
<pathelement location="${build.lib}/jabref.jar"/>
<pathelement location="${library.directory}/antlr.jar" />
- <pathelement location="${library.directory}/looks-1.2.2.jar" />
+ <pathelement location="${library.directory}/looks-2.0.1.jar" />
<pathelement location="${library.directory}/forms-1.0.4.jar" />
- <pathelement location="${library.directory}/spin.jar" />
+ <pathelement location="${library.directory}/spin-1.4.jar" />
<pathelement location="${library.directory}/glazedlists-1.5.0_java14.jar" />
</classpath>
</nbprofiledirect>
<classpath>
<pathelement location="${build.lib}/jabref.jar"/>
<pathelement location="${library.directory}/antlr.jar" />
- <pathelement location="${library.directory}/looks-1.2.2.jar" />
+ <pathelement location="${library.directory}/looks-2.0.1.jar" />
<pathelement location="${library.directory}/forms-1.0.4.jar" />
- <pathelement location="${library.directory}/spin.jar" />
+ <pathelement location="${library.directory}/spin-1.4.jar" />
<pathelement location="${library.directory}/glazedlists-1.5.0_java14.jar" />
+
</classpath>
</java>
</target>
<target name="compile">
<mkdir dir="${build.classes}" />
<!--deprecation="on"-->
- <javac debug="off" deprecation="on" destdir="${build.classes}" source="1.4" target="1.4">
+ <javac debug="on" deprecation="on" destdir="${build.classes}" source="1.4" target="1.4">
<src path="${java.dir}"/>
<exclude name="tests/**"/>
<classpath>
<!--<pathelement location="${library.directory}/commons-httpclient-2.0.jar" />
<pathelement location="${library.directory}/commons-logging.jar" />-->
<pathelement location="${library.directory}/antlr.jar" />
- <pathelement location="${library.directory}/looks-1.2.2.jar" />
+ <pathelement location="${library.directory}/looks-2.0.1.jar" />
<pathelement location="${library.directory}/forms-1.0.4.jar" />
- <pathelement location="${library.directory}/spin.jar" />
- <pathelement location="${library.directory}/glazedlists-1.5.0_java14.jar" />
+ <pathelement location="${library.directory}/spin-1.4.jar" />
+ <pathelement location="${library.directory}/glazedlists-1.5.0_java14.jar" />
+ <pathelement location="${library.directory}/microba.jar" />
</classpath>
</javac>
</target>
<!--<pathelement location="${library.directory}/commons-httpclient-2.0.jar" />
<pathelement location="${library.directory}/commons-logging.jar" />-->
<pathelement location="${library.directory}/antlr.jar" />
- <pathelement location="${library.directory}/looks-1.2.2.jar" />
- <pathelement location="${library.directory}/spin.jar" />
+ <pathelement location="${library.directory}/looks-2.0.1.jar" />
+ <pathelement location="${library.directory}/spin-1.4.jar" />
</classpath>
</javac>
<include name="README" />
</fileset>
<manifest>
- <attribute name="Main-Class" value="net.sf.jabref.JabRef" />
+ <attribute name="Main-Class" value="net.sf.jabref.JabRef" />
+<!-- <attribute name="Main-Class" value="net.sf.jabref.gui.FieldWeightDialog" /> -->
</manifest>
</jar>
</javadoc>
</target>
+ <!-- Creates javadocs for the extensions -->
+ <target name="extension-javadocs" depends="build" description="Generates the javadocs for the extensions archive">
+ <mkdir dir="${build.extension-javadocs}" />
+ <copy todir="${build.extension-javadocs}">
+ <fileset dir="${help.dir}" defaultexcludes="yes">
+ <include name="CustomExports.html" />
+ <include name="CustomImports.html" />
+ </fileset>
+ </copy>
+
+ <javadoc sourcepath="${java.dir}"
+ destdir="${build.extension-javadocs}"
+ author="true"
+ version="true"
+ windowtitle="JabRef-Extensions API"
+ link="http://java.sun.com/j2se/1.4.1/docs/api/"
+ Overview="${extensions.dir}/API/overview.html"
+ access="protected"
+ >
+ <!--
+ create javadoc only selectively for classes that
+ users extending JabRef are likely to use
+ -->
+ <fileset dir="${java.dir}" defaultexcludes="yes">
+ <include name="net/sf/jabref/imports/ImportFormat.java" />
+ <include name="net/sf/jabref/imports/ImportFormatReader.java" />
+ <include name="net/sf/jabref/BibtexEntry.java" />
+ <include name="net/sf/jabref/BibtexEntryType.java" />
+ <include name="net/sf/jabref/AuthorList.java" />
+ <include name="net/sf/jabref/AuthorList.java" />
+ <include name="net/sf/jabref/export/layout/LayoutFormatter.java" />
+ </fileset>
+
+ <classpath refid="classpath" />
+ </javadoc>
+ </target>
+
+ <!-- Creates javadocs for the extensions -->
+ <target name="extensions" depends="extension-javadocs" description="Generates the extensions archive">
+ <!-- copy examples -->
+ <copy todir="${build.extensions}">
+ <fileset dir="${java.dir}">
+ <include name="net/sf/jabref/export/layout/format/CurrentDate.java"/>
+ <include name="net/sf/jabref/export/layout/format/ToLowerCase.java"/>
+ <include name="net/sf/jabref/export/layout/format/HTMLChars.java"/>
+ <include name="net/sf/jabref/imports/*Importer.java"/>
+ </fileset>
+ </copy>
+ <mkdir dir="${build.extension-layout}" />
+ <copy todir="${build.extension-layout}">
+ <fileset dir="${layout.dir}" />
+ </copy>
+ <copy todir="${build.extensions}">
+ <fileset dir="${extensions.dir}" />
+ <filterset>
+ <filter token="version" value="${jabref.version}"/>
+ </filterset>
+ </copy>
+ <!-- create extensions-zip file -->
+ <zip destfile="${build.dir}/jabref-extensions.zip">
+ <zipfileset dir="${build.extensions}" prefix="jabref-extensions"/>
+ </zip>
+ </target>
+
<target name="clean" description="Clean project">
<delete dir="${build.dir}" />
</target>
<unjar src="${library.directory}/commons-logging.jar" dest="${build.tmp}" />-->
<unjar src="${library.directory}/antlr.jar" dest="${build.tmp}" />
<!-- <unjar src="${library.directory}/plastic-1.2.1.jar" dest="${build.classes}" />-->
- <unjar src="${library.directory}/looks-1.2.2.jar" dest="${build.tmp}" />
+ <unjar src="${library.directory}/looks-2.0.1.jar" dest="${build.tmp}" />
<unjar src="${library.directory}/forms-1.0.4.jar" dest="${build.tmp}" />
- <unjar src="${library.directory}/spin.jar" dest="${build.tmp}" />
+ <unjar src="${library.directory}/spin-1.4.jar" dest="${build.tmp}" />
<unjar src="${library.directory}/glazedlists-1.5.0_java14.jar" dest="${build.tmp}" />
-
+ <unjar src="${library.directory}/microba.jar" dest="${build.tmp}" />
<delete dir="${build.tmp}/META-INF"/>
+ <!-- rename the microba license file -->
+ <move file="${build.tmp}/license.txt" tofile="${build.tmp}/microba-license.txt"/>
</target>
<!--<pathelement location="${library.directory}/commons-httpclient-2.0.jar" />
<pathelement location="${library.directory}/commons-logging.jar" />-->
<pathelement location="${library.directory}/antlr.jar" />
- <pathelement location="${library.directory}/looks-1.2.2.jar" />
- <pathelement location="${library.directory}/looks-1.2.2.jar" />
- <pathelement location="${library.directory}/spin.jar" />
+ <pathelement location="${library.directory}/looks-2.0.1.jar" />
+ <pathelement location="${library.directory}/looks-2.0.1.jar" />
+ <pathelement location="${library.directory}/spin-1.4.jar" />
</classpath>
<!--<test name="tests.net.sf.jabref.export.layout.format.AuthorLastFirstAbbreviatorTester"/>-->
--- /dev/null
+EndNote.zip
+JavaApplicationStub
+OSXAdapter.class
+PrepRelease.java
+aelfred-1.2.jar
+antlr.jar
+ccl.jar
+forms-1.0.4.jar
+forms-1.0.5.jar
+glazedlists-1.0.0.jar
+glazedlists-1.5.0_java14.jar
+jalopy-1.0b10.jar
+jalopy-ant-0.6.1.jar
+jarbundler-1.4.jar
+javancss.jar
+jaxen-core-1.0-fcs.jar
+jaxp-1.2.jar
+jdom-1.0b8.jar
+junit.jar
+log4j-1.2.6.jar
+log4j-1.2.9.jar
+looks-1.2.2.jar
+looks-2.0.1.jar
+oro-2.0.6.jar
+plastic-1.2.1.jar
+pmd-2.0.jar
+sax-2.0.1.jar
+saxpath-1.0-fcs.jar
+spin-1.4.jar
+spin.jar
+syncLang.py
+vizant.jar
+langproper.jar
--- /dev/null
+<html>
+<head>
+ <title>JabRef-Extensions help</title>
+</head>
+
+<body>
+ <p>
+ JabRef can be extended in several ways.
+ To find out how to extend JabRef, please choose one of
+ <ul>
+ <li><a href="CustomExports.html">custom export layouts</a><br/>
+ </li>
+ <li><a href="CustomImports.html">custom importers</a><br/>
+ </li>
+ </ul>
+ </p>
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+1936;John Maynard Keynes;The General Theory of Employment, Interest and Money
+2003;Boldrin & Levine;Case Against Intellectual Monopoly
+2004;ROBERT HUNT AND JAMES BESSEN;The Software Patent Experiment
\ No newline at end of file
--- /dev/null
+import java.io.*;
+import java.util.*;
+import net.sf.jabref.*;
+import net.sf.jabref.imports.ImportFormat;
+import net.sf.jabref.imports.ImportFormatReader;
+
+public class SimpleCsvImporter extends ImportFormat {
+
+ public String getFormatName() {
+ return "Simple CSV Importer";
+ }
+
+ public boolean isRecognizedFormat(InputStream stream) throws IOException {
+ return true; // this is discouraged except for demonstration purposes
+ }
+
+ public List importEntries(InputStream stream) throws IOException {
+ ArrayList bibitems = new ArrayList();
+ BufferedReader in = new BufferedReader(ImportFormatReader.getReaderDefaultEncoding(stream));
+
+ String line = in.readLine();
+ while (line != null) {
+ if (!"".equals(line.trim())) {
+ String[] fields = line.split(";");
+ BibtexEntry be = new BibtexEntry(Util.createNeutralId());
+ be.setType(BibtexEntryType.getType("techreport"));
+ be.setField("year", fields[0]);
+ be.setField("author", fields[1]);
+ be.setField("title", fields[2]);
+ bibitems.add(be);
+ line = in.readLine();
+ }
+ }
+ return bibitems;
+ }
+}
--- /dev/null
+@echo off
+:: Simple Windows batch script to compile Java-classes that are part
+:: of the jabref-extensions.
+:: We don't use ant here, 'cause anyone just with a out-of-the-box
+:: Java-installation should be able to compile
+:: extension files.
+:: For UNIX there is a corresponding sh-script
+
+:: Make sure, jabref and java can be found
+if exist ..\lib\jabref.jar set JABREF_JAR=..\lib\jabref.jar
+if exist ..\lib\JabRef.jar set JABREF_JAR=..\lib\JabRef.jar
+if exist ..\lib\jabref-@version@.jar set JABREF_JAR=..\lib\jabref-@version@.jar
+if exist ..\lib\JabRef-@version@.jar set JABREF_JAR=..\lib\JabRef-@version@.jar
+if exist ..\jabref.jar set JABREF_JAR=..\jabref.jar
+if exist ..\JabRef.jar set JABREF_JAR=..\JabRef.jar
+if exist ..\jabref-@version@.jar set JABREF_JAR=..\jabref-@version@.jar
+if exist ..\JabRef-@version@.jar set JABREF_JAR=..\JabRef-@version@.jar
+if exist lib\jabref.jar set JABREF_JAR=lib\jabref.jar
+if exist lib\JabRef.jar set JABREF_JAR=lib\JabRef.jar
+if exist lib\jabref-@version@.jar set JABREF_JAR=lib\jabref-@version@.jar
+if exist lib\JabRef-@version@.jar set JABREF_JAR=lib\JabRef-@version@.jar
+if exist jabref.jar set JABREF_JAR=jabref.jar
+if exist JabRef.jar set JABREF_JAR=JabRef.jar
+if exist jabref-@version@.jar set JABREF_JAR=jabref-@version@.jar
+if exist JabRef-@version@.jar set JABREF_JAR=JabRef-@version@.jar
+if exist %JABREF_HOME%\jabref.jar set JABREF_JAR=%JABREF_HOME%\jabref.jar
+if exist %JABREF_HOME%\JabRef.jar set JABREF_JAR=%JABREF_HOME%\JabRef.jar
+if exist %JABREF_HOME%\jabref-@version@.jar set JABREF_JAR=%JABREF_HOME%\jabref-@version@.jar
+if exist %JABREF_HOME%\JabRef-@version@.jar set JABREF_JAR=%JABREF_HOME%\jabref-@version@.jar
+
+if NOT exist "%JABREF_JAR%"=="" goto nojabref
+
+if "%JAVA_HOME%"=="" goto nojava
+
+:: Compile Java-extensions
+%JAVA_HOME%\bin\javac -classpath %JABREF_JAR% net\sf\jabref\imports\*.java
+%JAVA_HOME%\bin\javac -classpath %JABREF_JAR% *.java
+%JAVA_HOME%\bin\javac -classpath %JABREF_JAR% net\sf\jabref\export\layout\format\*.java
+goto done
+
+:nojava
+echo Please set the environment variable JAVA_HOME to the base path of your Java-installation (e.g. set JAVA_HOME=C:\j2sdk1.4.2_07).
+goto done
+
+:nojabref
+echo Please set the environment variable JABREF_JAR to the path where your jabref.jar resides (e.g. set JABREF_HOME=C:\Programme\JabRef-2.0.1).
+goto done
+
+:done
+
--- /dev/null
+
+# Simple shell script to compile Java-classes that are part
+# of the jabref-extensions.
+# We don't use ant here, 'cause anyone just with a out-of-the-box
+# Java-installation should be able to compile
+# extension files.
+# For Windows there is a corresponding batch-script
+
+echo todo
\ No newline at end of file
--- /dev/null
+<html>
+<head>
+ <title>JabRef-Extensions for JabRef @version@ help</title>
+</head>
+
+<body>
+ <h1>Extending JabRef's export and import capabilities</h1>
+
+ <h2>Custom exports</h2>
+
+ <p>JabRef's export and import capabilities can be extended quite
+ easily. Please unzip the JabRef-extensions file, preferably to the
+ same folder where you installed JabRef (where the <code>jabref.jar</code> file can be found).
+ </p>
+
+ <p>To create your own export format, you can define <i>custom layouts</i>,
+ simple templates where at certain places the contents of a JabRef database are written
+ into. For an example see the files in the <a href="layout">layout directory</a>.
+ For more details about creating your own export format, please read
+ <a href="API/CustomExports.html"><code>API/CustomExports.html</code></a>.</p>
+
+ <p>The extensions contain also a few simple examples on how to create new <i>field formatters</i> -
+ small commands that determine how database entries are written to your
+ custom layout, please check <a href="net/sf/jabref/export/layout/format"><code>net/sf/export/layout/format</code></a>.
+ </p>
+
+ <h2>Custom imports</h2>
+
+ <p>You can also quite easily create an importer that allows you
+ to read references from sources important to you. This requires only
+ modest programming skills. Please check the
+ <a href="SimpleCsvImporter.java">example</a>, compile it
+ using the <code>compileAll.bat</code> script, register it
+ as a custom importer with your JabRef-installation and
+ import the <a href="SimpleCsvImporter.csv">SimpleCsvImporter.csv</a>
+ file to see how it is done. More details can be found
+ in <a href="API/CustomImports.html"><code>API/CustomImports.html</code></a>.</p>
+
+ <p>All importers that are part of the standard JabRef-distribution are also
+ included in this extensions-package under <a href="net/sf/jabref/imports"><code>net/sf/jabref/imports</code></a>.
+ In addition to serving as further examples, you can also fix them and register them as custom importers
+ if you encounter any problems.
+ </p>
+
+ <h2>API documentation</h2>
+
+ <p>The API-documentation for extensions that require some programming
+ is available under <a href="API/index.html"><code>API/index.html</code></a>.
+ </p>
+
+</body>
+</html>
\ No newline at end of file
Frédéric Darboux<BR>
Fabrice Dessaint<BR>
Nathan Dunn<BR>
-Brian van Essen<br>
+Brian Van Essen<br>
Alexis Gallagher<BR>
Sascha Hunold<BR>
Bernd Kalbfuss<BR>
<P>
JabRef also uses the threading library Spin 1.3.1, which is distributed under the terms of
the Lesser GNU Public License.
+
+<P>
+Some GUI components from the Microba library are used, it is licensed under a BSD style license.
+See <code>http://sourceforge.net/projects/microba/</code> for more informations.
<P>
This product includes software developed by the Apache Software
Foundation (http://www.apache.org/). The libraries Commons Logging and
-<HTML>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head></head>
-<BODY text="#275856">
+<body style="color: rgb(39, 88, 86);">
<basefont size="4" color="#2F4958" face="arial">
-<H1>About <em>bibtex</em></H1>
+<h1>About <em>bibtex</em></h1>
+
+
+
+
JabRef helps you work with your <em>bibtex</em> databases, but
there are still rules to keep in mind when editing your entries, to
ensure that your database is treated properly by the <em>bibtex</em>
program.
-<H2><em>Bibtex</em> fields</H2>
+<h2><em>Bibtex</em> fields</h2>
+
+
+
+
There is a lot of different fields in <em>bibtex</em>, and some
additional fields that you can set in JabRef.
-<P>
+<p>
Generally, you can use LaTeX commands inside of fields containing
text. <em>Bibtex</em> will automatically format your reference lists,
and those fields that are included in the lists will be
certain characters remain capitalized, enclose them in braces, like in
the word {B}elgium.
-<P>
+</p>
+
+
+
+<p>
Notes about some of the field types:
+</p>
+
+
+
<ul>
-<li><em>Author:</em> This field should contain the complete author
+
+
+
+<li><strong style="font-style: italic;">Bibtexkey</strong> A unique string used to refer to the entry in
+LaTeX documents. Note that when referencing an entry from LaTeX, the
+key must match case-sensitively with the reference string.<br>
+ <br>
+</li>
+
+ <li><strong>address<br>
+ </strong>Usually the address of the <tt>publisher</tt> or other type
+of institution.
+For major publishing houses,
+van Leunen recommends omitting the information entirely.
+For small publishers, on the other hand, you can help the
+reader by giving the complete address.
+ <p>
+ </p>
+ </li>
+ <li><strong>annote<br>
+ </strong>An annotation.
+It is not used by the standard bibliography styles,
+but may be used by others that produce an annotated bibliography.
+ <p>
+ </p>
+ </li>
+ <li><strong>author<br>
+ </strong>This field should contain the complete author
list for your entry. The names are separated by the word <em>and</em>,
even if there are more than two authors. Each name can be written
in two equivalent forms:<br>
+
Donald E. Knuth <em>or</em> Knuth, Donald E.<br>
+
Eddie van Halen <em>or</em> van Halen, Eddie<br>
+
The second form should be used for authors with more than two names,
-to differentiate between middle names and last names.
+to differentiate between middle names and last names.<br>
+ <br>
+ <span style="font-weight: bold;"></span></li>
+ <li><span style="font-weight: bold;"></span><strong>booktitle<br>
+ </strong>Title of a book, part of which is being cited.
+See the LaTeX book for how to type titles.
+For book entries, use the <tt>title</tt> field instead.
+ <p>
+ </p>
+ </li>
+ <li><strong>chapter<br>
+ </strong>A chapter (or section or whatever) number.
+ <p>
+ </p>
+ </li>
+ <li><strong>crossref<br>
+ </strong>The database key of the entry being cross referenced.
+ <p>
+ </p>
+ </li>
+ <li><strong>edition<br>
+ </strong>The edition of a book--for example, ``Second''.
+This should be an ordinal, and
+should have the first letter capitalized, as shown here;
+the standard styles convert to lower case when necessary.
+ <p>
+ </p>
+ </li>
+ <li><strong>editor<br>
+ </strong>This field is analogue to the <em>author</em> field.
+If there is also an <tt>author</tt> field, then
+the <tt>editor</tt> field gives the editor of the book or collection
+in which the reference appears.
+ <p>
+ </p>
+ </li>
+ <li><strong>howpublished<br>
+ </strong>How something strange has been published.
+The first word should be capitalized.
+ <p>
+ </p>
+ </li>
+ <li><strong>institution<br>
+ </strong>The sponsoring institution of a technical report.
+ <p>
+ </p>
+ </li>
+ <li><strong>journal<br>
+ </strong>A journal name.
+Abbreviations are provided for many journals; see the <i>Local Guide</i>.
+ <p>
+ </p>
+ </li>
+ <li><strong>key<br>
+ </strong>Used for alphabetizing, cross referencing, and creating a label when
+the ``author'' information is missing.
+This field should not be confused with the key that appears in the
+ <code>\cite</code> command and at the beginning of the database entry.
+ <p>
+ </p>
+ </li>
+ <li><strong>month<br>
+ </strong>The month in which the work was
+published or, for an unpublished work, in which it was written.
+You should use the standard three-letter abbreviation,
+as described in Appendix B.1.3 of the LaTeX book.
+ <p>
+ </p>
+ </li>
+ <li><strong>note<br>
+ </strong>Any additional information that can help the reader.
+The first word should be capitalized.
+ <p>
+ </p>
+ </li>
+ <li><strong>number</strong><br>
+The number of a journal, magazine, technical report,
+or of a work in a series.
+An issue of a journal or magazine is usually
+identified by its volume and number;
+the organization that issues a
+technical report usually gives it a number;
+and sometimes books are given numbers in a named series.
+ <p>
+ </p>
+ </li>
+ <li><strong>organization<br>
+ </strong>The organization that sponsors a conference or that publishes a manual.
+ <p>
+ </p>
+ </li>
+ <li><strong>pages<br>
+ </strong>One or more page numbers or range of numbers,
+such as <tt>42-111</tt> or <tt>7,41,73-97</tt> or <tt>43+</tt>
+(the `<tt>+</tt>' in this last example indicates pages following
+that don't form a simple range).
+To make it easier to maintain <em>Scribe</em>-compatible databases,
+the standard styles convert a single dash (as in <tt>7-33</tt>)
+to the double dash used in TeX to denote number ranges
+(as in <tt>7-33</tt>).
+ <p>
+ </p>
+ </li>
+ <li><strong>publisher<br>
+ </strong>The publisher's name.
+ <p>
+ </p>
+ </li>
+ <li><strong>school<br>
+ </strong>The name of the school where a thesis was written.
+ <p>
+ </p>
+ </li>
+ <li><strong>series<br>
+ </strong>The name of a series or set of books.
+When citing an entire book, the the <tt>title</tt> field
+gives its title and an optional <tt>series</tt> field gives the
+name of a series or multi-volume set
+in which the book is published.
+ <p>
+ </p>
+ </li>
+ <li><strong>title<br>
+ </strong>The work's title, typed as explained in the LaTeX book.
+ <p>
+ </p>
+ </li>
+ <li><strong>type<br>
+ </strong>The type of a technical report--for example,
+``Research Note''.
+ <p>
+ </p>
+ </li>
+ <li><strong>volume<br>
+ </strong>The volume of a journal or multivolume book.
+ <p>
+ </p>
+ </li>
+ <li><strong>year<br>
+ </strong>The year of publication or, for
+an unpublished work, the year it was written.
+Generally it should consist of four numerals, such as <tt>1984</tt>,
+although the standard styles can handle any <tt>year</tt> whose
+last four nonpunctuation characters are numerals,
+such as `(about 1984)'. This field is required
+for most entry types.</li>
+</ul>
-<li><em>Editor:</em> This field is analogue to the <em>author</em> field.
-<li><em>Year:</em> The year of the publication. This field is required
-for most entry types.
-<li><em>Bibtexkey:</em> A unique string used to refer to the entry in
-LaTeX documents. Note that when referencing an entry from LaTeX, the
-key must match case-sensitively with the reference string.
+
+
+
+<br>
+
+
+<h2>Other fields</h2>
+
+
+
+BibTeX is extremely popular, and many people have used it to store
+information. Here is a list of some of the more common fields:
+
+<dl>
+
+
+</dl>
+
+<ul>
+
+ <li><strong><span style="font-weight: normal; font-style: italic;">affiliation*</span><br>
+ </strong>The authors affiliation.<br>
+ <br>
+
+ </li>
+ <li><strong>abstract<br>
+ </strong>An abstract of the work.<br>
+ <br>
+
+ </li>
+ <li><strong><span style="font-weight: normal; font-style: italic;">contents*</span><br>
+ </strong>A Table of Contents<br>
+ <br>
+
+ </li>
+ <li><strong><span style="font-weight: normal; font-style: italic;">copyright*</span><br>
+ </strong>Copyright information.<br>
+ <br>
+ </li>
+ <li><strong><span style="font-weight: normal; font-style: italic;">ISBN*</span><br>
+ </strong>The International Standard Book Number.<br>
+ <br>
+
+ </li>
+ <li><strong><span style="font-weight: normal; font-style: italic;">ISSN*</span><br>
+ </strong>The International Standard Serial Number. Used to identify a journal.<br>
+ <br>
+
+ </li>
+ <li><strong>keywords<br>
+ </strong>Key words used for searching or possibly for annotation.<br>
+ <br>
+
+ </li>
+ <li><strong><span style="font-weight: normal; font-style: italic;">language*</span><br>
+ </strong>The language the document is in.<br>
+ <br>
+
+ </li>
+ <li><strong><span style="font-weight: normal; font-style: italic;">location*</span><br>
+ </strong>A location associated with the entry, such as the city in which a conference took place.<br>
+ <br>
+
+ </li>
+ <li><strong><span style="font-weight: normal; font-style: italic;">LCCN*</span><br>
+ </strong>The Library of Congress Call Number. I've also seen this as <tt>lib-congress</tt>.<br>
+ <br>
+
+ </li>
+ <li><strong><span style="font-weight: normal; font-style: italic;">mrnumber*</span><br>
+ </strong>The <i>Mathematical Reviews</i> number.<br>
+ <br>
+
+ </li>
+ <li><strong><span style="font-weight: normal; font-style: italic;">price*</span><br>
+ </strong>The price of the document.<br>
+ <br>
+
+ </li>
+ <li><strong><span style="font-weight: normal; font-style: italic;">size*</span><br>
+ </strong>The physical dimensions of a work.<br>
+ <br>
+
+ </li>
+ <li><strong>URL<br>
+ </strong>The WWW Universal Resource Locator that points to the item being
+ referenced. This often is used for technical reports to point to
+ the ftp site where the postscript source of the report is located.
+
+ </li>
+</ul>
+
+<dl>
+
+
+</dl>
+
+
+
+
+
+
+<h3><br>
+</h3>
+
+
+
+<h3>JuraBib</h3>
+
+
+
+
+<ul>
+
+ <li><strong>urldate<br>
+ </strong>The date of the last page visit.</li>
</ul>
-</HTML>
+<br>
+
+*) not direct supported by JabRef<br>
+
+
+
+
+
+
+
+<br>
+
+
+
+</body></html>
\ No newline at end of file
Navigate to <code>/mypath</code> and click the <b>Select ...</b> button. Select the
<code>SimpleCsvImporter.class</code> and click the <b>Select ...</b> button.
Your importer should now appear in the list of custom importers under the name
-"Simple CSV Importer" and, after you click <b>Close</bd> also in the <b>File -> Import ->
+"Simple CSV Importer" and, after you click <b>Close</b> also in the <b>File -> Import ->
Custom Importers</b> and <b>File -> Import and Append -> Custom Importers</b> submenus
of the JabRef window.</p>
<H2>Sharing your work</H2>
-With custom importer files, it's fairly simple to share custom import formats between users.
+<p>With custom importer files, it's fairly simple to share custom import formats between users.
If you write an import filter for a format not supported by JabRef, or an improvement over an
existing one, we encourage you to post your work on our SourceForge.net page. We'd be happy to
distribute a collection of submitted import files, or to add to the selection of standard
-importers.
+importers.</p>
+</BODY>
</HTML>
--- /dev/null
+<HTML>
+
+<BODY text="#275856">
+<basefont size="4" color="#2F4958" face="arial">
+
+<H1>Search IEEEXplore</H1>
+
+JabRef can download citations from the IEEEXplore database.
+To use this feature, choose <b>Tools -> Search IEEEXplore</b>,
+and the search interface will appear in the side pane.
+<P>
+To start a search, enter the words of your query, and press
+<b>Enter</b> or the <b>Fetch</b> button.
+
+<p>
+The search is done in guest mode, which means that a maximum of 100 results
+will be returned.
+
+<p>
+You may opt to download the abstracts along with the cite information for each
+entry, by checking the <b>Include abstracts</b> checkbox. This causes a
+significantly larger amount of network queries, so to avoid excessive pressure
+on the IEEEXplore web site, JabRef will refuse to download abstracts
+for searches returning more than a given number of hits.
+
+</HTML>
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head></head>
+
+<body>
+<basefont size="-1" color="#2F4958" face="arial">
+This feature generates a new database, which contains only the used references of an existing TeX project.
+</body></html>
\ No newline at end of file
Frédéric Darboux
Fabrice Dessaint
Nathan Dunn
+Brian Van Essen
Alexis Gallagher
Sascha Hunold
Bernd Kalbfuss
-<HTML>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head></head>
-<BODY text="#275856">
+<body text="#275856">
<basefont size="4" color="#2F4958" face="arial">
-<CENTER>
-<H1>JabRef Version @version@</H1>
+<center>
+<h1>JabRef Version @version@</h1>
(c) 2006
-<P>
+<p>
JabRef ist frei verfügbar unter den Bedingungen der
<a href="License.html">Gnu Public License</a>.
-<H2>Entwickler:</H2>
-Morten O. Alver<BR>
-Nizar N. Batada<BR>
-Michel Baylac<BR>
-Guillaume Gardey<BR>
-Cyrille d'Haese<BR>
-Raik Nagel<BR>
-Ellen Reitmayr<BR>
-Andreas Rudert<BR>
-Michael Spiegel<BR>
-Ulrik Stervbo<BR>
-Dominik Waßenhoven<BR>
-Joerg K. Wegner<BR>
-Michael Wrighton<BR>
-Egon Willighagen <BR>
-Jörg Zieren<BR>
+</p><h2>Entwickler:</h2>
+Morten O. Alver<br>
+Nizar N. Batada<br>
+Michel Baylac<br>
+Guillaume Gardey<br>
+Cyrille d'Haese<br>
+Raik Nagel<br>
+Ellen Reitmayr<br>
+Andreas Rudert<br>
+Michael Spiegel<br>
+Ulrik Stervbo<br>
+Dominik Waßenhoven<br>
+Joerg K. Wegner<br>
+Michael Wrighton<br>
+Egon Willighagen <br>
+Jörg Zieren<br>
-<H2>Beiträge von:</H2>
-Kolja Brix<BR>
-Frédéric Darboux<BR>
-Fabrice Dessaint<BR>
-Nathan Dunn<BR>
+<h2>Beiträge von:</h2>
+Kolja Brix<br>
+Frédéric Darboux<br>
+Fabrice Dessaint<br>
+Nathan Dunn<br>
Brian van Essen<br>
-Alexis Gallagher<BR>
-Sascha Hunold<BR>
-Bernd Kalbfuss<BR>
-Martin Kähmer<BR>
-Jeffrey Kuhn<BR>
-Alex Montgomery<BR>
-John Relph<BR>
-Moritz Ringler<BR>
-Rudolf Seemann<BR>
+Alexis Gallagher<br>
+Sascha Hunold<br>
+Bernd Kalbfuss<br>
+Martin Kähmer<br>
+Jeffrey Kuhn<br>
+Alex Montgomery<br>
+John Relph<br>
+Moritz Ringler<br>
+Rudolf Seemann<br>
Toralf Senger<br>
-Mike Smoot<BR>
-Martin Stolle<BR>
-David Weitzman<BR>
-Seb Wills<BR>
+Mike Smoot<br>
+Martin Stolle<br>
+David Weitzman<br>
+Seb Wills<br>
-<H2>Dank an:</H2>
-Samin Muhammad Ridwanul Karim<BR>
-Stefan Robert<BR>
+<h2>Dank an:</h2>
+Samin Muhammad Ridwanul Karim<br>
+Stefan Robert<br>
-<H2>Benutzte Fremdsoftware:</H2>
+<h2>Benutzte Fremdsoftware:</h2>
JabRef benutzt JGoodies Looks 1.2.2 und JGoodiesForms 1.0.4, das von JGoodies (<code>http://www.jgoodies.com</code>) unter den Bedingungen der BSD License vertrieben wird (siehe <code>http://www.opensource.org/licenses/bsd-license.html</code> für nähere Einzelheiten dieser Lizenz).
-<P>
-Außerdem werden zwei zustätzliche Klassen (SimpleInternalFrame and UIFSplitPane) von Karsten Lentzsch benutzt, die unter <A HREF="jgoodies.html">diesen Bedingungen</A> vertrieben werden.
-<P>
+<p>
+Außerdem werden zwei zustätzliche Klassen
+(SimpleInternalFrame and UIFSplitPane) von Karsten Lentzsch benutzt,
+die unter <a href="jgoodies.html">diesen Bedingungen</a> vertrieben werden.
+</p><p>
Kommandozeilenbefehle werden geparst mit RitOpt (<code>http://ritopt.sourceforge.net</code>), das unter den Bedingungen der <a href="License.html">GNU Public License</a> (Version 2) verfügbar ist.
-<P>
+</p><p>
JabRef verwendet für die Suche den ANTLR Parser Generator. ANTLR ist public domain software - siehe <code>http://www.antlr.org/license.html</code> für die Lizenzbedingungen.
-<p>
+</p><p>
Für die Darstellung und Filterung der Tabelle benutzt JabRef die Glazed Lists library
(<code>http://publicobject.com/glazedlists</code>), die unter den Bedingungen der Lesser GNU Public License vertrieben wird.
-<P>
-JabRef benutzt darüber hinaus die "threading library" Spin 1.3.1, die unter den Bedingungen der LGPL (Lesser GNU Public License) vertrieben wird.
-<P>
+</p><p>
+JabRef benutzt darüber hinaus die "threading library" Spin 1.3.1,
+die unter den Bedingungen der LGPL (Lesser GNU Public License)
+vertrieben wird.<br>
+</p>
+<p>Für die einfache Auswahl und den Umgang mit Datumsangaben
+werden Komponenten der Microba Bibliothek verwenden. Diese wird unter
+einer BSD Lizenz vertrieben, siehe auch <code>http://sourceforge.net/projects/microba/</code>
+für eine genauere Beschreibung.
+
+</p><p>
Dieses Produkt beinhaltet Software, die von der Apache Software Foundation (<code>http://www.apache.org</code>) entwickelt wurde. Die Bibliotheken "Commons Logging" und "Commons HTTP Client" werden von The Jakarta Project (<code>http://jakarta.apache.org</code>) unter der Apache Software Lizenz (Version 1.1) vertrieben (siehe die beigelegte Datei <code>apache-license.txt</code> oder <code>http://opensource.org/licenses/apachepl.php</code> für nähere Einzelheiten dieser Lizenz).
-<P>
+</p><p>
Einige Icons sind von uns, aber die meisten stammen vom Eclipse Projekt (<code>http://www.eclipse.org</code>), das unter den Bedingungen der <a href="cpl-v10.html">Common Public License</a> vertrieben wird, sowie vom QIcons Paket (<code>http://qt.osdn.org.ua</code>), das unter den Bedingungen der <a href="License.html">GNU Public License</a> vertrieben wird.
-</CENTER>
-</BODY>
-</HTML>
\ No newline at end of file
+</p></center>
+</body></html>
\ No newline at end of file
-%%%%% To do: %%%%%
-% OpenOffice-Export aktualisieren (an aktuelle HTML-Doku anpassen)
-%
% unter >>Erscheinungsbild<< noch die Punkte Tabellendarstellung,
% Toolbar, Panels und Schriften erstellen (DW)
%
\documentclass[10pt,normalheadings]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
-\setcounter{secnumdepth}{4}
-\setcounter{tocdepth}{2}
+\setcounter{secnumdepth}{1}
+\setcounter{tocdepth}{4}
%%%%% Page Dimensions %%%%%
\usepackage{geometry}
}%
}
%%% version number
-\newcommand{\versionnr}{2.0 beta} %
+\newcommand{\versionnr}{2.0} %
%%% JabRef logo with version nr
\newcommand{\jabrefversion}{\jabref{}~\versionnr}
%%% for Menu references
%%%%% Other stuff %%%%%
\deffootnote{1.5em}{1em}{\makebox[1.5em][l]{\thefootnotemark}}
-\usepackage{microtype} % micro typography
+%\usepackage{microtype} % micro typography
+
+%%%%% Mini TOCs %%%%%
+\usepackage[ngerman]{minitoc}
+\mtcsetrules{secttoc}{off}
+%\mtcsetdepth{secttoc}{3}
+\mtcsetfont{secttoc}{subsection}{}
+%\mtcsettitle{secttoc}{In diesem Abschnitt}
+%\mtcsettitlefont{secttoc}{\itshape}
%%%%% Language %%%%%
\usepackage[ngerman]{babel}
%%%%% Bibliography %%%%%
\usepackage{jurabib}
\jurabibsetup{annote=true}
-\renewcommand{\bib@heading}{\section*{Kommentiertes Literaturverzeichnis}}
+\renewcommand{\bib@heading}{\addsec{Kommentiertes Literaturverzeichnis}}
%%%%% Hyperref %%%%%
\usepackage{hyperref}
\end{abstract}
\begin{quote}
\begin{spacing}{0.7}
-\begin{center}{\scriptsize Copyright \textcopyright{} 2005, Dominik
+\begin{center}{\scriptsize Copyright \textcopyright{} 2005--2006, Dominik
Waßenhoven}
\end{center}
{\scriptsize Dieser Inhalt ist unter einem Creative Commons Attribution-NonCommercial-ShareAlike 2.0 Germany Lizenzvertrag lizenziert. Um die Lizenz anzusehen, gehen Sie bitte zu \href{http://creativecommons.org/licenses/by-nc-sa/2.0/de/}{http://creativecommons.org\slash{}licenses\slash{}by-nc-sa\slash{}2.0\slash{}de\slash{}} oder schicken Sie einen Brief an Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. \par}\end{spacing}
\thispagestyle{empty}
\newpage
-\tableofcontents{}
+\dosecttoc[e]
+\faketableofcontents{}
\newpage
\section{Einleitung}
-
+\secttoc
\subsection{Über dieses Handbuch}
dass Bib\TeX{} Ihre Datei richtig verarbeiten kann.}
-\subsubsection*{Bib\TeX{} Felder}
+\subsubsection{Bib\TeX{} Felder}
Es gibt viele unterschiedliche Felder in Bib\TeX{} und einige zusätzliche
Felder, die Sie in \jabref{} einsetzen können. Grundsätzlich können
Für weitere Erläuterungen zu Bib\TeX{} wird verwiesen auf \cite{Markey2005,btxdoc,btxhak,Raichle2002}.
+\clearpage
\section{Installation}
-
+\secttoc
\subsection{System-Voraussetzungen}
\subsection{Windows}
-\subsubsection*{Installer (msi)}
+\subsubsection{Installer (msi)}
\jabref{} gibt es im Windows Installer-Format (\texttt{.msi}). Ein
Doppelklick auf die MSI-Datei installiert \jabref{} und fügt dem
}
-\subsubsection*{Batch-Datei (jar)}
+\subsubsection{Batch-Datei (jar)}
Wenn Sie die ausführbare jar-Datei (\texttt{.jar}) heruntergeladen
haben, probieren Sie zunächst, ob ein Doppelklick darauf das Programm
(zum Kompilieren aus den \emph{sourcen}).
+\clearpage
\section{Funktionen}
+\secttoc
+\bigskip
-\label{JabRefHelp}\jabref{} ist ein Programm zur Verwaltung von
+\noindent \label{JabRefHelp}\jabref{} ist ein Programm zur Verwaltung von
Bib\TeX{}-Dateien. Es benutzt kein eigenes Dateiformat, d.\,h. dass
Sie Ihre Dateien direkt im Bib\TeX{}-Format (Dateiendung \texttt{.bib})
laden und speichern. Sie können aber auch bibliographische Datenbanken
die andere Bibliographie-Systeme benutzen oder schlicht und einfach
ihre Literaturquellen organisieren wollen.
-
\subsection{Das Hauptfenster}
\begin{quote}
in \jabref{} bearbeitet werden.
\end{itemize}
-\subsubsection*{Einen neuen Eintrag hinzufügen}
+\subsubsection{Einen neuen Eintrag hinzufügen}
Es gibt verschiedene Möglichkeiten, einen neuen Eintrag hinzuzufügen.
Im Menü \menu{BibTeX} führt ein Klick auf \menu{Neuer Eintrag} zu
für einen Zeitschriftenaufsatz \emph{(article)}.}
-\subsubsection*{Einen Eintrag bearbeiten}
+\subsubsection{Einen Eintrag bearbeiten}
Um den Eintrags-Editor (siehe \ref{EntryEditorHelp}) zur Bearbeitung
eines existierenden Eintrags zu öffnen, klicken Sie einfach doppelt
zugehörigen Zeile den Eintrags-Editor.
-\subsubsection*{Einen Bib\TeX{}-String in einem Feld verwenden}
+\subsubsection{Einen Bib\TeX{}-String in einem Feld verwenden}
In \jabref{} schreiben Sie den Inhalt aller Felder so, wie Sie es
in einem Texteditor machen würden, mit einer Ausnahme: um einen String
Sie mehr Informationen darüber erhalten möchten.
-\subsubsection*{Die Panels des Eintrags-Editors}
+\subsubsection{Die Panels des Eintrags-Editors}
Der Eintrags-Editor besteht in der Standardeinstellung aus fünf Panels:
\emph{Benötigte Felder}, \emph{Optionale Felder}, \emph{General},
Drag \& Drop. Sie können z.\,B. ein URL aus Ihrem Browser dort einfügen.}
-\subsubsection*{Überprüfung der Feldkonsistenz}
+\subsubsection{Überprüfung der Feldkonsistenz}
Wenn der Inhalt eines Feldes geändert wird, überprüft \jabref{},
ob der neue Inhalt akzeptiert werden kann. Bei Feldern, die von Bib\TeX{}
Suche, die Markier-Suche und die Sortier-Suche.
-\subsubsection*{Direkte Suche}
+\subsubsection{Direkte Suche}
Bei der direkten Suche sucht \jabref{} unmittelbar, wenn Sie einen
Buchstaben eingeben. Die Statuszeile informiert Sie über den Sucherfolg.
Sie ESC oder klicken Sie auf \menu{Zurücksetzen}.
-\subsubsection*{Markier-Suche}
+\subsubsection{Markier-Suche}
Wenn Sie die Suchmethode \emph{Markieren} wählen, sucht das Programm
in Ihrer Datei nach allen Vorkommen ihres Suchbegriffs, sobald Sie
des Suchdialogs), dann werden die Treffer ausgewählt.
-\subsubsection*{Sortier-Suche}
+\subsubsection{Sortier-Suche}
Die Suche mit der Methode \emph{Oben einsortieren} ist ähnlich wie
die Suche mit Markierung, nur dass die Treffer automatisch an den
ohne die bisherigen Ergebnisse zu >>verlieren<<.}
-\subsubsection*{Feldbezeichner und logische Operatoren}
+\subsubsection{Feldbezeichner und logische Operatoren}
\label{SearchHelp_advanced}Um nur einige bestimmte Felder zu durchsuchen
und\slash{}oder logische Operatoren im Suchbegriff zu benutzen, wird
bibtexkey~=~miller2005
\end{lyxcode}
-\subsubsection*{Suchoptionen}
+\subsubsection{Suchoptionen}
Der \menu{Einstellungen}-Button im Suchdialog öffnet ein Menü, in
dem man mehrere Optionen (de)aktivieren kann: das Beachten von Groß-
benutzerabhängige Gruppen unterstützen.)
-\subsubsection*{Die Gruppenansicht}
+\subsubsection{Die Gruppenansicht}
Die Gruppenansicht wird im linken Bereich des Bildschirms angezeigt.
Sie kann mit der Tastenkombination STRG-SHIFT-G oder dem Gruppen-Button
wird ebenfalls unterstützt.
-\subsection*{Einige kurze Beispiele}
+\subsection{Einige kurze Beispiele}
Sie möchten vielleicht~\ldots{}
\end{itemize}
-\subsubsection*{Arten von Gruppen}
+\subsubsection{Arten von Gruppen}
In \jabref{}~1.8 gibt es vier verschiedene Arten von Gruppen:
ausgewählten Gruppe.
-\subsubsection*{Gruppenstrukturen, Erstellen und Löschen von Gruppen}
+\subsubsection{Gruppenstrukturen, Erstellen und Löschen von Gruppen}
Die Gruppen sind~-- vergleichbar mit Datei-Ordnern~-- in einer Baumansicht
strukturiert, in der die Gruppe \emph{Alle Einträge} das Stammelement
alle Bearbeitungsschritte unterstützt.
-\paragraph*{Statische Gruppen}
+\paragraph{Statische Gruppen}
Statische Gruppen werden nur durch manuelles Zuweisen von Einträgen
>>gefüttert<<. Nachdem Sie eine statische Gruppe erstellt haben,
Sitzungen nicht korrekt wiederhergestellt werden.
-\paragraph*{Dynamische Gruppen}
+\paragraph{Dynamische Gruppen}
Der Inhalt einer dynamischen Gruppe wird von einer logischen Bedingung
bestimmt. Nur Einträge, die dieser Bedingung entsprechen, gehören
\msep{} \menu{Gruppen} abgestellt werden.
-\paragraph*{Hierarchischer Kontext}
+\paragraph{Hierarchischer Kontext}
Standardmäßig ist eine Gruppe \emph{unabhängig} von ihrer Position
im Gruppenbaum. Ist eine Gruppe ausgewählt, wird nur der Inhalt dieser
kann in den Einstellungen abgestellt werden.)
-\subsubsection*{Einträge einer Gruppe anzeigen, mehrere Gruppen kombinieren}
+\subsubsection{Einträge einer Gruppe anzeigen, mehrere Gruppen kombinieren}
Wenn Sie eine Gruppe auswählen, werden die Einträge, die dieser Gruppe
zugeordnet sind, hervorgehoben und~-- je nach Einstellung (die mit
Einstellungen aktiviert sein).
-\subsubsection*{Gruppen und Suche}
+\subsubsection{Gruppen und Suche}
Wenn der Inhalt einer oder mehrerer Gruppen angezeigt wird, können
Sie eine Suche innerhalb dieser Einträge durchführen. Benutzen Sie
dazu die normalen Suchfunktionen (siehe Abschnitt~\ref{SearchHelp}).
-\subsubsection*{Sich überschneidende Gruppen markieren}
+\subsubsection{Sich überschneidende Gruppen markieren}
Der \menu{Einstellungen}-Button bietet eine Option zum Markieren
von sich überschneidenden Gruppen. Wenn diese Option aktiviert ist
Einträge enthält, die Sie noch lesen wollten.
-\subsubsection*{Erweiterte Funktionen}
+\subsubsection{Erweiterte Funktionen}
Wenn Sie sich mit dem oben beschriebenen Gruppenkonzept vertraut gemacht
haben, könnten die folgenden erweiterten Funktionen nützlich sein.
-\paragraph*{Dynamische Gruppen automatisch erstellen}
+\paragraph{Dynamische Gruppen automatisch erstellen}
Mit einem Klick auf den Button \menu{Automatisch Gruppen für die Datei anlegen}
können Sie ganz schnell passende Gruppen für Ihre Datei erzeugen.
nach dem automatischen Erstellen von Hand löschen.)
-\paragraph*{Ansicht aktualisieren}
+\paragraph{Ansicht aktualisieren}
Der \menu{Aktualisieren}-Button in der Gruppenansicht aktualisiert
die Tabelle in Bezug auf die aktuell ausgewählten Gruppen. Normalerweise
ist ein händisches Aktualisieren nötig.
-\paragraph*{Verfeinernde Untergruppen und einbeziehende Obergruppen mischen\protect%
-\footnote{In \jabref{}~1.8.1 sind die entsprechenden Optionen noch nicht ins
-Deutsche übersetzt. Gemeint sind hier \emph{refining (sub-)groups}
-und \emph{including (super-)groups}.%
-}}
+\paragraph{Verfeinernde Untergruppen und einbeziehende Obergruppen mischen%\protect%
+%\footnote{In \jabref{}~1.8.1 sind die entsprechenden Optionen noch nicht ins
+%Deutsche übersetzt. Gemeint sind hier \emph{refining (sub-)groups}
+%und \emph{including (super-)groups}.%
+%}
+}
Wenn eine verfeinernde Gruppe die Untergruppe von einer Gruppe ist,
die ihre Untergruppen berücksichtigt~-- also sozusagen die Geschwister
\subsection{Import und Export}
-\subsubsection*{Import-Kontrollfenster}
+\subsubsection{Import-Kontrollfenster}
\label{ImportInspectionDialog}Beim Importieren neuer Einträge aus
einem unterstützten Format oder beim Herunterladen von Einträgen aus
Einträge zwischen die bereits bestehenden sortiert wurden.
-\subsubsection*{\jabref{} $\to$~EndNote}
+\subsubsection[JabRef -> EndNote]{\jabref{} $\to$~EndNote}
\begin{quote}
\label{EndnoteFilters}\emph{\jabref{} kann Dateien so exportieren,
und demzufolge unpassend formatiert.
-\subsubsection*{Erweiterte Benutzung: EndNote Extras}
+\subsubsection{Erweiterte Benutzung: EndNote Extras}
\label{EndNote_erweitert}Einige Felder, die von Bib\TeX{} genutzt
werden, gehören nicht zu EndNotes vorgegebenen Referenztypen. Während
Sie den Angaben in der Datei \texttt{readme.txt}.
-\subsubsection*{EndNote $\to$~\jabref{}}
+\subsubsection[EndNote -> JabRef]{EndNote $\to$~\jabref{}}
EndNote hat einen Export-Stil Bib\TeX{}, der allerdings nicht alle
Eintragstypen und Felder von Bib\TeX{} und auch nicht die zusätzlich
die dabei erstellt wird und folgen den Anweisungenx in der Datei \texttt{readme.txt}.
-\subsubsection*{\jabref{} $\to$~ OpenOffice.org}
+\subsubsection[JabRef-Bibliographien in OpenOffice.org benutzen]{\jabref{}-Bibliographien in OpenOffice.org benutzen}
-\begin{quote}
-\label{OpenOfficeHelp}\menu{Datei} \msep{} \menu{Exportieren}
-\msep{} \menu{OpenOffice Calc}
-\end{quote}
-\jabref{} kann Ihre Datei in das OpenOffice.org-Tabellenkalkulationsformat
-exportieren. Die exportierte Tabelle besteht aus einem Arbeitsblatt,
-das die Einträge in Reihen und die unterschiedlichen Felder in Spalten
-enthält. Die Tabelle ist kompatibel zu den Literaturverzeichnis-Funktionen
-von OpenOffice.org; Sie können die exportierte Tabelle unter \menu{Datenquellen}
-als Literaturdatenbank angeben.
+\jabref{} kann Ihre Datei sowohl in das OpenOffice.org 1.1 \texttt{.sxc}"=Tabellenkalkulationsformat als auch in das OpenDocument \texttt{.ods}"=Tabellenkalkulationsformat, das von OpenOffice.org 2.0 benutzt wird, exportieren.
+In beiden Fällen besteht die exportierte Tabelle aus einem Arbeitsblatt, das die Einträge in Reihen
+und die unterschiedlichen Felder in Spalten enthält. Die Reihenfolge und Benennung der Spalten ist kompatibel
+zu den Literaturverzeichnis-Funktionen von OpenOffice.org (OOo 1.1: \texttt{.sxc}, OOo 2.0: \texttt{.ods}).
-\subsubsection*{Klartext-Import}
+\paragraph{Die exportierte Datei als Bibliographiedatenbank in OpenOffice 2.0 (oder neuer) benutzen}
+Gehen Sie folgendermaßen vor, um eine Tabelle, die von \jabref{} exportiert wurde, als Bibliographiedatenbank in OpenOffice.org zu benutzen:
+
+\begin{itemize}
+\item Exportieren Sie Ihre Datenbank in das \texttt{.ods} -Format.
+\item Starten Sie OpenOffice.org.
+\item Wählen Sie \menu{Extras} \msep{} \menu{Optionen} \msep{} \menu{OpenOffice.org Base} \msep{} \menu{Datenbanken}.
+\item Bearbeiten Sie die \emph{Bibliography}-Datenbank und ändern ihren Namen z.\,B. in \emph{Bibliographie-alt}.
+\item Schließen Sie das Fenster \menu{Optionen} und gehen Sie zu \menu{Datei} \msep{} \menu{Neu} \msep{} \menu{Datenbank}.
+\item Dann wählen Sie \menu{Verbindung zu einer bestehenden Datenbank herstellen}, nehmen \menu{Tabellendokument} als
+ Datenbanktyp und wählen die \texttt{.ods}-Datei, die Sie exportiert haben.
+\item Klicken Sie auf \menu{Fertig stellen} und wählen den Namen \emph{Bibliography} im Speicherdialog.
+\end{itemize}
+Anschließend wählen Sie \menu{Extras} \msep{} \menu{Literaturdatenbank}. Ihre Datenbank sollte nun angezeigt werden.
+
+\paragraph{Eine exportierte Datei als Datenbank in OpenOffice 1.1.x benutzen}
+
+\begin{itemize}
+\item Exportieren Sie Ihre Datei in das \texttt{.sxc}-Format.
+\item Starten Sie OpenOffice.org.
+\item Wählen Sie \menu{Extras} \msep{} \menu{Datenquellen}.
+\item Wählen Sie die \emph{Bibliography}-Datei und ändern ihren Namen z.B. in \emph{Bibliographie-alt}.
+\item Drücken Sie \menu{Anwenden}.
+\item Klicken Sie \menu{Neue Datenquelle}. Ein neuer Eintrag erscheint. Ändern Sie den Namen zu \emph{Bibliography}.
+\item Ändern Sie den \menu{Dateityp} zu \menu{Tabelle}. Klicken Sie den \menu{\ldots}-Button in der Zeile \menu{Datenquellen URL}. Wählen Sie die \texttt{.sxc}-Datei, die Sie exportiert haben.
+\item Klicken Sie auf \menu{OK}, um das Fenster \menu{Datenquellen} zu schließen.
+\end{itemize}
+Anschließend wählen Sie \menu{Extras} \msep{} \menu{Literaturdatenbank}.
+Ihre Datenbank sollte nun angezeigt werden.
+
+\subsubsection{Klartext-Import}
\begin{quote}
\emph{Sie können aus einfachen Text-Dateien oder der Zwischenablage
ein URL oder DOI zu verlinken.
-\subsubsection*{Externe Betrachter einrichten}
+\subsubsection{Externe Betrachter einrichten}
\jabref{} benötigt Informationen darüber, welche Programme es für
PDF- und PS-Dateien und Internetseiten benutzen soll. In der Standardeinstellung
\msep{} \emph{\menu{Einstellungen}.}
\end{quote}
-\subsubsection*{Externe Dateien oder Links öffnen}
+\subsubsection{Externe Dateien oder Links öffnen}
Es gibt verschiedene Möglichkeiten, wie man externe Dateien oder Internetseiten
aus \jabref{} öffnen kann. Im Eintrags-Editor können Sie einfach
URL oder DOI (nur URL, wenn beide vorhanden sind).
-\subsubsection*{Der Standard-Ordner für PDF-Dateien}
+\subsubsection{Der Standard-Ordner für PDF-Dateien}
PDF-Dateien erhalten von \jabref{} eine >>Spezialbehandlung<<,
um das Verlinken mit den entsprechenden Einträgen so einfach wie möglich
\subsection[JabRef und Online-Datenbanken]{\jabref{} und Online-Datenbanken}
-\subsubsection*{CiteSeer}
+\subsubsection{CiteSeer}
\label{CiteSeerHelp}\jabref{} kann Informationen über eine bestimmte
Literaturangabe aus der CiteSeer-Datenbank herunterladen. Um diesen
}
-\subsubsection*{Medline}
+\subsubsection{Medline}
\begin{quote}
\label{MedlineHelp}\jabref{} kann Literaturangaben von der Medline-Datenbank
Datei zugeordnet.
-\subsubsection*{Benutzung eines Proxy-Servers}
+\subsubsection{Benutzung eines Proxy-Servers}
Wenn Sie einen HTTP-Proxy-Server benutzen müssen, übergeben Sie den
Servernamen und die Portnummer an Java. Diese Umgebungseinstellungen
und \emph{timestamp}.
-\subsubsection*{Zeitstempel \emph{(timestamp)}}
+\subsubsection{Zeitstempel \emph{(timestamp)}}
\begin{quote}
\label{TimeStampHelp}\emph{Die Benutzung des Zeitstempels kann unter
\texttt{yyyy.MM.dd~HH:mm} $\to$ 2005.09.14 17:45
\end{quote}
-\subsubsection*{Besitzer \emph{(owner)}}
+\subsubsection{Besitzer \emph{(owner)}}
\label{OwnerHelp}\jabref{} kann allen neuen Einträgen, die zu einer
Datei hinzugefügt oder in sie importiert werden, Ihren Benutzernamen
wird.
-\subsubsection*{Kommandozeilen-Optionen}
+\subsubsection{Kommandozeilen-Optionen}
Im folgenden werden die wichtigsten Optionen und Befehle für die Kommandozeile
vorgestellt.
\end{itemize}
+\clearpage
\section{Anpassung}
-
+\secttoc
\subsection{Eintragstypen}
gehen die bislang nicht übernommenen Änderungen verloren.
-\subsubsection*{Der Dialog \menu{Eintragstypen anpassen}}
+\subsubsection{Der Dialog \menu{Eintragstypen anpassen}}
Der Dialog \menu{Eintragstypen anpassen} ist in drei Hauptbereiche
unterteilt. Im linken Bereich können Sie den Eintragstyp auswählen,
Felder.
-\subsubsection*{Eintragstypen hinzufügen und löschen}
+\subsubsection{Eintragstypen hinzufügen und löschen}
Die derzeit verfügbaren Eintragstypen werden im linken Bereich des
Dialogfensters aufgelistet. Wenn Sie einen Eintragstyp auswählen,
Standard-Typen verfügbar, die bearbeitet wurden.
-\subsubsection*{Eintragstypen bearbeiten}
+\subsubsection{Eintragstypen bearbeiten}
Wenn ein Eintragstyp ausgewählt ist, werden die derzeitigen benötigten
und optionalen Felder im mittleren und rechten Bereich des Dialogfensters
können Sie auch neue spezielle Feldmarken vorschlagen.
-\subsubsection*{Spezielle Feldmarken}
+\subsubsection{Spezielle Feldmarken}
\begin{labeling}{veryveryveryshorttitle}
\item [\texttt{{[}auth{]}}]Der Nachname des ersten Autors.
Texteditor erstellen.
-\subsubsection*{Hinzufügen eines Exportfilters}
+\subsubsection{Hinzufügen eines Exportfilters}
Die einzige Voraussetzung für einen Exportfilter ist, daß eine Datei
mit der Endung \texttt{.layout} vorhanden ist. Um einen neuen, eigenen
vorgeschlagen.
-\subsubsection*{Das Erstellen des Exportfilters}
+\subsubsection{Das Erstellen des Exportfilters}
Um einen Eindruck zu bekommen, wie Exportfilter auszusehen haben,
suchen Sie am besten auf unserer Homepage nach dem Paket, das die
so allgemein gehalten wird, dass sie die meisten Eintragstypen abdeckt.
-\paragraph*{Das Format der Layout-Datei}
+\paragraph{Das Format der Layout-Datei}
Layout-Dateien werden mit einem einfachen markup-Format erstellt,
bei dem die Kommandos mit einem >>backslash<< (\texttt{\textbackslash{}})
identifiziert werden, gelangen direkt in die Ausgabedatei.
-\paragraph*{Feldkommandos}
+\paragraph{Feldkommandos}
Ein beliebiges Wort, vor dem ein backslash steht, z.\,B. \texttt{\textbackslash{}author},
\texttt{\textbackslash{}editor,} \texttt{\textbackslash{}title} oder
Feld ausgewertet, das dann direkt in die Ausgabe kopiert wird.
-\paragraph*{Feldformatierer}
+\paragraph{Feldformatierer}
Oft muss der Feldinhalt vor der Ausgabe verarbeitet werden. Dies wird
mit Hilfe eines \emph{Feldformatierers} gemacht~-- einer java class,
starten.
-\paragraph*{Bedingte Ausgabe}
+\paragraph{Bedingte Ausgabe}
Manche statische Ausgabe macht nur Sinn, wenn ein bestimmtes Feld
nicht leer ist. Wenn wir z.\,B. hinter den Namen der Editoren den
die mit einer Vielzahl von Eintragstypen umgehen können.}
-\paragraph*{Gruppierte Ausgabe}
+\paragraph{Gruppierte Ausgabe}
Wenn Sie Ihre Einträge auf der Basis eines bestimmten Feldes gruppieren
wollen, benutzen Sie die Kommandos für die gruppierte Ausgabe. Die
\textbackslash{}endgroup\{keywords\}
\end{lyxcode}
-\subsubsection*{Teilen Sie Ihre Arbeit mit anderen}
+\subsubsection{Teilen Sie Ihre Arbeit mit anderen}
Mit externen Layout-Dateien ist es einfach, Ihre eigenen Export-Formate
mit anderen Anwendern gemeinsam zu benutzen. Falls Sie einen Exportfilter
zu erweitern.
+\clearpage
\section{Externe Importfilter}
+\secttoc
+\bigskip
-\jabref{} bietet Ihnen die Möglichkeit, ganz ähnlich den Standard-Importern, eigene Importer
+\noindent \jabref{} bietet Ihnen die Möglichkeit, ganz ähnlich den Standard-Importern, eigene Importer
zu definieren und zu benutzen. Man definiert einen Importer durch eine oder mehrere Java
\emph{Klassen}, die Dateiinhalte aus einem sogenannten \emph{Input stream} lesen
-und daraus Bib\TeX{}-Einträge erzeugen. Sie können vorkompilierte Importer einbinden, die Sie vielleicht
-von SourceForge erhalten haben (siehe Abschnitt >>Ihre Arbeit anderen zur Verfügung stellen<<,
+und daraus Bib\TeX{}-Einträge erzeugen. Sie können vorkompilierte Importer einbinden, die Sie vielleicht
+von SourceForge erhalten haben (siehe Abschnitt >>Ihre Arbeit anderen zur Verfügung stellen<<,
S.\,\pageref{subsec:Ihre-Arbeit}). Sie können auch
-mit Grundkenntnissen der Java-Programmierung eigene Importer für für Sie wichtige Referenzquellen
+mit Grundkenntnissen der Java-Programmierung eigene Importer für für Sie wichtige Referenzquellen
erstellen oder neue, verbesserte Versionen existierender Importer einbinden, ohne \jabref{} neu zu
kompilieren.
-\paragraph*{Vorrangsregeln}
+\paragraph{Vorrangsregeln}
Externe Importfilter haben Vorrang vor Standard-Importern. So können Sie mit Ihren Importern
die existierenden in der automatischen Formaterkennung und an der Kommandozeile in \jabref{} überschreiben.
Stellen Sie sicher, dass Sie den Importer in kompilierter Form haben (eine oder mehrere
\texttt{.class} Dateien) und dass die Klassendateien
-in einer Verzeichnisstruktur entsprechend ihrer Package-Struktur liegen.
-Um einen neuen externen Importfilter hinzuzufügen, öffnen Sie den Dialog
+in einer Verzeichnisstruktur entsprechend ihrer Package-Struktur liegen.
+Um einen neuen externen Importfilter hinzuzufügen, öffnen Sie den Dialog
\menu{Optionen} \msep{} \menu{Verwalte externe Importfilter}, und klicken Sie auf
-\menu{Aus Klassenpfad hinzufügen}. Ein Dateiauswahl-Fenster erscheint,
+\menu{Aus Klassenpfad hinzufügen}. Ein Dateiauswahl-Fenster erscheint,
mit dem Sie den Klassenpfad des Importers wählen, dass heißt den obersten Ordner,
in dem die Package-Struktur Ihres Importers beginnt. In einem zweiten Dateiauswahl-Fenster
wählen Sie die \emph{.class}-Datei Ihres Importers, die von \texttt{\textbackslash{}ImportFormat} abgeleitet
ist. Wenn Sie \menu{Klasse auswählen} klicken, erscheint Ihr neuer Importer
in der Liste der externen Importfilter. Alle externen Importfilter erscheinen in den
-\jabref{}-Untermenüs \menu{Datei} \msep{} \menu{Importieren} \msep{} \menu{Externe Importfilter} und
+\jabref{}-Untermenüs \menu{Datei} \msep{} \menu{Importieren} \msep{} \menu{Externe Importfilter} und
\menu{Datei} \msep{} \menu{Importieren und Anhängen} \msep{} \menu{Externe Importfilter}.
\tip[Bitte beachten Sie: ]{Wenn Sie die Klassen in ein anderes Verzeichnis verschieben,
\subsection{Einen Importfilter entwickeln}
-Bitte schauen Sie auf unseren Download-Seiten nach Beispielen und nützlichen Dateien zur
+Bitte schauen Sie auf unseren Download-Seiten nach Beispielen und nützlichen Dateien zur
Entwicklung Ihres Importfilters.
\subsubsection{Ein einfaches Beispiel}
2004;ROBERT HUNT AND JAMES BESSEN;The Software Patent Experiment
\end{lyxcode}
-\paragraph*{SimpleCsvImporter Erstellen}
+\paragraph{SimpleCsvImporter Erstellen}
Erzeugen Sie in einem Text-Editor eine von \texttt{ImportFormat} abgeleitete Klasse,
-die die Methoden \texttt{getFormatName()},
+die die Methoden \texttt{getFormatName()},
\texttt{isRecognizedFormat()}
und \texttt{importEntries()} implementiert. Hier ein Beispiel:
\begin{lyxcode}
return true; // this is discouraged except for demonstration purposes
}
-
+
~
- public List importEntries(InputStream stream) throws IOException {
+ public List importEntries(InputStream stream) throws IOException {
ArrayList bibitems = new ArrayList();
BufferedReader in = new BufferedReader(ImportFormatReader.getReaderDefaultEncoding(stream));
-
+
~
String line = in.readLine();
line = in.readLine();
- }
+ }
}
- return bibitems;
+ return bibitems;
}
}
\end{lyxcode}
-\paragraph*{SimpleCsvImporter übersetzen}
+\paragraph{SimpleCsvImporter übersetzen}
Beachten Sie, dass die Beispielklasse im Default"=Package liegt. Angenommen, Sie haben
sie unter \texttt{/meinpfad/SimpleCsvImporter.java} gespeichert. Nehmen wir weiter an,
die Datei \texttt{JabRef-2.0.jar} ist im gleichen Verzeichnis wie
-\texttt{SimpleCsvImporter.java} und Java ist in Ihrem Kommandopfad.
-Kompilieren Sie die Klasse mit JSDK 1.4 zum Beispiel mit folgendem Kommandozeilen"=Aufruf:
+\texttt{SimpleCsvImporter.java} und Java ist in Ihrem Kommandopfad.
+Kompilieren Sie die Klasse mit JSDK 1.4 zum Beispiel mit folgendem Kommandozeilen"=Aufruf:
\begin{lyxcode}
javac -classpath JabRef-2.0.jar SimpleCsvImporter.java
\end{lyxcode}
Nun sollte dort auch eine Datei \texttt{/mypath/SimpleCsvImporter.class} liegen.
-\paragraph*{SimpleCsvImporter registrieren}
+\paragraph{SimpleCsvImporter registrieren}
Öffnen Sie in \jabref{} \menu{Optionen} \msep{} \menu{Verwaltung externer Importfilter} und klicken Sie
-auf \menu{Aus Klassenpfad hinzufügen}. Navigieren Sie nach \texttt{/meinpfad} und
+auf \menu{Aus Klassenpfad hinzufügen}. Navigieren Sie nach \texttt{/meinpfad} und
klicken Sie \menu{Klassenpfad auswählen}. Wählen Sie dann die Datei \texttt{SimpleCsvImporter.class}
und klicken Sie \menu{Klasse auswählen}. Ihr Importfilter sollte nun in der Liste der
externen Importfilter unter dem Namen >>Simple CSV Importer<< erscheinen und,
-sobald Sie \menu{Schließen} gewählt haben, auch in den Untermenüs \menu{Datei} \msep{} \menu{Importieren} \msep{}
-\menu{Externe Importfilter} und \menu{Datei} \msep{} \menu{Importieren und Anhängen} \msep{} \menu{Externe Importfilter}
+sobald Sie \menu{Schließen} gewählt haben, auch in den Untermenüs \menu{Datei} \msep{} \menu{Importieren} \msep{}
+\menu{Externe Importfilter} und \menu{Datei} \msep{} \menu{Importieren und Anhängen} \msep{} \menu{Externe Importfilter}
des \jabref{}-Hauptfensters auftauchen.
\subsection{Ihre Arbeit anderen zur Verfügung stellen}
\label{subsec:Ihre-Arbeit}
Mit externen Importfiltern ist es recht einfach, Importfilter zwischen Nutzern auszutauschen und
-gemeinsam zu nutzen. Wenn Sie einen Importer für ein Format schreiben, das \jabref{} noch nicht unterstützt,
-oder einen Importer verbessern, bitten wir Sie, Ihre Ergebnisse auf unserer SourceForge.net
-Seite zu veröffentlichen. Wir bieten gerne eine Sammlung eingereichter Importfilter an oder
+gemeinsam zu nutzen. Wenn Sie einen Importer für ein Format schreiben, das \jabref{} noch nicht unterstützt,
+oder einen Importer verbessern, bitten wir Sie, Ihre Ergebnisse auf unserer SourceForge.net
+Seite zu veröffentlichen. Wir bieten gerne eine Sammlung eingereichter Importfilter an oder
fügen sie unserer Auswahl an Standard-Importfiltern hinzu.
+\clearpage
\section{Tastenkürzel}
Die Menüs können alle über Tastenkürzel angesteuert werden, die meisten
\end{longtable}
+\clearpage
\section{Entwicklung}
+\secttoc
+\bigskip
-\jabref{} ist ein \emph{Open Source} Projekt, das heißt, dass jede(r)
+\noindent \jabref{} ist ein \emph{Open Source} Projekt, das heißt, dass jede(r)
dazu beitragen kann, das Programm zu verbessern und weiterzuentwickeln.
Wenn Sie Anregungen, Wünsche oder Fragen haben, ist die erste Anlaufstelle
die \href{http://sourceforge.net/projects/jabref/}{Projektseite bei \emph{Sourceforge}}.
\jabref{} ist frei verfügbar unter den Bedingungen der \href{http://www.gnu.org/copyleft/gpl.html}{GNU Public License}.
-\subsubsection*{Benutzte Fremdsoftware}
+\subsubsection{Benutzte Fremdsoftware}
\jabref{} benutzt JGoodies Looks 1.2.2 und JGoodiesForms 1.0.4, das
von \href{http://www.jgoodies.com}{JGoodies} unter den Bedingungen
\newpage
-\section*{Versionsgeschichte}
+\addsec{Versionsgeschichte}
\label{RevisionHistory}
-\subsection*{Version 0.3 (zu \jabref{} 2.0, Stand: 16.\,1.\,2006)}
+\subsection*{(in Arbeit))}
+\begin{revhist}
+\end{revhist}
+
+\subsection*{30.\,1.\,2006)}
\begin{revhist}
+\item Abschnitt >>\jabref{}-Bibliographien in OpenOffice.org benutzen<< aktualisiert
\item Abschnitt zur Erzeugung der Bib\TeX{}-Keys aktualisiert
\item Neues Kapitel (>>Externe Importfilter<<), geschrieben von Andreas Rudert
\item Einige kleinere Änderungen
\end{revhist}
-\subsection*{Version 0.2 (6.\,12.\,2005)}
+\subsection*{6.\,12.\,2005}
%\renewcommand{\labelitemi}{}
\begin{revhist}
\item mehrere kleinere Änderungen
\end{revhist}
-\subsubsection*{Version 0.1 (16.\,11.\,2005)}
+\subsection*{16.\,11.\,2005}
\begin{revhist}
\item Erstentwurf von Dominik Waßenhoven, basierend
auf dem unveröffentlichten englischen \emph{Initial Draft} von Nizar Batada (20.\,2.\,2004)
Anschließend wählen Sie <b>Extras -> Literaturdatenbank</b>. Ihre Datenbank sollte nun angezeigt werden.
<p>
+<h2>Eine exportierte Datei als Datenbank in OpenOffice 1.1.x benutzen</h2>
+
+ <ul>
+ <li>Exportieren Sie Ihre Datei in das <b>.sxc</b>-Format</li>
+ <li>Starten Sie OpenOffice.org</li>
+ <li>Wählen Sie <b>Extras -> Datenquellen</b></li>
+ <li>Wählen Sie die <i>Bibliography</i>-Datei und ändern ihren Namen z.B. in <i>Bibliographie-alt</i>.</li>
+ <li>Drücken Sie <b>Anwenden</b>.
+ <li>Klicken Sie <b>Neue Datenquelle</b>. Ein neuer Eintrag erscheint. Ändern Sie den Namen zu
+ <i>Bibliography</i>.</li>
+ <li>Ändern Sie den <b>Dateityp</b> zu <b>Tabelle</b>. Klicken Sie den <b>...</b>-Button
+ in der Zeile <b>Datenquellen URL</b>. Wählen Sie die <b>.sxc</b>-Datei, die Sie exportiert haben.</li>
+ <li>Klicken Sie auf <b>OK</b>, um das Fenster <b>Datenquellen</b> zu schließen.</li>
+</ul>
+Anschließend wählen Sie <b>Extras -> Literaturdatenbank</b>.
+Ihre Datenbank sollte nun angezeigt werden.
+
+<h2>Die exportierte Datei als Bibliographiedatenbank in OpenOffice 2.0 (oder neuer) benutzen</h2>
+Gehen Sie folgendermaßen vor, um eine Tabelle, die von JabRef exportiert wurde, als Bibliographiedatenbank in OpenOffice.org zu benutzen:
+
+<ul>
+ <li>Exportieren Sie Ihre Datenbank in das <b>.ods</b> -Format</li>
+ <li>Starten Sie OpenOffice.org</li>
+ <li>Wählen Sie <b>Extras -> Optionen -> OpenOffice.org Base -> Datenbanken</b></li>
+ <li>Bearbeiten Sie die <i>Bibliography</i>-Datenbank und ändern ihren Namen z.B. in <i>Bibliographie-alt</i></li>
+ <li>Schließen Sie das Fenster <b>Optionen</b> und gehen Sie zu <b>Datei -> Neu -> Datenbank</b></li>
+ <li>Wählen Sie <b>Verbindung zu einer bestehenden Datenbank herstellen</b>, wählen <b>Tabellendokument</b> als
+ Datenbanktyp und wählen die <b>.ods</b>-Datei, die Sie exportiert haben</li>
+ <li>Klicken Sie auf <b>Fertig stellen</b> und wählen den Namen <i>Bibliography</i> im Speicherdialog</li>
+</ul>
+Anschließend wählen Sie <b>Extras -> Literaturdatenbank</b>. Ihre Datenbank sollte nun angezeigt werden.
+<p>
+
<h2>Eine exportierte Datei als Datenbank in OpenOffice 1.1.x benutzen</h2>
<ul>
Anschließend wählen Sie <b>Extras -> Literaturdatenbank</b>.
Ihre Datenbank sollte nun angezeigt werden.
-</HTML>
\ No newline at end of file
+</HTML>
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head></head>
+
+<body>
+<basefont size="-1" color="#2F4958" face="arial">
+Dieses Modul erstellt eine neue Datenbank, welche nur die im TeX Projekt
+vorkommenden Verweise/Einträge enthält.
+</body></html>
\ No newline at end of file
Frédéric Darboux<BR>
Fabrice Dessaint<BR>
Nathan Dunn<BR>
-Brian van Essen<br>
+Brian Van Essen<br>
Alexis Gallagher<BR>
Sascha Hunold<BR>
Bernd Kalbfuss<BR>
<H2>Partager votre travail</H2>
-Avec des fichiers de filtres d'importation personnalisés, il est vraiment simple de partager des formats d'importation personnalisés entre utilisateurs. Si vous écrivez un filtre d'importation pour un format non supporté par JabRef, ou l'amélioration d'un filtre existant, nous vous encourageons à soumettre votre travail sur notre page SourceForge.net. Nous serons heureux de distribuer la collection des fichiers d'importation soumis, ou d'en ajouter à la sélection de filtres d'importation standard.
+<p>Avec des fichiers de filtres d'importation personnalisés, il est vraiment simple de partager des formats d'importation personnalisés entre utilisateurs. Si vous écrivez un filtre d'importation pour un format non supporté par JabRef, ou l'amélioration d'un filtre existant, nous vous encourageons à soumettre votre travail sur notre page SourceForge.net. Nous serons heureux de distribuer la collection des fichiers d'importation soumis, ou d'en ajouter à la sélection de filtres d'importation standard.</p>
+</BODY>
</HTML>
Dans le menu 'Paramétrage des clefs' de la fenêtre Préférences, on peut indiquer les champs à utiliser pour la génération automatique des clefs BibTeX. La définition peut être faite pour chacune des entrées standards.
</p>
+<H2>Les définitions de clefs</H2>
<p>
La définition peut contenir n'importe quel texte au choix ainsi que des marqueurs de champs qui indiquent les champs particuliers de l'entrée utilisés et leur position dans la clef. Un marqueur de champ est constitué généralement du nom du champ entre crochets, par ex. <b>[volume]</b>. Si le champ n'est pas défini dans l'entrée lorsque la clef est générée, aucun texte n'est inséré dans la clef.
</p>
<li><b>[<code>auth.auth.ea</code>]</b> : Le nom des deux premiers auteurs suivi de ".ea" lorsqu'ils sont plus de deux.<BR>
<li><b>[<code>authshort</code>]</b> : Le nom s'il n'y a qu'un seul auteur. Jusqu'à trois auteurs, le premier caractère du nom de chacun d'eux. Au delà de trois auteurs, le caractère plus (+) est ajouté.<BR>
</ul>
-<b>Note :</b> S'il n'y a pas d'auteur (dans le cas d'un livre édité), alors tous les marqueurs <b><code>[auth...]</code></b> ci-dessus utiliseront l'éditeur(s) (s'il y en a) comme alternative. Ainsi l'éditeur(s) d'un livre sans auteur sera traité comme l'auteur(s) pour la génération des clefs.
-Si vous ne désirez pas ce comportement, c'est à dire si vous voulez un marqueur qui soit vide s'il n'y a pas d'auteur, utilisez le code <b><code>pureauth</code></b> au lieu du code <b><code>auth</code></b> dans les marqueurs ci-dessus. Par exemple, <b><code>[pureauth]</code></b> ou <b><code>[pureauthors3]</code></b>.
+<b>Note :</b> S'il n'y a pas d'auteur (dans le cas d'un livre édité), alors tous les marqueurs <b><code>[auth...]</code></b> ci-dessus utiliseront l'éditeur(s) (s'il y en a) comme alternative. Ainsi l'éditeur(s) d'un livre sans auteur sera traité comme l'auteur(s) pour la génération des clefs.
+Si vous ne désirez pas ce comportement, c'est à dire si vous voulez un marqueur qui soit vide s'il n'y a pas d'auteur, utilisez le code <b><code>pureauth</code></b> au lieu du code <b><code>auth</code></b> dans les marqueurs ci-dessus. Par exemple, <b><code>[pureauth]</code></b> ou <b><code>[pureauthors3]</code></b>.
<ul>
<li><b>[<code>edtr</code>]</b> : Le nom du premier éditeur<BR>
<li><b>[<code>edtrIniN</code>]</b> : Les N premières lettres du nom de chaque éditeur<BR>
<code>Yared1998b</code>
</blockquote>
+<h2>Remplacement d'expressions régulières</h2>
+
+<P>
+Après que la définition de clef ait été appliquée pour produire une clef, vous pouvez demander au générateur de clef de rechercher les occurrences d'une expression régulière donnée et de la remplacer avec une chaîne. L'expression régulière et la chaîne de remplacement sont entrées dans les champs textes situés sous la liste des définition de clefs.
+</P>
+
+<P>
+Si la chaîne de remplacement est vide, les correspondances de l'expression régulière seront simplement supprimées de la clef générée.
+</P>
+
+
</body>
</html>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ inkscape:export-ydpi="90.000000"
+ inkscape:export-xdpi="90.000000"
+ inkscape:export-filename="/home/alver/Desktop/bilder/jabref/splash6.png"
+ sodipodi:docname="splash.svg"
+ sodipodi:docbase="/home/alver/jabref_beta/jabref/src/images"
+ inkscape:version="0.42+0.43pre1"
+ sodipodi:version="0.32"
+ id="svg2138"
+ height="1052.3622047"
+ width="744.09448819">
+ <defs
+ id="defs2140">
+ <pattern
+ patternTransform="translate(316.0000,1046.362)"
+ id="pattern9054"
+ xlink:href="#pattern9048"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient5361"
+ inkscape:collect="always">
+ <stop
+ id="stop5363"
+ offset="0"
+ style="stop-color:#000000;stop-opacity:1;" />
+ <stop
+ id="stop5365"
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0;" />
+ </linearGradient>
+ <marker
+ style="overflow:visible;"
+ id="Arrow2Send"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow2Send">
+ <path
+ transform="scale(0.3) rotate(180) translate(-5,0)"
+ d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
+ style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
+ id="path3046"
+ sodipodi:nodetypes="cccc" />
+ </marker>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ y2="300.91277"
+ x2="491.20592"
+ y1="300.91277"
+ x1="445.01770"
+ id="linearGradient5367"
+ xlink:href="#linearGradient5361"
+ inkscape:collect="always" />
+ <pattern
+ id="pattern9048"
+ patternTransform="translate(231.0000,284.3622)"
+ height="428.00000"
+ width="572.00000"
+ patternUnits="userSpaceOnUse">
+ <image
+ transform="translate(-231.0000,-284.3622)"
+ style="opacity:1.0000000;stroke:#000000;stroke-width:5.0000000;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-opacity:1.0000000"
+ inkscape:export-ydpi="90.000000"
+ inkscape:export-xdpi="90.000000"
+ inkscape:export-filename="/home/alver/Desktop/bilder/jabref/splash4.png"
+ y="284.36218"
+ x="231.00000"
+ xlink:href="behandlet.png"
+ sodipodi:absref="/home/alver/Desktop/bilder/jabref/behandlet.png"
+ width="572.00000"
+ height="428.00000"
+ id="image9050" />
+ </pattern>
+ </defs>
+ <sodipodi:namedview
+ inkscape:window-y="80"
+ inkscape:window-x="8"
+ inkscape:window-height="856"
+ inkscape:window-width="750"
+ inkscape:current-layer="layer1"
+ inkscape:document-units="px"
+ inkscape:cy="698.1925"
+ inkscape:cx="364.52617"
+ inkscape:zoom="1"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base" />
+ <metadata
+ id="metadata2143">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:groupmode="layer"
+ inkscape:label="Layer 1">
+ <rect
+ inkscape:export-ydpi="75.000000"
+ inkscape:export-xdpi="75.000000"
+ inkscape:export-filename="/home/alver/jabref_beta/jabref/jabref-2.0-splash.png"
+ y="170.36218"
+ x="77.500000"
+ height="432.00000"
+ width="576.00000"
+ id="rect6833"
+ style="opacity:1.0000000;fill:#6b6b75;fill-opacity:1.0000000;stroke:none;stroke-width:5.0000000;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000" />
+ <image
+ inkscape:export-ydpi="75.000000"
+ inkscape:export-xdpi="75.000000"
+ inkscape:export-filename="/home/alver/jabref_beta/jabref/jabref-2.0-splash.png"
+ y="172.36218"
+ x="79.000000"
+ id="image1390"
+ height="428.00000"
+ width="572.00000"
+ sodipodi:absref="/home/alver/oldhome/bilder/bilder/jabref/behandlet.png"
+ xlink:href="/home/alver/oldhome/bilder/bilder/jabref/behandlet.png" />
+ <flowRoot
+ inkscape:export-ydpi="75.000000"
+ inkscape:export-xdpi="75.000000"
+ inkscape:export-filename="/home/alver/jabref_beta/jabref/jabref-2.0-splash.png"
+ style="opacity:1.0000000;fill:#635578;fill-opacity:1.0000000;stroke:#b5b5c7;stroke-width:0.48137558;stroke-linejoin:bevel;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000"
+ transform="matrix(1.875133,0.000000,0.000000,2.542210,-129.6969,-372.8897)"
+ id="flowRoot2189"
+ xml:space="preserve">
+ <flowRegion
+ id="flowRegion2191">
+ <rect
+ style="fill:#635578;fill-opacity:1.0000000;stroke:#b5b5c7;stroke-opacity:1.0000000;stroke-width:0.48137557;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-linejoin:bevel"
+ y="199.10532"
+ x="128.49385"
+ height="127.49445"
+ width="283.51782"
+ id="rect2193" />
+ </flowRegion>
+ <flowPara
+ style="font-size:90.000000px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125.00000%;writing-mode:lr-tb;text-anchor:start;fill:#635578;fill-opacity:1.0000000;stroke:#b5b5c7;stroke-width:0.48137558;stroke-linejoin:bevel;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;font-family:AR PL KaitiM GB"
+ id="flowPara2201">JabRef</flowPara>
+ </flowRoot> <flowRoot
+ inkscape:export-ydpi="75.000000"
+ inkscape:export-xdpi="75.000000"
+ inkscape:export-filename="/home/alver/jabref_beta/jabref/jabref-2.0-splash.png"
+ style="font-size:34.96500015px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:104.16220427%;writing-mode:lr-tb;text-anchor:start;opacity:1;fill:#ffffff;fill-opacity:1;stroke:#5cc757;stroke-width:0.64448702;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:0.64448701 0.64448701 ;stroke-dashoffset:0.45114091;stroke-opacity:1;font-family:FreeSans"
+ transform="matrix(2.869197,-1.415830e-2,2.234317e-2,3.356271,-832.1435,-652.0185)"
+ id="flowRoot2203"
+ xml:space="preserve">
+ <flowRegion
+ style="stroke:url(#linearGradient5367);stroke-width:0.64448702;stroke-miterlimit:4;stroke-dasharray:0.64448701 0.64448701 ;stroke-dashoffset:0.45114091"
+ id="flowRegion2205">
+ <rect
+ style="font-size:34.96500015px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:104.16220427%;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:#322b5b;stroke-width:0.64448702;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:0.64448701 0.64448701 ;stroke-dashoffset:0.45114091;stroke-opacity:1;font-family:FreeSans"
+ y="286.45224"
+ x="443.95346"
+ height="119.83134"
+ width="173.972"
+ id="rect2207" />
+ </flowRegion>
+ <flowPara
+ style="font-size:34.96500015px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:104.16220427%;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:#322b5b;stroke-width:0.64448702;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:0.64448701 0.64448701 ;stroke-dashoffset:0.45114091;stroke-opacity:1;font-family:FreeSans"
+ id="flowPara2211">2.0</flowPara>
+ </flowRoot> <flowRoot
+ inkscape:export-ydpi="75.000000"
+ inkscape:export-xdpi="75.000000"
+ inkscape:export-filename="/home/alver/jabref_beta/jabref/jabref-2.0-splash.png"
+ transform="matrix(0.972246,0.000000,0.000000,1.325301,6.054966,-126.1181)"
+ style="font-size:11.9999996;font-style:oblique;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#797580;fill-opacity:1.0000000;font-family:Bitstream Vera Sans;text-anchor:middle;writing-mode:lr;text-align:center;line-height:100%"
+ id="flowRoot3076"
+ xml:space="preserve"><flowRegion
+ id="flowRegion3078">
+ <rect
+ style="fill:#797580;fill-opacity:1.0000000;font-family:Bitstream Vera Sans;font-weight:bold;font-style:oblique;font-stretch:normal;font-variant:normal;font-size:11.9999996;text-anchor:middle;text-align:center;writing-mode:lr;line-height:100%"
+ y="514.56494"
+ x="115.50008"
+ height="78.684433"
+ width="506.03476"
+ id="rect3080" />
+ </flowRegion><flowPara
+ id="flowPara1339">This program is distributed under the terms of the General Public License.</flowPara><flowPara
+ id="flowPara1341">Copyright (2003-2006) Morten O. Alver, Nizar Batada and all contributors.</flowPara></flowRoot> <text
+ inkscape:export-ydpi="75.000000"
+ inkscape:export-xdpi="75.000000"
+ inkscape:export-filename="/home/alver/jabref_beta/jabref/jabref-2.0-splash.png"
+ transform="scale(0.853277,1.171952)"
+ sodipodi:linespacing="100%"
+ id="text1393"
+ y="315.20035"
+ x="163.38908"
+ style="font-size:183.29680;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#413b62;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Nimbus Roman No9 L;text-anchor:start;writing-mode:lr-tb"
+ xml:space="preserve"><tspan
+ y="315.20035"
+ x="163.38908"
+ id="tspan1395"
+ sodipodi:role="line">JabRef</tspan></text>
+ <text
+ inkscape:export-ydpi="75.000000"
+ inkscape:export-xdpi="75.000000"
+ inkscape:export-filename="/home/alver/jabref_beta/jabref/jabref-2.0-splash.png"
+ transform="scale(0.853347,1.171856)"
+ sodipodi:linespacing="100%"
+ id="text2179"
+ y="397.84811"
+ x="149.99753"
+ style="font-size:45.702374;font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#805b41;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Times New Roman;text-anchor:start;writing-mode:lr-tb"
+ xml:space="preserve"><tspan
+ y="397.84811"
+ x="149.99753"
+ id="tspan2181"
+ sodipodi:role="line">reference manager</tspan></text>
+ </g>
+</svg>
\r
package com.jgoodies.uif_lite.panel;\r
\r
+import com.jgoodies.looks.LookUtils;\r
+\r
import java.awt.*;\r
\r
import javax.swing.*;\r
import javax.swing.border.AbstractBorder;\r
\r
-import com.jgoodies.plaf.LookUtils;\r
\r
/** \r
* A <code>JPanel</code> subclass that has a drop shadow border and \r
* be displayed as selected.\r
* \r
* @author Karsten Lentzsch\r
- * @version $Revision: 1.3 $\r
+ * @version $Revision: 1.4 $\r
* \r
* @see javax.swing.JInternalFrame\r
* @see javax.swing.JDesktopPane\r
JLabel lab;
builder.appendSeparator(Globals.lang("General"));
JPanel p1 = new JPanel();
- lab = new JLabel(Globals.lang("Menu and label font size") + ":");
- p1.add(lab);
- p1.add(fontSize);
- builder.append(p1);
- builder.nextLine();
+ //lab = new JLabel(Globals.lang("Menu and label font size") + ":");
+ //p1.add(lab);
+ //p1.add(fontSize);
+ //builder.append(p1);
+ //builder.nextLine();
builder.append(antialias);
builder.nextLine();
builder.appendSeparator(Globals.lang("Table appearance"));
}
if (c=='\\') current_backslash = token_end;
if (braces_level==0)
- if (c==',' || c=='~' || c=='-' || Character.isWhitespace(c)) break;
+ if (c==',' || c=='~' || /*c=='-' ||*/ Character.isWhitespace(c)) break;
+ // Morten Alver 18 Apr 2006: Removed check for hyphen '-' above to prevent
+ // problems with names like Bailey-Jones getting broken up and sorted wrong.
token_end++;
}
if (token_abbr<0) token_abbr = token_end;
Further information about the GNU GPL is available at:
http://www.gnu.org/copyleft/gpl.ja.html
-
+
*/
package net.sf.jabref;
import java.io.*;
import java.util.*;
import java.util.List;
+import java.nio.charset.UnsupportedCharsetException;
import javax.swing.*;
import javax.swing.tree.TreePath;
import javax.swing.undo.*;
import net.sf.jabref.collab.*;
import net.sf.jabref.export.*;
-import net.sf.jabref.external.PushToLyx;
import net.sf.jabref.external.AutoSetExternalFileForEntries;
-import net.sf.jabref.external.PushToEmacs;
import net.sf.jabref.groups.*;
import net.sf.jabref.imports.*;
import net.sf.jabref.labelPattern.LabelPatternUtil;
import net.sf.jabref.search.NoSearchMatcher;
import net.sf.jabref.search.SearchMatcher;
import com.jgoodies.uif_lite.component.UIFSplitPane;
+import com.jgoodies.forms.builder.DefaultFormBuilder;
+import com.jgoodies.forms.layout.FormLayout;
import ca.odell.glazedlists.FilterList;
import ca.odell.glazedlists.matchers.Matcher;
import ca.odell.glazedlists.event.ListEventListener;
this.sidePaneManager = Globals.sidePaneManager;
database = new BibtexDatabase();
metaData = new MetaData();
+ metaData.initializeNewDatabase();
this.frame = frame;
setupActions();
setupMainPanel();
database = db;
if (meta != null)
parseMetaData(meta);
- else
+ else {
metaData = new MetaData();
+ metaData.initializeNewDatabase();
+ }
setupActions();
setupMainPanel();
/*if (Globals.prefs.getBoolean("autoComplete")) {
*/
});
+
+ actions.put("test", new BaseAction () {
+ public void action() throws Throwable {
+
+
+
+
+ }
+ });
+
+
// The action for saving a database.
actions.put("save", new AbstractWorker() {
private boolean success = false;
public void run() {
try {
+ // If the option is set, autogenerate keys for all entries that are
+ // lacking keys, before saving:
+ if (Globals.prefs.getBoolean("generateKeysBeforeSaving")) {
+ BibtexEntry bes;
+ NamedCompound ce = new NamedCompound(Globals.lang("autogenerate keys"));
+ boolean any = false;
+ for (Iterator i=database.getKeySet().iterator(); i.hasNext();) {
+ bes = database.getEntryById((String)i.next());
+ String oldKey = bes.getCiteKey();
+ if ((oldKey == null) || (oldKey.equals(""))) {
+ LabelPatternUtil.makeLabel(Globals.prefs.getKeyPattern(), database, bes);
+ ce.addEdit(new UndoableKeyChange(database, bes.getId(), null,
+ (String)bes.getField(BibtexFields.KEY_FIELD)));
+ any = true;
+ }
+ }
+ // Store undo information, if any:
+ if (any) {
+ ce.end();
+ undoManager.addEdit(ce);
+ }
+ }
+ // Done with autosetting keys. Now save the database:
+
success = saveDatabase(file, false, encoding);
//Util.pr("Testing resolve string... BasePanel line 237");
// finally we paste in the entries (if any), which either came from TransferableBibtexEntries
// or were parsed from a string
if ((bes != null) && (bes.length > 0)) {
+
NamedCompound ce = new NamedCompound
(Globals.lang(bes.length > 1 ? "paste entries" : "paste entry"));
for (int i=0; i<bes.length; i++) {
try {
BibtexEntry be = (BibtexEntry)(bes[i].clone());
+ Util.setAutomaticFields(be);
+
// We have to clone the
// entries, since the pasted
// entries must exist
}
});
- // The action for pushing citations to an open Lyx/Kile instance:
- actions.put("pushToLyX", new PushToLyx(BasePanel.this));
-
- actions.put("pushToWinEdt",new BaseAction(){
- public void action(){
- final List entries = mainTable.getSelected();
- final int numSelected = entries.size();
- // Globals.logger("Pushing " +numSelected+(numSelected>1? " entries" : "entry") + " to WinEdt");
-
- if( numSelected > 0){
- Thread pushThread = new Thread() {
- public void run() {
- String winEdt = Globals.prefs.get("winEdtPath");
- //winEdt = "osascript";
- try {
- StringBuffer toSend = new StringBuffer("\"[InsText('\\")
- .append(Globals.prefs.get("citeCommand")).append("{");
- String citeKey = "";//, message = "";
- boolean first = true;
- for (Iterator i=entries.iterator(); i.hasNext();) {
- BibtexEntry bes = (BibtexEntry)i.next();
- citeKey = (String) bes.getField(GUIGlobals.KEY_FIELD);
- // if the key is empty we give a warning and ignore this entry
- if (citeKey == null || citeKey.equals(""))
- continue;
- if (first) {
- toSend.append(citeKey);
- first = false;
- }
- else {
- toSend.append(",").append(citeKey);
- //message += ", ";
- }
- //message += (1 + rows[i]);
-
- }
- if (first)
- output(Globals.lang("Please define BibTeX key first"));
- else {
- toSend.append("}');]\"");
- //System.out.println(toSend.toString());
- Runtime.getRuntime().exec(winEdt + " " + toSend.toString());
- Globals.lang("Pushed citations to WinEdt");
- /*output(
- Globals.lang("Pushed the citations for the following rows to")+"WinEdt: " +
- message);*/
- }
- }
-
- catch (IOException excep) {
- output(Globals.lang("Error")+": "+Globals.lang("Could not call executable")+" '"
- +winEdt+"'.");
- excep.printStackTrace();
- }
- }
- };
-
- pushThread.start();
- }
- }
- });
-
- actions.put("pushToEmacs", new PushToEmacs(BasePanel.this));
// The action for auto-generating keys.
actions.put("makeKey", new AbstractWorker() {
// them from consideration, or warn about overwriting keys.
loop: for (Iterator i=entries.iterator(); i.hasNext();) {
bes = (BibtexEntry)i.next();
- if (bes.getField(GUIGlobals.KEY_FIELD) != null) {
+ if (bes.getField(BibtexFields.KEY_FIELD) != null) {
if (Globals.prefs.getBoolean("avoidOverwritingKey"))
// Rmove the entry, because its key is already set:
i.remove();
if (!Globals.prefs.getBoolean("avoidOverwritingKey")) for (Iterator i=entries.iterator(); i.hasNext();) {
bes = (BibtexEntry)i.next();
// Store the old value:
- oldvals.put(bes, bes.getField(GUIGlobals.KEY_FIELD));
+ oldvals.put(bes, bes.getField(BibtexFields.KEY_FIELD));
database.setCiteKeyForEntry(bes.getId(), null);
}
bes = LabelPatternUtil.makeLabel(Globals.prefs.getKeyPattern(), database, bes);
ce.addEdit(new UndoableKeyChange
(database, bes.getId(), (String)oldvals.get(bes),
- (String)bes.getField(GUIGlobals.KEY_FIELD)));
+ (String)bes.getField(BibtexFields.KEY_FIELD)));
}
ce.end();
undoManager.addEdit(ce);
Vector keys = new Vector();
// Collect all non-null keys.
for (int i=0; i<bes.length; i++)
- if (bes[i].getField(Globals.KEY_FIELD) != null)
- keys.add(bes[i].getField(Globals.KEY_FIELD));
+ if (bes[i].getField(BibtexFields.KEY_FIELD) != null)
+ keys.add(bes[i].getField(BibtexFields.KEY_FIELD));
if (keys.size() == 0) {
output("None of the selected entries have BibTeX keys.");
return;
Vector keys = new Vector();
// Collect all non-null keys.
for (int i=0; i<bes.length; i++)
- if (bes[i].getField(Globals.KEY_FIELD) != null)
- keys.add(bes[i].getField(Globals.KEY_FIELD));
+ if (bes[i].getField(BibtexFields.KEY_FIELD) != null)
+ keys.add(bes[i].getField(BibtexFields.KEY_FIELD));
if (keys.size() == 0) {
output("None of the selected entries have BibTeX keys.");
return;
// see if we can fall back to a filename based on the bibtex key
String basefile;
- Object key = bes[0].getField(Globals.KEY_FIELD);
+ Object key = bes[0].getField(BibtexFields.KEY_FIELD);
if (key != null) {
basefile = key.toString();
final String[] types = new String[] {"pdf", "ps"};
if (filepath != null) {
//output(Globals.lang("Calling external viewer..."));
try {
- Util.openExternalViewer(filepath, field, Globals.prefs);
+ Util.openExternalViewer(metaData(), filepath, field);
output(Globals.lang("External viewer called") + ".");
}
catch (IOException ex) {
if (link != null) {
//output(Globals.lang("Calling external viewer..."));
try {
- Util.openExternalViewer(link.toString(), field, Globals.prefs);
+ Util.openExternalViewer(metaData(), link.toString(), field);
output(Globals.lang("External viewer called")+".");
} catch (IOException ex) {
output(Globals.lang("Error") + ": " + ex.getMessage());
// Create an UndoableInsertEntry object.
undoManager.addEdit(new UndoableInsertEntry(database, bibEntry, BasePanel.this));
- TextInputDialog tidialog = new TextInputDialog(frame, BasePanel.this,
+ TextInputDialog tidialog = new TextInputDialog(frame, BasePanel.this,
"import", true,
bibEntry) ;
Util.placeDialog(tidialog, BasePanel.this);
session = FileActions.savePartOfDatabase(database, metaData, file,
Globals.prefs, mainTable.getSelectedEntries(), encoding);
+ } catch (UnsupportedCharsetException ex2) {
+ JOptionPane.showMessageDialog(frame, Globals.lang("Could not save file. "
+ +"Character encoding '%0' is not supported.", encoding),
+ Globals.lang("Save database"), JOptionPane.ERROR_MESSAGE);
+ throw new SaveException("rt");
} catch (SaveException ex) {
if (ex.specificEntry()) {
// Error occured during processing of
boolean commit = true;
if (!session.getWriter().couldEncodeAll()) {
- String warning = Globals.lang("The chosen encoding '%0' could not encode the following characters: ",
- session.getEncoding())+session.getWriter().getProblemCharacters()
- +"\nDo you want to continue?";
- //int answer = JOptionPane.showConfirmDialog(frame, warning, Globals.lang("Save database"),
- // JOptionPane.YES_NO_OPTION);
- String message = Globals.lang("The chosen encoding '%0' could not encode the following characters: ",
- session.getEncoding())+session.getWriter().getProblemCharacters()
- +"\nWhat do you want to do?";
+ DefaultFormBuilder builder = new DefaultFormBuilder(new FormLayout("left:pref, 4dlu, fill:pref", ""));
+ JTextArea ta = new JTextArea(session.getWriter().getProblemCharacters());
+ ta.setEditable(false);
+ builder.append(Globals.lang("The chosen encoding '%0' could not encode the following characters: ",
+ session.getEncoding()));
+ builder.append(ta);
+ builder.append(Globals.lang("What do you want to do?"));
String tryDiff = Globals.lang("Try different encoding");
- int answer = JOptionPane.showOptionDialog(frame, message, Globals.lang("Save database"),
+ int answer = JOptionPane.showOptionDialog(frame, builder.getPanel(), Globals.lang("Save database"),
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE, null,
new String[] {Globals.lang("Save"), tryDiff, Globals.lang("Cancel")}, tryDiff);
}
highlightEntry(be); // Selects the entry. The selection listener will open the editor.
-
+
markBaseChanged(); // The database just changed.
new FocusRequester(getEntryEditor(be));
} catch (KeyCollisionException ex) {
database.insertEntry(bibEntry) ;
if (Globals.prefs.getBoolean("useOwner"))
// Set owner field to default value
- bibEntry.setField(Globals.OWNER, Globals.prefs.get("defaultOwner") );
+ bibEntry.setField(BibtexFields.OWNER, Globals.prefs.get("defaultOwner") );
// Create an UndoableInsertEntry object.
undoManager.addEdit(new UndoableInsertEntry(database, bibEntry, BasePanel.this));
output(Globals.lang("Added new")+" '"
boolean first = true;
for (Iterator i = entries.iterator(); i.hasNext();) {
BibtexEntry bes = (BibtexEntry) i.next();
- citeKey = (String) bes.getField(GUIGlobals.KEY_FIELD);
+ citeKey = (String) bes.getField(BibtexFields.KEY_FIELD);
// if the key is empty we give a warning and ignore this entry
if (citeKey == null || citeKey.equals(""))
continue;
public void vetoableChange(PropertyChangeEvent pce)
throws PropertyVetoException
{
- if (pce.getPropertyName() == null)
- fireDatabaseChanged (new DatabaseChangeEvent(ths, DatabaseChangeEvent.CHANGING_ENTRY, (BibtexEntry)pce.getSource()));
+ if (pce.getPropertyName() == null)
+ fireDatabaseChanged (new DatabaseChangeEvent(ths, DatabaseChangeEvent.CHANGING_ENTRY, (BibtexEntry)pce.getSource()));
else if ("id".equals(pce.getPropertyName()))
{
// locate the entry under its old key
_entries.put((String) pce.getNewValue(),
(BibtexEntry) pce.getSource());
} else {
- fireDatabaseChanged (new DatabaseChangeEvent(ths, DatabaseChangeEvent.CHANGED_ENTRY, (BibtexEntry)pce.getSource()));
- //Util.pr(pce.getSource().toString()+"\n"+pce.getPropertyName()
- // +"\n"+pce.getNewValue());
- }
+ fireDatabaseChanged (new DatabaseChangeEvent(ths, DatabaseChangeEvent.CHANGED_ENTRY, (BibtexEntry)pce.getSource()));
+ //Util.pr(pce.getSource().toString()+"\n"+pce.getPropertyName()
+ // +"\n"+pce.getNewValue());
+ }
}
};
* sorted by the given Comparator.
*/
public synchronized EntrySorter getSorter(java.util.Comparator comp) {
- EntrySorter sorter = new EntrySorter(_entries, comp);
- addDatabaseChangeListener(sorter);
+ EntrySorter sorter = new EntrySorter(_entries, comp);
+ addDatabaseChangeListener(sorter);
return sorter;
}
{
return (BibtexEntry) _entries.get(id);
}
-
+
public synchronized Collection getEntries() {
- return _entries.values();
+ return _entries.values();
}
/**
}
return back ;
}
-
+
public synchronized BibtexEntry[] getEntriesByKey(String key) {
Vector entries = new Vector();
BibtexEntry entry;
}
BibtexEntry[] entryArray = new BibtexEntry[entries.size()];
return (BibtexEntry[]) entries.toArray(entryArray);
- }
+ }
/**
* Inserts the entry, given that its ID is not already in use.
*/
_entries.put(id, entry);
- fireDatabaseChanged(new DatabaseChangeEvent(this, DatabaseChangeEvent.ADDED_ENTRY, entry));
+ fireDatabaseChanged(new DatabaseChangeEvent(this, DatabaseChangeEvent.ADDED_ENTRY, entry));
return checkForDuplicateKeyAndAdd(null, entry.getCiteKey(), false);
}
oldValue.removePropertyChangeListener(listener);
}
- fireDatabaseChanged(new DatabaseChangeEvent(this, DatabaseChangeEvent.REMOVED_ENTRY, oldValue));
+ fireDatabaseChanged(new DatabaseChangeEvent(this, DatabaseChangeEvent.REMOVED_ENTRY, oldValue));
return oldValue;
}
BibtexEntry entry = getEntryById(id);
String oldKey = entry.getCiteKey();
if (key != null)
- entry.setField(Globals.KEY_FIELD, key);
+ entry.setField(BibtexFields.KEY_FIELD, key);
else
- entry.clearField(Globals.KEY_FIELD);
+ entry.clearField(BibtexFields.KEY_FIELD);
return checkForDuplicateKeyAndAdd(oldKey, entry.getCiteKey(), false);
}
if (((BibtexString)_strings.get(i.next())).getName().equals(string.getName()))
throw new KeyCollisionException("A string with this label already exists,");
}
-
- if (_strings.containsKey(string.getId()))
- throw new KeyCollisionException("Duplicate BibtexString id.");
-
+
+ if (_strings.containsKey(string.getId()))
+ throw new KeyCollisionException("Duplicate BibtexString id.");
+
_strings.put(string.getId(), string);
}
* These are in no sorted order.
*/
public Set getStringKeySet() {
- return _strings.keySet();
+ return _strings.keySet();
}
/**
return false;
}
- /**
- * If the label represents a string contained in this database, returns
- * that string's content. Resolves references to other strings, taking
- * care not to follow a circular reference pattern.
- * If the string is undefined, returns the label itself.
- */
- public String resolveString(String label) {
- return resolveString(label, new HashSet());
- }
-
/**
* Resolves any references to strings contained in this database,
* if possible.
*/
public String resolveForStrings(String content) {
- return resolveContent(content, new HashSet());
+ return resolveContent(content, new HashSet());
}
+ /**
+ * If the label represents a string contained in this database, returns
+ * that string's content. Resolves references to other strings, taking
+ * care not to follow a circular reference pattern.
+ * If the string is undefined, returns the label itself.
+ */
private String resolveString(String label, HashSet usedIds) {
-
for (java.util.Iterator i=_strings.keySet().iterator(); i.hasNext();) {
BibtexString string = (BibtexString)_strings.get(i.next());
- //Util.pr(label+" : "+string.getName());
+ //Util.pr(label+" : "+string.getName());
if (string.getName().toLowerCase().equals(label.toLowerCase())) {
- // First check if this string label has been resolved
- // earlier in this recursion. If so, we have a
- // circular reference, and have to stop to avoid
- // infinite recursion.
- if (usedIds.contains(string.getId())) {
- Util.pr("Stopped due to circular reference in strings: "+label);
- return label;
- }
- // If not, log this string's ID now.
- usedIds.add(string.getId());
-
- // Ok, we found the string. Now we must make sure we
- // resolve any references to other strings in this one.
- String res = string.getContent();
- res = resolveContent(res, usedIds);
-
- // Finished with recursing this branch, so we remove our
- // ID again:
- usedIds.remove(string.getId());
-
- return res;
- }
+ // First check if this string label has been resolved
+ // earlier in this recursion. If so, we have a
+ // circular reference, and have to stop to avoid
+ // infinite recursion.
+ if (usedIds.contains(string.getId())) {
+ Util.pr("Stopped due to circular reference in strings: "+label);
+ return label;
+ }
+ // If not, log this string's ID now.
+ usedIds.add(string.getId());
+
+ // Ok, we found the string. Now we must make sure we
+ // resolve any references to other strings in this one.
+ String res = string.getContent();
+ res = resolveContent(res, usedIds);
+
+ // Finished with recursing this branch, so we remove our
+ // ID again:
+ usedIds.remove(string.getId());
+
+ return res;
+ }
}
-
+
// If we get to this point, the string has obviously not been defined locally.
// Check if one of the standard BibTeX month strings has been used:
Object o;
if ((o = Globals.MONTH_STRINGS.get(label.toLowerCase())) != null) {
return (String)o;
}
-
+
return label;
}
private String resolveContent(String res, HashSet usedIds) {
- //if (res.matches(".*#[-\\^\\:\\w]+#.*")) {
+ //if (res.matches(".*#[-\\^\\:\\w]+#.*")) {
if (res.matches(".*#[^#]+#.*")) {
- StringBuffer newRes = new StringBuffer();
- int piv = 0, next = 0;
- while ((next=res.indexOf("#", piv)) >= 0) {
- // We found the next string ref. Append the text
- // up to it.
- if (next > 0)
- newRes.append(res.substring(piv, next));
- int stringEnd = res.indexOf("#", next+1);
- if (stringEnd >= 0) {
- // We found the boundaries of the string ref,
- // now resolve that one.
- String refLabel = res.substring(next+1, stringEnd);
- newRes.append(resolveString(refLabel, usedIds));
- }
- piv = stringEnd+1;
- }
- if (piv < res.length()-1)
- newRes.append(res.substring(piv));
- res = newRes.toString();
- }
- return res;
+ StringBuffer newRes = new StringBuffer();
+ int piv = 0, next = 0;
+ while ((next=res.indexOf("#", piv)) >= 0) {
+
+ // We found the next string ref. Append the text
+ // up to it.
+ if (next > 0)
+ newRes.append(res.substring(piv, next));
+ int stringEnd = res.indexOf("#", next+1);
+ if (stringEnd >= 0) {
+ // We found the boundaries of the string ref,
+ // now resolve that one.
+ String refLabel = res.substring(next+1, stringEnd);
+ String resolved = resolveString(refLabel, usedIds);
+ if (refLabel.equals(resolved)) {
+ // We got just the label in return, so this may not have
+ // been intended as a string label, or it may be a label for
+ // an undefined string. Therefore we prefer to display the #
+ // characters rather than removing them:
+ newRes.append(res.substring(next, stringEnd+1));
+ } else
+ // The string was resolved, so we display its meaning only,
+ // stripping the # characters signifying the string label:
+ newRes.append(resolved);
+ piv = stringEnd+1;
+ } else {
+ // We didn't find the boundaries of the string ref. This
+ // makes it impossible to interpret it as a string label.
+ // So we should just append the rest of the text and finish.
+ newRes.append(res.substring(next));
+ piv = res.length();
+ break;
+ }
+
+ }
+ if (piv < res.length()-1)
+ newRes.append(res.substring(piv));
+ res = newRes.toString();
+ }
+ return res;
}
//##########################################
return 0;
else
return ((Integer)o).intValue();
-
+
}
-
+
//========================================================
// keep track of all the keys to warn if there are duplicates
//========================================================
}
-
+
public void fireDatabaseChanged(DatabaseChangeEvent e) {
- for (Iterator i=changeListeners.iterator(); i.hasNext();) {
- ((DatabaseChangeListener)i.next()).databaseChanged(e);
- }
+ for (Iterator i=changeListeners.iterator(); i.hasNext();) {
+ ((DatabaseChangeListener)i.next()).databaseChanged(e);
+ }
}
public void addDatabaseChangeListener(DatabaseChangeListener l) {
- changeListeners.add(l);
+ changeListeners.add(l);
}
public void removeDatabaseChangeListener(DatabaseChangeListener l) {
- changeListeners.remove(l);
+ changeListeners.remove(l);
}
/*
public class BibtexEntry
{
+ public final static String ID_FIELD = "id";
private String _id;
private BibtexEntryType _type;
private Map _fields = new HashMap();
try
{
- firePropertyChangedEvent("id", _id, id);
+ firePropertyChangedEvent(ID_FIELD, _id, id);
}
catch (PropertyVetoException pv)
{
}
public String getCiteKey() {
- return (_fields.containsKey(Globals.KEY_FIELD) ?
- (String)_fields.get(Globals.KEY_FIELD) : null);
+ return (_fields.containsKey(BibtexFields.KEY_FIELD) ?
+ (String)_fields.get(BibtexFields.KEY_FIELD) : null);
}
/**
* Sets the given field to the given value.
*/
public void setField(HashMap fields){
- _fields.putAll(fields);
+ _fields.putAll(fields);
}
public void setField(String name, Object value) {
- if ("id".equals(name)) {
+ if (ID_FIELD.equals(name)) {
throw new IllegalArgumentException("The field name '" + name +
"' is reserved");
}
//Object normalValue = FieldTypes.normalize(name, value);
- Object oldValue = _fields.get(name);
+ Object oldValue = _fields.get(name);
try {
- /* The first event is no longer needed, so the following comment doesn't apply
- as of 2005.08.11.
+ /* The first event is no longer needed, so the following comment doesn't apply
+ as of 2005.08.11.
// First throw an empty event that just signals that this entry
- // is about to change. This is needed, so the EntrySorter can
- // remove the entry from its TreeSet. After a sort-sensitive
- // field changes, the entry will not be found by the TreeMap,
- // so without this event it would be impossible to reinsert this
- // entry to keep everything sorted properly.
+ // is about to change. This is needed, so the EntrySorter can
+ // remove the entry from its TreeSet. After a sort-sensitive
+ // field changes, the entry will not be found by the TreeMap,
+ // so without this event it would be impossible to reinsert this
+ // entry to keep everything sorted properly.
firePropertyChangedEvent(null, null, null);
*/
// We set the field before throwing the changeEvent, to enable
- // the change listener to access the new value if the change
- // sets off a change in database sorting etc.
- _fields.put(name, value);
+ // the change listener to access the new value if the change
+ // sets off a change in database sorting etc.
+ _fields.put(name, value);
firePropertyChangedEvent(name, oldValue, value);
} catch (PropertyVetoException pve) {
- // Since we have already made the change, we must undo it since
- // the change was rejected:
- _fields.put(name, oldValue);
+ // Since we have already made the change, we must undo it since
+ // the change was rejected:
+ _fields.put(name, oldValue);
throw new IllegalArgumentException("Change rejected: " + pve);
}
*/
public void clearField(String name) {
- if ("id".equals(name)) {
+ if (ID_FIELD.equals(name)) {
throw new IllegalArgumentException("The field name '" + name +
"' is reserved");
}
// Write header with type and bibtex-key.
out.write("@"+_type.getName().toUpperCase()+"{");
- String str = Util.shaveString((String)getField(GUIGlobals.KEY_FIELD));
+ String str = Util.shaveString((String)getField(BibtexFields.KEY_FIELD));
out.write(((str == null) ? "" : str)+","+Globals.NEWLINE);
HashMap written = new HashMap();
- written.put(GUIGlobals.KEY_FIELD, null);
+ written.put(BibtexFields.KEY_FIELD, null);
+ boolean hasWritten = false;
// Write required fields first.
String[] s = getRequiredFields();
if (s != null) for (int i=0; i<s.length; i++) {
- writeField(s[i], out, ff);
+ hasWritten = hasWritten | writeField(s[i], out, ff, hasWritten);
written.put(s[i], null);
}
// Then optional fields.
s = getOptionalFields();
if (s != null) for (int i=0; i<s.length; i++) {
if (!written.containsKey(s[i])) { // If field appears both in req. and opt. don't repeat.
- writeField(s[i], out, ff);
+ //writeField(s[i], out, ff);
+ hasWritten = hasWritten | writeField(s[i], out, ff, hasWritten);
written.put(s[i], null);
}
}
TreeSet remainingFields = new TreeSet();
for (Iterator i = _fields.keySet().iterator(); i.hasNext(); ) {
String key = (String)i.next();
- boolean writeIt = (write ? GUIGlobals.isWriteableField(key) :
- GUIGlobals.isDisplayableField(key));
+ boolean writeIt = (write ? BibtexFields.isWriteableField(key) :
+ BibtexFields.isDisplayableField(key));
if (!written.containsKey(key) && writeIt)
- remainingFields.add(key);
+ remainingFields.add(key);
}
for (Iterator i = remainingFields.iterator(); i.hasNext(); )
- writeField((String)i.next(),out,ff);
+ hasWritten = hasWritten | writeField((String)i.next(), out, ff, hasWritten);
+ //writeField((String)i.next(),out,ff);
// Finally, end the entry.
- out.write("}"+Globals.NEWLINE);
+ out.write((hasWritten ? Globals.NEWLINE : "")+"}"+Globals.NEWLINE);
}
- private void writeField(String name, Writer out,
- FieldFormatter ff) throws IOException {
+ /**
+ * Write a single field, if it has any content.
+ * @param name The field name
+ * @param out The Writer to send it to
+ * @param ff A formatter to filter field contents before writing
+ * @param isFirst Indicates whether this is the first field written for
+ * this entry - if not, start by writing a comma and newline
+ * @return true if this field was written, false if it was skipped because
+ * it was not set
+ * @throws IOException In case of an IO error
+ */
+ private boolean writeField(String name, Writer out,
+ FieldFormatter ff, boolean isFirst) throws IOException {
Object o = getField(name);
if (o != null) {
+ if (isFirst)
+ out.write(","+Globals.NEWLINE);
out.write(" "+name+" = ");
try {
throw new IOException
(Globals.lang("Error in field")+" '"+name+"': "+ex.getMessage());
}
+ return true;
//Util.writeField(name, o, out);
- out.write(","+Globals.NEWLINE);
- }
+ //out.write(","+Globals.NEWLINE);
+ } else
+ return false;
}
/**
return clone;
}
-
+
public String toString() {
- return getType().getName()+":"+getField(Globals.KEY_FIELD);
+ return getType().getName()+":"+getField(BibtexFields.KEY_FIELD);
}
public boolean isSearchHit() {
--- /dev/null
+/*
+ Copyright (C) 2006 Raik Nagel <kiar@users.sourceforge.net>
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of the author nor the names of its contributors may be
+ used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// created by : r.nagel 19.04.2006
+//
+// function : Handling of bibtex fields.
+// All bibtex-field related stuff should be placed here!
+// Because we can export these informations into additional
+// config files -> simple extension and definition of new fields....
+//
+// todo : - handling of identically fields with different names
+// e.g. LCCN = lib-congress
+// - group id for each fields, e.g. standard, jurabib, bio....
+// - add a additional properties functionality into the
+// BibtexSingleField class
+//
+// modified : r.nagel 25.04.2006
+// export/import of some definition from/to a xml file
+
+package net.sf.jabref ;
+
+import java.util.* ;
+import net.sf.jabref.util.*;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+public class BibtexFields
+{
+ public static final String KEY_FIELD = "bibtexkey" ;
+
+ // some internal fields
+ public static final String
+ SEARCH = "__search",
+ GROUPSEARCH = "__groupsearch",
+ MARKED = "__markedentry",
+ OWNER = "owner",
+ TIMESTAMP = "timestamp", // it's also definied at the JabRefPreferences class
+ ENTRYTYPE = "entrytype",
+
+ // Using this when I have no database open or when I read
+ // non bibtex file formats (used by the ImportFormatReader.java)
+ DEFAULT_BIBTEXENTRY_ID = "__ID" ;
+
+ public static final String[] DEFAULT_INSPECTION_FIELDS = new String[]
+ {"author", "title", "year", KEY_FIELD};
+
+
+ // singleton instance
+ private static final BibtexFields runtime = new BibtexFields() ;
+
+ // contains all bibtex-field objects (BibtexSingleField)
+ private HashMap fieldSet = null ;
+
+ // contains all known (and public) bibtex fieldnames
+ private Object[] PUBLIC_FIELDS = null ;
+
+ private BibtexFields()
+ {
+ fieldSet = new HashMap() ;
+ BibtexSingleField dummy = null ;
+
+ // FIRST: all standard fields
+ // These are the fields that BibTex might want to treat, so these
+ // must conform to BibTex rules.
+ add( new BibtexSingleField( "address", true, GUIGlobals.SMALL_W ) ) ;
+ // An annotation. It is not used by the standard bibliography styles,
+ // but may be used by others that produce an annotated bibliography.
+ // http://www.ecst.csuchico.edu/~jacobsd/bib/formats/bibtex.html
+ add( new BibtexSingleField( "annote", true, GUIGlobals.LARGE_W ) ) ;
+ add( new BibtexSingleField( "author", true, GUIGlobals.MEDIUM_W, 280 ) ) ;
+ add( new BibtexSingleField( "booktitle", true, 175 ) ) ;
+ add( new BibtexSingleField( "chapter", true, GUIGlobals.SMALL_W ) ) ;
+ add( new BibtexSingleField( "crossref", true, GUIGlobals.SMALL_W ) ) ;
+ add( new BibtexSingleField( "edition", true, GUIGlobals.SMALL_W ) ) ;
+ add( new BibtexSingleField( "editor", true, GUIGlobals.MEDIUM_W, 280 ) ) ;
+ add( new BibtexSingleField( "howpublished", true, GUIGlobals.MEDIUM_W ) ) ;
+ add( new BibtexSingleField( "institution", true, GUIGlobals.MEDIUM_W ) ) ;
+
+ dummy = new BibtexSingleField( "journal", true, GUIGlobals.SMALL_W ) ;
+ dummy.setExtras("journalNames");
+ add(dummy) ;
+ add( new BibtexSingleField( "key", true ) ) ;
+ add( new BibtexSingleField( "month", true, GUIGlobals.SMALL_W ) ) ;
+ add( new BibtexSingleField( "note", true, GUIGlobals.MEDIUM_W ) ) ;
+ add( new BibtexSingleField( "number", true, GUIGlobals.SMALL_W, 60 ) ) ;
+ add( new BibtexSingleField( "organization", true, GUIGlobals.MEDIUM_W ) ) ;
+ add( new BibtexSingleField( "pages", true, GUIGlobals.SMALL_W ) ) ;
+ add( new BibtexSingleField( "publisher", true, GUIGlobals.MEDIUM_W ) ) ;
+ add( new BibtexSingleField( "school", true, GUIGlobals.MEDIUM_W ) ) ;
+ add( new BibtexSingleField( "series", true, GUIGlobals.SMALL_W ) ) ;
+ add( new BibtexSingleField( "title", true, 400 ) ) ;
+ add( new BibtexSingleField( "type", true, GUIGlobals.SMALL_W ) ) ;
+ add( new BibtexSingleField( "volume", true, GUIGlobals.SMALL_W, 60 ) ) ;
+ add( new BibtexSingleField( "year", true, GUIGlobals.SMALL_W, 60 ) ) ;
+
+ // some semi-standard fields
+ dummy = new BibtexSingleField( KEY_FIELD, true ) ;
+ dummy.setPrivate();
+ add( dummy ) ;
+
+ dummy = new BibtexSingleField( "doi", true, GUIGlobals.SMALL_W ) ;
+ dummy.setExtras("external");
+ add(dummy) ;
+ add( new BibtexSingleField( "eid", true, GUIGlobals.SMALL_W ) ) ;
+
+ dummy = new BibtexSingleField( "date", true ) ;
+ dummy.setPrivate();
+ add( dummy ) ;
+
+
+ // additional fields ------------------------------------------------------
+ dummy = new BibtexSingleField( "citeseercitationcount", false,
+ GUIGlobals.SMALL_W, 75) ;
+ dummy.setAlternativeDisplayName("Popularity") ;
+ add(dummy) ;
+ add( new BibtexSingleField( "location", false ) ) ;
+ add( new BibtexSingleField( "abstract", false, GUIGlobals.LARGE_W, 400 ) ) ;
+
+ dummy = new BibtexSingleField( "url", false, GUIGlobals.SMALL_W) ;
+ dummy.setExtras("external");
+ add(dummy) ;
+
+ dummy = new BibtexSingleField( "citeseerurl", false, GUIGlobals.SMALL_W ) ;
+ dummy.setExtras("external");
+ add(dummy) ;
+
+ dummy = new BibtexSingleField( "pdf", false, GUIGlobals.SMALL_W ) ;
+ dummy.setExtras("browseDoc");
+ add(dummy) ;
+
+ dummy = new BibtexSingleField( "ps", false, GUIGlobals.SMALL_W ) ;
+ dummy.setExtras("browseDocZip");
+ add(dummy) ;
+ add( new BibtexSingleField( "comment", false, GUIGlobals.MEDIUM_W ) ) ;
+ add( new BibtexSingleField( "keywords", false, GUIGlobals.SMALL_W ) ) ;
+ //FIELD_EXTRAS.put("keywords", "selector");
+
+ add( new BibtexSingleField( "search", false, 75 ) ) ;
+
+
+ // some internal fields ----------------------------------------------
+ dummy = new BibtexSingleField( GUIGlobals.NUMBER_COL, false, 32 ) ;
+ dummy.setPrivate() ;
+ dummy.setWriteable(false);
+ dummy.setDisplayable(false);
+ add( dummy ) ;
+
+ dummy = new BibtexSingleField( OWNER, false, GUIGlobals.SMALL_W ) ;
+ dummy.setPrivate();
+ add(dummy) ;
+
+ dummy = new BibtexSingleField( TIMESTAMP, false, GUIGlobals.SMALL_W ) ;
+ dummy.setExtras("datepicker");
+ dummy.setPrivate();
+ add(dummy) ;
+
+ dummy = new BibtexSingleField( ENTRYTYPE, false, 75 ) ;
+ dummy.setPrivate();
+ add(dummy) ;
+
+ dummy = new BibtexSingleField( SEARCH, false) ;
+ dummy.setPrivate();
+ dummy.setWriteable(false);
+ dummy.setDisplayable(false);
+ add(dummy) ;
+
+ dummy = new BibtexSingleField( GROUPSEARCH, false) ;
+ dummy.setPrivate();
+ dummy.setWriteable(false);
+ dummy.setDisplayable(false);
+ add(dummy) ;
+
+ dummy = new BibtexSingleField( MARKED, false) ;
+ dummy.setPrivate();
+ dummy.setWriteable(false);
+ dummy.setDisplayable(false);
+ add(dummy) ;
+
+ // read external field definitions
+ readXML( Globals.additionalFields ) ;
+
+ // collect all public fields for the PUBLIC_FIELDS array
+ Vector pFields = new Vector( fieldSet.size()) ;
+ for(Iterator iter = fieldSet.values().iterator(); iter.hasNext() ; )
+ {
+ BibtexSingleField sField = (BibtexSingleField) iter.next() ;
+ if (sField.isPublic() )
+ {
+ pFields.add( sField.getFieldName() );
+ // or export the complet BibtexSingleField ?
+ // BibtexSingleField.toString() { return fieldname ; }
+ }
+ }
+
+ PUBLIC_FIELDS = pFields.toArray() ;
+ // sort the entries
+ java.util.Arrays.sort( PUBLIC_FIELDS );
+ }
+
+
+ /** insert a field into the internal list */
+ private void add( BibtexSingleField field )
+ {
+ // field == null check
+ String key = field.name ;
+ fieldSet.put( key, field ) ;
+ }
+
+ /** read a xml definiton file and put only NEW fields into the field list */
+ private void readXML( String resName )
+ {
+ TXMLReader reader = new TXMLReader(resName) ;
+ if (reader.isReady() )
+ {
+ // get a list of all fields
+ NodeList fieldNodes = reader.getNodes("field") ;
+
+ int tagsCount = fieldNodes.getLength() ;
+ for (int t = 0 ; t < tagsCount ; t++)
+ {
+ Element entry = (Element) fieldNodes.item(t) ;
+ String fName = reader.readStringAttribute(entry, "name", null) ;
+ if (fName != null) // something found ?
+ {
+ fName = fName.toLowerCase() ;
+ BibtexSingleField dummy = (BibtexSingleField) fieldSet.get( fName ) ;
+ if (dummy == null) // unknown field
+ {
+ dummy = new BibtexSingleField(reader, entry) ;
+ fieldSet.put(fName, dummy) ;
+ }
+ }
+ }
+ }
+ }
+
+ // --------------------------------------------------------------------------
+ // the "static area"
+ // --------------------------------------------------------------------------
+ private static final BibtexSingleField getField( String name )
+ {
+ if (name != null)
+ {
+ return (BibtexSingleField) runtime.fieldSet.get(name.toLowerCase()) ;
+ }
+
+ return null ;
+ }
+
+ public static String getFieldExtras( String name )
+ {
+ BibtexSingleField sField = getField( name ) ;
+ if (sField != null)
+ {
+ return sField.getExtras() ;
+ }
+ return null ;
+ }
+
+ public static double getFieldWeight( String name )
+ {
+ BibtexSingleField sField = getField( name ) ;
+ if (sField != null)
+ {
+ return sField.getWeight() ;
+ }
+ return GUIGlobals.DEFAULT_FIELD_WEIGHT ;
+ }
+
+ public static void setFieldWeight( String fieldName, double weight )
+ {
+ BibtexSingleField sField = getField( fieldName ) ;
+ if (sField != null)
+ {
+ sField.setWeight( weight ) ;
+ }
+ }
+
+ public static int getFieldLength( String name )
+ {
+ BibtexSingleField sField = getField( name ) ;
+ if (sField != null)
+ {
+ return sField.getLength() ;
+ }
+ return GUIGlobals.DEFAULT_FIELD_LENGTH ;
+ }
+
+ // returns an alternative name for the given fieldname
+ public static String getFieldDisplayName( String fieldName )
+ {
+ BibtexSingleField sField = getField( fieldName ) ;
+ if (sField != null)
+ {
+ return sField.getAlternativeDisplayName() ;
+ }
+ return null ;
+ }
+
+ public static boolean isWriteableField( String field )
+ {
+ BibtexSingleField sField = getField( field ) ;
+ if (sField != null)
+ {
+ return sField.isWriteable() ;
+ }
+ return true ;
+ }
+
+ public static boolean isDisplayableField( String field )
+ {
+ BibtexSingleField sField = getField( field ) ;
+ if (sField != null)
+ {
+ return sField.isDisplayable() ;
+ }
+ return true ;
+ }
+
+ /**
+ * Returns true if the given field is a standard Bibtex field.
+ *
+ * @param field a <code>String</code> value
+ * @return a <code>boolean</code> value
+ */
+ public static boolean isStandardField( String field )
+ {
+ BibtexSingleField sField = getField( field ) ;
+ if (sField != null)
+ {
+ return sField.isStandard() ;
+ }
+ return false ;
+ }
+
+ /** returns an string-array with all fieldnames */
+ public static Object[] getAllFieldNames()
+ {
+ return runtime.PUBLIC_FIELDS ;
+ }
+
+ /** returns the fieldname of the entry at index t */
+ public static String getFieldName( int t )
+ {
+ return (String) runtime.PUBLIC_FIELDS[t] ;
+ }
+
+ /** returns the number of available fields */
+ public static int numberOfPublicFields()
+ {
+ return runtime.PUBLIC_FIELDS.length ;
+ }
+
+ /*
+ public static int getPreferredFieldLength(String name) {
+ int l = DEFAULT_FIELD_LENGTH;
+ Object o = fieldLength.get(name.toLowerCase());
+ if (o != null)
+ l = ((Integer)o).intValue();
+ return l;
+ }*/
+
+
+ // --------------------------------------------------------------------------
+ // a container class for all properties of a bibtex-field
+ // --------------------------------------------------------------------------
+ private class BibtexSingleField
+ {
+ private static final int
+ STANDARD = 0x01, // it is a standard bibtex-field
+ PRIVATE = 0x02, // internal use, e.g. owner, timestamp
+ DISPLAYABLE = 0x04, // These fields cannot be shown inside the source editor panel
+ WRITEABLE = 0x08 ; // These fields will not be saved to the .bib file.
+
+ // the fieldname
+ private String name ;
+
+ // contains the standard, privat, displayable, writable infos
+ // default is: not standard, public, displayable and writable
+ private int flag = DISPLAYABLE | WRITEABLE ;
+
+ private int length = GUIGlobals.DEFAULT_FIELD_LENGTH ;
+ private double weight = GUIGlobals.DEFAULT_FIELD_WEIGHT ;
+
+ // a alternative displayname, e.g. used for
+ // "citeseercitationcount"="Popularity"
+ private String alternativeDisplayName = null ;
+
+ // the extras data
+ // fieldExtras contains mappings to tell the EntryEditor to add a specific
+ // function to this field, for instance a "browse" button for the "pdf" field.
+ private String extras = null ;
+
+ // a comma separated list of alternative bibtex-fieldnames, e.g.
+ // "LCCN" is the same like "lib-congress"
+ // private String otherNames = null ;
+
+ // a Hashmap for a lot of additional "not standard" properties
+ // todo: add the handling in a key=value manner
+ // private HashMap props = new HashMap() ;
+
+ // some constructors ;-)
+ public BibtexSingleField( String fieldName )
+ {
+ name = fieldName ;
+ }
+
+ public BibtexSingleField( String fieldName, boolean pStandard )
+ {
+ name = fieldName ;
+ setFlag( pStandard, STANDARD) ;
+ }
+
+ public BibtexSingleField( String fieldName, boolean pStandard, double pWeight)
+ {
+ name = fieldName ;
+ setFlag( pStandard, STANDARD) ;
+ weight = pWeight ;
+ }
+
+ public BibtexSingleField( String fieldName, boolean pStandard, int pLength)
+ {
+ name = fieldName ;
+ setFlag( pStandard, STANDARD) ;
+ length = pLength ;
+ }
+
+ public BibtexSingleField( String fieldName, boolean pStandard,
+ double pWeight, int pLength)
+ {
+ name = fieldName ;
+ setFlag( pStandard, STANDARD) ;
+ weight = pWeight ;
+ length = pLength ;
+ }
+
+ /** the constructor reads all neccessary data from the xml file */
+ public BibtexSingleField( TXMLReader reader, Element node)
+ {
+ // default is: not standard, public, displayable and writable
+ flag = DISPLAYABLE | WRITEABLE ;
+
+ name = reader.readStringAttribute(node, "name", "field") ;
+ name = name.toLowerCase() ;
+
+ // read the weight
+ String wStr = reader.readStringAttribute(node, "weight", null) ;
+ if (wStr != null)
+ {
+ int hCode = wStr.toLowerCase().hashCode() ;
+ if (hCode == "small".hashCode())
+ {
+ weight = GUIGlobals.SMALL_W ;
+ }
+ else if (hCode == "medium".hashCode())
+ {
+ weight = GUIGlobals.MEDIUM_W ;
+ }
+ else if (hCode == "large".hashCode())
+ {
+ weight = GUIGlobals.LARGE_W ;
+ }
+ else // try to convert to a double value
+ {
+ try
+ {
+ weight = Double.parseDouble(wStr) ;
+ if ((weight < 0.0) || (weight > GUIGlobals.MAX_FIELD_WEIGHT))
+ {
+ weight = GUIGlobals.DEFAULT_FIELD_WEIGHT ;
+ }
+ }
+ catch (Exception e)
+ {
+ weight = GUIGlobals.DEFAULT_FIELD_WEIGHT ;
+ }
+ }
+ }
+ length = reader.readIntegerAttribute( node, "length", GUIGlobals.DEFAULT_FIELD_LENGTH ) ;
+
+ extras = reader.readStringAttribute(node, "extras", null) ;
+ }
+
+ // -----------------------------------------------------------------------
+ // -----------------------------------------------------------------------
+
+ private void setFlag( boolean onOff, int flagID)
+ {
+ if (onOff) // set the flag
+ {
+ flag = flag | flagID ;
+ }
+ else // unset the flag,
+ {
+ flag = flag & ( 0xff ^ flagID ) ;
+ }
+ }
+
+ private boolean isSet( int flagID )
+ {
+ if ( (flag & flagID) == flagID)
+ return true ;
+
+ return false ;
+ }
+
+ // -----------------------------------------------------------------------
+ public boolean isStandard()
+ {
+ return isSet( STANDARD ) ;
+ }
+
+ public void setPrivate()
+ {
+ flag = flag | PRIVATE ;
+ }
+
+ public boolean isPrivate()
+ {
+ return isSet( PRIVATE ) ;
+ }
+
+ public void setPublic()
+ {
+ setFlag( false, PRIVATE ) ;
+ }
+
+ public boolean isPublic()
+ {
+ return !isSet( PRIVATE ) ;
+ }
+
+ public void setDisplayable(boolean value)
+ {
+ setFlag( value, DISPLAYABLE ) ;
+ }
+
+ public boolean isDisplayable()
+ {
+ return isSet(DISPLAYABLE) ;
+ }
+
+
+ public void setWriteable(boolean value)
+ {
+ setFlag( value, WRITEABLE ) ;
+ }
+
+ public boolean isWriteable()
+ {
+ return isSet( WRITEABLE ) ;
+ }
+
+ // -----------------------------------------------------------------------
+ public void setAlternativeDisplayName( String aName)
+ {
+ alternativeDisplayName = aName ;
+ }
+
+ public String getAlternativeDisplayName()
+ {
+ return alternativeDisplayName ;
+ }
+ // -----------------------------------------------------------------------
+
+ public void setExtras( String pExtras)
+ {
+ extras = pExtras ;
+ }
+
+ // fieldExtras contains mappings to tell the EntryEditor to add a specific
+ // function to this field, for instance a "browse" button for the "pdf" field.
+ public String getExtras()
+ {
+ return extras ;
+ }
+ // -----------------------------------------------------------------------
+
+ public void setWeight( double value )
+ {
+ this.weight = value ;
+ }
+
+ public double getWeight()
+ {
+ return this.weight ;
+ }
+
+ // -----------------------------------------------------------------------
+ public int getLength()
+ {
+ return this.length ;
+ }
+
+ // -----------------------------------------------------------------------
+
+ public String getFieldName()
+ {
+ return name ;
+ }
+
+ }
+}
--- /dev/null
+package net.sf.jabref;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+
+/**
+ * Action used to produce a "Browse" button for one of the text fields.
+ */
+public class BrowseAction extends AbstractAction implements ActionListener {
+
+ JFrame frame;
+ JTextField comp;
+ boolean dir;
+
+ public BrowseAction(JFrame frame, JTextField tc, boolean dir) {
+ super(Globals.lang("Browse"));
+ this.frame = frame;
+ this.dir = dir;
+ comp = tc;
+
+ }
+
+ public void actionPerformed(ActionEvent e) {
+ String chosen = null;
+ if (dir)
+ chosen = Globals.getNewDir(frame, Globals.prefs, new File(comp.getText()), Globals.NONE,
+ JFileChooser.OPEN_DIALOG, false);
+ else
+ chosen = Globals.getNewFile(frame, Globals.prefs, new File(comp.getText()), Globals.NONE,
+ JFileChooser.OPEN_DIALOG, false);
+ if (chosen != null) {
+ File newFile = new File(chosen);
+ comp.setText(newFile.getPath());
+ }
+ }
+
+}
public class DuplicateResolverDialog extends JDialog {
public static final int
- NOT_CHOSEN = -1,
- KEEP_BOTH = 0,
- KEEP_UPPER = 1,
- KEEP_LOWER = 2,
- BREAK = 5, // close
- DUPLICATE_SEARCH = 1,
- IMPORT_CHECK = 2,
+ NOT_CHOSEN = -1,
+ KEEP_BOTH = 0,
+ KEEP_UPPER = 1,
+ KEEP_LOWER = 2,
+ BREAK = 5, // close
+ DUPLICATE_SEARCH = 1,
+ IMPORT_CHECK = 2,
INSPECTION = 3;
final Dimension DIM = new Dimension(650, 600);
-
+
PreviewPanel p1, p2;
JTextArea ta1, ta2;
JTabbedPane tabbed = new JTabbedPane();
GridBagLayout gbl = new GridBagLayout();
GridBagConstraints con = new GridBagConstraints();
JButton first, second, both,
- cancel = new JButton(Globals.lang("Cancel"));
+ cancel = new JButton(Globals.lang("Cancel"));
JPanel options = new JPanel(),
- main = new JPanel(),
- source = new JPanel();
+ main = new JPanel(),
+ source = new JPanel();
int status = NOT_CHOSEN;
boolean block = true;
TitleLabel lab;
-
+
public DuplicateResolverDialog(JabRefFrame frame, BibtexEntry one, BibtexEntry two, int type) {
super(frame, Globals.lang("Possible duplicate entries"), true);
break;
default:
first = new JButton(Globals.lang("Import and remove old entry"));
- second = new JButton(Globals.lang("Do not import entry"));
- both = new JButton(Globals.lang("Import and keep old entry"));
+ second = new JButton(Globals.lang("Do not import entry"));
+ both = new JButton(Globals.lang("Import and keep old entry"));
}
String layout = Globals.prefs.get("preview0");
- p1 = new PreviewPanel(one, layout);
- p2 = new PreviewPanel(two, layout);
+ p1 = new PreviewPanel(one, new MetaData(), layout);
+ p2 = new PreviewPanel(two, new MetaData(), layout);
ta1 = new JTextArea();
ta2 = new JTextArea();
ta1.setEditable(false);
ta2.setEditable(false);
-
- //ta1.setPreferredSize(dim);
+
+ //ta1.setPreferredSize(dim);
//ta2.setPreferredSize(dim);
-
+
setSourceView(one, two);
//getContentPane().setLayout();
con.weightx = 1;
con.weighty = 0;
lab = new TitleLabel(Globals.lang((type==DUPLICATE_SEARCH)?"":
- "Entry in current database"));
+ "Entry in current database"));
gbl.setConstraints(lab, con);
main.add(lab);
con.weighty = 1;
con.weighty = 0;
con.insets = new Insets(10,10,0,10);
lab = new TitleLabel(Globals.lang((type==DUPLICATE_SEARCH)?"":
- "Entry in import"));
+ "Entry in import"));
gbl.setConstraints(lab, con);
main.add(lab);
con.weighty = 1;
getContentPane().add(tabbed, BorderLayout.CENTER);
getContentPane().add(options, BorderLayout.SOUTH);
pack();
-
-
+
+
if (getHeight() > DIM.height) {
setSize(new Dimension(getWidth(), DIM.height));
}
if (getWidth() > DIM.width) {
setSize(new Dimension(DIM.width, getHeight()));
}
-
-
+
+
both.requestFocus();
Util.placeDialog(this, frame);
}
public static int resolveDuplicate(JabRefFrame frame, BibtexEntry one, BibtexEntry two) {
DuplicateResolverDialog drd = new DuplicateResolverDialog(frame, one, two,
- DUPLICATE_SEARCH);
- drd.show();
+ DUPLICATE_SEARCH);
+ drd.setVisible(true); // drd.show(); -> deprecated since 1.5
return drd.getSelected();
}
{
drd = new DuplicateResolverDialog( panel.frame, be[0], be[1],
- DuplicateResolverDialog.DUPLICATE_SEARCH) ;
- drd.show() ;
+ DuplicateResolverDialog.DUPLICATE_SEARCH) ;
+ drd.setVisible(true); // drd.show(); -> deprecated since 1.5
duplicateCounter++ ;
int answer = drd.getSelected() ;
import net.sf.jabref.undo.*;
import net.sf.jabref.external.ExternalFilePanel;
import net.sf.jabref.journals.JournalAbbreviations;
-import net.sf.jabref.gui.MainTableSelectionListener;
-
-import java.text.*;
+import com.michaelbaranov.microba.calendar.*;
+import com.michaelbaranov.microba.common.*;
+import net.sf.jabref.gui.date.*;
public class EntryEditor extends JPanel implements VetoableChangeListener {
/*
/**
- * getExtra checks the field name against GUIGlobals.FIELD_EXTRAS. If the name
- * has an entry, the proper component to be shown is created and returned.
- * Otherwise, null is returned. In addition, e.g. listeners can be added to
- * the field editor, even if no component is returned.
+ * getExtra checks the field name against BibtexFields.getFieldExtras(name).
+ * If the name has an entry, the proper component to be shown is created and
+ * returned. Otherwise, null is returned. In addition, e.g. listeners can be
+ * added to the field editor, even if no component is returned.
*
* @param string
* Field name
*/
public JComponent getExtra(String string, FieldEditor editor) {
final FieldEditor ed = editor;
- Object o = GUIGlobals.FIELD_EXTRAS.get(string);
+
+ // fieldName and parameter string identically ????
final String fieldName = editor.getFieldName();
- //if (o == null)
- // return null;
- String s = (String) o;
- //addedByMoritz
- if (fieldName.equals(Globals.prefs.get("timeStampField"))){
- //if (fieldName.equals("dateadded")){
+ String s = BibtexFields.getFieldExtras( string ) ;
+
+ // timestamp or a other field with datepicker command
+ if ( (fieldName.equals( Globals.prefs.get("timeStampField"))) ||
+ ((s != null) && s.equals("datepicker")) )
+ {
+ // double click AND datefield => insert the current date (today)
((JTextArea) ed).addMouseListener(new MouseAdapter(){
public void mouseClicked(MouseEvent e){
- if(e.getClickCount()==2){
+ if(e.getClickCount()==2) // double click
+ {
String date = Util.easyDateFormat();
ed.setText(date);
- //DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
- //ed.setText(df.format(new Date()));
}
}
});
+
+ // insert a datepicker, if the extras field contains this command
+ if ((s != null) && s.equals("datepicker"))
+ {
+ DatePickerButton datePicker = new DatePickerButton( ed ) ;
+ return datePicker.getDatePicker() ;
+ }
}
- //END_OF addedByMoritz
+
if ((s != null) && s.equals("external")) {
// Add external viewer listener for "pdf" and "url" fields.
return controls;
}
else if (panel.metaData.getData(Globals.SELECTOR_META_PREFIX
- + editor.getFieldName()) != null) {
+ + editor.getFieldName()) != null)
+ {
FieldContentSelector ws = new FieldContentSelector(frame, panel, frame, editor,
panel.metaData, storeFieldAction, false);
contentSelectors.add(ws);
else
off = new OpenFileFilter(new String[] { ext });
- ExternalFilePanel pan = new ExternalFilePanel(frame, this, fieldName, off, ed);
+ ExternalFilePanel pan = new ExternalFilePanel(frame, panel.metaData(), this, fieldName, off, ed);
return pan;
}
/*else if ((s != null) && s.equals("browsePs")) {
Object[] fields = entry.getAllFields();
for (int i = 0; i < fields.length; i++) {
- if (GUIGlobals.isDisplayableField(fields[i].toString())) {
+ if (BibtexFields.isDisplayableField(fields[i].toString())) {
if (nu.getField(fields[i].toString()) == null) {
compound.addEdit(new UndoableFieldChange(entry, fields[i].toString(),
entry.getField(fields[i].toString()), (Object) null));
try {
// this updates the table automatically, on close, but not
// within the tab
- Object oldValue = entry.getField(GUIGlobals.KEY_FIELD);
+ Object oldValue = entry.getField(BibtexFields.KEY_FIELD);
//entry = frame.labelMaker.applyRule(entry, panel.database) ;
LabelPatternUtil.makeLabel(prefs.getKeyPattern(), panel.database, entry);
// Store undo information:
panel.undoManager.addEdit(new UndoableKeyChange(panel.database, entry.getId(),
- (String) oldValue, (String) entry.getField(GUIGlobals.KEY_FIELD)));
+ (String) oldValue, (String) entry.getField(BibtexFields.KEY_FIELD)));
// here we update the field
- String bibtexKeyData = (String) entry.getField(Globals.KEY_FIELD);
+ String bibtexKeyData = (String) entry.getField(BibtexFields.KEY_FIELD);
// set the field named for "bibtexkey"
- setField(Globals.KEY_FIELD, bibtexKeyData);
+ setField(BibtexFields.KEY_FIELD, bibtexKeyData);
updateSource();
panel.markBaseChanged();
} catch (Throwable t) {
// getSelectedText()
try {
- Util.openExternalViewer(link, tf.getFieldName(), prefs);
+ Util.openExternalViewer(panel.metaData(), link, tf.getFieldName());
} catch (IOException ex) {
System.err.println("Error opening file.");
}
public EntryEditorTab(List fields, EntryEditor parent, boolean addKeyField, String name) {
if (fields != null)
- this.fields = (String[])fields.toArray(ARRAY);
+ this.fields = (String[])fields.toArray(ARRAY);
else
this.fields = new String[] {};
this.parent = parent;
private final void setupPanel(boolean addKeyField, String title) {
- GridBagLayout gbl = new GridBagLayout();
- GridBagConstraints con = new GridBagConstraints();
- panel.setLayout(gbl);
- double totalWeight = 0;
-
- //panel.setOpaque(true);
- //panel.setBackground(java.awt.Color.white);
-
- for (int i=0; i<fields.length; i++) {
-
- // Create the text area:
- FieldTextArea ta = new FieldTextArea(fields[i], null);//stringContent);
+ GridBagLayout gbl = new GridBagLayout();
+ GridBagConstraints con = new GridBagConstraints();
+ panel.setLayout(gbl);
+ double totalWeight = 0;
+
+ //panel.setOpaque(true);
+ //panel.setBackground(java.awt.Color.white);
+
+ for (int i=0; i<fields.length; i++) {
+
+ // Create the text area:
+ FieldTextArea ta = new FieldTextArea(fields[i], null);//stringContent);
JComponent ex = parent.getExtra(fields[i], ta);
- // Attach listeners and key bindings:
- setupJTextComponent(ta);
- ta.addFocusListener(new FieldListener(ta));
+ // Attach listeners and key bindings:
+ setupJTextComponent(ta);
+ ta.addFocusListener(new FieldListener(ta));
- // Store the editor for later reference:
- editors.put(fields[i], ta);
+ // Store the editor for later reference:
+ editors.put(fields[i], ta);
if (i == 0)
activeField = ta;
-
- // The label for this field:
- con.insets = new Insets(5, 5, 0, 0);
- con.anchor = GridBagConstraints.WEST;
- con.fill = GridBagConstraints.BOTH;
- con.gridwidth = 1;
- con.weightx = 0;
- con.weighty = 0;
- con.anchor = GridBagConstraints.NORTH;
- con.fill = GridBagConstraints.BOTH;
- gbl.setConstraints(ta.getLabel(), con);
- panel.add(ta.getLabel());
-
- // The field itself:
- con.fill = GridBagConstraints.BOTH;
- con.weightx = 1;
- con.weighty = GUIGlobals.getFieldWeight(fields[i]);
- totalWeight += con.weighty;
- // The gridwidth depends on whether we will add an extra component to the right:
- if (ex != null)
- con.gridwidth = 1;
- else
- con.gridwidth = GridBagConstraints.REMAINDER;
- gbl.setConstraints(ta.getPane(), con);
- panel.add(ta.getPane());
-
- // Possibly an extra component:
- if (ex != null) {
- con.gridwidth = GridBagConstraints.REMAINDER;
- con.anchor = GridBagConstraints.NORTH;
- con.fill = GridBagConstraints.HORIZONTAL;
- con.weightx = 0;
- gbl.setConstraints(ex, con);
- panel.add(ex);
- }
+
+ // The label for this field:
+ con.insets = new Insets(5, 5, 0, 0);
+ con.anchor = GridBagConstraints.WEST;
+ con.fill = GridBagConstraints.BOTH;
+ con.gridwidth = 1;
+ con.weightx = 0;
+ con.weighty = 0;
+ con.anchor = GridBagConstraints.NORTH;
+ con.fill = GridBagConstraints.BOTH;
+ gbl.setConstraints(ta.getLabel(), con);
+ panel.add(ta.getLabel());
+
+ // The field itself:
+ con.fill = GridBagConstraints.BOTH;
+ con.weightx = 1;
+ con.weighty = BibtexFields.getFieldWeight(fields[i]);
+ totalWeight += con.weighty;
+ // The gridwidth depends on whether we will add an extra component to the right:
+ if (ex != null)
+ con.gridwidth = 1;
+ else
+ con.gridwidth = GridBagConstraints.REMAINDER;
+ gbl.setConstraints(ta.getPane(), con);
+ panel.add(ta.getPane());
+
+ // Possibly an extra component:
+ if (ex != null) {
+ con.gridwidth = GridBagConstraints.REMAINDER;
+ con.anchor = GridBagConstraints.NORTH;
+ con.fill = GridBagConstraints.HORIZONTAL;
+ con.weightx = 0;
+ gbl.setConstraints(ex, con);
+ panel.add(ex);
+ }
panel.setName(title);
- }
-
- // Add the edit field for Bibtex-key.
- if (addKeyField) {
- con.insets.top += 25;
- con.insets.bottom = 10;
- con.gridwidth = 1;
- con.weighty = 0;
- con.weightx = 0;
- con.fill = GridBagConstraints.HORIZONTAL;
- con.anchor = GridBagConstraints.SOUTHWEST;
- FieldTextField tf = new FieldTextField(Globals.KEY_FIELD, (String) parent.getEntry().getField(Globals.KEY_FIELD), true);
+ }
+
+ // Add the edit field for Bibtex-key.
+ if (addKeyField) {
+ con.insets.top += 25;
+ con.insets.bottom = 10;
+ con.gridwidth = 1;
+ con.weighty = 0;
+ con.weightx = 0;
+ con.fill = GridBagConstraints.HORIZONTAL;
+ con.anchor = GridBagConstraints.SOUTHWEST;
+ FieldTextField tf = new FieldTextField(BibtexFields.KEY_FIELD,
+ (String) parent.getEntry().getField(BibtexFields.KEY_FIELD), true);
editors.put("bibtexkey", tf);
// If the key field is the only field, we should have only one editor, and this one should be set
// as active initially:
if (editors.size() == 1)
activeField = tf;
-
- gbl.setConstraints(tf.getLabel(), con);
- panel.add(tf.getLabel());
- con.gridwidth = GridBagConstraints.REMAINDER;
- con.weightx = 1;
- setupJTextComponent(tf);
- tf.addFocusListener(new FieldListener(tf));
- gbl.setConstraints(tf, con);
- panel.add(tf);
- }
+
+ gbl.setConstraints(tf.getLabel(), con);
+ panel.add(tf.getLabel());
+ con.gridwidth = GridBagConstraints.REMAINDER;
+ con.weightx = 1;
+ setupJTextComponent(tf);
+ tf.addFocusListener(new FieldListener(tf));
+ gbl.setConstraints(tf, con);
+ panel.add(tf);
+ }
}
public void setActive(FieldEditor c) {
- activeField = c;
- //System.out.println(c.toString());
+ activeField = c;
+ //System.out.println(c.toString());
}
-
+
public FieldEditor getActive() {
- return activeField;
+ return activeField;
}
public List getFields() {
- return java.util.Arrays.asList(fields);
+ return java.util.Arrays.asList(fields);
}
public void activate() {
- if (activeField != null)
- activeField.requestFocus();
+ if (activeField != null)
+ activeField.requestFocus();
- //System.out.println("Activate, hurra");
+ //System.out.println("Activate, hurra");
}
public void updateAll() {
}
public void setEntry(BibtexEntry entry) {
- for (Iterator i=editors.keySet().iterator(); i.hasNext();) {
- String field = (String)i.next();
- FieldEditor ed = (FieldEditor)editors.get(field);
- Object content = entry.getField(ed.getFieldName());
- ed.setText((content == null) ? "" : content.toString());
- }
+ for (Iterator i=editors.keySet().iterator(); i.hasNext();) {
+ String field = (String)i.next();
+ FieldEditor ed = (FieldEditor)editors.get(field);
+ Object content = entry.getField(ed.getFieldName());
+ ed.setText((content == null) ? "" : content.toString());
+ }
}
public boolean updateField(String field, String content) {
- if (!editors.containsKey(field))
- return false;
- FieldEditor ed = (FieldEditor)editors.get(field);
- ed.setText(content);
- return true;
+ if (!editors.containsKey(field))
+ return false;
+ FieldEditor ed = (FieldEditor)editors.get(field);
+ ed.setText(content);
+ return true;
}
public void validateAllFields() {
- for (Iterator i=editors.keySet().iterator(); i.hasNext();) {
- String field = (String)i.next();
- FieldEditor ed = (FieldEditor)editors.get(field);
+ for (Iterator i=editors.keySet().iterator(); i.hasNext();) {
+ String field = (String)i.next();
+ FieldEditor ed = (FieldEditor)editors.get(field);
if (((Component)ed).hasFocus())
ed.setBackground(GUIGlobals.activeEditor);
else
- ed.setBackground(GUIGlobals.validFieldBackground);
- }
+ ed.setBackground(GUIGlobals.validFieldBackground);
+ }
}
public void setEnabled(boolean enabled) {
- for (Iterator i=editors.keySet().iterator(); i.hasNext();) {
- String field = (String)i.next();
- FieldEditor ed = (FieldEditor)editors.get(field);
- ed.setEnabled(enabled);
- }
+ for (Iterator i=editors.keySet().iterator(); i.hasNext();) {
+ String field = (String)i.next();
+ FieldEditor ed = (FieldEditor)editors.get(field);
+ ed.setEnabled(enabled);
+ }
}
public Component getPane() {
- return panel;
+ return panel;
}
public void setupJTextComponent(JTextComponent ta) {
- // Activate autocompletion if it should be used for this field.
-
- // Set up key bindings and focus listener for the FieldEditor.
- InputMap im = ta.getInputMap(JComponent.WHEN_FOCUSED);
- ActionMap am = ta.getActionMap();
+ // Activate autocompletion if it should be used for this field.
+
+ // Set up key bindings and focus listener for the FieldEditor.
+ InputMap im = ta.getInputMap(JComponent.WHEN_FOCUSED);
+ ActionMap am = ta.getActionMap();
im.put(Globals.prefs.getKey("Entry editor, previous entry"), "prev");
am.put("prev", parent.prevEntryAction);
im.put(Globals.prefs.getKey("Entry editor, next entry"), "next");
am.put("next", parent.nextEntryAction);
-
- im.put(Globals.prefs.getKey("Entry editor, store field"), "store");
- am.put("store", parent.storeFieldAction);
- im.put(Globals.prefs.getKey("Entry editor, next panel"), "right");
+
+ im.put(Globals.prefs.getKey("Entry editor, store field"), "store");
+ am.put("store", parent.storeFieldAction);
+ im.put(Globals.prefs.getKey("Entry editor, next panel"), "right");
im.put(Globals.prefs.getKey("Entry editor, next panel 2"), "right");
- am.put("left", parent.switchLeftAction);
- im.put(Globals.prefs.getKey("Entry editor, previous panel"), "left");
+ am.put("left", parent.switchLeftAction);
+ im.put(Globals.prefs.getKey("Entry editor, previous panel"), "left");
im.put(Globals.prefs.getKey("Entry editor, previous panel 2"), "left");
- am.put("right", parent.switchRightAction);
- im.put(Globals.prefs.getKey("Help"), "help");
- am.put("help", parent.helpAction);
- im.put(Globals.prefs.getKey("Save database"), "save");
- am.put("save", parent.saveDatabaseAction);
- im.put(Globals.prefs.getKey("Next tab"), "nexttab");
+ am.put("right", parent.switchRightAction);
+ im.put(Globals.prefs.getKey("Help"), "help");
+ am.put("help", parent.helpAction);
+ im.put(Globals.prefs.getKey("Save database"), "save");
+ am.put("save", parent.saveDatabaseAction);
+ im.put(Globals.prefs.getKey("Next tab"), "nexttab");
am.put("nexttab", parent.frame.nextTab);
im.put(Globals.prefs.getKey("Previous tab"), "prevtab");
am.put("prevtab", parent.frame.prevTab);
-
-
- try {
- HashSet keys =
- new HashSet(ta.getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS));
- keys.clear();
- keys.add(AWTKeyStroke.getAWTKeyStroke("pressed TAB"));
- ta.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, keys);
- keys =
- new HashSet(ta.getFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS));
- keys.clear();
- keys.add(KeyStroke.getKeyStroke("shift pressed TAB"));
- ta.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, keys);
- } catch (Throwable t) {
- System.err.println(t);
- }
-
+
+
+ try {
+ HashSet keys =
+ new HashSet(ta.getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS));
+ keys.clear();
+ keys.add(AWTKeyStroke.getAWTKeyStroke("pressed TAB"));
+ ta.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, keys);
+ keys =
+ new HashSet(ta.getFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS));
+ keys.clear();
+ keys.add(KeyStroke.getKeyStroke("shift pressed TAB"));
+ ta.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, keys);
+ } catch (Throwable t) {
+ System.err.println(t);
+ }
+
}
*/
class FieldListener extends FocusAdapter {
- FieldEditor fe;
+ FieldEditor fe;
+
+ public FieldListener(FieldEditor fe) {
+ this.fe = fe;
+ }
- public FieldListener(FieldEditor fe) {
- this.fe = fe;
- }
+ public void focusGained(FocusEvent e) {
+ setActive(fe);
+ }
- public void focusGained(FocusEvent e) {
- setActive(fe);
- }
-
- public void focusLost(FocusEvent e) {
- if (!e.isTemporary())
- parent.updateField(fe);
- }
+ public void focusLost(FocusEvent e) {
+ if (!e.isTemporary())
+ parent.updateField(fe);
+ }
}
-
+
}
private List names = null;
public EntryEditorTabList() {
- init();
+ init();
}
private void init() {
- list = new ArrayList();
- names = new ArrayList();
- int i=0;
- String name=null;
- String[] fields=null;
- while ((name=Globals.prefs.get(Globals.prefs.CUSTOM_TAB_NAME+i)) != null) {
-
- fields = Globals.prefs.get(Globals.prefs.CUSTOM_TAB_FIELDS+i).split(";");
- List entry = Arrays.asList(fields);
- names.add(name);
- list.add(entry);
- i++;
- }
-
+ list = new ArrayList();
+ names = new ArrayList();
+ int i = 0;
+ String name;
+ String[] fields;
+ if (Globals.prefs.hasKey(Globals.prefs.CUSTOM_TAB_NAME + 0)) {
+ // The user has modified from the default values:
+ while (Globals.prefs.hasKey(Globals.prefs.CUSTOM_TAB_NAME + i)) {
+ name = Globals.prefs.get(Globals.prefs.CUSTOM_TAB_NAME + i);
+ fields = Globals.prefs.get(Globals.prefs.CUSTOM_TAB_FIELDS + i).split(";");
+ List entry = Arrays.asList(fields);
+ names.add(name);
+ list.add(entry);
+ i++;
+ }
+ } else {
+ // Nothing set, so we use the default values:
+ while (Globals.prefs.get(Globals.prefs.CUSTOM_TAB_NAME + "_def"+i) != null) {
+ name = Globals.prefs.get(Globals.prefs.CUSTOM_TAB_NAME + "_def" + i);
+ fields = Globals.prefs.get(Globals.prefs.CUSTOM_TAB_FIELDS + "_def" + i).split(";");
+ List entry = Arrays.asList(fields);
+ names.add(name);
+ list.add(entry);
+ i++;
+ }
+ }
}
public int getTabCount() {
- return list.size();
+ return list.size();
}
public String getTabName(int tab) {
- return (String)names.get(tab);
+ return (String) names.get(tab);
}
public List getTabFields(int tab) {
- return (List)list.get(tab);
+ return (List) list.get(tab);
}
}
import javax.swing.plaf.basic.BasicTableUI;
import javax.swing.table.*;
-import net.sf.jabref.groups.EntryTableTransferHandler;
-
public class EntryTable extends JTable {
final int PREFERRED_WIDTH = 400, PREFERRED_HEIGHT = 30;
private ListSelectionListener previewListener = null;
private int activeRow = -1;
-
+
ListSelectionListener groupsHighlightListener;
-
+
public EntryTable(EntryTableModel tm_, BasePanel panel_, JabRefPreferences prefs_) {
super(tm_);
this.tableModel = tm_;
// enable DnD
setDragEnabled(true);
// The following line is commented because EntryTableTransferHandler's
- // constructor now only accepts MainTable which has replaced EntryTable.
- // setTransferHandler(new EntryTableTransferHandler(this));
+ // constructor now only accepts MainTable which has replaced EntryTable.
+ // setTransferHandler(new EntryTableTransferHandler(this));
//renderingHints = g2.getRenderingHints();
//renderingHints.put(RenderingHints.KEY_ANTIALIASING,
else prefs.putBoolean("priDescending",
!prefs.getBoolean("priDescending"));
tableModel.remap();
-
+
}
}
});
}
};
getSelectionModel().addListSelectionListener(groupsHighlightListener);
-
+
// (to update entry editor or preview)
setWidths();
sp.getViewport().setBackground(Globals.prefs.getColor("tableBackground"));
/**
* Updates our Set containing the last row selection. Ckecks which rows were ADDED
* to the selection, to see what new entry should be previewed.
- * Returns the number of the row that should be considered active, or -1 if none.
*
* This method may have some potential for optimization.
*
* @param rows
- * @return
+ * @return The number of the row that should be considered active, or -1 if none.
*/
private int resolveNewSelection(int[] rows) {
HashSet newSel = new HashSet();
}
try {
- Util.openExternalViewer( (String) link, fieldName, prefs);
+ Util.openExternalViewer(panel.metaData, (String) link, fieldName);
}
catch (IOException ex) {
panel.output(Globals.lang("Error")+": "+ex.getMessage());
if (!panel.coloringBySearchResults ||
- tableModel.nonZeroField(row, Globals.SEARCH))
+ tableModel.nonZeroField(row, BibtexFields.SEARCH))
score++;
if (!panel.coloringByGroup ||
- tableModel.nonZeroField(row, Globals.GROUPSEARCH))
+ tableModel.nonZeroField(row, BibtexFields.GROUPSEARCH))
score+=2;
// Now, a grayed out renderer is for entries with -1, and
else if (getIconTypeForColumn(col) != null) {
return "";
}
- else if(GUIGlobals.FIELD_DISPLAYS.get(columns[col - padleft]) != null) {
- return((String) GUIGlobals.FIELD_DISPLAYS.get(columns[col - padleft]));
+ else // try to find an alternative fieldname (for display)
+ {
+ String disName = BibtexFields.getFieldDisplayName(columns[col - padleft]) ;
+ if ( disName != null)
+ {
+ return disName ;
+ }
}
return Util.nCase(columns[col - padleft]);
}
- public void showAllEntries() {
+ public void showAllEntries() {
visibleRows = sorter.getEntryCount();
}
- public void setRowCount(int rows) {
+ public void setRowCount(int rows) {
visibleRows = rows;
}
o = "" + (row + 1);
}
/* if (!isComplete(row)) {
- //JLabel incomplete = new JLabel("" + (row + 1),GUIGlobals.incompleteLabel.getIcon(), JLabel.RIGHT);
+ //JLabel incomplete = new JLabel("" + (row + 1),GUIGlobals.incompleteLabel.getIcon(), JLabel.RIGHT);
//JLabel incomplete = new JLabel("" + (row + 1));
//incomplete.setToolTipText(Globals.lang("This entry is incomplete"));
- //return incomplete;
+ //return incomplete;
} else
*/
o = processed;
} else
o = processed;
-
-
+
+
}*/
return o;
}
BibtexEntryType type = (db.getEntryById(getIdForRow(row)))
.getType();
- if (columns[col - padleft].equals(GUIGlobals.KEY_FIELD)
+ if (columns[col - padleft].equals(BibtexFields.KEY_FIELD)
|| type.isRequired(columns[col - padleft])) {
return REQUIRED;
}
// For testing MARKED feature. With this IF clause, the marked entries will only float to the top when
// no sorting/grouping reordering is active.
if (!panel.sortingBySearchResults && !panel.sortingByCiteSeerResults && !panel.sortingByGroup) {
- fields.add(Globals.MARKED);
+ fields.add(BibtexFields.MARKED);
directions.add(Boolean.TRUE);
binary.add(Boolean.FALSE);
}
if (panel.sortingByGroup) {
// Group search has the highest priority if active.
- fields.add(Globals.GROUPSEARCH);
+ fields.add(BibtexFields.GROUPSEARCH);
directions.add(Boolean.TRUE);
binary.add(Boolean.FALSE);
}
if (panel.sortingBySearchResults) {
// Normal search has priority over regular sorting.
- fields.add(Globals.SEARCH);
+ fields.add(BibtexFields.SEARCH);
directions.add(Boolean.TRUE);
binary.add(Boolean.FALSE);
}
// Loop down towards the highest ranking criterion, wrapping new sorters around the
// ones we have:
String field = (String)fields.get(piv);
- if (field.equals(Globals.MARKED)) {
+ if (field.equals(BibtexFields.MARKED)) {
comp = new MarkedComparator(comp);
}
else
import javax.swing.*;
import java.awt.*;
-import java.awt.event.*;
-import java.util.Iterator;
-import java.io.File;
import com.jgoodies.forms.layout.*;
-import com.jgoodies.forms.factories.*;
import com.jgoodies.forms.builder.*;
public class ExternalTab extends JPanel implements PrefsTab {
JLabel lab = new JLabel(Globals.lang("Main PDF directory") + ":");
builder.append(lab);
builder.append(pdfDir);
- browse = new BrowseAction(pdfDir, true);
+ browse = new BrowseAction(_frame, pdfDir, true);
builder.append(new JButton(browse));
builder.nextLine();
builder.appendSeparator(Globals.lang("PS links"));
lab = new JLabel(Globals.lang("Main PS directory") + ":");
builder.append(lab);
builder.append(psDir);
- browse = new BrowseAction(psDir, true);
+ browse = new BrowseAction(_frame, psDir, true);
builder.append(new JButton(browse));
builder.nextLine();
builder.appendSeparator(Globals.lang("External programs"));
builder.append(pan);
builder.append(lab);
builder.append(pdf);
- browse = new BrowseAction(pdf, false);
+ browse = new BrowseAction(_frame, pdf, false);
if (Globals.ON_WIN)
browse.setEnabled(false);
builder.append(new JButton(browse));
builder.append(pan);
builder.append(lab);
builder.append(ps);
- browse = new BrowseAction(ps, false);
+ browse = new BrowseAction(_frame, ps, false);
if (Globals.ON_WIN)
browse.setEnabled(false);
builder.append(new JButton(browse));
builder.append(pan);
builder.append(lab);
builder.append(html);
- browse = new BrowseAction(html, false);
+ browse = new BrowseAction(_frame, html, false);
if (Globals.ON_WIN)
browse.setEnabled(false);
builder.append(new JButton(browse));
builder.append(pan);
builder.append(lab);
builder.append(lyx);
- browse = new BrowseAction(lyx, false);
+ browse = new BrowseAction(_frame, lyx, false);
builder.append(new JButton(browse));
builder.nextLine();
lab = new JLabel(Globals.lang("Path to WinEdt.exe") + ":");
builder.append(pan);
builder.append(lab);
builder.append(winEdt);
- browse = new BrowseAction(winEdt, false);
+ browse = new BrowseAction(_frame, winEdt, false);
builder.append(new JButton(browse));
builder.nextLine();
builder.append(pan);
add(pan, BorderLayout.CENTER);
}
- /**
- * Action used to produce a "Browse" button for one of the text fields.
- */
- class BrowseAction extends AbstractAction {
- JTextField comp;
- boolean dir;
-
- public BrowseAction(JTextField tc, boolean dir) {
- super(Globals.lang("Browse"));
- this.dir = dir;
- comp = tc;
- }
-
- public void actionPerformed(ActionEvent e) {
- String chosen = null;
- if (dir)
- chosen = Globals.getNewDir(_frame, _prefs, new File(comp.getText()), Globals.NONE,
- JFileChooser.OPEN_DIALOG, false);
- else
- chosen = Globals.getNewFile(_frame, _prefs, new File(comp.getText()), Globals.NONE,
- JFileChooser.OPEN_DIALOG, false);
- if (chosen != null) {
- File newFile = new File(chosen);
- comp.setText(newFile.getPath());
- }
- }
- }
-
public void setValues() {
pdfDir.setText(_prefs.get("pdfDirectory"));
psDir.setText(_prefs.get("psDirectory"));
String ours = ((String) f1).toLowerCase(),
theirs = ((String) f2).toLowerCase();
result = ours.compareTo(theirs);
-
}
return result*multiplier;
GridBagConstraints con = new GridBagConstraints();
protected final MetaData m_metaData;
protected final JabRefFrame m_frame;
- protected final Window m_owner;
+ protected final Window m_owner;
protected final BasePanel m_panel;
protected final AbstractAction m_action;
protected final boolean m_horizontalLayout;
private void doInit() {
setLayout(gbl);
- list.setEditable(true);
+ //list.setEditable(true);
+
list.setMaximumRowCount(35);
/*
list.addActionListener(this);
add(list);
-
+
if (m_horizontalLayout)
add(Box.createHorizontalStrut(Sizes.dialogUnitXAsPixel(2,this)));
manage.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// m_owner is either a Frame or a Dialog
- ContentSelectorDialog2 csd = m_owner instanceof Frame ?
+ ContentSelectorDialog2 csd = m_owner instanceof Frame ?
new ContentSelectorDialog2(
(Frame) m_owner, m_frame, m_panel, true, m_metaData,
m_editor.getFieldName())
m_panel, true, m_metaData, m_editor
.getFieldName());
Util.placeDialog(csd, m_frame);
- csd.show();
+ csd.setVisible(true); // csd.show(); -> deprecated since 1.5
updateList();
}
});
/**
* Adds a word to the selector (to the JList and to the MetaData), unless it
* is already there
- *
+ *
* @param newWord
* String Word to add
*/
* A font chooser widget.
* @author Slava Pestov (jEdit), Sylvain Reynal
* @since jpicedt 1.3.2.beta-9
- * @version $Id: FontSelectorDialog.java,v 1.6 2004/02/27 23:28:41 mortenalver Exp $
+ * @version $Id: FontSelectorDialog.java,v 1.7 2006/04/26 08:46:57 kiar Exp $
* <p>
* $Log: FontSelectorDialog.java,v $
+ * Revision 1.7 2006/04/26 08:46:57 kiar
+ * fix dialog.show() deprecation messages, change build.xml
+ *
* Revision 1.6 2004/02/27 23:28:41 mortenalver
* Some code tidying, no effect on behaviour (hopefully)
*
class FontSelector extends JButton {
- static final String PLAIN="plain";
- static final String BOLD="bold";
- static final String BOLD_ITALIC="bold-italic";
- static final String ITALIC="italic";
-
- /** init with a default font */
- public FontSelector(){
- this(new Font("SansSerif", Font.PLAIN, 10));
- }
-
- /** init with the given font */
- public FontSelector(Font font){
- setFont(font);
- setRequestFocusEnabled(false);
- addActionListener(new ActionHandler());
- }
-
- public void setFont(Font font){
- super.setFont(font);
- updateText();
- }
-
- /**
- * update button's text content from the current button's font.
- */
- private void updateText(){
- Font font = getFont();
- String styleString;
- switch(font.getStyle()){
- case Font.PLAIN:
- styleString = PLAIN;
- break;
- case Font.BOLD:
- styleString = BOLD;
- break;
- case Font.ITALIC:
- styleString = ITALIC;
- break;
- case Font.BOLD | Font.ITALIC:
- styleString = BOLD_ITALIC;
- break;
- default:
- styleString = "UNKNOWN!!!???";
- break;
- }
-
- setText(font.getFamily() + " " + font.getSize() + " " + styleString);
- }
-
- /**
- * button's action-listener ; open a FontSelectorDialog
- */
- class ActionHandler implements ActionListener {
- public void actionPerformed(ActionEvent evt) {
- Font font = new FontSelectorDialog(FontSelector.this,getFont()).getSelectedFont();
- if(font != null){
- setFont(font);
- }
- }
- }
+ static final String PLAIN="plain";
+ static final String BOLD="bold";
+ static final String BOLD_ITALIC="bold-italic";
+ static final String ITALIC="italic";
+
+ /** init with a default font */
+ public FontSelector(){
+ this(new Font("SansSerif", Font.PLAIN, 10));
+ }
+
+ /** init with the given font */
+ public FontSelector(Font font){
+ setFont(font);
+ setRequestFocusEnabled(false);
+ addActionListener(new ActionHandler());
+ }
+
+ public void setFont(Font font){
+ super.setFont(font);
+ updateText();
+ }
+
+ /**
+ * update button's text content from the current button's font.
+ */
+ private void updateText(){
+ Font font = getFont();
+ String styleString;
+ switch(font.getStyle()){
+ case Font.PLAIN:
+ styleString = PLAIN;
+ break;
+ case Font.BOLD:
+ styleString = BOLD;
+ break;
+ case Font.ITALIC:
+ styleString = ITALIC;
+ break;
+ case Font.BOLD | Font.ITALIC:
+ styleString = BOLD_ITALIC;
+ break;
+ default:
+ styleString = "UNKNOWN!!!???";
+ break;
+ }
+
+ setText(font.getFamily() + " " + font.getSize() + " " + styleString);
+ }
+
+ /**
+ * button's action-listener ; open a FontSelectorDialog
+ */
+ class ActionHandler implements ActionListener {
+ public void actionPerformed(ActionEvent evt) {
+ Font font = new FontSelectorDialog(FontSelector.this,getFont()).getSelectedFont();
+ if(font != null){
+ setFont(font);
+ }
+ }
+ }
}
*/
public class FontSelectorDialog extends JDialog {
- /**
- *
- */
- static final String PLAIN="plain";
- static final String BOLD="bold";
- static final String BOLD_ITALIC="bold-italic";
- static final String ITALIC="italic";
-
- public FontSelectorDialog(Component comp, Font font) {
+ /**
+ *
+ */
+ static final String PLAIN="plain";
+ static final String BOLD="bold";
+ static final String BOLD_ITALIC="bold-italic";
+ static final String ITALIC="italic";
+
+ public FontSelectorDialog(Component comp, Font font) {
+
+ //super(JOptionPane.getFrameForComponent(comp),jpicedt.Localizer.currentLocalizer().get("widget.FontSelector"),true); //
+ super(JOptionPane.getFrameForComponent(comp),Globals.lang("FontSelector"),true); //
+ JPanel content = new JPanel(new BorderLayout());
+ content.setBorder(new EmptyBorder(12,12,12,12));
+ setContentPane(content);
+
+ JPanel listPanel = new JPanel(new GridLayout(1,3,6,6));
+
+ JPanel familyPanel = createTextFieldAndListPanel(
+ Globals.lang("Font Family"),
+ familyField = new JTextField(),
+ familyList = new JList(getFontList()));
+ listPanel.add(familyPanel);
- //super(JOptionPane.getFrameForComponent(comp),jpicedt.Localizer.currentLocalizer().get("widget.FontSelector"),true); //
- super(JOptionPane.getFrameForComponent(comp),Globals.lang("FontSelector"),true); //
- JPanel content = new JPanel(new BorderLayout());
- content.setBorder(new EmptyBorder(12,12,12,12));
- setContentPane(content);
-
- JPanel listPanel = new JPanel(new GridLayout(1,3,6,6));
+ String[] sizes = { "9", "10", "12", "14", "16", "18", "24" };
+ JPanel sizePanel = createTextFieldAndListPanel(
+ Globals.lang("Font Size"),
+ sizeField = new JTextField(),
+ sizeList = new JList(sizes));
+ listPanel.add(sizePanel);
+
+ String[] styles = {PLAIN,BOLD,ITALIC,BOLD_ITALIC};
- JPanel familyPanel = createTextFieldAndListPanel(
- Globals.lang("Font Family"),
- familyField = new JTextField(),
- familyList = new JList(getFontList()));
- listPanel.add(familyPanel);
-
- String[] sizes = { "9", "10", "12", "14", "16", "18", "24" };
- JPanel sizePanel = createTextFieldAndListPanel(
- Globals.lang("Font Size"),
- sizeField = new JTextField(),
- sizeList = new JList(sizes));
- listPanel.add(sizePanel);
-
- String[] styles = {PLAIN,BOLD,ITALIC,BOLD_ITALIC};
-
- JPanel stylePanel = createTextFieldAndListPanel(
- Globals.lang("Font Style"),
- styleField = new JTextField(),
- styleList = new JList(styles));
- styleField.setEditable(false);
- listPanel.add(stylePanel);
-
- familyList.setSelectedValue(font.getFamily(),true);
- familyField.setText(font.getFamily());
- sizeList.setSelectedValue(String.valueOf(font.getSize()),true);
- sizeField.setText(String.valueOf(font.getSize()));
- styleList.setSelectedIndex(font.getStyle());
- styleField.setText((String)styleList.getSelectedValue());
-
- ListHandler listHandler = new ListHandler();
- familyList.addListSelectionListener(listHandler);
- sizeList.addListSelectionListener(listHandler);
- styleList.addListSelectionListener(listHandler);
-
- content.add(BorderLayout.NORTH,listPanel);
-
- //preview = new JLabel("Font Preview");
-
- /* --------------------------------------------------------
- | Experimental addition by Morten Alver. I want to |
- | enable antialiasing in the preview field, since I'm |
- | working on introducing this in the table view. |
- -------------------------------------------------------- */
- preview = new JLabel(Globals.lang("Font Preview")) {
- public void paint(Graphics g) {
- Graphics2D g2 = (Graphics2D)g;
- g2.setRenderingHint
- (RenderingHints.KEY_ANTIALIASING,
- RenderingHints.VALUE_ANTIALIAS_ON);
- super.paint(g2);
- }
-
- };
-
-
-
- preview.setBorder(new TitledBorder(Globals.lang("Font Preview")));
-
- updatePreview();
-
- Dimension prefSize = preview.getPreferredSize();
- prefSize.height = 50;
- preview.setPreferredSize(prefSize);
-
- content.add(BorderLayout.CENTER,preview);
-
- JPanel buttons = new JPanel();
- buttons.setLayout(new BoxLayout(buttons,BoxLayout.X_AXIS));
- buttons.setBorder(new EmptyBorder(12,0,0,0));
- buttons.add(Box.createGlue());
-
- ok = new JButton(Globals.lang("OK"));
- ok.addActionListener(new ActionHandler());
- getRootPane().setDefaultButton(ok);
- buttons.add(ok);
-
- buttons.add(Box.createHorizontalStrut(6));
-
- cancel = new JButton(Globals.lang("Cancel"));
- cancel.addActionListener(new ActionHandler());
- buttons.add(cancel);
-
- buttons.add(Box.createGlue());
-
- content.add(BorderLayout.SOUTH,buttons);
-
- pack();
- setLocationRelativeTo(JOptionPane.getFrameForComponent(comp));
- show();
- }
-
- public void ok(){
- isOK = true;
- dispose();
- }
-
- public void cancel(){
- dispose();
- }
-
- public Font getSelectedFont(){
- if(!isOK)
- return null;
-
- int size;
- try{
- size = Integer.parseInt(sizeField.getText());
- }
- catch(Exception e){
- size = 14;
- }
-
- return new Font(familyField.getText(),styleList.getSelectedIndex(),size);
- }
-
- // private members
- private boolean isOK;
- private JTextField familyField;
- private JList familyList;
- private JTextField sizeField;
- private JList sizeList;
- private JTextField styleField;
- private JList styleList;
- private JLabel preview;
- private JButton ok;
- private JButton cancel;
-
- /**
- * For some reason the default Java fonts show up in the
- * list with .bold, .bolditalic, and .italic extensions.
- */
- private static final String[] HIDEFONTS = {".bold",".italic"};
-
- // [pending] from GeneralCustomizer :
- // GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames()
- private String[] getFontList(){
- try{
- Class GEClass = Class.forName("java.awt.GraphicsEnvironment");
- Object GEInstance = GEClass.getMethod("getLocalGraphicsEnvironment", null).invoke(null, null);
-
- String[] nameArray = (String[])GEClass.getMethod("getAvailableFontFamilyNames", null).invoke(GEInstance, null);
- Vector nameVector = new Vector(nameArray.length);
-
- for(int i = 0, j; i < nameArray.length; i++){
- for(j = 0; j < HIDEFONTS.length; j++){
- if(nameArray[i].indexOf(HIDEFONTS[j]) >= 0) break;
- }
-
- if(j == HIDEFONTS.length) nameVector.addElement(nameArray[i]);
- }
-
- String[] _array = new String[nameVector.size()];
- nameVector.copyInto(_array);
- return _array;
- }
- catch(Exception ex){
- return null;//return Toolkit.getDefaultToolkit().getFontList();
- }
- }
-
- private JPanel createTextFieldAndListPanel(String label,JTextField textField, JList list){
- GridBagLayout layout = new GridBagLayout();
- JPanel panel = new JPanel(layout);
-
- GridBagConstraints cons = new GridBagConstraints();
- cons.gridx = cons.gridy = 0;
- cons.gridwidth = cons.gridheight = 1;
- cons.fill = GridBagConstraints.BOTH;
- cons.weightx = 1.0f;
-
- JLabel _label = new JLabel(label);
- layout.setConstraints(_label,cons);
- panel.add(_label);
-
- cons.gridy = 1;
- Component vs = Box.createVerticalStrut(6);
- layout.setConstraints(vs,cons);
- panel.add(vs);
-
- cons.gridy = 2;
- layout.setConstraints(textField,cons);
- panel.add(textField);
-
- cons.gridy = 3;
- vs = Box.createVerticalStrut(6);
- layout.setConstraints(vs,cons);
- panel.add(vs);
-
- cons.gridy = 4;
- cons.gridheight = GridBagConstraints.REMAINDER;
- cons.weighty = 1.0f;
- JScrollPane scroller = new JScrollPane(list);
- layout.setConstraints(scroller,cons);
- panel.add(scroller);
-
- return panel;
- }
-
- private void updatePreview(){
- String family = familyField.getText();
- int size;
- try{
- size = Integer.parseInt(sizeField.getText());
- }
- catch(Exception e){
- size = 14;
- }
- int style = styleList.getSelectedIndex();
- preview.setFont(new Font(family,style,size));
- }
-
- class ActionHandler implements ActionListener {
- public void actionPerformed(ActionEvent evt){
- if(evt.getSource() == ok)ok();
- else if(evt.getSource() == cancel)cancel();
- }
- }
-
- class ListHandler implements ListSelectionListener {
- public void valueChanged(ListSelectionEvent evt)
- {
- Object source = evt.getSource();
- if(source == familyList) {
- String family = (String)familyList.getSelectedValue();
- if(family != null)
- familyField.setText(family);
- }
- else if(source == sizeList) {
- String size = (String)sizeList.getSelectedValue();
- if(size != null)
- sizeField.setText(size);
- }
- else if(source == styleList) {
- String style = (String)styleList.getSelectedValue();
- if(style != null)
- styleField.setText(style);
- }
- updatePreview();
- }
- }
+ JPanel stylePanel = createTextFieldAndListPanel(
+ Globals.lang("Font Style"),
+ styleField = new JTextField(),
+ styleList = new JList(styles));
+ styleField.setEditable(false);
+ listPanel.add(stylePanel);
+
+ familyList.setSelectedValue(font.getFamily(),true);
+ familyField.setText(font.getFamily());
+ sizeList.setSelectedValue(String.valueOf(font.getSize()),true);
+ sizeField.setText(String.valueOf(font.getSize()));
+ styleList.setSelectedIndex(font.getStyle());
+ styleField.setText((String)styleList.getSelectedValue());
+
+ ListHandler listHandler = new ListHandler();
+ familyList.addListSelectionListener(listHandler);
+ sizeList.addListSelectionListener(listHandler);
+ styleList.addListSelectionListener(listHandler);
+
+ content.add(BorderLayout.NORTH,listPanel);
+
+ //preview = new JLabel("Font Preview");
+
+ /* --------------------------------------------------------
+ | Experimental addition by Morten Alver. I want to |
+ | enable antialiasing in the preview field, since I'm |
+ | working on introducing this in the table view. |
+ -------------------------------------------------------- */
+ preview = new JLabel(Globals.lang("Font Preview")) {
+ public void paint(Graphics g) {
+ Graphics2D g2 = (Graphics2D)g;
+ g2.setRenderingHint
+ (RenderingHints.KEY_ANTIALIASING,
+ RenderingHints.VALUE_ANTIALIAS_ON);
+ super.paint(g2);
+ }
+
+ };
+
+
+
+ preview.setBorder(new TitledBorder(Globals.lang("Font Preview")));
+
+ updatePreview();
+
+ Dimension prefSize = preview.getPreferredSize();
+ prefSize.height = 50;
+ preview.setPreferredSize(prefSize);
+
+ content.add(BorderLayout.CENTER,preview);
+
+ JPanel buttons = new JPanel();
+ buttons.setLayout(new BoxLayout(buttons,BoxLayout.X_AXIS));
+ buttons.setBorder(new EmptyBorder(12,0,0,0));
+ buttons.add(Box.createGlue());
+
+ ok = new JButton(Globals.lang("OK"));
+ ok.addActionListener(new ActionHandler());
+ getRootPane().setDefaultButton(ok);
+ buttons.add(ok);
+
+ buttons.add(Box.createHorizontalStrut(6));
+
+ cancel = new JButton(Globals.lang("Cancel"));
+ cancel.addActionListener(new ActionHandler());
+ buttons.add(cancel);
+
+ buttons.add(Box.createGlue());
+
+ content.add(BorderLayout.SOUTH,buttons);
+
+ pack();
+ setLocationRelativeTo(JOptionPane.getFrameForComponent(comp));
+ setVisible(true); // show(); -> deprecated since 1.5
+ }
+
+ public void ok(){
+ isOK = true;
+ dispose();
+ }
+
+ public void cancel(){
+ dispose();
+ }
+
+ public Font getSelectedFont(){
+ if(!isOK)
+ return null;
+
+ int size;
+ try{
+ size = Integer.parseInt(sizeField.getText());
+ }
+ catch(Exception e){
+ size = 14;
+ }
+
+ return new Font(familyField.getText(),styleList.getSelectedIndex(),size);
+ }
+
+ // private members
+ private boolean isOK;
+ private JTextField familyField;
+ private JList familyList;
+ private JTextField sizeField;
+ private JList sizeList;
+ private JTextField styleField;
+ private JList styleList;
+ private JLabel preview;
+ private JButton ok;
+ private JButton cancel;
+
+ /**
+ * For some reason the default Java fonts show up in the
+ * list with .bold, .bolditalic, and .italic extensions.
+ */
+ private static final String[] HIDEFONTS = {".bold",".italic"};
+
+ // [pending] from GeneralCustomizer :
+ // GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames()
+ private String[] getFontList(){
+ try{
+ Class GEClass = Class.forName("java.awt.GraphicsEnvironment");
+ Object GEInstance = GEClass.getMethod("getLocalGraphicsEnvironment", null).invoke(null, null);
+
+ String[] nameArray = (String[])GEClass.getMethod("getAvailableFontFamilyNames", null).invoke(GEInstance, null);
+ Vector nameVector = new Vector(nameArray.length);
+
+ for(int i = 0, j; i < nameArray.length; i++){
+ for(j = 0; j < HIDEFONTS.length; j++){
+ if(nameArray[i].indexOf(HIDEFONTS[j]) >= 0) break;
+ }
+
+ if(j == HIDEFONTS.length) nameVector.addElement(nameArray[i]);
+ }
+
+ String[] _array = new String[nameVector.size()];
+ nameVector.copyInto(_array);
+ return _array;
+ }
+ catch(Exception ex){
+ return null;//return Toolkit.getDefaultToolkit().getFontList();
+ }
+ }
+
+ private JPanel createTextFieldAndListPanel(String label,JTextField textField, JList list){
+ GridBagLayout layout = new GridBagLayout();
+ JPanel panel = new JPanel(layout);
+
+ GridBagConstraints cons = new GridBagConstraints();
+ cons.gridx = cons.gridy = 0;
+ cons.gridwidth = cons.gridheight = 1;
+ cons.fill = GridBagConstraints.BOTH;
+ cons.weightx = 1.0f;
+
+ JLabel _label = new JLabel(label);
+ layout.setConstraints(_label,cons);
+ panel.add(_label);
+
+ cons.gridy = 1;
+ Component vs = Box.createVerticalStrut(6);
+ layout.setConstraints(vs,cons);
+ panel.add(vs);
+
+ cons.gridy = 2;
+ layout.setConstraints(textField,cons);
+ panel.add(textField);
+
+ cons.gridy = 3;
+ vs = Box.createVerticalStrut(6);
+ layout.setConstraints(vs,cons);
+ panel.add(vs);
+
+ cons.gridy = 4;
+ cons.gridheight = GridBagConstraints.REMAINDER;
+ cons.weighty = 1.0f;
+ JScrollPane scroller = new JScrollPane(list);
+ layout.setConstraints(scroller,cons);
+ panel.add(scroller);
+
+ return panel;
+ }
+
+ private void updatePreview(){
+ String family = familyField.getText();
+ int size;
+ try{
+ size = Integer.parseInt(sizeField.getText());
+ }
+ catch(Exception e){
+ size = 14;
+ }
+ int style = styleList.getSelectedIndex();
+ preview.setFont(new Font(family,style,size));
+ }
+
+ class ActionHandler implements ActionListener {
+ public void actionPerformed(ActionEvent evt){
+ if(evt.getSource() == ok)ok();
+ else if(evt.getSource() == cancel)cancel();
+ }
+ }
+
+ class ListHandler implements ListSelectionListener {
+ public void valueChanged(ListSelectionEvent evt)
+ {
+ Object source = evt.getSource();
+ if(source == familyList) {
+ String family = (String)familyList.getSelectedValue();
+ if(family != null)
+ familyField.setText(family);
+ }
+ else if(source == sizeList) {
+ String size = (String)sizeList.getSelectedValue();
+ if(size != null)
+ sizeField.setText(size);
+ }
+ else if(source == styleList) {
+ String style = (String)styleList.getSelectedValue();
+ if(style != null)
+ styleField.setText(style);
+ }
+ updatePreview();
+ }
+ }
/*public static void main(String args[])
- {
- Font font = new FontSelectorDialog(null,new Font("Times",Font.PLAIN,12)).getSelectedFont();
+ {
+ Font font = new FontSelectorDialog(null,new Font("Times",Font.PLAIN,12)).getSelectedFont();
- }
+ }
*/
}
import java.awt.*;
import java.util.*;
-import java.util.List;
+//import java.util.List;
import java.net.URL;
import javax.swing.*;
+import java.io.FileInputStream;
+import java.io.InputStream;
public class GUIGlobals {
TYPE_HEADER = "entrytype",
NUMBER_COL = "#",
encPrefix = "Encoding: ", // Part of the signature in written bib files.
- linuxDefaultLookAndFeel = "com.jgoodies.plaf.plastic.Plastic3DLookAndFeel",
+ linuxDefaultLookAndFeel = "com.jgoodies.looks.plastic.Plastic3DLookAndFeel",
//"com.shfarr.ui.plaf.fh.FhLookAndFeel",
//"net.sourceforge.mlf.metouia.MetouiaLookAndFeel",
//"org.compiere.plaf.CompiereLookAndFeel",
- windowsDefaultLookAndFeel = "com.jgoodies.plaf.windows.ExtWindowsLookAndFeel";
+ windowsDefaultLookAndFeel = "com.jgoodies.looks.windows.WindowsLookAndFeel";
public static Font CURRENTFONT,
typeNameFont,
// further below.
public static JLabel incompleteLabel; // JLabel with icon signaling an incomplete entry.
public static Color activeEditor = new Color(230, 230, 255);
- public static final String[] DEFAULT_INSPECTION_FIELDS = new String[]
- {"author", "title", "year"};
public static JLabel getTableIcon(String fieldType) {
Object o = tableIcons.get(fieldType);
integrityFail = GUIGlobals.class.getResource(pre + "messageFail.png"),
duplicateIcon = GUIGlobals.class.getResource(pre + "duplicate.png"),
emacsIcon = GUIGlobals.class.getResource(pre + "emacs.png");
-
+
public static ImageIcon
- groupRefiningIcon = new ImageIcon(GUIGlobals.class.getResource(pre +"groupRefining.png")),
- groupIncludingIcon = new ImageIcon(GUIGlobals.class.getResource(pre +"groupIncluding.png")),
- groupRegularIcon = null;
+ groupRefiningIcon = new ImageIcon(GUIGlobals.class.getResource(pre +"groupRefining.png")),
+ groupIncludingIcon = new ImageIcon(GUIGlobals.class.getResource(pre +"groupIncluding.png")),
+ groupRegularIcon = null;
/*public static incompleteEntryIcon = new ImageIcon(incompleteIcon);
static {
shortPlainImport="ShortPlainImport.html",
importInspectionHelp = "ImportInspectionDialog.html",
shortIntegrityCheck="ShortIntegrityCheck.html",
+ shortAuxImport="ShortAuxImport.html",
remoteHelp = "RemoteHelp.html",
journalAbbrHelp = "JournalAbbreviations.html";
public static String META_FLAG = "jabref-meta: ";
public static String META_FLAG_OLD = "bibkeeper-meta: ";
public static String ENTRYTYPE_FLAG = "jabref-entrytype: ";
- public static String KEY_FIELD = "bibtexkey";
- public static String[] ALL_FIELDS = new String[] {
- "author",
- "editor",
- "title",
- "year",
- "pages",
- "publisher",
- "journal",
- "volume",
- "month",
- "note",
- "edition",
- "number",
- "chapter",
- "series",
- "type",
- "address",
- "location",
- "annote",
- "booktitle",
- "crossref",
- "howpublished",
- "institution",
- "key",
- "organization",
- "school",
- "abstract",
- "url",
- "citeseerurl",
- "pdf",
- "comment",
- "bibtexkey",
- "keywords",
- "doi",
- "eid",
- "search",
- "citeseercitationcount"
- };
-
- public static final Map FIELD_DISPLAYS;
- static {
- Arrays.sort(ALL_FIELDS);
- FIELD_DISPLAYS = new HashMap();
- FIELD_DISPLAYS.put("citeseercitationcount","Popularity");
- }
-
-// These are the fields that BibTex might want to treat, so these
-// must conform to BibTex rules.
- public static String[] BIBTEX_STANDARD_FIELDS = new String[] {
- "author",
- "editor",
- "title",
- "year",
- "pages",
- "month",
- "note",
- "publisher",
- "journal",
- "volume",
- "edition",
- "number",
- "chapter",
- "series",
- "type",
- "address",
- //? "annote",
- "booktitle",
- "crossref",
- "howpublished",
- "institution",
- "key",
- "organization",
- "school",
- "bibtexkey",
- "doi",
- "eid",
- "date"
- };
-
- // These fields will not be saved to the .bib file.
- public static String[] NON_WRITABLE_FIELDS = new String[] {
- Globals.SEARCH,
- Globals.GROUPSEARCH
- };
-
- // These fields will not be shown inside the source editor panel.
- public static String[] NON_DISPLAYABLE_FIELDS = new String[] {
- Globals.MARKED,
- Globals.SEARCH,
- Globals.GROUPSEARCH
- };
-
- public static boolean isWriteableField(String field) {
- for (int i = 0; i < NON_WRITABLE_FIELDS.length; i++) {
- if (NON_WRITABLE_FIELDS[i].equals(field)) {
- return false;
- }
- }
- return true;
- }
-
- public static boolean isDisplayableField(String field) {
- for (int i = 0; i < NON_DISPLAYABLE_FIELDS.length; i++) {
- if (NON_DISPLAYABLE_FIELDS[i].equals(field)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Returns true if the given field is a standard Bibtex field.
- *
- * @param field a <code>String</code> value
- * @return a <code>boolean</code> value
- */
- public static boolean isStandardField(String field) {
- for (int i = 0; i < BIBTEX_STANDARD_FIELDS.length; i++) {
- if (BIBTEX_STANDARD_FIELDS[i].equals(field)) {
- return true;
- }
- }
- return false;
- }
-
- public static double DEFAULT_FIELD_WEIGHT = 1,
+ // some fieldname constants
+ public static final double
+ DEFAULT_FIELD_WEIGHT = 1,
MAX_FIELD_WEIGHT = 2;
- public static Double
- SMALL_W = new Double(0.30),
- MEDIUM_W = new Double(0.5),
- LARGE_W = new Double(1.5);
+ public static final double
+ SMALL_W = 0.30,
+ MEDIUM_W = 0.5,
+ LARGE_W = 1.5 ;
+
public static final double PE_HEIGHT = 2;
// Size constants for EntryTypeForm; small, medium and large.
- public static int[] FORM_WIDTH = new int[] {
- 500, 650, 820};
- public static int[] FORM_HEIGHT = new int[] {
- 90, 110, 130};
+ public static int[] FORM_WIDTH = new int[] { 500, 650, 820};
+ public static int[] FORM_HEIGHT = new int[] { 90, 110, 130};
// Constants controlling formatted bibtex output.
public static final int
IMPORT_DIALOG_COL_2_WIDTH = 200,
IMPORT_DIALOG_COL_3_WIDTH = 200;
- public static final Map FIELD_WEIGHT;
- public static final Map FIELD_EXTRAS, LANGUAGES;
- public static Map fieldLength = new HashMap();
- static {
+ public static final Map LANGUAGES;
+ static {
LANGUAGES = new HashMap();
// LANGUAGES contains mappings for supported languages.
LANGUAGES.put("English", "en");
LANGUAGES.put("Deutsch", "de");
LANGUAGES.put("Fran\u00E7ais", "fr");
- LANGUAGES.put("Norsk", "no");
-
- FIELD_EXTRAS = new HashMap();
- // fieldExtras contains mappings to tell the EntryEditor to add a specific
- // function to this field, for instance a "browse" button for the "pdf" field.
- FIELD_EXTRAS.put("pdf", "browseDoc");
- FIELD_EXTRAS.put("ps", "browseDocZip");
- FIELD_EXTRAS.put("url", "external");
- FIELD_EXTRAS.put("citeseerurl", "external");
- FIELD_EXTRAS.put("doi", "external");
- FIELD_EXTRAS.put("journal", "journalNames");
- //FIELD_EXTRAS.put("keywords", "selector");
-
-
- fieldLength.put("author", new Integer(280));
- fieldLength.put("editor", new Integer(280));
- fieldLength.put("title", new Integer(400));
- fieldLength.put("abstract", new Integer(400));
- fieldLength.put("booktitle", new Integer(175));
- fieldLength.put("year", new Integer(60));
- fieldLength.put("volume", new Integer(60));
- fieldLength.put("number", new Integer(60));
- fieldLength.put("entrytype", new Integer(75));
- fieldLength.put("search", new Integer(75));
- fieldLength.put("citeseercitationcount", new Integer(75));
- fieldLength.put(NUMBER_COL, new Integer(32));
-
- FIELD_WEIGHT = new HashMap();
- FIELD_WEIGHT.put("author", MEDIUM_W);
- FIELD_WEIGHT.put("year", SMALL_W);
- FIELD_WEIGHT.put("pages", SMALL_W);
- FIELD_WEIGHT.put("month", SMALL_W);
- FIELD_WEIGHT.put("url", SMALL_W);
- FIELD_WEIGHT.put("citeseerurl", SMALL_W);
- FIELD_WEIGHT.put("crossref", SMALL_W);
- FIELD_WEIGHT.put("note", MEDIUM_W);
- FIELD_WEIGHT.put("publisher", MEDIUM_W);
- FIELD_WEIGHT.put("journal", SMALL_W);
- FIELD_WEIGHT.put("volume", SMALL_W);
- FIELD_WEIGHT.put("edition", SMALL_W);
- FIELD_WEIGHT.put("keywords", SMALL_W);
- FIELD_WEIGHT.put("doi", SMALL_W);
- FIELD_WEIGHT.put("eid", SMALL_W);
- FIELD_WEIGHT.put("pdf", SMALL_W);
- FIELD_WEIGHT.put("number", SMALL_W);
- FIELD_WEIGHT.put("chapter", SMALL_W);
- FIELD_WEIGHT.put("editor", MEDIUM_W);
- FIELD_WEIGHT.put("series", SMALL_W);
- FIELD_WEIGHT.put("type", SMALL_W);
- FIELD_WEIGHT.put("address", SMALL_W);
- FIELD_WEIGHT.put("howpublished", MEDIUM_W);
- FIELD_WEIGHT.put("institution", MEDIUM_W);
- FIELD_WEIGHT.put("organization", MEDIUM_W);
- FIELD_WEIGHT.put("school", MEDIUM_W);
- FIELD_WEIGHT.put("comment", MEDIUM_W);
- FIELD_WEIGHT.put("abstract", LARGE_W);
- FIELD_WEIGHT.put("annote", LARGE_W);
- FIELD_WEIGHT.put("citeseercitationcount", SMALL_W);
- FIELD_WEIGHT.put("owner", SMALL_W);
- FIELD_WEIGHT.put("timestamp", SMALL_W);
- //FIELD_WEIGHT = Collections.unmodifiableMap(FIELD_WEIGHT);
- }
-
- /*
- public static int getPreferredFieldLength(String name) {
- int l = DEFAULT_FIELD_LENGTH;
- Object o = fieldLength.get(name.toLowerCase());
- if (o != null)
- l = ((Integer)o).intValue();
- return l;
- }*/
-
- public static double getFieldWeight(String name) {
- double l = DEFAULT_FIELD_WEIGHT;
- Object o = FIELD_WEIGHT.get(name.toLowerCase());
- if (o != null) {
- l = ( (Double) o).doubleValue();
- }
- return l;
- }
+ LANGUAGES.put("Italiano", "it");
+ LANGUAGES.put("Norsk", "no");
- public static void setFieldWeight(String fieldName, double weight) {
- FIELD_WEIGHT.put(fieldName, new Double(weight));
}
/** returns the path to language independent help files */
private JCheckBox autoOpenForm, backup, openLast, showSource,
defSource, editSource, defSort, ctrlClick, disableOnMultiple,
useOwner, keyDuplicateWarningDialog, keyEmptyWarningDialog, autoDoubleBraces,
- confirmDelete, saveInStandardOrder, allowEditing, /*preserveFormatting, */useImportInspector,
+ confirmDelete, allowEditing, /*preserveFormatting, */useImportInspector,
useImportInspectorForSingle, inspectionWarnDupli, useTimeStamp;
+ private JRadioButton
+ saveOriginalOrder, saveAuthorOrder, saveTableOrder;
private JTextField defOwnerField, timeStampFormat, timeStampField,
bracesAroundCapitalsFields, nonWrappableFields;
JabRefPreferences _prefs;
keyDuplicateWarningDialog = new JCheckBox(Globals.lang("Show warning dialog when a duplicate BibTeX key is entered"));
keyEmptyWarningDialog = new JCheckBox(Globals.lang("Show warning dialog when an empty BibTeX key is entered")); // JZTODO lyrics
confirmDelete = new JCheckBox(Globals.lang("Show confirmation dialog when deleting entries"));
- saveInStandardOrder = new JCheckBox(Globals.lang("Always save database ordered by author name"));
+ saveAuthorOrder = new JRadioButton(Globals.lang("Save ordered by author/editor/year"));
+ saveOriginalOrder = new JRadioButton(Globals.lang("Save entries in their original order"));
+ saveTableOrder = new JRadioButton(Globals.lang("Save in default table sort order"));
+ ButtonGroup bg = new ButtonGroup();
+ bg.add(saveAuthorOrder);
+ bg.add(saveOriginalOrder);
+ bg.add(saveTableOrder);
autoDoubleBraces = new JCheckBox(
//+ Globals.lang("Store fields with double braces, and remove extra braces when loading.<BR>"
//+ "Double braces signal that BibTeX should preserve character case.") + "</HTML>");
editSource.setMargin(marg);
defSource.setMargin(marg);
inspectionWarnDupli.setMargin(marg);
- bracesAroundCapitalsFields = new JTextField(30);
- nonWrappableFields = new JTextField(30);
+ bracesAroundCapitalsFields = new JTextField(25);
+ nonWrappableFields = new JTextField(25);
// We need a listener on showSource to enable and disable the source panel-related choices:
showSource.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent event) {
);
FormLayout layout = new FormLayout
- ("1dlu, 8dlu, left:pref, 4dlu, fill:60dlu, 4dlu, fill:pref", // 4dlu, left:pref, 4dlu",
- "");
+ ("8dlu, left:pref, 8dlu, fill:pref, 4dlu, fill:pref", // 4dlu, left:pref, 4dlu",
+ "pref, 6dlu, pref, 6dlu, pref, 6dlu, pref, 6dlu, pref, 6dlu, "
+ +"pref, 6dlu, pref, 6dlu, pref, 6dlu, pref, 6dlu, pref, 6dlu, "
+ +"pref, 6dlu, pref, 6dlu, pref, 6dlu, pref, 6dlu, pref, 6dlu, "
+ +"pref, 6dlu, pref, 6dlu, pref");
DefaultFormBuilder builder = new DefaultFormBuilder(layout);
- JPanel pan = new JPanel();
- builder.appendSeparator(Globals.lang("File"));
- builder.nextLine();
- builder.append(pan);
- builder.append(openLast);
- builder.nextLine();
- builder.append(pan);
- builder.append(backup);
- builder.nextLine();
- builder.append(pan);
- builder.append(saveInStandardOrder);
- builder.nextLine();
- builder.append(pan);
- //builder.append(preserveFormatting);
- //builder.nextLine();
- //builder.append(pan);
- builder.append(autoDoubleBraces);
- builder.nextLine();
+ CellConstraints cc = new CellConstraints();
+ builder.addSeparator(Globals.lang("File"), cc.xyw(1,1, 5));
+ builder.add(openLast, cc.xy(2,3));
+ builder.add(backup, cc.xy(2,5));
+ builder.add(autoDoubleBraces, cc.xy(2, 7));
+ builder.add(saveAuthorOrder, cc.xy(4, 3));
+ builder.add(saveTableOrder, cc.xy(4, 5));
+ builder.add(saveOriginalOrder, cc.xy(4, 7));
JLabel label = new JLabel(Globals.lang("Store the following fields with braces around capital letters")+":");
- DefaultFormBuilder builder3 = new DefaultFormBuilder(new FormLayout("left:pref, 4dlu, fill:pref",""));
- //panel.setLayout
+ DefaultFormBuilder builder3 = new DefaultFormBuilder
+ (new FormLayout("left:pref, 4dlu, fill:pref",""));
builder3.append(label);
builder3.append(bracesAroundCapitalsFields);
- //
- //builder.append(panel);
- //builder.nextLine();
label = new JLabel(Globals.lang("Do not wrap the following fields when saving")+":");
builder3.append(label);
builder3.append(nonWrappableFields);
- builder.append(pan);
- builder.append(builder3.getPanel());
- //builder.append(panel);
- builder.nextLine();
+ builder.add(builder3.getPanel(), cc.xyw(2, 9, 3));
- //builder.appendSeparator(Globals.lang("Miscellaneous"));
- //builder.nextLine();
- builder.appendSeparator(Globals.lang("Entry editor"));
- builder.nextLine();
- builder.append(pan);
- builder.append(autoOpenForm);
- builder.nextLine();
- builder.append(pan);
- builder.append(disableOnMultiple);
- builder.nextLine();
- builder.append(pan);
- builder.append(showSource);
- builder.nextLine();
- builder.append(pan);
- builder.append(defSource);
- builder.nextLine();
- builder.appendSeparator(Globals.lang("Miscellaneous"));
- builder.append(pan);
- builder.append(useImportInspector);
- builder.nextLine();
- builder.append(pan);
- builder.append(useImportInspector);
- builder.nextLine();
- builder.append(pan);
- builder.append(useImportInspectorForSingle);
- builder.nextLine();
- builder.append(pan);
- builder.append(inspectionWarnDupli);
- builder.nextLine();
- builder.append(pan);
- builder.append(ctrlClick);
- builder.nextLine();
- builder.append(pan);
- builder.append(confirmDelete);
- builder.nextLine();
- builder.append(pan);
- builder.append(keyDuplicateWarningDialog);
- builder.nextLine();
- builder.append(pan);
- builder.append(keyEmptyWarningDialog);
- builder.nextLine();
+ builder.addSeparator(Globals.lang("Entry editor"), cc.xyw(1, 11, 5));
+ builder.add(autoOpenForm, cc.xy(2, 13));
+ builder.add(disableOnMultiple, cc.xy(2, 15));
+ builder.add(showSource, cc.xy(2, 17));
+ builder.add(defSource, cc.xy(2, 19));
+ builder.addSeparator(Globals.lang("Miscellaneous"), cc.xyw(1, 21, 5));
+ builder.add(useImportInspector, cc.xy(2, 23));
+ builder.add(useImportInspectorForSingle, cc.xy(4, 23));
+ builder.add(inspectionWarnDupli, cc.xy(4, 25));
+ builder.add(ctrlClick, cc.xy(2, 27));
+ builder.add(confirmDelete, cc.xy(2, 29));
+ builder.add(keyDuplicateWarningDialog, cc.xy(2, 31));
+ builder.add(keyEmptyWarningDialog, cc.xy(2, 33));
// Create a new panel with its own FormLayout for the last items:
FormLayout layout2 = new FormLayout
("left:pref, 8dlu, fill:60dlu, 4dlu, left:pref, 4dlu, fill:60dlu, 4dlu, fill:pref", "");
lab = new JLabel(Globals.lang("Default encoding") + ":");
builder2.append(lab);
builder2.append(encodings);
- builder.append(pan);
- builder.append(builder2.getPanel());
- builder.nextLine();
- //builder.appendSeparator();
- pan = builder.getPanel();
+ builder.add(builder2.getPanel(), cc.xyw(2, 35, 3));
+
+
+ JPanel pan = builder.getPanel();
pan.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
add(pan, BorderLayout.CENTER);
keyDuplicateWarningDialog.setSelected(_prefs.getBoolean("dialogWarningForDuplicateKey"));
keyEmptyWarningDialog.setSelected(_prefs.getBoolean("dialogWarningForEmptyKey"));
confirmDelete.setSelected(_prefs.getBoolean("confirmDelete"));
- saveInStandardOrder.setSelected(_prefs.getBoolean("saveInStandardOrder"));
+ if (_prefs.getBoolean("saveInStandardOrder"))
+ saveAuthorOrder.setSelected(true);
+ else if (_prefs.getBoolean("saveInOriginalOrder"))
+ saveOriginalOrder.setSelected(true);
+ else
+ saveTableOrder.setSelected(true);
//preserveFormatting.setSelected(_prefs.getBoolean("preserveFieldFormatting"));
autoDoubleBraces.setSelected(_prefs.getBoolean("autoDoubleBraces"));
defOwnerField.setText(_prefs.get("defaultOwner"));
_prefs.putBoolean("dialogWarningForDuplicateKey", keyDuplicateWarningDialog.isSelected());
_prefs.putBoolean("dialogWarningForEmptyKey", keyEmptyWarningDialog.isSelected());
_prefs.putBoolean("confirmDelete", confirmDelete.isSelected());
- _prefs.putBoolean("saveInStandardOrder", saveInStandardOrder.isSelected());
+ _prefs.putBoolean("saveInStandardOrder", saveAuthorOrder.isSelected());
+ _prefs.putBoolean("saveInOriginalOrder", saveOriginalOrder.isSelected());
_prefs.putBoolean("allowTableEditing", allowEditing.isSelected());
_prefs.putBoolean("ctrlClick", ctrlClick.isSelected());
//_prefs.putBoolean("preserveFieldFormatting", preserveFormatting.isSelected());
package net.sf.jabref;
import java.io.* ;
+import java.nio.charset.Charset;
import java.util.* ;
+import java.util.List;
import java.util.logging.* ;
import java.util.logging.Filter ;
import java.awt.* ;
+import java.nio.charset.Charset;
import javax.swing.* ;
import net.sf.jabref.collab.* ;
menuResourcePrefix = "resource/Menu",
integrityResourcePrefix = "resource/IntegrityMessage";
private static final String buildInfos = "/resource/build.properties" ;
+ public static final String additionalFields = "/resource/fields/fields.xml" ; // some extra field definitions
private static String logfile = "jabref.log";
public static ResourceBundle messages, menuTitles, intMessages ;
public static FileUpdateMonitor fileUpdateMonitor = new FileUpdateMonitor();
public static ImportFormatReader importFormatReader = new ImportFormatReader();
-
+ public static ErrorConsole errorConsole;
public static String VERSION,
BUILD,
VERSION = bi.getBUILD_VERSION() ;
BUILD = bi.getBUILD_NUMBER() ;
BUILD_DATE = bi.getBUILD_DATE() ;
+
+ // TODO: Error console initialization here. When should it be used?
+ errorConsole = ErrorConsole.getInstance();
}
FORMATTER_PACKAGE = "net.sf.jabref.export.layout.format.";
public static float duplicateThreshold = 0.75f;
private static Handler consoleHandler = new java.util.logging.ConsoleHandler();
- public static String[] ENCODINGS = new String[] {"ISO8859_1", "UTF8", "UTF-16", "ASCII",
- "Cp1250", "Cp1251", "Cp1252", "Cp1253", "Cp1254", "Cp1257",
- "JIS", "SJIS", "EUC-JP", // Added Japanese encodings.
- "Big5", "Big5_HKSCS", "GBK",
- "ISO8859_2", "ISO8859_3", "ISO8859_4", "ISO8859_5", "ISO8859_6",
- "ISO8859_7", "ISO8859_8", "ISO8859_9", "ISO8859_13", "ISO8859_15"};
+ public static String[] ENCODINGS,
+ ALL_ENCODINGS = //(String[]) Charset.availableCharsets().keySet().toArray(new String[]{});
+ new String[] {"ISO8859_1", "UTF8", "UTF-16", "ASCII",
+ "Cp1250", "Cp1251", "Cp1252", "Cp1253", "Cp1254", "Cp1257",
+ "JIS", "SJIS", "EUC-JP", // Added Japanese encodings.
+ "Big5", "Big5_HKSCS", "GBK",
+ "ISO8859_2", "ISO8859_3", "ISO8859_4", "ISO8859_5", "ISO8859_6",
+ "ISO8859_7", "ISO8859_8", "ISO8859_9", "ISO8859_13", "ISO8859_15"};
// String array that maps from month number to month string label:
public static String[] MONTHS = new String[] {"jan", "feb", "mar", "apr", "may", "jun",
MONTH_STRINGS.put("oct", "October");
MONTH_STRINGS.put("nov", "November");
MONTH_STRINGS.put("dec", "December");
+
+ // Build list of encodings, by filtering out all that are not supported
+ // on this system:
+ List encodings = new ArrayList();
+ for (int i=0; i<ALL_ENCODINGS.length; i++) {
+ if (Charset.isSupported(ALL_ENCODINGS[i]))
+ encodings.add(ALL_ENCODINGS[i]);
+ }
+ ENCODINGS = (String[])encodings.toArray(new String[0]);
+
}
});
}
- /**
- * String constants.
- */
- public static final String
- KEY_FIELD = "bibtexkey",
- SEARCH = "__search",
- GROUPSEARCH = "__groupsearch",
- MARKED = "__markedentry",
- OWNER = "owner",
- // Using this when I have no database open when I read
- // non bibtex file formats (used byte ImportFormatReader.java
- DEFAULT_BIBTEXENTRY_ID = "__ID";
-
public static void setLanguage(String language, String country) {
locale = new Locale(language, country);
messages = ResourceBundle.getBundle(resourcePrefix, locale);
}
- public static JournalAbbreviations journalAbbrev;
+ public static JournalAbbreviations journalAbbrev;
public static String lang(String key, String[] params) {
updateWorkingDirectory, false);
}
-
+
public static String getNewFile(JFrame owner, JabRefPreferences prefs,
File directory, String extension,
String description,
updateWorkingDirectory, false);
}
-
+
public static String getNewFile(JFrame owner, JabRefPreferences prefs,
File directory, String extension, OpenFileFilter off,
int dialogType,
}
private static String getNewFile(JFrame owner, JabRefPreferences prefs,
- File directory, String extension,
+ File directory, String extension,
String description,
OpenFileFilter off,
int dialogType,
fc.setMode(FileDialog.SAVE);
}
- fc.show();
+ fc.setVisible(true); // fc.show(); -> deprecated since 1.5
if (fc.getFile() != null) {
Globals.prefs.put("workingDirectory", fc.getDirectory() + fc.getFile());
public static HashMap HTML_CHARS = new HashMap(),
HTMLCHARS = new HashMap(),
XML_CHARS = new HashMap(),
+ ASCII2XML_CHARS = new HashMap(),
UNICODE_CHARS = new HashMap(),
- RTFCHARS = new HashMap();
+ RTFCHARS = new HashMap(),
+ URL_CHARS = new HashMap();
static {
-
+
//System.out.println(journalAbbrev.getAbbreviatedName("Journal of Fish Biology", true));
//System.out.println(journalAbbrev.getAbbreviatedName("Journal of Fish Biology", false));
//System.out.println(journalAbbrev.getFullName("Aquaculture Eng."));
} catch (Throwable t) {
}
- /*
- HTML_CHARS.put("\\{\\\\\\\"\\{a\\}\\}", "ä");
- HTML_CHARS.put("\\{\\\\\\\"\\{A\\}\\}", "Ä");
- HTML_CHARS.put("\\{\\\\\\\"\\{e\\}\\}", "ë");
- HTML_CHARS.put("\\{\\\\\\\"\\{E\\}\\}", "Ë");
- HTML_CHARS.put("\\{\\\\\\\"\\{i\\}\\}", "ï");
- HTML_CHARS.put("\\{\\\\\\\"\\{I\\}\\}", "Ï");
- HTML_CHARS.put("\\{\\\\\\\"\\{o\\}\\}", "ö");
- HTML_CHARS.put("\\{\\\\\\\"\\{O\\}\\}", "Ö");
- HTML_CHARS.put("\\{\\\\\\\"\\{u\\}\\}", "ü");
- HTML_CHARS.put("\\{\\\\\\\"\\{U\\}\\}", "Ü");
-
- HTML_CHARS.put("\\{\\\\\\`\\{e\\}\\}", "è");
- HTML_CHARS.put("\\{\\\\\\`\\{E\\}\\}", "È");
- HTML_CHARS.put("\\{\\\\\\`\\{i\\}\\}", "ì");
- HTML_CHARS.put("\\{\\\\\\`\\{I\\}\\}", "Ì");
- HTML_CHARS.put("\\{\\\\\\`\\{o\\}\\}", "ò");
- HTML_CHARS.put("\\{\\\\\\`\\{O\\}\\}", "Ò");
- HTML_CHARS.put("\\{\\\\\\`\\{u\\}\\}", "ù");
- HTML_CHARS.put("\\{\\\\\\`\\{U\\}\\}", "Ù");
-
- HTML_CHARS.put("\\{\\\\\\'\\{e\\}\\}", "é");
- HTML_CHARS.put("\\{\\\\\\'\\{E\\}\\}", "É");
- HTML_CHARS.put("\\{\\\\\\'\\{i\\}\\}", "í");
- HTML_CHARS.put("\\{\\\\\\'\\{I\\}\\}", "Í");
- HTML_CHARS.put("\\{\\\\\\'\\{o\\}\\}", "ó");
- HTML_CHARS.put("\\{\\\\\\'\\{O\\}\\}", "Ó");
- HTML_CHARS.put("\\{\\\\\\'\\{u\\}\\}", "ú");
- HTML_CHARS.put("\\{\\\\\\'\\{U\\}\\}", "Ú");
- HTML_CHARS.put("\\{\\\\\\'\\{a\\}\\}", "á");
- HTML_CHARS.put("\\{\\\\\\'\\{A\\}\\}", "Á");
- HTML_CHARS.put("\\{\\\\\\^\\{o\\}\\}", "ô");
- HTML_CHARS.put("\\{\\\\\\^\\{O\\}\\}", "Ô");
- HTML_CHARS.put("\\{\\\\\\^\\{u\\}\\}", "û");
- HTML_CHARS.put("\\{\\\\\\^\\{U\\}\\}", "Û");
- HTML_CHARS.put("\\{\\\\\\^\\{e\\}\\}", "ê");
- HTML_CHARS.put("\\{\\\\\\^\\{E\\}\\}", "Ê");
- HTML_CHARS.put("\\{\\\\\\^\\{i\\}\\}", "î");
- HTML_CHARS.put("\\{\\\\\\^\\{I\\}\\}", "Î");
- HTML_CHARS.put("\\{\\\\\\~\\{o\\}\\}", "õ");
- HTML_CHARS.put("\\{\\\\\\~\\{O\\}\\}", "Õ");
- HTML_CHARS.put("\\{\\\\\\~\\{n\\}\\}", "ñ");
- HTML_CHARS.put("\\{\\\\\\~\\{N\\}\\}", "Ñ");
- HTML_CHARS.put("\\{\\\\\\~\\{a\\}\\}", "ã");
- HTML_CHARS.put("\\{\\\\\\~\\{A\\}\\}", "Ã");
- */
+
+ // Special characters in URLs need to be replaced to ensure that the URL
+ // opens properly on all platforms:
+ URL_CHARS.put("<", "%3c");
+ URL_CHARS.put(">", "%3e");
+ URL_CHARS.put("(", "%28");
+ URL_CHARS.put(")", "%29");
+ URL_CHARS.put(" ", "%20");
+ URL_CHARS.put("&", "%26");
+ URL_CHARS.put("$", "%24");
+
+
HTMLCHARS.put("\"a", "ä");
HTMLCHARS.put("\"A", "Ä");
HTMLCHARS.put("'U", "Ú");
HTMLCHARS.put("'a", "á");
HTMLCHARS.put("'A", "Á");
+ HTMLCHARS.put("^a", "ô");
+ HTMLCHARS.put("^A", "Ô");
HTMLCHARS.put("^o", "ô");
HTMLCHARS.put("^O", "Ô");
HTMLCHARS.put("^u", "û");
HTMLCHARS.put("~A", "Ã");
HTMLCHARS.put("cc", "ç");
HTMLCHARS.put("cC", "Ç");
- /*
- HTML_CHARS.put("\\{\\\\\\\"a\\}", "ä");
- HTML_CHARS.put("\\{\\\\\\\"A\\}", "Ä");
- HTML_CHARS.put("\\{\\\\\\\"e\\}", "ë");
- HTML_CHARS.put("\\{\\\\\\\"E\\}", "Ë");
- HTML_CHARS.put("\\{\\\\\\\"i\\}", "ï");
- HTML_CHARS.put("\\{\\\\\\\"I\\}", "Ï");
- HTML_CHARS.put("\\{\\\\\\\"o\\}", "ö");
- HTML_CHARS.put("\\{\\\\\\\"O\\}", "Ö");
- HTML_CHARS.put("\\{\\\\\\\"u\\}", "ü");
- HTML_CHARS.put("\\{\\\\\\\"U\\}", "Ü");
-
- HTML_CHARS.put("\\{\\\\\\`e\\}", "è");
- HTML_CHARS.put("\\{\\\\\\`E\\}", "È");
- HTML_CHARS.put("\\{\\\\\\`i\\}", "ì");
- HTML_CHARS.put("\\{\\\\\\`I\\}", "Ì");
- HTML_CHARS.put("\\{\\\\\\`o\\}", "ò");
- HTML_CHARS.put("\\{\\\\\\`O\\}", "Ò");
- HTML_CHARS.put("\\{\\\\\\`u\\}", "ù");
- HTML_CHARS.put("\\{\\\\\\`U\\}", "Ù");
- HTML_CHARS.put("\\{\\\\\\'A\\}", "é");
- HTML_CHARS.put("\\{\\\\\\'E\\}", "É");
- HTML_CHARS.put("\\{\\\\\\'i\\}", "í");
- HTML_CHARS.put("\\{\\\\\\'I\\}", "Í");
- HTML_CHARS.put("\\{\\\\\\'o\\}", "ó");
- HTML_CHARS.put("\\{\\\\\\'O\\}", "Ó");
- HTML_CHARS.put("\\{\\\\\\'u\\}", "ú");
- HTML_CHARS.put("\\{\\\\\\'U\\}", "Ú");
- HTML_CHARS.put("\\{\\\\\\'a\\}", "á");
- HTML_CHARS.put("\\{\\\\\\'A\\}", "Á");
-
- HTML_CHARS.put("\\{\\\\\\^o\\}", "ô");
- HTML_CHARS.put("\\{\\\\\\^O\\}", "Ô");
- HTML_CHARS.put("\\{\\\\\\^u\\}", "û");
- HTML_CHARS.put("\\{\\\\\\^U\\}", "Û");
- HTML_CHARS.put("\\{\\\\\\^e\\}", "ê");
- HTML_CHARS.put("\\{\\\\\\^E\\}", "Ê");
- HTML_CHARS.put("\\{\\\\\\^i\\}", "î");
- HTML_CHARS.put("\\{\\\\\\^I\\}", "Î");
- HTML_CHARS.put("\\{\\\\\\~o\\}", "õ");
- HTML_CHARS.put("\\{\\\\\\~O\\}", "Õ");
- HTML_CHARS.put("\\{\\\\\\~n\\}", "ñ");
- HTML_CHARS.put("\\{\\\\\\~N\\}", "Ñ");
- HTML_CHARS.put("\\{\\\\\\~a\\}", "ã");
- HTML_CHARS.put("\\{\\\\\\~A\\}", "Ã");
-
- HTML_CHARS.put("\\{\\\\c c\\}", "ç");
- HTML_CHARS.put("\\{\\\\c C\\}", "Ç");
- */
XML_CHARS.put("\\{\\\\\\\"\\{a\\}\\}", "ä");
XML_CHARS.put("\\{\\\\\\\"\\{A\\}\\}", "Ä");
XML_CHARS.put("\\{\\\\\\'a\\}", "á");
XML_CHARS.put("\\{\\\\\\'A\\}", "Á");
+ XML_CHARS.put("\\{\\\\\\^a\\}", "ô");
+ XML_CHARS.put("\\{\\\\\\^A\\}", "Ô");
XML_CHARS.put("\\{\\\\\\^o\\}", "ô");
XML_CHARS.put("\\{\\\\\\^O\\}", "Ô");
XML_CHARS.put("\\{\\\\\\^u\\}", "ù");
XML_CHARS.put("\\{\\\\\\~a\\}", "ã");
XML_CHARS.put("\\{\\\\\\~A\\}", "Ã");
+ ASCII2XML_CHARS.put("<", "<");
+ ASCII2XML_CHARS.put("\"", """);
+ ASCII2XML_CHARS.put(">", ">");
+
+
UNICODE_CHARS.put("\u00C0", "A");
UNICODE_CHARS.put("\u00C1", "A");
UNICODE_CHARS.put("\u00C2", "A");
--- /dev/null
+package net.sf.jabref;
+
+import java.util.Comparator;
+
+/**
+ * Comparator for sorting BibtexEntry objects based on their ID. This
+ * can be used to sort entries back into the order they were created,
+ * provided the IDs given to entries are lexically monotonically increasing.
+ */
+public class IdComparator implements Comparator {
+
+ public int compare(Object o1, Object o2) {
+ BibtexEntry one = (BibtexEntry)o1,
+ two = (BibtexEntry)o2;
+ return one.getId().compareTo(two.getId());
+ }
+}
}
public boolean search(String pattern, BibtexEntry bibtexEntry) {
- hitInField = null;
- //if (!prefs.getBoolean("caseSensitiveSearch"))
- // flags = Pattern.CASE_INSENSITIVE;
- //Pattern pattern = Pattern.compile(searchString, flags);
+ hitInField = null;
+ //if (!prefs.getBoolean("caseSensitiveSearch"))
+ // flags = Pattern.CASE_INSENSITIVE;
+ //Pattern pattern = Pattern.compile(searchString, flags);
- if (prefs.getBoolean("searchAll")) {
Object[] fields = bibtexEntry.getAllFields();
return searchFields(fields, bibtexEntry, pattern);
- } else {
- if (prefs.getBoolean("searchReq")) {
- String[] requiredField = bibtexEntry.getRequiredFields() ;
- if (searchFields(requiredField, bibtexEntry, pattern))
- return true;
- }
- if (prefs.getBoolean("searchOpt")) {
- String[] optionalField = bibtexEntry.getOptionalFields() ;
- if (searchFields(optionalField, bibtexEntry, pattern))
- return true;
- }
- if (prefs.getBoolean("searchGen")) {
- String[] generalField = bibtexEntry.getGeneralFields() ;
- if (searchFields(generalField, bibtexEntry, pattern))
- return true;
- }
- }
- return false;
}
protected boolean searchFields(Object[] fields, BibtexEntry bibtexEntry,
*/
package net.sf.jabref;
-import com.jgoodies.plaf.FontSizeHints;
import net.sf.jabref.export.*;
import net.sf.jabref.imports.*;
import net.sf.jabref.wizard.auximport.*;
import javax.swing.*;
-import com.jgoodies.plaf.plastic.Plastic3DLookAndFeel;
-import com.jgoodies.plaf.windows.ExtWindowsLookAndFeel;
-
-
-
+import com.jgoodies.looks.plastic.Plastic3DLookAndFeel;
+import com.jgoodies.looks.windows.WindowsLookAndFeel;
+import com.jgoodies.looks.FontPolicy;
//import javax.swing.UIManager;
//import javax.swing.UIDefaults;
public JabRef(String[] args) {
- /*
- String aut = "{Bill and Bob Alver}, Jr., Morten Omholt and Alfredsen, Jo A. and Øie, G. and Yngvar von Olsen";
- System.out.println("lastnameFirst: "+ImportFormatReader.fixAuthor_lastNameFirst(aut));
- System.out.println("lastnameFirstCommas: "+ImportFormatReader.fixAuthor_lastNameFirstCommas(aut,false));
- System.out.println("lastnameFirstCommas (abbr): "+ImportFormatReader.fixAuthor_lastNameFirstCommas(aut,true));
- System.out.println("firstNameFirst: "+ImportFormatReader.fixAuthor_firstNameFirst(aut));
- System.out.println("firstNameFirstCommas: "+ImportFormatReader.fixAuthor_firstNameFirstCommas(aut, false));
- System.out.println("forAlphabetization: "+ImportFormatReader.fixAuthorForAlphabetization(aut));
- */
+
ths = this;
JabRefPreferences prefs = JabRefPreferences.getInstance();
Globals.prefs = prefs;
// To specify export formats, we need to take the custom export formats
// into account.
// So we iterate through the custom formats and add them.
- String outFormats = ": bibtexml, docbook, html, simplehtml";
+ String outFormats = ": bibtexml, docbook, endnote, harvard, html, mods, ods, oocalc, simplehtml";
int length = outFormats.length();
for (int i = 0; i < Globals.prefs.customExports.size(); i++) {
Vector toImport = new Vector();
if (!blank.isInvoked() && (leftOver.length > 0)) {
for (int i = 0; i < leftOver.length; i++) {
- // Leftover arguments are interpreted as bib files to open.
-
- ParserResult pr = openBibFile(leftOver[i]);
-
- if (pr != null) {
- if (pr == ParserResult.INVALID_FORMAT)
- // We will try to import this file instead:
+ // Leftover arguments that have a "bib" extension are interpreted as
+ // bib files to open. Other files, and files that could not be opened
+ // as bib, we try to import instead.
+ boolean bibExtension = leftOver[i].toLowerCase().endsWith("bib");
+ ParserResult pr = null;
+ if (bibExtension)
+ pr = openBibFile(leftOver[i]);
+
+ if ((pr == null) || (pr == ParserResult.INVALID_FORMAT)) {
+ // We will try to import this file. Normally we
+ // will import it into a new tab, but if this import has
+ // been initiated by another instance through the remote
+ // listener, we will instead import it into the current database.
+ // This will enable easy integration with web browers that can
+ // open a reference file in JabRef.
+ if (initialStartup) {
toImport.add(leftOver[i]);
- else
- loaded.add(pr);
- } else {
-
+ } else {
+ ParserResult res = importToOpenBase(leftOver[i]);
+ if (res != null)
+ loaded.add(res);
+ }
}
+ else
+ loaded.add(pr);
+
}
}
toImport.add(importFile.getStringValue());
}
- if (toImport.size() > 0) for (int i=0; i<toImport.size(); i++) {
- String[] data = ((String)toImport.elementAt(i)).split(",");
+ if (toImport.size() > 0) for (int i = 0; i < toImport.size(); i++) {
+ String[] data = ((String) toImport.elementAt(i)).split(",");
- /*if (data.length == 1) {
- // Load a bibtex file:
- ParserResult pr = openBibFile(data[0]);
+ try {
- if (pr != null)
+ if ((data.length > 1) && !"*".equals(data[1])) {
+ System.out.println(Globals.lang("Importing") + ": " + data[0]);
+ List entries =
+ Globals.importFormatReader.importFromFile(data[1],
+ data[0].replaceAll("~", System.getProperty("user.home")));
+ BibtexDatabase base = ImportFormatReader.createDatabase(entries);
+ ParserResult pr = new ParserResult(base, null, new HashMap());
loaded.add(pr);
- } else if (data.length == 2) {*/
- // Import a database in a certain format.
- try {
- if ((data.length > 1) && !"*".equals(data[1])) {
- System.out.println(Globals.lang("Importing") + ": " + data[0]);
- List entries =
- Globals.importFormatReader.importFromFile(data[1],
- data[0].replaceAll("~", System.getProperty("user.home")));
- BibtexDatabase base = ImportFormatReader.createDatabase(entries);
- ParserResult pr = new ParserResult(base, null, new HashMap());
- loaded.add(pr);
-
- } else {
- // * means "guess the format":
- System.out.println(Globals.lang("Importing in unknown format")
+ } else {
+ // * means "guess the format":
+ System.out.println(Globals.lang("Importing in unknown format")
+ ": " + data[0]);
- Object[] o =
+ Object[] o =
Globals.importFormatReader.importUnknownFormat(data[0]
- .replaceAll("~", System.getProperty("user.home")));
- String formatName = (String) o[0];
-
- if (formatName == null) {
- System.err.println(Globals.lang("Error opening file")+" '"+data[0]+"'");
- }
- else if (formatName.equals(ImportFormatReader.BIBTEX_FORMAT)) {
- ParserResult pr = (ParserResult)o[1];
- loaded.add(pr);
-
- }
- else {
- List entries = (java.util.List) o[1];
- if (entries != null)
- System.out.println(Globals.lang("Format used") + ": "
- + formatName);
- else
- System.out.println(Globals.lang(
- "Could not find a suitable import format."));
-
- if (entries != null) {
- &n