Load /tmp/tmp.cssmc10846/jabref-2.0.1+2.1b into upstream/2.0.1+2.1b
authorgregor herrmann <gregoa@debian.org>
Sat, 20 May 2006 15:03:40 +0000 (15:03 -0000)
committergregor herrmann <gregoa@debian.org>
Sat, 20 May 2006 15:03:40 +0000 (15:03 -0000)
debian/jabref/branches/upstream/current.

170 files changed:
build.number
build.xml
lib/.cvsignore [new file with mode: 0644]
lib/looks-1.2.2.jar [deleted file]
lib/looks-2.0.1.jar [new file with mode: 0644]
lib/microba.jar [new file with mode: 0644]
lib/spin-1.4.jar [new file with mode: 0644]
lib/spin.jar [deleted file]
src/extensions/API/overview.html [new file with mode: 0644]
src/extensions/SimpleCsvImporter.csv [new file with mode: 0644]
src/extensions/SimpleCsvImporter.java [new file with mode: 0644]
src/extensions/compileAll.bat [new file with mode: 0644]
src/extensions/compileAll.sh [new file with mode: 0644]
src/extensions/readme.html [new file with mode: 0644]
src/help/About.html
src/help/BibtexHelp.html
src/help/CustomImports.html
src/help/IEEEXplorerHelp.html [new file with mode: 0644]
src/help/ShortAuxImport.html [new file with mode: 0644]
src/help/credits.txt
src/help/de/About.html
src/help/de/JabRef-UserManual_de.tex
src/help/de/OpenOfficeHelp.html
src/help/de/ShortAuxImport.html [new file with mode: 0644]
src/help/fr/About.html
src/help/fr/CustomImports.html
src/help/fr/LabelPatterns.html
src/images/font/ACTIVA.TTF [new file with mode: 0644]
src/images/font/ASTROLYT.TTF [new file with mode: 0644]
src/images/font/AUGIE.TTF [new file with mode: 0644]
src/images/groupIncluding.png
src/images/jabref-2.0-splash.png [deleted file]
src/images/splash-2.1beta.png [new file with mode: 0644]
src/images/splash.svg [new file with mode: 0644]
src/java/com/jgoodies/uif_lite/panel/SimpleInternalFrame.java
src/java/net/sf/jabref/AppearancePrefsTab.java
src/java/net/sf/jabref/AuthorList.java
src/java/net/sf/jabref/BasePanel.java
src/java/net/sf/jabref/BibtexDatabase.java
src/java/net/sf/jabref/BibtexEntry.java
src/java/net/sf/jabref/BibtexFields.java [new file with mode: 0644]
src/java/net/sf/jabref/BrowseAction.java [new file with mode: 0644]
src/java/net/sf/jabref/DuplicateResolverDialog.java
src/java/net/sf/jabref/DuplicateSearch.java
src/java/net/sf/jabref/EntryEditor.java
src/java/net/sf/jabref/EntryEditorTab.java
src/java/net/sf/jabref/EntryEditorTabList.java
src/java/net/sf/jabref/EntryTable.java
src/java/net/sf/jabref/EntryTableModel.java
src/java/net/sf/jabref/ExternalTab.java
src/java/net/sf/jabref/FieldComparator.java
src/java/net/sf/jabref/FieldContentSelector.java
src/java/net/sf/jabref/FontSelectorDialog.java
src/java/net/sf/jabref/GUIGlobals.java
src/java/net/sf/jabref/GeneralTab.java
src/java/net/sf/jabref/Globals.java
src/java/net/sf/jabref/IdComparator.java [new file with mode: 0644]
src/java/net/sf/jabref/IncrementalSearcher.java
src/java/net/sf/jabref/JabRef.java
src/java/net/sf/jabref/JabRefFrame.java
src/java/net/sf/jabref/JabRefPreferences.java
src/java/net/sf/jabref/MetaData.java
src/java/net/sf/jabref/PreviewPanel.java
src/java/net/sf/jabref/PreviewPrefsTab.java
src/java/net/sf/jabref/ReplaceStringDialog.java
src/java/net/sf/jabref/RightClickMenu.java
src/java/net/sf/jabref/SearchManager2.java
src/java/net/sf/jabref/SplashScreen.java
src/java/net/sf/jabref/SplashScreen.java~ [new file with mode: 0644]
src/java/net/sf/jabref/TabLabelPattern.java
src/java/net/sf/jabref/TableColumnsTab.java
src/java/net/sf/jabref/TablePrefsTab.java
src/java/net/sf/jabref/UrlDragDrop.java
src/java/net/sf/jabref/Util.java
src/java/net/sf/jabref/collab/ChangeScanner.java
src/java/net/sf/jabref/collab/EntryAddChange.java
src/java/net/sf/jabref/collab/EntryDeleteChange.java
src/java/net/sf/jabref/export/ExportCustomizationDialog.java
src/java/net/sf/jabref/export/FileActions.java
src/java/net/sf/jabref/export/LatexFieldFormatter.java
src/java/net/sf/jabref/export/OOCalcDatabase.java
src/java/net/sf/jabref/export/OpenDocumentRepresentation.java
src/java/net/sf/jabref/export/SaveSession.java
src/java/net/sf/jabref/export/layout/Layout.java
src/java/net/sf/jabref/export/layout/LayoutEntry.java
src/java/net/sf/jabref/export/layout/LayoutHelper.java
src/java/net/sf/jabref/export/layout/format/XMLChars.java
src/java/net/sf/jabref/external/AutoSetExternalFileForEntries.java
src/java/net/sf/jabref/external/ExternalFileMenuItem.java [new file with mode: 0644]
src/java/net/sf/jabref/external/ExternalFilePanel.java
src/java/net/sf/jabref/external/ExternalFileType.java [new file with mode: 0644]
src/java/net/sf/jabref/external/PushToApplication.java [new file with mode: 0644]
src/java/net/sf/jabref/external/PushToApplicationAction.java [new file with mode: 0644]
src/java/net/sf/jabref/external/PushToEmacs.java
src/java/net/sf/jabref/external/PushToLatexEditor.java [new file with mode: 0644]
src/java/net/sf/jabref/external/PushToLyx.java
src/java/net/sf/jabref/external/PushToWinEdt.java [new file with mode: 0644]
src/java/net/sf/jabref/groups/GroupDialog.java
src/java/net/sf/jabref/groups/GroupSelector.java
src/java/net/sf/jabref/gui/AttachFileDialog.java
src/java/net/sf/jabref/gui/DatabasePropertiesDialog.java
src/java/net/sf/jabref/gui/EntryCustomizationDialog2.java
src/java/net/sf/jabref/gui/FieldWeightDialog.java
src/java/net/sf/jabref/gui/FirstColumnComparator.java
src/java/net/sf/jabref/gui/GenFieldsCustomizer.java
src/java/net/sf/jabref/gui/GlazedEntrySorter.java
src/java/net/sf/jabref/gui/ImportInspectionDialog.java
src/java/net/sf/jabref/gui/IsMarkedComparator.java [new file with mode: 0644]
src/java/net/sf/jabref/gui/MainTable.java
src/java/net/sf/jabref/gui/MainTableFormat.java
src/java/net/sf/jabref/gui/MainTableSelectionListener. [deleted file]
src/java/net/sf/jabref/gui/MainTableSelectionListener.java
src/java/net/sf/jabref/gui/SortTabsAction.java [new file with mode: 0644]
src/java/net/sf/jabref/gui/date/DatePickerButton.java [new file with mode: 0644]
src/java/net/sf/jabref/imports/BibTeXMLHandler.java
src/java/net/sf/jabref/imports/BiblioscapeImporter.java
src/java/net/sf/jabref/imports/BibtexParser.java
src/java/net/sf/jabref/imports/BiomailImporter.java
src/java/net/sf/jabref/imports/CiteSeerFetcherPanel.java
src/java/net/sf/jabref/imports/CsaImporter.java
src/java/net/sf/jabref/imports/EndnoteImporter.java
src/java/net/sf/jabref/imports/EntryFetcher.java [new file with mode: 0644]
src/java/net/sf/jabref/imports/GeneralFetcher.java [new file with mode: 0644]
src/java/net/sf/jabref/imports/HTMLConverter.java [new file with mode: 0644]
src/java/net/sf/jabref/imports/IEEEXploreFetcher.java [new file with mode: 0644]
src/java/net/sf/jabref/imports/ImportCustomizationDialog.java
src/java/net/sf/jabref/imports/ImportFormatReader.java
src/java/net/sf/jabref/imports/InspecImporter.java
src/java/net/sf/jabref/imports/IsiImporter.java
src/java/net/sf/jabref/imports/MedlineFetcher.java
src/java/net/sf/jabref/imports/MedlineHandler.java
src/java/net/sf/jabref/imports/RisImporter.java
src/java/net/sf/jabref/imports/ScifinderImporter.java
src/java/net/sf/jabref/imports/SilverPlatterImporter.java
src/java/net/sf/jabref/label/ArticleLabelRule.java
src/java/net/sf/jabref/label/BookLabelRule.java
src/java/net/sf/jabref/label/DefaultLabelRule.java
src/java/net/sf/jabref/label/InproceedingsLabelRule.java
src/java/net/sf/jabref/labelPattern/LabelPatternUtil.java
src/java/net/sf/jabref/util/CaseChanger.java
src/java/net/sf/jabref/util/ErrorConsole.java [new file with mode: 0644]
src/java/net/sf/jabref/util/TXMLReader.java [new file with mode: 0644]
src/java/net/sf/jabref/wizard/auximport/gui/FromAuxDialog.java
src/java/net/sf/jabref/wizard/integrity/gui/IntegrityMessagePanel.java
src/java/net/sf/jabref/wizard/integrity/gui/IntegrityWizard.java
src/resource/.cvsignore [new file with mode: 0644]
src/resource/IntegrityMessage_it.properties [new file with mode: 0644]
src/resource/JabRef_de.properties
src/resource/JabRef_de.properties.orig [deleted file]
src/resource/JabRef_en.properties
src/resource/JabRef_en.properties.orig [deleted file]
src/resource/JabRef_fr.properties
src/resource/JabRef_fr.properties.orig [deleted file]
src/resource/JabRef_it.properties [new file with mode: 0644]
src/resource/JabRef_no.properties
src/resource/Menu_de.properties
src/resource/Menu_en.properties
src/resource/Menu_fr.properties
src/resource/Menu_it.properties [new file with mode: 0644]
src/resource/Menu_no.properties
src/resource/build.properties
src/resource/layout/bibtexml.begin.layout
src/resource/layout/bibtexml.layout
src/resource/layout/harvard/harvard.proceedings.layout
src/resource/layout/html.begin.layout
src/resource/layout/html.inbook.layout
src/resource/layout/html.inproceedings.layout
src/resource/layout/html.layout
src/txt/README
src/windows/jabref.wxs

index 765b15f16bfcb97bbe6ac7da284558f5dcb9d60c..30ca81d5df31b001e7230302373dd38a5ac062bb 100644 (file)
@@ -1,3 +1,3 @@
 #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
index d4d96252f659f12ba66f6d8f3e10e0520bf45c40..a8ccea22ac42fb87c42496cb0645c513c6d721c1 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -22,9 +22,9 @@
    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
@@ -46,7 +46,7 @@
 
         <!-- 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 -->
 
 
@@ -63,6 +63,9 @@
         <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 -->
@@ -77,6 +80,8 @@
         <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>
 
@@ -327,6 +335,70 @@ version=${jabref.version}</echo>
                 </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>
@@ -338,12 +410,14 @@ version=${jabref.version}</echo>
                 <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>
 
 
@@ -471,9 +545,9 @@ Number (CCN)           maintenance
                                 <!--<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"/>-->
diff --git a/lib/.cvsignore b/lib/.cvsignore
new file mode 100644 (file)
index 0000000..670be53
--- /dev/null
@@ -0,0 +1,33 @@
+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
diff --git a/lib/looks-1.2.2.jar b/lib/looks-1.2.2.jar
deleted file mode 100644 (file)
index a68ba26..0000000
Binary files a/lib/looks-1.2.2.jar and /dev/null differ
diff --git a/lib/looks-2.0.1.jar b/lib/looks-2.0.1.jar
new file mode 100644 (file)
index 0000000..e969b64
Binary files /dev/null and b/lib/looks-2.0.1.jar differ
diff --git a/lib/microba.jar b/lib/microba.jar
new file mode 100644 (file)
index 0000000..f8ea63a
Binary files /dev/null and b/lib/microba.jar differ
diff --git a/lib/spin-1.4.jar b/lib/spin-1.4.jar
new file mode 100644 (file)
index 0000000..a683361
Binary files /dev/null and b/lib/spin-1.4.jar differ
diff --git a/lib/spin.jar b/lib/spin.jar
deleted file mode 100644 (file)
index d5103e4..0000000
Binary files a/lib/spin.jar and /dev/null differ
diff --git a/src/extensions/API/overview.html b/src/extensions/API/overview.html
new file mode 100644 (file)
index 0000000..d6ac343
--- /dev/null
@@ -0,0 +1,18 @@
+<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
diff --git a/src/extensions/SimpleCsvImporter.csv b/src/extensions/SimpleCsvImporter.csv
new file mode 100644 (file)
index 0000000..0585107
--- /dev/null
@@ -0,0 +1,3 @@
+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
diff --git a/src/extensions/SimpleCsvImporter.java b/src/extensions/SimpleCsvImporter.java
new file mode 100644 (file)
index 0000000..3b4ee40
--- /dev/null
@@ -0,0 +1,36 @@
+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;      
+  }
+}
diff --git a/src/extensions/compileAll.bat b/src/extensions/compileAll.bat
new file mode 100644 (file)
index 0000000..b7604fc
--- /dev/null
@@ -0,0 +1,50 @@
+@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
+
diff --git a/src/extensions/compileAll.sh b/src/extensions/compileAll.sh
new file mode 100644 (file)
index 0000000..10e7b90
--- /dev/null
@@ -0,0 +1,9 @@
+
+# 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
diff --git a/src/extensions/readme.html b/src/extensions/readme.html
new file mode 100644 (file)
index 0000000..8de028c
--- /dev/null
@@ -0,0 +1,52 @@
+<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
index 175538de3858430324df25a5b51d19030a14a984..a99654b286b6d5091298c4987176a647ce7eb5df 100755 (executable)
@@ -34,7 +34,7 @@ Kolja Brix<BR>
 Fr&eacute;d&eacute;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>
@@ -78,6 +78,10 @@ For table presentation and filtering, JabRef uses the Glazed Lists library
 <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
index a5e2ed7ee6b39062ad8f9f699b19a5aab2755ea1..5aaf241b02062d68ec2a17d21e5f6acc36f8009d 100755 (executable)
@@ -1,20 +1,29 @@
-<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
@@ -22,29 +31,337 @@ 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&nbsp;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
index 2cc1b37e3454ccd26e5f22944b383aa39380108a..cebf2f7d4edd6696f26569ad5cda85bf6966a0b1 100644 (file)
@@ -110,16 +110,17 @@ Now there should be a file <code>/mypath/SimpleCsvImporter.class</code>.</p>
 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>
diff --git a/src/help/IEEEXplorerHelp.html b/src/help/IEEEXplorerHelp.html
new file mode 100644 (file)
index 0000000..5661a54
--- /dev/null
@@ -0,0 +1,26 @@
+<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>
diff --git a/src/help/ShortAuxImport.html b/src/help/ShortAuxImport.html
new file mode 100644 (file)
index 0000000..7a9d14b
--- /dev/null
@@ -0,0 +1,7 @@
+<!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
index 6a4035f6a7134143433f077c1be816670d1d8037..62fd99269c41a79867d62cd570eb3a2d7f7fc359 100644 (file)
@@ -19,6 +19,7 @@ Kolja Brix
 Frédéric Darboux
 Fabrice Dessaint
 Nathan Dunn
+Brian Van Essen
 Alexis Gallagher
 Sascha Hunold
 Bernd Kalbfuss
index 3482716a450cf8612fd3f93f22e679005c354276..f12ff20b6ff1b9414cfe37bf4b9a87ceae179638 100644 (file)
@@ -1,77 +1,87 @@
-<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&uuml;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&szlig;enhoven<BR>
-Joerg K. Wegner<BR>
-Michael Wrighton<BR>
-Egon Willighagen <BR>
-J&ouml;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&szlig;enhoven<br>
+Joerg K. Wegner<br>
+Michael Wrighton<br>
+Egon Willighagen <br>
+J&ouml;rg Zieren<br>
 
-<H2>Beitr&auml;ge von:</H2>
-Kolja Brix<BR>
-Fr&eacute;d&eacute;ric Darboux<BR>
-Fabrice Dessaint<BR>
-Nathan Dunn<BR>
+<h2>Beitr&auml;ge von:</h2>
+Kolja Brix<br>
+Fr&eacute;d&eacute;ric Darboux<br>
+Fabrice Dessaint<br>
+Nathan Dunn<br>
 Brian van Essen<br>
-Alexis Gallagher<BR>
-Sascha Hunold<BR>
-Bernd Kalbfuss<BR>
-Martin K&auml;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&auml;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&uuml;r n&auml;here Einzelheiten dieser Lizenz).
-<P>
-Au&szlig;erdem werden zwei zust&auml;tzliche Klassen (SimpleInternalFrame and UIFSplitPane) von Karsten Lentzsch benutzt, die unter <A HREF="jgoodies.html">diesen Bedingungen</A> vertrieben werden.
-<P>
+<p>
+Au&szlig;erdem werden zwei zust&auml;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&uuml;gbar ist.
-<P>
+</p><p>
 JabRef verwendet f&uuml;r die Suche den ANTLR Parser Generator. ANTLR ist public domain software - siehe <code>http://www.antlr.org/license.html</code> f&uuml;r die Lizenzbedingungen.
