Revision: 15880
http://gate.svn.sourceforge.net/gate/?rev=15880&view=rev
Author: valyt
Date: 2012-06-08 14:03:31 +0000 (Fri, 08 Jun 2012)
Log Message:
-----------
Support for Ubuntu unity.
Modified Paths:
--------------
gate/trunk/build/launcher/.classpath
gate/trunk/build/launcher/build.xml
gate/trunk/build/launcher/src/gate/Launcher.java
Added Paths:
-----------
gate/trunk/build/launcher/lib/
gate/trunk/build/launcher/lib/jayatana-1.2.3.jar
Modified: gate/trunk/build/launcher/.classpath
===================================================================
--- gate/trunk/build/launcher/.classpath 2012-06-08 01:19:40 UTC (rev
15879)
+++ gate/trunk/build/launcher/.classpath 2012-06-08 14:03:31 UTC (rev
15880)
@@ -2,5 +2,6 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib" path="lib/jayatana-1.2.3.jar"/>
<classpathentry kind="output" path="classes"/>
</classpath>
Modified: gate/trunk/build/launcher/build.xml
===================================================================
--- gate/trunk/build/launcher/build.xml 2012-06-08 01:19:40 UTC (rev 15879)
+++ gate/trunk/build/launcher/build.xml 2012-06-08 14:03:31 UTC (rev 15880)
@@ -8,8 +8,19 @@
plugin is in GATE Developer's plugin directory -->
<property name="src.dir" location="src" />
<property name="classes.dir" location="classes" />
+ <property name="lib.dir" location="lib" />
<property name="jar.location" location="../../bin/gateLauncher.jar" />
+ <!-- The libraries -->
+ <fileset id="libs" dir="${libDir}">
+ <include name="*.jar" />
+ </fileset>
+
+ <!-- The build CLASSPATH -->
+ <path id="build.class.path">
+ <fileset refid="libs" />
+ </path>
+
<!-- create build directory structure -->
<target name="prepare">
<mkdir dir="${classes.dir}" />
@@ -19,20 +30,27 @@
<target name="compile" depends="prepare">
<javac srcdir="${src.dir}"
destdir="${classes.dir}"
+ classpathref="build.class.path"
debug="true"
debuglevel="lines,source"
encoding="UTF-8"
- source="1.6" target="1.6" />
+ source="1.6"
+ target="1.6" />
</target>
<!-- create the JAR file -->
<target name="jar" depends="compile" >
<jar destfile="${jar.location}"
- update="false"
- basedir="${classes.dir}">
+ update="false">
<manifest>
<attribute name="Main-Class" value="gate.Launcher" />
</manifest>
+ <fileset dir="${classes.dir}" />
+ <archives>
+ <zips>
+ <fileset dir="${lib.dir}" includes="*.jar" />
+ </zips>
+ </archives>
</jar>
</target>
Added: gate/trunk/build/launcher/lib/jayatana-1.2.3.jar
===================================================================
(Binary files differ)
Property changes on: gate/trunk/build/launcher/lib/jayatana-1.2.3.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: gate/trunk/build/launcher/src/gate/Launcher.java
===================================================================
--- gate/trunk/build/launcher/src/gate/Launcher.java 2012-06-08 01:19:40 UTC
(rev 15879)
+++ gate/trunk/build/launcher/src/gate/Launcher.java 2012-06-08 14:03:31 UTC
(rev 15880)
@@ -29,15 +29,18 @@
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
-import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import javax.swing.filechooser.FileFilter;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+import org.java.ayatana.ApplicationMenu;
+import org.java.ayatana.AyatanaDesktop;
+
/**
* A simple launcher for GATE. It builds the correct classpath and starts
GATE.
*/
@@ -68,6 +71,28 @@
Thread.currentThread().setContextClassLoader(classLoader);
Class.forName("gate.Main", true, classLoader).getDeclaredMethod(
"main", new Class[]{String[].class}).invoke(null, new Object[] {args});
+ // try to register with Unity
+ if (AyatanaDesktop.isSupported()){
+ // the previous call will create a gate.gui.MainFrame in the swing thread
+ // we queue an action to be called once that completes.
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ // get the MainFrame class
+ try {
+ JFrame mainFrame = (JFrame) Class.forName("gate.gui.MainFrame",
+ true, classLoader).getDeclaredMethod("getInstance").invoke(
+ null, (Object[])null);
+ if(mainFrame != null){
+ ApplicationMenu.tryInstall(mainFrame);
+ }
+ } catch(Exception e) {
+ // could not do registration...
+ // ignore
+ }
+ }
+ });
+ }
}
protected void findGateHome() throws URISyntaxException {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs