Changeset 101815 for trunk/dports/java


Ignore:
Timestamp:
Jan 20, 2013, 2:46:21 PM (6 years ago)
Author:
nicos@…
Message:

jabref: update to 2.9.2

Location:
trunk/dports/java/jabref
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/java/jabref/Portfile

    r101150 r101815  
    55
    66name                jabref
    7 version             2.9.1
     7version             2.9.2
    88categories          java
    99platforms           darwin
     
    2020master_sites        sourceforge:project/jabref/jabref/${version}
    2121
    22 checksums           rmd160  42c635c3c40c14f299eb04f57392c361bc20dc3f \
    23                     sha256  db609ba3c92f2d2dd12821ba837b6c7f1cb191580c40c334533bd0d0f9ba6699
     22checksums           rmd160  ee1e399936ea6a315edb85c992eca8c0f31b8a71 \
     23                    sha256  12bc7e489709bc6f57327bf8e15c6bc9ceaa600369dca6452b7c13d792215e83
    2424
    2525worksrcdir          ${name}-${version}
  • trunk/dports/java/jabref/files/JabRefFrame.java.diff

    r101150 r101815  
    1 --- src/java/net/sf/jabref/JabRefFrame.java.orig        2013-01-01 14:36:55.000000000 +0900
    2 +++ src/java/net/sf/jabref/JabRefFrame.java     2013-01-05 20:11:11.000000000 +0900
    3 @@ -610,7 +610,32 @@
     1--- src/java/net/sf/jabref/JabRefFrame.java.orig        2013-01-13 00:12:24.000000000 +0900
     2+++ src/java/net/sf/jabref/JabRefFrame.java     2013-01-19 15:03:41.000000000 +0900
     3@@ -610,6 +610,31 @@
    44             sidePaneManager.show("search");
    55     }
    66 
    7 -
    87+    // The OSXAdapter calls this method when a ".bib" file has been double-clicked from the Finder.
    98+    public void openAction(String filePath) {
    109+               File file = new File(filePath);
    11 +
     10+               
    1211+               // Check if the file is already open.
    1312+               for (int i=0; i<this.getTabbedPane().getTabCount(); i++) {
    14 +                               BasePanel bp = this.baseAt(i);
    15 +                               if ((bp.getFile() != null) && bp.getFile().equals(file)) {
    16 +                                               //The file is already opened, so just raising its tab.
    17 +                                               this.getTabbedPane().setSelectedComponent(bp);
    18 +                                               return;
    19 +                                       }
     13+                       BasePanel bp = this.baseAt(i);
     14+                       if ((bp.getFile() != null) && bp.getFile().equals(file)) {
     15+                               //The file is already opened, so just raising its tab.
     16+                               this.getTabbedPane().setSelectedComponent(bp);
     17+                               return;
    2018+                       }
    21 +
     19+               }
     20+               
    2221+               if (file.exists()) {
    23 +                               // Run the actual open in a thread to prevent the program
    24 +                               // locking until the file is loaded.
    25 +                               final File theFile = new File(filePath);
    26 +                               (new Thread() {
    27 +                                               public void run() {
    28 +                                                               open.openIt(theFile, true);
    29 +                                                       }
    30 +                                       }).start();
    31 +                       }
    32 +       } 
    33 +   
     22+                       // Run the actual open in a thread to prevent the program
     23+                       // locking until the file is loaded.
     24+                       final File theFile = new File(filePath);
     25+                       (new Thread() {
     26+                               public void run() {
     27+                                       open.openIt(theFile, true);
     28+                               }
     29+                       }).start();
     30+               }
     31+       }
     32
    3433 AboutAction aboutAction = new AboutAction();
    3534   class AboutAction
    36        extends AbstractAction {
    37 @@ -815,28 +840,30 @@
     35@@ -815,29 +840,31 @@
    3836   private void macOSXRegistration() {
    3937     if (Globals.osName.equals(Globals.MAC)) {
     
    6159-          prefsEnableMethod.invoke(osxAdapter, args);
    6260-        }
     61-      }
    6362+                 Class<?> osxAdapter = Class.forName("osxadapter.OSXAdapter");
    6463+                 
     
    8584+                         registerMethod.invoke(osxAdapter, args);
    8685+                 }
    87        }
     86+         }
    8887       catch (NoClassDefFoundError e) {
    8988         // This will be thrown first if the OSXAdapter is loaded on a system without the EAWT
     89         // because OSXAdapter extends ApplicationAdapter in its def
  • trunk/dports/java/jabref/files/OSXAdapter.java.diff

    r101150 r101815  
    1 --- src/osx/osxadapter/OSXAdapter.java.orig     2013-01-01 14:36:56.000000000 +0900
    2 +++ src/osx/osxadapter/OSXAdapter.java  2013-01-05 20:06:32.000000000 +0900
     1--- src/osx/osxadapter/OSXAdapter.java.orig     2013-01-13 00:12:24.000000000 +0900
     2+++ src/osx/osxadapter/OSXAdapter.java  2013-01-19 14:52:29.000000000 +0900
    33@@ -1,133 +1,203 @@
    4  /*
     4-/*
    55-  File:    OSXAdapter.java
    66-
     
    135135-  }
    136136-}   */
     137+/*
    137138+ File: OSXAdapter.java
    138139+
    139140+ Abstract: Hooks existing preferences/about/quit functionality from an
    140 +     existing Java app into handlers for the Mac OS X application menu.
    141 +     Uses a Proxy object to dynamically implement the
    142 +     com.apple.eawt.ApplicationListener interface and register it with the
    143 +     com.apple.eawt.Application object.  This allows the complete project
    144 +     to be both built and run on any platform without any stubs or
    145 +     placeholders. Useful for developers looking to implement Mac OS X
    146 +     features while supporting multiple platforms with minimal impact.
     141+ existing Java app into handlers for the Mac OS X application menu.
     142+ Uses a Proxy object to dynamically implement the
     143+ com.apple.eawt.ApplicationListener interface and register it with the
     144+ com.apple.eawt.Application object.  This allows the complete project
     145+ to be both built and run on any platform without any stubs or
     146+ placeholders. Useful for developers looking to implement Mac OS X
     147+ features while supporting multiple platforms with minimal impact.
    147148+
    148149+ Version: 2.0
     
    190191+ */
    191192+
    192 +  package osxadapter;
    193 +  import java.lang.reflect.*;
    194 + 
    195 + 
    196 +  public class OSXAdapter implements InvocationHandler {
    197 + 
     193+package osxadapter;
     194+import java.lang.reflect.*;
     195+
     196+
     197+public class OSXAdapter implements InvocationHandler {
     198+       
    198199+    protected Object targetObject;
    199200+    protected Method targetMethod;
    200201+    protected String proxySignature;
    201 +
     202+       
    202203+    static Object macOSXApplication;
    203 +
     204+       
    204205+    // Pass this method an Object and Method equipped to perform application shutdown logic
    205206+    // The method passed should return a boolean stating whether or not the quit should occur
     
    207208+        setHandler(new OSXAdapter("handleQuit", target, quitHandler));
    208209+    }
    209 +
     210+       
    210211+    // Pass this method an Object and Method equipped to display application info
    211212+    // They will be called when the About menu item is selected from the application menu
     
    225226+        }
    226227+    }
    227 +
     228+       
    228229+    // Pass this method an Object and a Method equipped to display application options
    229230+    // They will be called when the Preferences menu item is selected from the application menu
     
    243244+        }
    244245+    }
    245 +
     246+       
    246247+    // Pass this method an Object and a Method equipped to handle document events from the Finder
    247248+    // Documents are registered with the Finder via the CFBundleDocumentTypes dictionary in the
     
    258259+                        this.targetMethod.invoke(this.targetObject, new Object[] { filename });
    259260+                    } catch (Exception ex) {
    260 +
     261+                                               
    261262+                    }
    262263+                }
     
    265266+        });
    266267+    }
    267 +
     268+       
    268269+    // setHandler creates a Proxy object from the passed OSXAdapter and adds it as an ApplicationListener
    269270+    public static void setHandler(OSXAdapter adapter) {
     
    285286+        }
    286287+    }
    287 +
     288+       
    288289+    // Each OSXAdapter has the name of the EAWT method it intends to listen for (handleAbout, for example),
    289290+    // the Object that will ultimately perform the task, and the Method to be called on that Object
     
    293294+        this.targetMethod = handler;
    294295+    }
    295 +
     296+       
    296297+    // Override this method to perform any operations on the event
    297298+    // that comes with the various callbacks
     
    304305+        return Boolean.valueOf(result.toString()).booleanValue();
    305306+    }
    306 +
     307+       
    307308+    // InvocationHandler implementation
    308309+    // This is the entry point for our proxy object; it is called every time an ApplicationListener method is invoked
     
    315316+        return null;
    316317+    }
    317 +
     318+       
    318319+    // Compare the method that was called to the intended method when the OSXAdapter instance was created
    319320+    // (e.g. handleAbout, handleQuit, handleOpenFile, etc.)
     
    321322+        return (targetMethod != null && proxySignature.equals(method.getName()) && args.length == 1);
    322323+    }
    323 +
     324+       
    324325+    // It is important to mark the ApplicationEvent as handled and cancel the default behavior
    325326+    // This method checks for a boolean result from the proxy method and sets the event accordingly
Note: See TracChangeset for help on using the changeset viewer.