-<p>
+</p><p>
 F&uuml;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&uuml;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&uuml;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&uuml;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&uuml;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&uuml;r n&auml;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
index 06a50e8a70eab258f3dab6ae395c4f8562e09494..4fdef1434ec31cfde2369b3fbb93f14fa6ca9331 100644 (file)
@@ -1,6 +1,3 @@
-%%%%% To do: %%%%%
-% OpenOffice-Export aktualisieren (an aktuelle HTML-Doku anpassen)
-%
 % unter >>Erscheinungsbild<< noch die Punkte Tabellendarstellung,
 % Toolbar, Panels und Schriften erstellen (DW)
 %
@@ -10,8 +7,8 @@
 \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}
@@ -70,7 +67,7 @@
   }%
 }
 %%% 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}
@@ -123,7 +128,7 @@ Me-n
 %%%%% Bibliography %%%%%
 \usepackage{jurabib}
 \jurabibsetup{annote=true}
-\renewcommand{\bib@heading}{\section*{Kommentiertes Literaturverzeichnis}}
+\renewcommand{\bib@heading}{\addsec{Kommentiertes Literaturverzeichnis}}
 
 %%%%% Hyperref %%%%%
 \usepackage{hyperref}
@@ -178,7 +183,7 @@ zu starten.
 \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}
@@ -187,13 +192,14 @@ Wa
 \thispagestyle{empty}
 
 \newpage
-\tableofcontents{}
+\dosecttoc[e]
+\faketableofcontents{}
 
 \newpage
 
 
 \section{Einleitung}
-
+\secttoc
 
 \subsection{Über dieses Handbuch}
 
@@ -232,7 +238,7 @@ wenn Sie Ihre Eintr
 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
@@ -274,8 +280,9 @@ die Gro
 Für weitere Erläuterungen zu Bib\TeX{} wird verwiesen auf \cite{Markey2005,btxdoc,btxhak,Raichle2002}.
 
 
+\clearpage
 \section{Installation}
-
+\secttoc
 
 \subsection{System-Voraussetzungen}
 
@@ -292,7 +299,7 @@ Development Kit}.
 \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
@@ -306,7 +313,7 @@ ein Tool zum Kompilieren von MSI-Dateien aus einer XML-Spezifikation
 }
 
 
-\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
@@ -358,9 +365,12 @@ unter \url{http://jabref.sourceforge.net} und in der Datei INSTALL
 (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
@@ -375,7 +385,6 @@ oder CiteMaker benutzen, kann aber auch f
 die andere Bibliographie-Systeme benutzen oder schlicht und einfach
 ihre Literaturquellen organisieren wollen.
 
-
 \subsection{Das Hauptfenster}
 
 \begin{quote}
@@ -431,7 +440,7 @@ f
 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
@@ -448,7 +457,7 @@ einzupr
 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
@@ -459,7 +468,7 @@ nicht ausgew
 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
@@ -499,7 +508,7 @@ Schlagen Sie unter Abschnitt~\ref{CustomEntriesHelp} nach, wenn
 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},
@@ -541,7 +550,7 @@ erscheinen diese im Quelltext-Panel.}
 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{}
@@ -615,7 +624,7 @@ Es gibt drei verschiedene Suchmethoden in \jabref{}: die direkte
 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.
@@ -627,7 +636,7 @@ Sortierung Ihrer Datei. Um die direkte Suche zu verlassen, dr
 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
@@ -637,7 +646,7 @@ Nicht-Treffer werden grau hinterlegt. Haben Sie zus
 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
@@ -652,7 +661,7 @@ Markieren von Eintr
 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
@@ -704,7 +713,7 @@ die Suche nach Bib\TeX{}-Keys, z.\,B.:
 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ß-
@@ -741,7 +750,7 @@ benutzt. (K
 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
@@ -751,7 +760,7 @@ das Kontextmen
 wird ebenfalls unterstützt.
 
 
-\subsection*{Einige kurze Beispiele}
+\subsection{Einige kurze Beispiele}
 
 Sie möchten vielleicht~\ldots{}
 
@@ -822,7 +831,7 @@ anderen Gruppen sollten nun markiert sein.
 
 \end{itemize}
 
-\subsubsection*{Arten von Gruppen}
+\subsubsection{Arten von Gruppen}
 
 In \jabref{}~1.8 gibt es vier verschiedene Arten von Gruppen:
 
@@ -854,7 +863,7 @@ auf eine Gruppe aufgerufen wird, zeigt eine kurze Beschreibung der
 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
@@ -873,7 +882,7 @@ Die Funktionen \menu{R
 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,
@@ -889,7 +898,7 @@ Bib\TeX{}-Keys kann das Zuweisen der betreffenden Eintr
 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
@@ -932,7 +941,7 @@ dargestellt. Dies kann unter \menu{Optionen} \msep{} \menu{Einstellungen}
 \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
@@ -962,7 +971,7 @@ hat auch diese Art von Gruppen ein spezielles Icon. (Dieses Verhalten
 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
@@ -981,14 +990,14 @@ Sie beide Gruppen ausw
 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
@@ -1002,13 +1011,13 @@ wird die Gruppe \emph{lesen} markiert, sofern die ausgew
 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.
@@ -1028,7 +1037,7 @@ ignorieren. Sie m
 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
@@ -1139,7 +1149,7 @@ Um ein neues Wort hinzuzuf
 \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
@@ -1155,7 +1165,7 @@ ist es oftmals leichter, diese Arbeiten durchzuf
 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,
@@ -1239,7 +1249,7 @@ mit Klammern enthalten, als Eintrag mit mehreren Autoren gewertet
 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
@@ -1258,7 +1268,7 @@ und entpacken die Zip-Datei, die dabei erstellt wird. Dann folgen
 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
@@ -1269,21 +1279,45 @@ extrahieren Sie die EndNote Extras (\menu{Datei} \msep{} \menu{Exportieren}
 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
@@ -1331,7 +1365,7 @@ befinden, verlinken. Ebenso ist es m
 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
@@ -1345,7 +1379,7 @@ Sie den Unterpunkt \menu{Externe Programme} im Dialog \menu{Optionen}}
 \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
@@ -1366,7 +1400,7 @@ PDF, wenn beide vorhanden sind), die dritte Spalte zeigt Icons f
 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
@@ -1396,7 +1430,7 @@ nicht angezeigt wird, solange das PDF-Feld leer bleibt.
 \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
@@ -1435,7 +1469,7 @@ ich deshalb dankbar.%
 }
 
 
-\subsubsection*{Medline}
+\subsubsection{Medline}
 
 \begin{quote}
 \label{MedlineHelp}\jabref{} kann Literaturangaben von der Medline-Datenbank
@@ -1462,7 +1496,7 @@ Die abgerufenen Eintr
 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
@@ -1482,7 +1516,7 @@ ein Netzwerk~-- bearbeitet wird. Das sind vor allem die Felder \emph{owner}
 und \emph{timestamp}.
 
 
-\subsubsection*{Zeitstempel \emph{(timestamp)}}
+\subsubsection{Zeitstempel \emph{(timestamp)}}
 
 \begin{quote}
 \label{TimeStampHelp}\emph{Die Benutzung des Zeitstempels kann unter
@@ -1515,7 +1549,7 @@ werden. Hier einige Beispiele:
 \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
@@ -1554,7 +1588,7 @@ dass der Dateiname als Argument der Option \texttt{-n} interpretiert
 wird.
 
 
-\subsubsection*{Kommandozeilen-Optionen}
+\subsubsection{Kommandozeilen-Optionen}
 
 Im folgenden werden die wichtigsten Optionen und Befehle für die Kommandozeile
 vorgestellt.
@@ -1659,8 +1693,9 @@ ist, auch nicht in die neue Datei geschrieben werden kann.
 
 \end{itemize}
 
+\clearpage
 \section{Anpassung}
-
+\secttoc
 
 \subsection{Eintragstypen}
 
@@ -1681,7 +1716,7 @@ Wenn Sie \menu{Abbrechen} anklicken oder einfach den Dialog schlie
 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,
@@ -1691,7 +1726,7 @@ Eintragstyps vorgenommen und im rechten Bereich diejenigen der optionalen
 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,
@@ -1713,7 +1748,7 @@ ihn aus und dr
 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
@@ -1800,7 +1835,7 @@ Teil aus einem Feld extrahieren. Sie werden unten aufgelistet. Nat
 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.
@@ -1930,7 +1965,7 @@ Dateien festlegen. Ihre Layout-Datei m
 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
@@ -1944,7 +1979,7 @@ den Exportfilter benutzen, wird diese Endung im Datei-Dialog automatisch
 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
@@ -2000,7 +2035,7 @@ Typs genutzt werden. Achten Sie darauf, dass die Standard-Layout-Datei
 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{}})
@@ -2008,7 +2043,7 @@ eingeleitet werden. Alle Textbestandteile, die nicht als Kommando
 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
@@ -2016,7 +2051,7 @@ Ein beliebiges Wort, vor dem ein backslash steht, z.\,B. \texttt{\textbackslash{
 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,
@@ -2085,7 +2120,7 @@ muss der Formatierer in ihrem classpath sein, wenn Sie \jabref{}
 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
@@ -2118,7 +2153,7 @@ leer ist.
 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
@@ -2140,7 +2175,7 @@ New~Category:~\textbackslash{}format{[}HTMLChars{]}\{\textbackslash{}keywords\}
 \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
@@ -2153,19 +2188,22 @@ zu k
 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.
@@ -2175,16 +2213,16 @@ Externe Importfilter selbst sind dann nach Namen sortiert.
 
 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,
@@ -2200,7 +2238,7 @@ Sie k
 
 \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}
@@ -2214,10 +2252,10 @@ Angenommen, wir wollen Dateien der folgenden Form importieren:
 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}
@@ -2250,15 +2288,15 @@ public class SimpleCsvImporter extends ImportFormat {
     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();
@@ -2283,49 +2321,50 @@ public class SimpleCsvImporter extends ImportFormat {
 
         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
@@ -2477,9 +2516,12 @@ F1\tabularnewline
 \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}}.
@@ -2533,7 +2575,7 @@ geht an Samin Muhammad Ridwanul Karim und Stefan Robert.
 \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}
@@ -2591,7 +2638,7 @@ M
 \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)
index 24544a01f34fa1e7de1b71da01ad4ae71987aa60..efbca982960e9633d76258f57fd3203138ea7b24 100644 (file)
@@ -27,6 +27,39 @@ Gehen Sie folgenderma&szlig;en vor, um eine Tabelle, die von JabRef exportiert w
 Anschlie&szlig;end w&auml;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&auml;hlen Sie <b>Extras -> Datenquellen</b></li>
+    <li>W&auml;hlen Sie die <i>Bibliography</i>-Datei und &auml;ndern ihren Namen z.B. in <i>Bibliographie-alt</i>.</li>
+    <li>Dr&uuml;cken Sie <b>Anwenden</b>.
+    <li>Klicken Sie <b>Neue Datenquelle</b>. Ein neuer Eintrag erscheint. &Auml;ndern Sie den Namen zu
+        <i>Bibliography</i>.</li>
+     <li>&Auml;ndern Sie den <b>Dateityp</b> zu <b>Tabelle</b>. Klicken Sie den <b>...</b>-Button
+     in der Zeile <b>Datenquellen URL</b>. W&auml;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&szlig;en.</li>
+</ul>
+Anschlie&szlig;end w&auml;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&szlig;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&auml;hlen Sie <b>Extras -> Optionen -> OpenOffice.org Base -> Datenbanken</b></li>
+    <li>Bearbeiten Sie die <i>Bibliography</i>-Datenbank und &auml;ndern ihren Namen z.B. in <i>Bibliographie-alt</i></li>
+    <li>Schlie&szlig;en Sie das Fenster <b>Optionen</b> und gehen Sie zu <b>Datei -> Neu -> Datenbank</b></li>
+    <li>W&auml;hlen Sie <b>Verbindung zu einer bestehenden Datenbank herstellen</b>, w&auml;hlen <b>Tabellendokument</b> als
+    Datenbanktyp und w&auml;hlen die <b>.ods</b>-Datei, die Sie exportiert haben</li>
+    <li>Klicken Sie auf <b>Fertig stellen</b> und w&auml;hlen den Namen <i>Bibliography</i> im Speicherdialog</li>
+</ul>
+Anschlie&szlig;end w&auml;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>
@@ -43,4 +76,4 @@ Anschlie&szlig;end w&auml;hlen Sie <b>Extras -> Literaturdatenbank</b>. Ihre Dat
 Anschlie&szlig;end w&auml;hlen Sie <b>Extras -> Literaturdatenbank</b>.
 Ihre Datenbank sollte nun angezeigt werden.
 
-</HTML>
\ No newline at end of file
+</HTML>
diff --git a/src/help/de/ShortAuxImport.html b/src/help/de/ShortAuxImport.html
new file mode 100644 (file)
index 0000000..ac0690c
--- /dev/null
@@ -0,0 +1,8 @@
+<!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&auml;ge enth&auml;lt.
+</body></html>
\ No newline at end of file
index 7281b27bb6c4bb2c69264115bea9b524910e8da0..48ac59f295f09b211edfcf8aaa9d7bad0c1739cc 100644 (file)
@@ -34,7 +34,7 @@ Kolja Brix<BR>
 Fr&eacute;d&eacute;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>
index 278ed75bcd0def9fd65993694abd428a5c5ae352..ca1cb1a977305d17c03dc84a1736adfa031a5909 100644 (file)
@@ -90,6 +90,7 @@ Votre filtre d'importation devrait maintenant appara&icirc;tre dans la liste des
 
 <H2>Partager votre travail</H2>
 
-Avec des fichiers de filtres d'importation personnalis&eacute;s, il est vraiment simple de partager des formats d'importation personnalis&eacute;s entre utilisateurs. Si vous &eacute;crivez un filtre d'importation pour un format non support&eacute; par JabRef, ou l'am&eacute;lioration d'un filtre existant, nous vous encourageons &agrave; soumettre votre travail sur notre page SourceForge.net. Nous serons heureux de distribuer la collection des fichiers d'importation soumis, ou d'en ajouter &agrave; la s&eacute;lection de filtres d'importation standard.
+<p>Avec des fichiers de filtres d'importation personnalis&eacute;s, il est vraiment simple de partager des formats d'importation personnalis&eacute;s entre utilisateurs. Si vous &eacute;crivez un filtre d'importation pour un format non support&eacute; par JabRef, ou l'am&eacute;lioration d'un filtre existant, nous vous encourageons &agrave; soumettre votre travail sur notre page SourceForge.net. Nous serons heureux de distribuer la collection des fichiers d'importation soumis, ou d'en ajouter &agrave; la s&eacute;lection de filtres d'importation standard.</p>
 
+</BODY>
 </HTML>
index 1524dde6a82d14f1eb53585fcf852e5433160655..cef308b79d349c425587d17dd6feece1069d7220 100644 (file)
@@ -10,6 +10,7 @@
 Dans le menu 'Param&eacute;trage des clefs' de la fen&ecirc;tre Pr&eacute;f&eacute;rences, on peut indiquer les champs &agrave; utiliser pour la g&eacute;n&eacute;ration automatique des clefs BibTeX. La d&eacute;finition peut &ecirc;tre faite pour chacune des entr&eacute;es standards.
 </p>
 
+<H2>Les d&eacute;finitions de clefs</H2>
 <p>
 La d&eacute;finition peut contenir n'importe quel texte au choix ainsi que des marqueurs de champs qui indiquent les champs particuliers de l'entr&eacute;e utilis&eacute;s et leur position dans la clef. Un marqueur de champ est constitu&eacute; g&eacute;n&eacute;ralement du nom du champ entre crochets, par ex. <b>[volume]</b>. Si le champ n'est pas d&eacute;fini dans l'entr&eacute;e lorsque la clef est g&eacute;n&eacute;r&eacute;e, aucun texte n'est ins&eacute;r&eacute; dans la clef.
 </p>
@@ -33,8 +34,8 @@ Les marqueurs de champs sp&eacute;ciaux&nbsp;:
 <li><b>[<code>auth.auth.ea</code>]</b>&nbsp;: Le nom des deux premiers auteurs suivi de ".ea" lorsqu'ils sont plus de deux.<BR>
 <li><b>[<code>authshort</code>]</b>&nbsp;: Le nom s'il n'y a qu'un seul auteur. Jusqu'&agrave; trois auteurs, le premier caract&egrave;re du nom de chacun d'eux. Au del&agrave; de trois auteurs, le caract&egrave;re plus (+) est ajout&eacute;.<BR>
 </ul>
-<b>Note&nbsp;:</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&nbsp;:</b> S'il n'y a pas d'auteur (dans le cas d'un livre &eacute;dit&eacute;), alors tous les marqueurs <b><code>[auth...]</code></b> ci-dessus utiliseront l'&eacute;diteur(s) (s'il y en a) comme alternative. Ainsi l'&eacute;diteur(s) d'un livre sans auteur sera trait&eacute; comme l'auteur(s) pour la g&eacute;n&eacute;ration des clefs.
+Si vous ne d&eacute;sirez pas ce comportement, c'est &agrave; 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>&nbsp;: Le nom du premier &eacute;diteur<BR>
 <li><b>[<code>edtrIniN</code>]</b>&nbsp;: Les N premi&egrave;res lettres du nom de chaque &eacute;diteur<BR>
@@ -76,5 +77,16 @@ La clef utilis&eacute;e par d&eacute;faut est [auth][year]; elle produit des cle
 <code>Yared1998b</code> 
 </blockquote>
 
+<h2>Remplacement d'expressions r&eacute;guli&egrave;res</h2>
+
+<P>
+Apr&egrave;s que la d&eacute;finition de clef ait &eacute;t&eacute; appliqu&eacute;e pour produire une clef, vous pouvez demander au g&eacute;n&eacute;rateur de clef de rechercher les occurrences d'une expression r&eacute;guli&egrave;re donn&eacute;e et de la remplacer avec une cha&icirc;ne. L'expression r&eacute;guli&egrave;re et la cha&icirc;ne de remplacement sont entr&eacute;es dans les champs textes situ&eacute;s sous la liste des d&eacute;finition de clefs.
+</P>
+
+<P>
+Si la cha&icirc;ne de remplacement est vide, les correspondances de l'expression r&eacute;guli&egrave;re seront simplement supprim&eacute;es de la clef g&eacute;n&eacute;r&eacute;e.
+</P>
+
+
 </body>
 </html>
diff --git a/src/images/font/ACTIVA.TTF b/src/images/font/ACTIVA.TTF
new file mode 100644 (file)
index 0000000..c973b2c
Binary files /dev/null and b/src/images/font/ACTIVA.TTF differ
diff --git a/src/images/font/ASTROLYT.TTF b/src/images/font/ASTROLYT.TTF
new file mode 100644 (file)
index 0000000..9a92497
Binary files /dev/null and b/src/images/font/ASTROLYT.TTF differ
diff --git a/src/images/font/AUGIE.TTF b/src/images/font/AUGIE.TTF
new file mode 100644 (file)
index 0000000..175d7ce
Binary files /dev/null and b/src/images/font/AUGIE.TTF differ
index 6e7210121e3cb0d748307c625361895689793eae..6f2bd0863910ff16d607bac086b833d74de87907 100644 (file)
Binary files a/src/images/groupIncluding.png and b/src/images/groupIncluding.png differ
diff --git a/src/images/jabref-2.0-splash.png b/src/images/jabref-2.0-splash.png
deleted file mode 100644 (file)
index e295337..0000000
Binary files a/src/images/jabref-2.0-splash.png and /dev/null differ
diff --git a/src/images/splash-2.1beta.png b/src/images/splash-2.1beta.png
new file mode 100644 (file)
index 0000000..4304131
Binary files /dev/null and b/src/images/splash-2.1beta.png differ
diff --git a/src/images/splash.svg b/src/images/splash.svg
new file mode 100644 (file)
index 0000000..628543b
--- /dev/null
@@ -0,0 +1,229 @@
+<?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>
index 7abbe72dee80b38fd3b804fd99ae4ea487ac2e8f..6cd57ccbdeeec324562e8eead525e665a7ae8b02 100644 (file)
 \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
@@ -57,7 +58,7 @@ import com.jgoodies.plaf.LookUtils;
  * 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
index 2b4d4eb6928f46de18de17dc8503b5903a6b9d07..926e01af3a83a7dd759aa969a303b3ef626c2bf3 100644 (file)
@@ -47,11 +47,11 @@ class AppearancePrefsTab extends JPanel implements PrefsTab {
         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"));
index 4f5bb54e24597a9a1fb94781951680a046c0d849..571de46aa4bada54c47b4fb1f3ac6a5f7a5f2128 100644 (file)
@@ -439,7 +439,9 @@ public class AuthorList {
             }
             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;
index 36cab5bb64d167efb661519e19a7aa83106f9e33..8ce08fe5f6383071cd20629017257321a036c5e0 100644 (file)
@@ -23,7 +23,7 @@ USA
 Further information about the GNU GPL is available at:
 http://www.gnu.org/copyleft/gpl.ja.html
 
+
 */
 
 package net.sf.jabref;
@@ -34,14 +34,13 @@ import java.awt.event.*;
 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;
@@ -53,6 +52,8 @@ import net.sf.jabref.gui.*;
 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;
@@ -161,6 +162,7 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
       this.sidePaneManager = Globals.sidePaneManager;
       database = new BibtexDatabase();
       metaData = new MetaData();
+        metaData.initializeNewDatabase();
       this.frame = frame;
       setupActions();
       setupMainPanel();
@@ -179,8 +181,10 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
       database = db;
       if (meta != null)
         parseMetaData(meta);
-      else
+      else {
         metaData = new MetaData();
+        metaData.initializeNewDatabase();   
+      }
       setupActions();
       setupMainPanel();
       /*if (Globals.prefs.getBoolean("autoComplete")) {
@@ -258,6 +262,17 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
                 */
             });
 
+
+        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;
@@ -316,6 +331,30 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
 
             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");
@@ -600,11 +639,14 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
                         // 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
@@ -680,69 +722,6 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
             }
         });
 
-    // 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() {
@@ -780,7 +759,7 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
                     // 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();
@@ -810,7 +789,7 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
                     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);
                     }
 
@@ -820,7 +799,7 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
                         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);
@@ -881,8 +860,8 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
                         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;
@@ -919,8 +898,8 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
                         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;
@@ -1020,7 +999,7 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
 
                      // 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"};
@@ -1043,7 +1022,7 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
                    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) {
@@ -1076,7 +1055,7 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
                               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());
@@ -1173,7 +1152,7 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
                           // 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);
@@ -1453,6 +1432,11 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
                 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
@@ -1478,16 +1462,15 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
 
         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);
 
@@ -1563,7 +1546,7 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
                 }
 
                 highlightEntry(be);  // Selects the entry. The selection listener will open the editor.
-                
+
                 markBaseChanged(); // The database just changed.
                 new FocusRequester(getEntryEditor(be));
             } catch (KeyCollisionException ex) {
@@ -1682,7 +1665,7 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
           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")+" '"
@@ -2542,7 +2525,7 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
         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;
index 6208906c2aa9787c84af056423aa83e6cbf7f676..61a621b718289d59257f85986a5e4a37c5b3cb36 100644 (file)
@@ -68,8 +68,8 @@ public class BibtexDatabase
             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
@@ -98,10 +98,10 @@ public class BibtexDatabase
                     _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());
+                }
             }
         };
 
@@ -127,8 +127,8 @@ public class BibtexDatabase
      * 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;
     }
 
@@ -145,9 +145,9 @@ public class BibtexDatabase
     {
         return (BibtexEntry) _entries.get(id);
     }
-    
+
     public synchronized Collection getEntries() {
-       return _entries.values();
+            return _entries.values();
     }
 
     /**
@@ -185,7 +185,7 @@ public class BibtexDatabase
       }
       return back ;
     }
-    
+
     public synchronized BibtexEntry[] getEntriesByKey(String key) {
         Vector entries = new Vector();
         BibtexEntry entry;
@@ -196,7 +196,7 @@ public class BibtexDatabase
         }
         BibtexEntry[] entryArray = new BibtexEntry[entries.size()];
         return (BibtexEntry[]) entries.toArray(entryArray);
-    }    
+    }
 
     /**
      * Inserts the entry, given that its ID is not already in use.
@@ -226,7 +226,7 @@ public class BibtexDatabase
         */
         _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);
     }
@@ -244,7 +244,7 @@ public class BibtexDatabase
             oldValue.removePropertyChangeListener(listener);
         }
 
-       fireDatabaseChanged(new DatabaseChangeEvent(this, DatabaseChangeEvent.REMOVED_ENTRY, oldValue));
+        fireDatabaseChanged(new DatabaseChangeEvent(this, DatabaseChangeEvent.REMOVED_ENTRY, oldValue));
 
         return oldValue;
     }
@@ -254,9 +254,9 @@ public class BibtexDatabase
         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);
     }
 
@@ -286,10 +286,10 @@ public class BibtexDatabase
             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);
     }
 
@@ -305,7 +305,7 @@ public class BibtexDatabase
      * These are in no sorted order.
      */
     public Set getStringKeySet() {
-       return _strings.keySet();
+        return _strings.keySet();
     }
 
     /**
@@ -333,90 +333,104 @@ public class BibtexDatabase
         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;
     }
 
     //##########################################
@@ -466,9 +480,9 @@ public class BibtexDatabase
             return 0;
         else
             return ((Integer)o).intValue();
-            
+
     }
-    
+
     //========================================================
     // keep track of all the keys to warn if there are duplicates
     //========================================================
@@ -500,19 +514,19 @@ public class BibtexDatabase
     }
 
 
-    
+
     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);
     }
 
     /*
index ff8b1947c8d84ee4b21bccdfb815839252cd01b9..b5f14096ae79217ce58362c4c11b94b843dc3d74 100644 (file)
@@ -42,6 +42,7 @@ import java.io.*;
 
 public class BibtexEntry
 {
+    public final static String ID_FIELD = "id";
     private String _id;
     private BibtexEntryType _type;
     private Map _fields = new HashMap();
@@ -169,7 +170,7 @@ public class BibtexEntry
 
         try
         {
-            firePropertyChangedEvent("id", _id, id);
+            firePropertyChangedEvent(ID_FIELD, _id, id);
         }
         catch (PropertyVetoException pv)
         {
@@ -195,20 +196,20 @@ public class BibtexEntry
     }
 
     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");
         }
@@ -217,30 +218,30 @@ public class BibtexEntry
         //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);
         }
 
@@ -251,7 +252,7 @@ public class BibtexEntry
      */
     public void clearField(String name) {
 
-      if ("id".equals(name)) {
+      if (ID_FIELD.equals(name)) {
            throw new IllegalArgumentException("The field name '" + name +
                                               "' is reserved");
        }
@@ -312,21 +313,23 @@ public class BibtexEntry
         // 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);
             }
         }
@@ -334,22 +337,36 @@ public class BibtexEntry
         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 {
@@ -358,9 +375,11 @@ public class BibtexEntry
                 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;
     }
 
     /**
@@ -372,9 +391,9 @@ public class BibtexEntry
         return clone;
     }
 
-   
+
     public String toString() {
-       return getType().getName()+":"+getField(Globals.KEY_FIELD);
+        return getType().getName()+":"+getField(BibtexFields.KEY_FIELD);
     }
 
     public boolean isSearchHit() {
diff --git a/src/java/net/sf/jabref/BibtexFields.java b/src/java/net/sf/jabref/BibtexFields.java
new file mode 100644 (file)
index 0000000..280f132
--- /dev/null
@@ -0,0 +1,629 @@
+/*
+ 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 ;
+    }
+
+  }
+}
diff --git a/src/java/net/sf/jabref/BrowseAction.java b/src/java/net/sf/jabref/BrowseAction.java
new file mode 100644 (file)
index 0000000..24c36ad
--- /dev/null
@@ -0,0 +1,39 @@
+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());
+        }
+    }
+
+}
index b57ba0f646caed6d1de148281a5a6374b507341b..6f0f55f7364d9cd4a6ac5fa5dd7b9b48a4cbfee1 100644 (file)
@@ -22,31 +22,31 @@ import java.awt.*;
 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);
 
@@ -63,21 +63,21 @@ public class DuplicateResolverDialog extends JDialog {
               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();
@@ -89,7 +89,7 @@ public class DuplicateResolverDialog extends JDialog {
     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;
@@ -100,7 +100,7 @@ public class DuplicateResolverDialog extends JDialog {
     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;
@@ -159,16 +159,16 @@ public class DuplicateResolverDialog extends JDialog {
     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);
   }
@@ -208,8 +208,8 @@ public boolean isBlocking() {
 
   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();
   }
 
index 01e2f27af5479a967a09d7fde8305b1252f7ec18..4e6d918a8ba2a787a2f7fd7fa81a486a3da80071 100644 (file)
@@ -102,8 +102,8 @@ public void run() {
       {
 
         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() ;
index ea5d9540369e877b068663598207f347e71e7449..fef7f077aecff99c594a23d280322c1955a1b090 100644 (file)
@@ -45,9 +45,9 @@ import net.sf.jabref.labelPattern.LabelPatternUtil;
 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 {
   /*
@@ -298,10 +298,10 @@ 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
@@ -309,27 +309,35 @@ public class EntryEditor extends JPanel implements VetoableChangeListener {
    */
   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.
@@ -354,7 +362,8 @@ public class EntryEditor extends JPanel implements VetoableChangeListener {
         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);
@@ -396,7 +405,7 @@ public class EntryEditor extends JPanel implements VetoableChangeListener {
         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")) {
@@ -690,7 +699,7 @@ public class EntryEditor extends JPanel implements VetoableChangeListener {
       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));
@@ -1217,20 +1226,20 @@ public class EntryEditor extends JPanel implements VetoableChangeListener {
       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) {
@@ -1303,7 +1312,7 @@ public class EntryEditor extends JPanel implements VetoableChangeListener {
 
         // getSelectedText()
         try {
-          Util.openExternalViewer(link, tf.getFieldName(), prefs);
+          Util.openExternalViewer(panel.metaData(), link, tf.getFieldName());
         } catch (IOException ex) {
           System.err.println("Error opening file.");
         }
index b89805cc1b286ac7acfc4de26b6a085497aed05d..23d0500f5ff76fe2f8754fbfd5d523144c59cb38 100644 (file)
@@ -44,7 +44,7 @@ public class EntryEditorTab {
 
     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;
@@ -58,115 +58,116 @@ public class EntryEditorTab {
 
 
     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() {
@@ -179,91 +180,91 @@ public class EntryEditorTab {
     }
 
     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);
+        }
+
     }
 
 
@@ -273,21 +274,21 @@ public class EntryEditorTab {
      */
     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);
+        }
     }
-    
+
 }
 
index a8e611631a2908b6de8079bf972a5dd500883267..92191ba24ae1692af901b94d5d01178a53d79c55 100644 (file)
@@ -11,35 +11,47 @@ public final class EntryEditorTabList {
     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);
     }
 }
index b90389c6443b6da19667900c0ee8bfcf2b12a711..38c49a6735a29e98eb13c7090bb5d56e49fdaf59 100644 (file)
@@ -39,8 +39,6 @@ import javax.swing.event.*;
 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;
@@ -67,9 +65,9 @@ public class EntryTable extends JTable {
 
     private ListSelectionListener previewListener = null;
     private int activeRow = -1;
-    
+
     ListSelectionListener groupsHighlightListener;
-    
+
     public EntryTable(EntryTableModel tm_, BasePanel panel_, JabRefPreferences prefs_) {
         super(tm_);
         this.tableModel = tm_;
@@ -82,8 +80,8 @@ public class EntryTable extends JTable {
         // 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,
@@ -157,7 +155,7 @@ public class EntryTable extends JTable {
               else prefs.putBoolean("priDescending",
                                     !prefs.getBoolean("priDescending"));
               tableModel.remap();
-              
+
             }
           }
         });
@@ -194,7 +192,7 @@ public class EntryTable extends JTable {
             }
         };
         getSelectionModel().addListSelectionListener(groupsHighlightListener);
-        
+
         // (to update entry editor or preview)
         setWidths();
         sp.getViewport().setBackground(Globals.prefs.getColor("tableBackground"));
@@ -226,12 +224,11 @@ public class EntryTable extends JTable {
     /**
      * 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();
@@ -546,7 +543,7 @@ public class EntryTable extends JTable {
               }
 
               try {
-                Util.openExternalViewer( (String) link, fieldName, prefs);
+                Util.openExternalViewer(panel.metaData, (String) link, fieldName);
               }
               catch (IOException ex) {
                 panel.output(Globals.lang("Error")+": "+ex.getMessage());
@@ -575,10 +572,10 @@ public class EntryTable extends JTable {
 
 
         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
index ebf0026377d64b37d3d7ddfd0170370d919e1b29..bd7263a0d7e2fee3112a2db5c4b01cda9458cbc9 100644 (file)
@@ -105,17 +105,22 @@ public class EntryTableModel
     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;
     }
 
@@ -164,10 +169,10 @@ public class EntryTableModel
         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
 */
 
@@ -231,8 +236,8 @@ public class EntryTableModel
             o = processed;
         } else
             o = processed;
-        
-            
+
+
     }*/
     return o;
   }
@@ -261,7 +266,7 @@ public class EntryTableModel
 
     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;
     }
@@ -347,19 +352,19 @@ public class EntryTableModel
     // 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);
     }
@@ -395,7 +400,7 @@ public class EntryTableModel
           // 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
index fc7b8967be91a145983554bb9cee9ea829dda31f..77bd0bc1fa588437d28e1225bbaa89612e512248 100644 (file)
@@ -2,12 +2,8 @@ package net.sf.jabref;
 
 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 {
@@ -50,7 +46,7 @@ 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"));
@@ -59,7 +55,7 @@ public class ExternalTab extends JPanel implements PrefsTab {
         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"));
@@ -70,7 +66,7 @@ public class ExternalTab extends JPanel implements PrefsTab {
         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));
@@ -79,7 +75,7 @@ public class ExternalTab extends JPanel implements PrefsTab {
         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));
@@ -88,7 +84,7 @@ public class ExternalTab extends JPanel implements PrefsTab {
         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));
@@ -97,14 +93,14 @@ public class ExternalTab extends JPanel implements PrefsTab {
         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);
@@ -117,34 +113,6 @@ public class ExternalTab extends JPanel implements PrefsTab {
         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"));
index 61fc2ad329832c68fde253189112f58fe91084fa..3b93347146c4939c89b273699554417aa9007b2a 100644 (file)
@@ -71,7 +71,6 @@ public class FieldComparator implements Comparator {
                String ours = ((String) f1).toLowerCase(),
                theirs = ((String) f2).toLowerCase();
                result = ours.compareTo(theirs);
-               
        }
 
         return result*multiplier;
index 8150ca8e42475c552ebbba34d6c04b5498f139b1..79359e5a0194a679bd08f049eec3de87e450b9e7 100644 (file)
@@ -51,7 +51,7 @@ public class FieldContentSelector extends JComponent implements ActionListener {
     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;
@@ -94,7 +94,8 @@ public class FieldContentSelector extends JComponent implements ActionListener {
 
     private void doInit() {
         setLayout(gbl);
-        list.setEditable(true);
+        //list.setEditable(true);
+
         list.setMaximumRowCount(35);
 
         /*
@@ -114,7 +115,7 @@ public class FieldContentSelector extends JComponent implements ActionListener {
         list.addActionListener(this);
 
         add(list);
-        
+
         if (m_horizontalLayout)
             add(Box.createHorizontalStrut(Sizes.dialogUnitXAsPixel(2,this)));
 
@@ -125,7 +126,7 @@ public class FieldContentSelector extends JComponent implements ActionListener {
         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())
@@ -133,7 +134,7 @@ public class FieldContentSelector extends JComponent implements ActionListener {
                                 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();
             }
         });
@@ -196,7 +197,7 @@ public class FieldContentSelector extends JComponent implements ActionListener {
     /**
      * Adds a word to the selector (to the JList and to the MetaData), unless it
      * is already there
-     * 
+     *
      * @param newWord
      *            String Word to add
      */
index 41bc0cb83dd9f938cbe818d6e0ea5e74ac5c49f8..64d97a58672457a565f5b8859ed0ee3052215609 100644 (file)
@@ -44,9 +44,12 @@ import javax.swing.*;
  * 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)
  *
@@ -80,66 +83,66 @@ import javax.swing.*;
 
 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);
+                        }
+                }
+        }
 
 }
 
@@ -152,268 +155,268 @@ class FontSelector extends JButton {
  */
 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();
 
-       }
+        }
     */
 }
index e311f28862cf32d3bbccea3ef26382c6ce969611..5a6ce258ff546c5b9165346bdee2d816ea151814 100644 (file)
@@ -32,9 +32,11 @@ package net.sf.jabref;
 
 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 {
 
@@ -60,11 +62,11 @@ 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,
@@ -117,8 +119,6 @@ public class GUIGlobals {
     // 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);
@@ -200,11 +200,11 @@ public class GUIGlobals {
           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 {
@@ -235,6 +235,7 @@ public class GUIGlobals {
       shortPlainImport="ShortPlainImport.html",
       importInspectionHelp = "ImportInspectionDialog.html",
       shortIntegrityCheck="ShortIntegrityCheck.html",
+      shortAuxImport="ShortAuxImport.html",
         remoteHelp = "RemoteHelp.html",
         journalAbbrHelp = "JournalAbbreviations.html";
 
@@ -262,147 +263,22 @@ public class GUIGlobals {
   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
@@ -426,99 +302,17 @@ public class GUIGlobals {
       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 */
index 88c7b9bee5cf54ccf231f5d61ce60d97ba6106ee..1b6c9adf88b2999d87ae16a5cbde51e0ca891001 100644 (file)
@@ -15,8 +15,10 @@ public class GeneralTab extends JPanel implements PrefsTab {
     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;
@@ -46,7 +48,13 @@ public class GeneralTab extends JPanel implements PrefsTab {
         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>");
@@ -68,8 +76,8 @@ public class GeneralTab extends JPanel implements PrefsTab {
         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) {
@@ -89,84 +97,43 @@ public class GeneralTab extends JPanel implements PrefsTab {
         );
 
         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", "");
@@ -195,12 +162,11 @@ public class GeneralTab extends JPanel implements PrefsTab {
         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);
 
@@ -222,7 +188,12 @@ public class GeneralTab extends JPanel implements PrefsTab {
         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"));
@@ -271,7 +242,8 @@ public class GeneralTab extends JPanel implements PrefsTab {
         _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());
index de7fa4e2408623273462d6bbe00a6f056708abe5..f7e3fe62364360330ffdfd16041b88b2f5d3ac8c 100644 (file)
 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.* ;
@@ -51,12 +54,13 @@ public class Globals {
                         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,
@@ -68,6 +72,9 @@ public class Globals {
     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();
   }
 
 
@@ -83,12 +90,14 @@ public class Globals {
       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",
@@ -109,6 +118,16 @@ public class Globals {
       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]);
+
   }
 
 
@@ -164,19 +183,6 @@ public class Globals {
     });
   }
 
-  /**
-   * 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);
@@ -187,7 +193,7 @@ public class Globals {
   }
 
 
-    public static JournalAbbreviations journalAbbrev;
+  public static JournalAbbreviations journalAbbrev;
 
 
   public static String lang(String key, String[] params) {
@@ -371,7 +377,7 @@ public class Globals {
                       updateWorkingDirectory, false);
   }
 
-    
+
   public static String getNewFile(JFrame owner, JabRefPreferences prefs,
                                   File directory, String extension,
                                   String description,
@@ -381,7 +387,7 @@ public class Globals {
                       updateWorkingDirectory, false);
   }
 
-    
+
   public static String getNewFile(JFrame owner, JabRefPreferences prefs,
                                   File directory, String extension, OpenFileFilter off,
                                   int dialogType,
@@ -423,7 +429,7 @@ public class Globals {
   }
 
   private static String getNewFile(JFrame owner, JabRefPreferences prefs,
-                                   File directory, String extension, 
+                                   File directory, String extension,
                                    String description,
                                    OpenFileFilter off,
                                    int dialogType,
@@ -510,7 +516,7 @@ public class Globals {
       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());
@@ -526,10 +532,12 @@ public class Globals {
   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."));
@@ -547,52 +555,18 @@ public class Globals {
     } catch (Throwable t) {
 
     }
-    /*
-    HTML_CHARS.put("\\{\\\\\\\"\\{a\\}\\}", "&auml;");
-    HTML_CHARS.put("\\{\\\\\\\"\\{A\\}\\}", "&Auml;");
-    HTML_CHARS.put("\\{\\\\\\\"\\{e\\}\\}", "&euml;");
-    HTML_CHARS.put("\\{\\\\\\\"\\{E\\}\\}", "&Euml;");
-    HTML_CHARS.put("\\{\\\\\\\"\\{i\\}\\}", "&iuml;");
-    HTML_CHARS.put("\\{\\\\\\\"\\{I\\}\\}", "&Iuml;");
-    HTML_CHARS.put("\\{\\\\\\\"\\{o\\}\\}", "&ouml;");
-    HTML_CHARS.put("\\{\\\\\\\"\\{O\\}\\}", "&Ouml;");
-    HTML_CHARS.put("\\{\\\\\\\"\\{u\\}\\}", "&uuml;");
-    HTML_CHARS.put("\\{\\\\\\\"\\{U\\}\\}", "&Uuml;");
-
-    HTML_CHARS.put("\\{\\\\\\`\\{e\\}\\}", "&egrave;");
-    HTML_CHARS.put("\\{\\\\\\`\\{E\\}\\}", "&Egrave;");
-    HTML_CHARS.put("\\{\\\\\\`\\{i\\}\\}", "&igrave;");
-    HTML_CHARS.put("\\{\\\\\\`\\{I\\}\\}", "&Igrave;");
-    HTML_CHARS.put("\\{\\\\\\`\\{o\\}\\}", "&ograve;");
-    HTML_CHARS.put("\\{\\\\\\`\\{O\\}\\}", "&Ograve;");
-    HTML_CHARS.put("\\{\\\\\\`\\{u\\}\\}", "&ugrave;");
-    HTML_CHARS.put("\\{\\\\\\`\\{U\\}\\}", "&Ugrave;");
-
-    HTML_CHARS.put("\\{\\\\\\'\\{e\\}\\}", "&eacute;");
-    HTML_CHARS.put("\\{\\\\\\'\\{E\\}\\}", "&Eacute;");
-    HTML_CHARS.put("\\{\\\\\\'\\{i\\}\\}", "&iacute;");
-    HTML_CHARS.put("\\{\\\\\\'\\{I\\}\\}", "&Iacute;");
-    HTML_CHARS.put("\\{\\\\\\'\\{o\\}\\}", "&oacute;");
-    HTML_CHARS.put("\\{\\\\\\'\\{O\\}\\}", "&Oacute;");
-    HTML_CHARS.put("\\{\\\\\\'\\{u\\}\\}", "&uacute;");
-    HTML_CHARS.put("\\{\\\\\\'\\{U\\}\\}", "&Uacute;");
-    HTML_CHARS.put("\\{\\\\\\'\\{a\\}\\}", "&aacute;");
-    HTML_CHARS.put("\\{\\\\\\'\\{A\\}\\}", "&Aacute;");
-    HTML_CHARS.put("\\{\\\\\\^\\{o\\}\\}", "&ocirc;");
-    HTML_CHARS.put("\\{\\\\\\^\\{O\\}\\}", "&Ocirc;");
-    HTML_CHARS.put("\\{\\\\\\^\\{u\\}\\}", "&ucirc;");
-    HTML_CHARS.put("\\{\\\\\\^\\{U\\}\\}", "&Ucirc;");
-    HTML_CHARS.put("\\{\\\\\\^\\{e\\}\\}", "&ecirc;");
-    HTML_CHARS.put("\\{\\\\\\^\\{E\\}\\}", "&Ecirc;");
-    HTML_CHARS.put("\\{\\\\\\^\\{i\\}\\}", "&icirc;");
-    HTML_CHARS.put("\\{\\\\\\^\\{I\\}\\}", "&Icirc;");
-    HTML_CHARS.put("\\{\\\\\\~\\{o\\}\\}", "&otilde;");
-    HTML_CHARS.put("\\{\\\\\\~\\{O\\}\\}", "&Otilde;");
-    HTML_CHARS.put("\\{\\\\\\~\\{n\\}\\}", "&ntilde;");
-    HTML_CHARS.put("\\{\\\\\\~\\{N\\}\\}", "&Ntilde;");
-    HTML_CHARS.put("\\{\\\\\\~\\{a\\}\\}", "&atilde;");
-    HTML_CHARS.put("\\{\\\\\\~\\{A\\}\\}", "&Atilde;");
-    */
+
+      // 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", "&auml;");
     HTMLCHARS.put("\"A", "&Auml;");
@@ -624,6 +598,8 @@ public class Globals {
     HTMLCHARS.put("'U", "&Uacute;");
     HTMLCHARS.put("'a", "&aacute;");
     HTMLCHARS.put("'A", "&Aacute;");
+    HTMLCHARS.put("^a", "&ocirc;");
+    HTMLCHARS.put("^A", "&Ocirc;");
     HTMLCHARS.put("^o", "&ocirc;");
     HTMLCHARS.put("^O", "&Ocirc;");
     HTMLCHARS.put("^u", "&ucirc;");
@@ -640,55 +616,6 @@ public class Globals {
     HTMLCHARS.put("~A", "&Atilde;");
     HTMLCHARS.put("cc", "&ccedil;");
     HTMLCHARS.put("cC", "&Ccedil;");
-    /*
-    HTML_CHARS.put("\\{\\\\\\\"a\\}", "&auml;");
-    HTML_CHARS.put("\\{\\\\\\\"A\\}", "&Auml;");
-    HTML_CHARS.put("\\{\\\\\\\"e\\}", "&euml;");
-    HTML_CHARS.put("\\{\\\\\\\"E\\}", "&Euml;");
-    HTML_CHARS.put("\\{\\\\\\\"i\\}", "&iuml;");
-    HTML_CHARS.put("\\{\\\\\\\"I\\}", "&Iuml;");
-    HTML_CHARS.put("\\{\\\\\\\"o\\}", "&ouml;");
-    HTML_CHARS.put("\\{\\\\\\\"O\\}", "&Ouml;");
-    HTML_CHARS.put("\\{\\\\\\\"u\\}", "&uuml;");
-    HTML_CHARS.put("\\{\\\\\\\"U\\}", "&Uuml;");
-
-    HTML_CHARS.put("\\{\\\\\\`e\\}", "&egrave;");
-    HTML_CHARS.put("\\{\\\\\\`E\\}", "&Egrave;");
-    HTML_CHARS.put("\\{\\\\\\`i\\}", "&igrave;");
-    HTML_CHARS.put("\\{\\\\\\`I\\}", "&Igrave;");
-    HTML_CHARS.put("\\{\\\\\\`o\\}", "&ograve;");
-    HTML_CHARS.put("\\{\\\\\\`O\\}", "&Ograve;");
-    HTML_CHARS.put("\\{\\\\\\`u\\}", "&ugrave;");
-    HTML_CHARS.put("\\{\\\\\\`U\\}", "&Ugrave;");
-    HTML_CHARS.put("\\{\\\\\\'A\\}", "&eacute;");
-    HTML_CHARS.put("\\{\\\\\\'E\\}", "&Eacute;");
-    HTML_CHARS.put("\\{\\\\\\'i\\}", "&iacute;");
-    HTML_CHARS.put("\\{\\\\\\'I\\}", "&Iacute;");
-    HTML_CHARS.put("\\{\\\\\\'o\\}", "&oacute;");
-    HTML_CHARS.put("\\{\\\\\\'O\\}", "&Oacute;");
-    HTML_CHARS.put("\\{\\\\\\'u\\}", "&uacute;");
-    HTML_CHARS.put("\\{\\\\\\'U\\}", "&Uacute;");
-    HTML_CHARS.put("\\{\\\\\\'a\\}", "&aacute;");
-    HTML_CHARS.put("\\{\\\\\\'A\\}", "&Aacute;");
-
-    HTML_CHARS.put("\\{\\\\\\^o\\}", "&ocirc;");
-    HTML_CHARS.put("\\{\\\\\\^O\\}", "&Ocirc;");
-    HTML_CHARS.put("\\{\\\\\\^u\\}", "&ucirc;");
-    HTML_CHARS.put("\\{\\\\\\^U\\}", "&Ucirc;");
-    HTML_CHARS.put("\\{\\\\\\^e\\}", "&ecirc;");
-    HTML_CHARS.put("\\{\\\\\\^E\\}", "&Ecirc;");
-    HTML_CHARS.put("\\{\\\\\\^i\\}", "&icirc;");
-    HTML_CHARS.put("\\{\\\\\\^I\\}", "&Icirc;");
-    HTML_CHARS.put("\\{\\\\\\~o\\}", "&otilde;");
-    HTML_CHARS.put("\\{\\\\\\~O\\}", "&Otilde;");
-    HTML_CHARS.put("\\{\\\\\\~n\\}", "&ntilde;");
-    HTML_CHARS.put("\\{\\\\\\~N\\}", "&Ntilde;");
-    HTML_CHARS.put("\\{\\\\\\~a\\}", "&atilde;");
-    HTML_CHARS.put("\\{\\\\\\~A\\}", "&Atilde;");
-
-    HTML_CHARS.put("\\{\\\\c c\\}", "&ccedil;");
-    HTML_CHARS.put("\\{\\\\c C\\}", "&Ccedil;");
-    */
 
     XML_CHARS.put("\\{\\\\\\\"\\{a\\}\\}", "&#x00E4;");
     XML_CHARS.put("\\{\\\\\\\"\\{A\\}\\}", "&#x00C4;");
@@ -766,6 +693,8 @@ public class Globals {
     XML_CHARS.put("\\{\\\\\\'a\\}", "&#x00E1;");
     XML_CHARS.put("\\{\\\\\\'A\\}", "&#x00C1;");
 
+    XML_CHARS.put("\\{\\\\\\^a\\}", "&#x00F4;");
+    XML_CHARS.put("\\{\\\\\\^A\\}", "&#x00D4;");
     XML_CHARS.put("\\{\\\\\\^o\\}", "&#x00F4;");
     XML_CHARS.put("\\{\\\\\\^O\\}", "&#x00D4;");
     XML_CHARS.put("\\{\\\\\\^u\\}", "&#x00F9;");
@@ -781,6 +710,11 @@ public class Globals {
     XML_CHARS.put("\\{\\\\\\~a\\}", "&#x00E3;");
     XML_CHARS.put("\\{\\\\\\~A\\}", "&#x00C3;");
 
+    ASCII2XML_CHARS.put("<", "&lt;");
+    ASCII2XML_CHARS.put("\"", "&quot;");
+    ASCII2XML_CHARS.put(">", "&gt;");
+
+
     UNICODE_CHARS.put("\u00C0", "A");
     UNICODE_CHARS.put("\u00C1", "A");
     UNICODE_CHARS.put("\u00C2", "A");
diff --git a/src/java/net/sf/jabref/IdComparator.java b/src/java/net/sf/jabref/IdComparator.java
new file mode 100644 (file)
index 0000000..5a238b2
--- /dev/null
@@ -0,0 +1,17 @@
+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());
+    }
+}
index f843d817bd17b83b6d4435f7e55e5fcb79523bce..5d9872b2b0fe41578b3a6a45976d7e0ce4507d4b 100644 (file)
@@ -16,33 +16,14 @@ public class IncrementalSearcher {
     }
 
     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, 
index 0c758c7e1edca39c041636b4f932777bb41b6eea..0e4681207c83597ffd792950b26acd9a51cefdf7 100644 (file)
@@ -24,7 +24,6 @@
  */
 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.*;
@@ -41,11 +40,9 @@ import java.util.*;
 
 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;
@@ -74,15 +71,7 @@ public class JabRef {
 
     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;
@@ -200,7 +189,7 @@ public class JabRef {
             // 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++) {
@@ -242,19 +231,32 @@ public class JabRef {
         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);
+
             }
         }
 
@@ -264,141 +266,68 @@ public class JabRef {
             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