Thread: [Jsxe-cvs] SF.net SVN: jsxe: [1140] tags/05pre3/jsxe
Status: Inactive
Brought to you by:
ian_lewis
From: <ian...@us...> - 2006-08-12 05:54:38
|
Revision: 1140 Author: ian_lewis Date: 2006-08-11 22:54:18 -0700 (Fri, 11 Aug 2006) ViewCVS: http://svn.sourceforge.net/jsxe/?rev=1140&view=rev Log Message: ----------- Added support for wrapper executables using launch4j in favor of jsmooth Modified Paths: -------------- tags/05pre3/jsxe/INSTALL tags/05pre3/jsxe/build.xml Added Paths: ----------- tags/05pre3/jsxe/installer/jsxe-installer.ico tags/05pre3/jsxe/installer/launch4j.xml tags/05pre3/jsxe/jsxe.ico tags/05pre3/jsxe/launch4j.xml Removed Paths: ------------- tags/05pre3/jsxe/buildlib/jsmoothgen-ant.jar tags/05pre3/jsxe/jsXe.jsmooth Modified: tags/05pre3/jsxe/INSTALL =================================================================== --- tags/05pre3/jsxe/INSTALL 2006-08-12 03:04:42 UTC (rev 1139) +++ tags/05pre3/jsxe/INSTALL 2006-08-12 05:54:18 UTC (rev 1140) @@ -2,6 +2,7 @@ Java 1.4.2 Xerces 2.8.0 +launch4j (for building the installer from source) GETTING jsXe @@ -24,6 +25,8 @@ BUILDING jsXe FROM SOURCE +** Requirements ** + This is pretty simple. You will need jakarta ANT and a Sun's javac compiler (others might work, I just haven't tested them). You will need the optional ant tasks installed as well. On some Linux distributions this may be a separate @@ -38,13 +41,28 @@ (where you installed jsXe's source) or in the jre/lib/ext or lib/ext in your JVM. These jar files will be included with jsXe distributions for convenience. -Simply typing 'ant' in jsXe's root directory will give you the +In order to build jsXe's installer or a windows distribution of jsXe you will +need to install launch4j (http://launch4j.sourceforge.net/). You can install it +in the buildlib directory or change the launch4j.dir property in the build.xml +file. + +** Building ** + +Simply typing 'ant -p' in jsXe's root directory will give you the available targets to use with ant. To just simply compile jsXe and the default views to a jar file you can type 'ant compile'. To build a binary distribution you will need to run the 'bin' target in the build.xml file. I do this by simply typing 'ant bin'. Source distributions can be built using the 'src' target by typing 'ant src'. +You can build jsXe's installer by running 'ant build-installer' which will +build jsXe's installer. The installer will be packaged in a jar file to be run +by java. + +You can build a windows distribution of jsXe by running the 'ant win'. This will +compile jsXe's installer and wrap it in an exe wrapper. The wrapper will search +for the appropriate java runtime with which to run jsXe. + INSTALLING jsXe Unpack the distribution file wherever you like. Normally you would install it @@ -52,14 +70,14 @@ RUNNING jsXe -You should have 1.4.2 or better of java and you need 2.6.2 of Xerces. +You should have 1.4.2 or better of java and you need 2.8.0 of Xerces. *Windows* Just run jsXe using the jsXe.exe in the install directory. The exe will detect your version of Java and run jsXe using that version. -*Unix* +*Unix/Linux* To run jsXe you should just run the java interpreter on the jsXe.jar file. There is a shell script or batch file included in the source tree for this purpose. Modified: tags/05pre3/jsxe/build.xml =================================================================== --- tags/05pre3/jsxe/build.xml 2006-08-12 03:04:42 UTC (rev 1139) +++ tags/05pre3/jsxe/build.xml 2006-08-12 05:54:18 UTC (rev 1140) @@ -15,10 +15,10 @@ sourceview module (optional) => jsxe/jars/sourceview jsxe installer (optional) => jsxe/installer jsxe web module (optional) => web/ - jsmooth ant task (optional) => buildlib/ + launch4j (needed for win builds) => buildlib/launch4j --> -<project basedir="." default="usage" name="jsXe"> +<project basedir="." default="compile" name="jsXe"> <description>jsXe - Java Simple XML Editor</description> @@ -48,6 +48,12 @@ <property name="build.messages" value="${build.dir}/messages"/> <property name="docs.dir" value="${src.dir}/doc"/> <property name="plugin.dir" value="${root.dir}/jars"/> + <property name="jsxe.jar" value="${build.dir}/${app.name}.jar"/> + <!-- jar file needs to be relative to the exe --> + <property name="launch4j.jsxe.jar" value="${app.name}.jar"/> + <property name="jsxe.exe" value="${build.dir}/${app.name}.exe"/> + <!-- launch4j doesn't like the ./ in the front of the path --> + <property name="launch4j.jsxe.exe" value="build/${app.name}.exe"/> <property name="build.plugin" value="${build.dir}/jars"/> <property name="build.src" value="${build.dir}/src"/> <property name="build.dest" value="${build.dir}/classes"/> @@ -61,8 +67,9 @@ <!--<property name="app_version" value="${major.version}_${minor.version}beta"/>--> <property name="distbin.dir" value="${build.dir}/${app.name}-${app_version}-bin"/> <property name="distsrc.dir" value="${build.dir}/${app.name}-${app_version}-src"/> - <property name="jsmooth.project" value="${root.dir}/jsXe.jsmooth"/> - <property name="jsmooth.jar" value="${buildlib.dir}/jsmoothgen-ant.jar"/> + <property name="launch4j.dir" value="${buildlib.dir}/launch4j"/> + <property name="launch4j.config" value="${root.dir}/launch4j.xml"/> + <property name="launch4j.classpath" value="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar"/> <!-- }}} --> <!-- {{{ installer directories --> <property name="installer.build.dir" value="${build.dir}/installer"/> @@ -74,6 +81,10 @@ <property name="installer.build.dest" value="${installer.build.dir}/build"/> <property name="install.props" value="${installer.build.dest}/installer/install.props"/> <property name="installer.dir" value="${root.dir}/installer"/> + <property name="installer.launch4j.config" value="${installer.dir}/launch4j.xml"/> + <!-- launch4j doesn't like the ./ in the front of the path --> + <property name="installer.jar" value="build/${app.name}-${app_version}-install.jar"/> + <property name="installer.exe" value="build/${app.name}-${app_version}-install.exe"/> <!-- }}} --> <!-- {{{ installer props --> <property name="installer.main.class" value="installer.Install"/> @@ -144,7 +155,7 @@ </path> <path id="run-classpath"> - <pathelement location="${build.dir}/${app.name}.jar"/> + <pathelement location="${jsxe.jar}"/> <fileset dir="${lib.dir}"> <include name="**/*.jar"/> </fileset> @@ -152,13 +163,6 @@ <!-- }}} --> <!-- {{{ conditionals --> - <available file="${jsmooth.jar}" property="jsmooth.avail"/> - <condition property="windows.build"> - <and> - <os family="windows"/> - <istrue value="${jsmooth.avail}"/> - </and> - </condition> <!-- set whether we have the source for the default views --> @@ -166,6 +170,7 @@ <available file="${plugin.dir}" property="plugin.avail"/> <available file="${plugin.dir}/treeview/build.xml" property="treeview.avail"/> <available file="${plugin.dir}/sourceview/build.xml" property="sourceview.avail"/> + <available file="${launch4j.dir}" property="launch4j.avail"/> <available classname="org.apache.bsf.BSFException" property="bsf.avail"/> <available classname="org.mozilla.javascript.JavaScriptException" property="js.avail"/> @@ -177,21 +182,6 @@ <echo message="----------------------------------------------------------"/> </target> <!-- }}} --> - <!-- {{{ ============ Prints the available targets ===================== --> - <target depends="init" name="usage" description="Prints available targets"> - <echo message=" available targets are:"/> - <echo message=""/> - <echo message=" compile --> generates the ${app.name}.jar file."/> - <echo message=" also generates the jars for the tree view"/> - <echo message=" and source view plugins if available."/> - <echo message=" bin --> generates a binary distribution"/> - <echo message=" src --> generates a source distribution"/> - <echo message=" doc --> generates all documentation"/> - <echo message=" also updates the web api if the web module"/> - <echo message=" is available."/> - <echo message=" clean --> cleans everything up"/> - </target> - <!-- }}} --> <!-- {{{ ============ Prepares for any type of build =================== --> <target depends="init" name="prepare"> <mkdir dir="${build.dir}"/> @@ -247,6 +237,7 @@ <classpath refid="classpath"/> <include name="**/*.java"/> </javac> + <copy todir="${build.dest}"> <fileset dir="${build.src}"> <include name="**/*.props"/> @@ -280,7 +271,7 @@ </section> </manifest> - <jar jarfile="${build.dir}/${app.name}.jar" manifest="${build.dir}/${app.name}.manifest"> + <jar jarfile="${jsxe.jar}" manifest="${build.dir}/${app.name}.manifest"> <fileset dir="${build.dest}"> <include name="**/*.class"/> <include name="**/properties"/> @@ -361,8 +352,9 @@ <!-- {{{ ============ Builds the installer ============================= --> <target depends="compile, prepare-build, doc" name="build-installer" description="Builds the installer"> - <fail unless="js.avail" message="You must have the ${buildlib.dir}/js.jar in your classpath to build the installer. See http://ant.apache.org/manual/install.html#librarydependencies"/> - <fail unless="bsf.avail" message="You must have the ${buildlib.dir}/bsf.jar in your classpath to build the installer. See http://ant.apache.org/manual/install.html#librarydependencies"/> + <fail unless="js.avail" message="You must have the ${buildlib.dir}/js.jar in your classpath to build the installer. It is located in the ${buildlib.dir} directory. See http://ant.apache.org/manual/install.html#librarydependencies"/> + <fail unless="bsf.avail" message="You must have the ${buildlib.dir}/bsf.jar in your classpath to build the installer. It is located in the ${buildlib.dir} directory. See http://ant.apache.org/manual/install.html#librarydependencies"/> + <fail unless="launch4j.avail" message="You must install launch4j in ${launch4j.dir} or change the launch4j.dir property in build.xml"/> <fail unless="treeview.avail" message="You must have the treeview source available to build the installer."/> <fail unless="sourceview.avail" message="You must have the sourceview source available to build the installer."/> @@ -448,7 +440,7 @@ </fileset> </copy> - <copy file="${build.dir}/${app.name}.jar" tofile="${installer.program.dir}/${app.name}.jar"/> + <copy file="${jsxe.jar}" todir="${installer.program.dir}"/> <!-- lib --> <mkdir dir="${installer.program.dir}/lib"/> <copy todir="${installer.program.dir}/lib"> @@ -457,9 +449,27 @@ </fileset> </copy> + <!-- copy the lib directory so that the jsXe.exe can be run + from the build dir --> + <mkdir dir="${build.dir}/lib"/> + <copy todir="${build.dir}/lib"> + <fileset dir="${build.lib}"> + <include name="**/*"/> + </fileset> + </copy> + <!-- create the windows exe --> - <antcall target="build-exe"/> + <taskdef name="launch4j" + classname="net.sf.launch4j.ant.Launch4jTask" + classpath="${launch4j.classpath}"/> + <launch4j configFile="${launch4j.config}" + outfile="${launch4j.jsxe.exe}" + jarPath="${launch4j.jsxe.jar}" + /> + + <copy file="${jsxe.exe}" todir="${installer.program.dir}" /> + <!-- create the tar.bz2 for the installer --> <tar basedir="${installer.program.dir}" includes="**/*" tarfile="${installer.build.dir}/${app.name}-${app_version}-program.tar"/> <bzip2 src="${installer.build.dir}/${app.name}-${app_version}-program.tar" destfile="${installer.build.program.tar}"/> @@ -595,7 +605,7 @@ <!-- }}} --> <!-- {{{ create the install jar --> - <jar jarfile="${build.dir}/${app.name}-${app_version}-install.jar" manifest="${installer.build.dir}/installer.manifest"> + <jar jarfile="${installer.jar}" manifest="${installer.build.dir}/installer.manifest"> <fileset dir="${installer.build.dest}"> <include name="**/*"/> </fileset> @@ -603,18 +613,16 @@ <!-- }}} --> </target> - <target name="build-exe" if="windows.build"> - <taskdef name="jsmoothgen" - classname="net.charabia.jsmoothgen.ant.JSmoothGen" - classpath="${jsmooth.jar}"/> - - <jsmoothgen project="${jsmooth.project}" skeletonroot="${buildlib.dir}/skeletons"/> - <copy todir="${installer.program.dir}" file="${build.dir}/jsXe.exe"/> - </target> <!-- }}} --> <!-- {{{ ============ Generates a windows distribution ================= --> - <target depends="build-installer" name="win" if="windows.build" description="Build a windows distribution"> + <target depends="build-installer" name="win" description="Build a windows distribution"> + <taskdef name="launch4j" + classname="net.sf.launch4j.ant.Launch4jTask" + classpath="${launch4j.classpath}"/> + <launch4j configFile="${installer.launch4j.config}" + jar="${installer.jar}" + outfile="${installer.exe}"/> </target> <!-- }}} --> <!-- {{{ ============ Generates the binary distribution ================ --> @@ -661,7 +669,7 @@ </fileset> </copy> - <copy file="${build.dir}/${app.name}.jar" tofile="${distbin.dir}/${app.name}.jar"/> + <copy file="${jsxe.jar}" todir="${distbin.dir}"/> <!-- lib --> <mkdir dir="${distbin.dir}/lib"/> <copy todir="${distbin.dir}/lib"> @@ -695,7 +703,7 @@ </fileset> </copy> - <!-- api --> + <!-- api --> <mkdir dir="${distsrc.dir}/doc/api"/> <copy todir="${distsrc.dir}/doc/api"> <fileset dir="${build.javadocs}"> @@ -747,7 +755,7 @@ <include name="**/*"/> </fileset> </copy> - <copy todir="${distsrc.dir}" file="${jsmooth.project}"/> + <copy todir="${distsrc.dir}" file="${launch4j.config}"/> <!-- messages --> <mkdir dir="${distsrc.dir}/messages"/> Deleted: tags/05pre3/jsxe/buildlib/jsmoothgen-ant.jar =================================================================== (Binary files differ) Added: tags/05pre3/jsxe/installer/jsxe-installer.ico =================================================================== (Binary files differ) Property changes on: tags/05pre3/jsxe/installer/jsxe-installer.ico ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: tags/05pre3/jsxe/installer/launch4j.xml =================================================================== --- tags/05pre3/jsxe/installer/launch4j.xml (rev 0) +++ tags/05pre3/jsxe/installer/launch4j.xml 2006-08-12 05:54:18 UTC (rev 1140) @@ -0,0 +1,20 @@ +<launch4jConfig> + <dontWrapJar>false</dontWrapJar> + <headerType>0</headerType> + <jar>..\build\jsXe-05_pre3-install.jar</jar> + <outfile>..\build\jsxe-installer.exe</outfile> + <errTitle>jsXe Installer</errTitle> + <jarArgs></jarArgs> + <chdir></chdir> + <customProcName>true</customProcName> + <stayAlive>false</stayAlive> + <icon>jsxe-installer.ico</icon> + <jre> + <path></path> + <minVersion>1.4.2</minVersion> + <maxVersion></maxVersion> + <initialHeapSize>16</initialHeapSize> + <maxHeapSize>64</maxHeapSize> + <args></args> + </jre> +</launch4jConfig> \ No newline at end of file Property changes on: tags/05pre3/jsxe/installer/launch4j.xml ___________________________________________________________________ Name: svn:executable + * Deleted: tags/05pre3/jsxe/jsXe.jsmooth =================================================================== --- tags/05pre3/jsxe/jsXe.jsmooth 2006-08-12 03:04:42 UTC (rev 1139) +++ tags/05pre3/jsxe/jsXe.jsmooth 2006-08-12 05:54:18 UTC (rev 1140) @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<jsmoothproject> -<JVMSearchPath>registry</JVMSearchPath> -<JVMSearchPath>javahome</JVMSearchPath> -<JVMSearchPath>jrepath</JVMSearchPath> -<JVMSearchPath>jdkpath</JVMSearchPath> -<JVMSearchPath>exepath</JVMSearchPath> -<JVMSearchPath>jview</JVMSearchPath> -<classPath>build\jsXe.jar</classPath> -<embeddedJar>false</embeddedJar> -<executableName>build\jsXe.exe</executableName> -<iconLocation>src\net\sourceforge\jsxe\icons\jsxe.jpg</iconLocation> -<initialMemoryHeap>16777216</initialMemoryHeap> -<javaProperties> -<name>java.endorsed.dirs</name> -<value>lib</value> -</javaProperties> -<mainClassName>net.sourceforge.jsxe.jsXe</mainClassName> -<maximumMemoryHeap>67108864</maximumMemoryHeap> -<maximumVersion></maximumVersion> -<minimumVersion>1.4.2</minimumVersion> -<skeletonName>Windowed Wrapper</skeletonName> -<skeletonProperties> -<key>Message</key> -<value>Java has not been found on your computer. Do you want to download it?</value> -</skeletonProperties> -<skeletonProperties> -<key>URL</key> -<value>http://www.java.com</value> -</skeletonProperties> -<skeletonProperties> -<key>SingleProcess</key> -<value>0</value> -</skeletonProperties> -<skeletonProperties> -<key>Debug</key> -<value>0</value> -</skeletonProperties> -</jsmoothproject> Added: tags/05pre3/jsxe/jsxe.ico =================================================================== (Binary files differ) Property changes on: tags/05pre3/jsxe/jsxe.ico ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: tags/05pre3/jsxe/launch4j.xml =================================================================== --- tags/05pre3/jsxe/launch4j.xml (rev 0) +++ tags/05pre3/jsxe/launch4j.xml 2006-08-12 05:54:18 UTC (rev 1140) @@ -0,0 +1,23 @@ +<launch4jConfig> + <dontWrapJar>true</dontWrapJar> + <headerType>0</headerType> + <jar>jsXe.jar</jar> + <outfile>build\jsXe.exe</outfile> + <errTitle>jsXe</errTitle> + <jarArgs></jarArgs> + <chdir></chdir> + <customProcName>true</customProcName> + <stayAlive>false</stayAlive> + <icon>jsxe.ico</icon> + <jre> + <path></path> + <minVersion>1.4.2</minVersion> + <maxVersion></maxVersion> + <initialHeapSize>16</initialHeapSize> + <maxHeapSize>64</maxHeapSize> + <args>-Djava.endorsed.dirs=lib + + +</args> + </jre> +</launch4jConfig> \ No newline at end of file Property changes on: tags/05pre3/jsxe/launch4j.xml ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ian...@us...> - 2006-08-12 16:50:34
|
Revision: 1141 Author: ian_lewis Date: 2006-08-12 09:50:27 -0700 (Sat, 12 Aug 2006) ViewCVS: http://svn.sourceforge.net/jsxe/?rev=1141&view=rev Log Message: ----------- Fixed the installer for unix/linux Modified Paths: -------------- tags/05pre3/jsxe/Changelog tags/05pre3/jsxe/build.xml tags/05pre3/jsxe/installer/src/installer/OperatingSystem.java Modified: tags/05pre3/jsxe/Changelog =================================================================== --- tags/05pre3/jsxe/Changelog 2006-08-12 05:54:18 UTC (rev 1140) +++ tags/05pre3/jsxe/Changelog 2006-08-12 16:50:27 UTC (rev 1141) @@ -1,3 +1,9 @@ +08/12/2006 Ian Lewis <Ian...@me...> + + * Added support for running jsXe in a wrapped exe using launch4j. + * Added an installer for jsXe. The installer can be packaged in an exe for + easy use by windows users. + 08/09/2006 Ian Lewis <Ian...@me...> * Added a new option to the Global Options dialog for the number of undo Modified: tags/05pre3/jsxe/build.xml =================================================================== --- tags/05pre3/jsxe/build.xml 2006-08-12 05:54:18 UTC (rev 1140) +++ tags/05pre3/jsxe/build.xml 2006-08-12 16:50:27 UTC (rev 1141) @@ -569,6 +569,9 @@ <entry key="app.license.title" value="${app.license.title}"/> <entry key="app.license" value="${app.license}"/> <entry key="ostask.unix-script.label" value="${ostask.unix-script.label}"/> + + <entry key="extra.vm.args" value="-Djava.endorsed.dirs=lib"/> + <!--<entry key="ostask.unix-man.label" value="${ostask.unix-man.label}"/>--> <entry key="comp.count" value="${comp.count}"/> <entry key="comp.0.name" value="${comp.0.name}"/> Modified: tags/05pre3/jsxe/installer/src/installer/OperatingSystem.java =================================================================== --- tags/05pre3/jsxe/installer/src/installer/OperatingSystem.java 2006-08-12 05:54:18 UTC (rev 1140) +++ tags/05pre3/jsxe/installer/src/installer/OperatingSystem.java 2006-08-12 16:50:27 UTC (rev 1141) @@ -22,321 +22,326 @@ */ public abstract class OperatingSystem { - public abstract String getInstallDirectory(String name, String version); + public abstract String getInstallDirectory(String name, String version); - public abstract static class OSTask - { - protected Install installer; - protected String name; - protected String label; - protected String directory; - protected boolean enabled; + public abstract static class OSTask + { + protected Install installer; + protected String name; + protected String label; + protected String directory; + protected boolean enabled; - public OSTask(Install installer, String name) - { - this.installer = installer; - this.name = name; - this.label = installer.getProperty("ostask." + name + ".label"); - this.directory = getDefaultDirectory(installer); + public OSTask(Install installer, String name) + { + this.installer = installer; + this.name = name; + this.label = installer.getProperty("ostask." + name + ".label"); + this.directory = getDefaultDirectory(installer); - // on by default - enabled = true; - } + // on by default + enabled = true; + } - public String getName() - { - return name; - } + public String getName() + { + return name; + } - public String getLabel() - { - return label; - } + public String getLabel() + { + return label; + } - public String getDefaultDirectory(Install installer) - { - return null; - } + public String getDefaultDirectory(Install installer) + { + return null; + } - public String getDirectory() - { - return directory; - } + public String getDirectory() + { + return directory; + } - public boolean isEnabled() - { - return enabled; - } + public boolean isEnabled() + { + return enabled; + } - public void setEnabled(boolean enabled) - { - this.enabled = enabled; - } + public void setEnabled(boolean enabled) + { + this.enabled = enabled; + } - public void setDirectory(String directory) - { - this.directory = directory; - } + public void setDirectory(String directory) + { + this.directory = directory; + } - public abstract void perform(String installDir, - Vector filesets) throws IOException; - } + public abstract void perform(String installDir, + Vector filesets) throws IOException; + } - public OSTask[] getOSTasks(Install installer) - { - return new OSTask[0]; - } + public OSTask[] getOSTasks(Install installer) + { + return new OSTask[0]; + } - public void mkdirs(String directory) throws IOException - { - File file = new File(directory); - if(!file.exists()) - file.mkdirs(); - } + public void mkdirs(String directory) throws IOException + { + File file = new File(directory); + if(!file.exists()) + file.mkdirs(); + } - public static OperatingSystem getOperatingSystem() - { - if(os != null) - return os; + public static OperatingSystem getOperatingSystem() + { + if(os != null) + return os; - if(System.getProperty("mrj.version") != null) - os = new MacOS(); - else - { - String osName = System.getProperty("os.name"); - if(osName.indexOf("Windows") != -1) - os = new Windows(); - else if(osName.indexOf("OS/2") != -1) - os = new HalfAnOS(); - else if(osName.indexOf("VMS") != -1) - os = new VMS(); - else - os = new Unix(); - } + if(System.getProperty("mrj.version") != null) + os = new MacOS(); + else + { + String osName = System.getProperty("os.name"); + if(osName.indexOf("Windows") != -1) + os = new Windows(); + else if(osName.indexOf("OS/2") != -1) + os = new HalfAnOS(); + else if(osName.indexOf("VMS") != -1) + os = new VMS(); + else + os = new Unix(); + } - return os; - } + return os; + } - public static class Unix extends OperatingSystem - { - public String getInstallDirectory(String name, String version) - { - String dir = "/usr/local/share/"; - if(!new File(dir).canWrite()) - dir = System.getProperty("user.home"); + public static class Unix extends OperatingSystem + { + public String getInstallDirectory(String name, String version) + { + String dir = "/usr/local/share/"; + if(!new File(dir).canWrite()) + dir = System.getProperty("user.home"); - return new File(dir,name.toLowerCase() + "/" + version).getPath(); - } + return new File(dir,name.toLowerCase() + "/" + version).getPath(); + } - public class ScriptOSTask extends OSTask - { - public ScriptOSTask(Install installer) - { - super(installer,"unix-script"); - } + public class ScriptOSTask extends OSTask + { + public ScriptOSTask(Install installer) + { + super(installer,"unix-script"); + } - public String getDefaultDirectory(Install installer) - { - String dir = "/usr/local/"; - if(!new File(dir).canWrite()) - dir = System.getProperty("user.home"); + public String getDefaultDirectory(Install installer) + { + String dir = "/usr/local/"; + if(!new File(dir).canWrite()) + dir = System.getProperty("user.home"); - return new File(dir,"bin").getPath(); - } + return new File(dir,"bin").getPath(); + } - public void perform(String installDir, - Vector filesets) throws IOException - { - if(!enabled) - return; + public void perform(String installDir, + Vector filesets) throws IOException + { + if(!enabled) + return; - mkdirs(directory); + mkdirs(directory); - String name = installer.getProperty("app.name"); + String name = installer.getProperty("app.name"); + String vmArgs = installer.getProperty("extra.vm.args"); - // create app start script - String script = directory + File.separatorChar - + name.toLowerCase(); + // create app start script + String script = directory + File.separatorChar + + name.toLowerCase(); - // Delete existing copy - new File(script).delete(); + // Delete existing copy + new File(script).delete(); - // Write simple script - FileWriter out = new FileWriter(script); - out.write("#!/bin/sh\n"); - out.write("# Java heap size, in megabytes\n"); - out.write("JAVA_HEAP_SIZE=32\n"); - out.write("DEFAULT_JAVA_HOME=\"" - + System.getProperty("java.home") - + "\"\n"); - out.write("if [ \"$JAVA_HOME\" = \"\" ]; then\n"); - out.write("JAVA_HOME=\"$DEFAULT_JAVA_HOME\"\n"); - out.write("fi\n"); + // Write simple script + FileWriter out = new FileWriter(script); + out.write("#!/bin/sh\n"); + out.write("# Java heap size, in megabytes\n"); + out.write("JAVA_HEAP_SIZE=32\n"); + out.write("DEFAULT_JAVA_HOME=\"" + + System.getProperty("java.home") + + "\"\n"); + out.write("if [ \"$JAVA_HOME\" = \"\" ]; then\n"); + out.write("JAVA_HOME=\"$DEFAULT_JAVA_HOME\"\n"); + out.write("fi\n"); - out.write("exec \"$JAVA_HOME" - + "/bin/java\" -mx${JAVA_HEAP_SIZE}m ${" - + name.toUpperCase() + "} "); + out.write("exec \"$JAVA_HOME" + + "/bin/java\" -mx${JAVA_HEAP_SIZE}m "+vmArgs+" ${" + + name.toUpperCase() + "} "); - String jar = installDir + File.separator - + name.toLowerCase() + ".jar"; + // String jar = installDir + File.separator + // + name.toLowerCase() + ".jar"; + + String jar = installDir + File.separator + + name + ".jar"; - out.write("-jar \"" + jar + "\" $@\n"); + out.write("-jar \"" + jar + "\" $@\n"); - out.close(); + out.close(); - // Make it executable - String[] chmodArgs = { "chmod", "755", script }; - exec(chmodArgs); - } - } + // Make it executable + String[] chmodArgs = { "chmod", "755", script }; + exec(chmodArgs); + } + } - public class ManPageOSTask extends OSTask - { - public ManPageOSTask(Install installer) - { - super(installer,"unix-man"); - } + public class ManPageOSTask extends OSTask + { + public ManPageOSTask(Install installer) + { + super(installer,"unix-man"); + } - public String getDefaultDirectory(Install installer) - { - String dir = "/usr/local/"; - if(!new File(dir).canWrite()) - dir = System.getProperty("user.home"); + public String getDefaultDirectory(Install installer) + { + String dir = "/usr/local/"; + if(!new File(dir).canWrite()) + dir = System.getProperty("user.home"); - return new File(dir,"man/man1").getPath(); - } + return new File(dir,"man/man1").getPath(); + } - public void perform(String installDir, - Vector filesets) throws IOException - { - if(!enabled) - return; + public void perform(String installDir, + Vector filesets) throws IOException + { + if(!enabled) + return; - mkdirs(directory); + mkdirs(directory); - String name = installer.getProperty("app.name"); + String name = installer.getProperty("app.name"); - // install man page - String manpage = installer.getProperty("ostask.unix-man.manpage"); + // install man page + String manpage = installer.getProperty("ostask.unix-man.manpage"); - InputStream in = getClass().getResourceAsStream("/" + manpage); - installer.copy(in,new File(directory,manpage).getPath(), - null); - } - } + if (manpage != null) { + InputStream in = getClass().getResourceAsStream("/" + manpage); + installer.copy(in, new File(directory,manpage).getPath(), null); + } + } + } - public OSTask[] getOSTasks(Install installer) - { - return new OSTask[] { new ScriptOSTask(installer), - new ManPageOSTask(installer) }; - } + public OSTask[] getOSTasks(Install installer) + { + return new OSTask[] { new ScriptOSTask(installer), + new ManPageOSTask(installer) }; + } - public void mkdirs(String directory) throws IOException - { - File file = new File(directory); - if(!file.exists()) - { - String[] mkdirArgs = { "mkdir", "-m", "755", - "-p", directory }; - exec(mkdirArgs); - } - } + public void mkdirs(String directory) throws IOException + { + File file = new File(directory); + if(!file.exists()) + { + String[] mkdirArgs = { "mkdir", "-m", "755", + "-p", directory }; + exec(mkdirArgs); + } + } - public void exec(String[] args) throws IOException - { - Process proc = Runtime.getRuntime().exec(args); - proc.getInputStream().close(); - proc.getOutputStream().close(); - proc.getErrorStream().close(); - try - { - proc.waitFor(); - } - catch(InterruptedException ie) - { - } - } - } + public void exec(String[] args) throws IOException + { + Process proc = Runtime.getRuntime().exec(args); + proc.getInputStream().close(); + proc.getOutputStream().close(); + proc.getErrorStream().close(); + try + { + proc.waitFor(); + } + catch(InterruptedException ie) + { + } + } + } - public static class MacOS extends Unix - { - public String getInstallDirectory(String name, String version) - { - return "/Applications/" + name + " " + version; - } - } + public static class MacOS extends Unix + { + public String getInstallDirectory(String name, String version) + { + return "/Applications/" + name + " " + version; + } + } - public static class Windows extends OperatingSystem - { - public String getInstallDirectory(String name, String version) - { - return "C:\\Program Files\\" + name + " " + version; - } + public static class Windows extends OperatingSystem + { + public String getInstallDirectory(String name, String version) + { + return "C:\\Program Files\\" + name + " " + version; + } - public class JEditLauncherOSTask extends OSTask - { - public JEditLauncherOSTask(Install installer) - { - super(installer,"jedit-launcher"); - } + public class JEditLauncherOSTask extends OSTask + { + public JEditLauncherOSTask(Install installer) + { + super(installer,"jedit-launcher"); + } - public String getDefaultDirectory(Install installer) - { - return null; - } + public String getDefaultDirectory(Install installer) + { + return null; + } - public void perform(String installDir, - Vector filesets) - { - if(!enabled - || !filesets.contains("jedit-windows")) - return; + public void perform(String installDir, + Vector filesets) + { + if(!enabled + || !filesets.contains("jedit-windows")) + return; - // run jEditLauncher installation - File executable = new File(installDir,"jedit.exe"); - if(!executable.exists()) - return; + // run jEditLauncher installation + File executable = new File(installDir,"jedit.exe"); + if(!executable.exists()) + return; - String[] args = { executable.getPath(), "/i", - System.getProperty("java.home") - + File.separator - + "bin" }; + String[] args = { executable.getPath(), "/i", + System.getProperty("java.home") + + File.separator + + "bin" }; - try - { - Runtime.getRuntime().exec(args).waitFor(); - } - catch(IOException io) - { - } - catch(InterruptedException ie) - { - } - } - } + try + { + Runtime.getRuntime().exec(args).waitFor(); + } + catch(IOException io) + { + } + catch(InterruptedException ie) + { + } + } + } - public OSTask[] getOSTasks(Install installer) - { - return new OSTask[] { /* new JEditLauncherOSTask(installer) */ }; - } - } + public OSTask[] getOSTasks(Install installer) + { + return new OSTask[] { /* new JEditLauncherOSTask(installer) */ }; + } + } - public static class HalfAnOS extends OperatingSystem - { - public String getInstallDirectory(String name, String version) - { - return "C:\\" + name + " " + version; - } - } + public static class HalfAnOS extends OperatingSystem + { + public String getInstallDirectory(String name, String version) + { + return "C:\\" + name + " " + version; + } + } - public static class VMS extends OperatingSystem - { - public String getInstallDirectory(String name, String version) - { - return "./" + name.toLowerCase() + "/" + version; - } - } + public static class VMS extends OperatingSystem + { + public String getInstallDirectory(String name, String version) + { + return "./" + name.toLowerCase() + "/" + version; + } + } - // private members - private static OperatingSystem os; + // private members + private static OperatingSystem os; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ian...@us...> - 2006-08-12 17:22:45
|
Revision: 1142 Author: ian_lewis Date: 2006-08-12 10:22:38 -0700 (Sat, 12 Aug 2006) ViewCVS: http://svn.sourceforge.net/jsxe/?rev=1142&view=rev Log Message: ----------- moved the windows exe integration into it's own installer component Modified Paths: -------------- tags/05pre3/jsxe/Changelog tags/05pre3/jsxe/INSTALL tags/05pre3/jsxe/build.xml Modified: tags/05pre3/jsxe/Changelog =================================================================== --- tags/05pre3/jsxe/Changelog 2006-08-12 16:50:27 UTC (rev 1141) +++ tags/05pre3/jsxe/Changelog 2006-08-12 17:22:38 UTC (rev 1142) @@ -3,6 +3,8 @@ * Added support for running jsXe in a wrapped exe using launch4j. * Added an installer for jsXe. The installer can be packaged in an exe for easy use by windows users. + * Moved the windows integration into it's own component in the installer so + that it won't be installed on systems other than Windows. 08/09/2006 Ian Lewis <Ian...@me...> Modified: tags/05pre3/jsxe/INSTALL =================================================================== --- tags/05pre3/jsxe/INSTALL 2006-08-12 16:50:27 UTC (rev 1141) +++ tags/05pre3/jsxe/INSTALL 2006-08-12 17:22:38 UTC (rev 1142) @@ -14,14 +14,27 @@ Once you have the source trees for both of these you should put them in a directory called 'jars' in your jsXe root folder. Once they are in that folder, the ant targets (compile, bin, src, etc.) will recognise those plugins and build -them if necessary. So something like this should do it: +them if necessary. -cvs checkout jsxe +You should check out jsxe to make a structure like this. This ensures that +when compiling jsXe the other views and will be compiled as well. It also +ensures that you can build jsxe's installer in binary release distributions. + +jsxe module => jsxe/ +treeview module (optional) => jsxe/jars/treeview +sourceview module (optional) => jsxe/jars/sourceview +jsxe installer (optional) => jsxe/installer +jsxe web module (optional) => web/ +launch4j (needed for win builds) => buildlib/launch4j + +So something like this should do it: + +svn checkout https://svn.sourceforge.net/svnroot/jsxe/trunk/jsxe cd jsxe mkdir jars cd jars -cvs checkout treeview -cvs checkout sourceview +svn checkout https://svn.sourceforge.net/svnroot/jsxe/trunk/treeview +svn checkout https://svn.sourceforge.net/svnroot/jsxe/trunk/sourceview BUILDING jsXe FROM SOURCE @@ -44,7 +57,9 @@ In order to build jsXe's installer or a windows distribution of jsXe you will need to install launch4j (http://launch4j.sourceforge.net/). You can install it in the buildlib directory or change the launch4j.dir property in the build.xml -file. +file. You will also need to put the js.jar and bsf.jar in your classpath. These +files are found in the 'buildlib' directory. They are used in scripts for +calculating file sizes. ** Building ** Modified: tags/05pre3/jsxe/build.xml =================================================================== --- tags/05pre3/jsxe/build.xml 2006-08-12 16:50:27 UTC (rev 1141) +++ tags/05pre3/jsxe/build.xml 2006-08-12 17:22:38 UTC (rev 1142) @@ -77,6 +77,7 @@ <property name="installer.api.dir" value="${installer.build.dir}/api"/> <property name="installer.treeview.dir" value="${installer.build.dir}/treeview"/> <property name="installer.sourceview.dir" value="${installer.build.dir}/sourceview"/> + <property name="installer.win.dir" value="${installer.build.dir}/win"/> <property name="installer.build.src" value="${installer.build.dir}/src"/> <property name="installer.build.dest" value="${installer.build.dir}/build"/> <property name="install.props" value="${installer.build.dest}/installer/install.props"/> @@ -97,7 +98,7 @@ <property name="ostask.unix-script.label" value="Install shortcut in:"/> <property name="ostask.unix-man.label" value="Install manual page in:"/> <!--<property name="ostask.unix-man.manpage" value="jsxe.1"/>--> - <property name="comp.count" value="4"/> + <property name="comp.count" value="5"/> <property name="comp.0.name" value="jsXe XML Editor"/> <!-- size values are set by the filesize task in the @@ -130,6 +131,16 @@ <property name="comp.3.real-size" value="6073"/>--> <property name="comp.3.fileset" value="jsxe-api"/> <property name="installer.build.api.tar" value="${installer.build.dest}/installer/${comp.3.fileset}.tar.bz2"/> + + <property name="comp.4.name" value="Windows Integration (highly recommended)"/> + <!-- size values are set by the filesize task in the + build-installer task --> + <!--<property name="comp.4.disk-size" value="7084"/> + <property name="comp.4.real-size" value="6073"/>--> + <property name="comp.4.fileset" value="jsxe-win"/> + <property name="comp.4.os" value="Windows"/> + <property name="installer.build.win.tar" value="${installer.build.dest}/installer/${comp.4.fileset}.tar.bz2"/> + <!-- }}} --> <!-- {{{ java build properties --> <property name="javac.debug" value="on"/> @@ -449,27 +460,6 @@ </fileset> </copy> - <!-- copy the lib directory so that the jsXe.exe can be run - from the build dir --> - <mkdir dir="${build.dir}/lib"/> - <copy todir="${build.dir}/lib"> - <fileset dir="${build.lib}"> - <include name="**/*"/> - </fileset> - </copy> - - <!-- create the windows exe --> - <taskdef name="launch4j" - classname="net.sf.launch4j.ant.Launch4jTask" - classpath="${launch4j.classpath}"/> - - <launch4j configFile="${launch4j.config}" - outfile="${launch4j.jsxe.exe}" - jarPath="${launch4j.jsxe.jar}" - /> - - <copy file="${jsxe.exe}" todir="${installer.program.dir}" /> - <!-- create the tar.bz2 for the installer --> <tar basedir="${installer.program.dir}" includes="**/*" tarfile="${installer.build.dir}/${app.name}-${app_version}-program.tar"/> <bzip2 src="${installer.build.dir}/${app.name}-${app_version}-program.tar" destfile="${installer.build.program.tar}"/> @@ -561,6 +551,47 @@ <!-- }}} --> + <!-- {{{ create the win tar.bz2 file --> + + <!-- copy the lib directory so that the jsXe.exe can be run + from the build dir --> + <mkdir dir="${build.dir}/lib"/> + <copy todir="${build.dir}/lib"> + <fileset dir="${build.lib}"> + <include name="**/*"/> + </fileset> + </copy> + + <!-- create the windows exe --> + <taskdef name="launch4j" + classname="net.sf.launch4j.ant.Launch4jTask" + classpath="${launch4j.classpath}"/> + + <launch4j configFile="${launch4j.config}" + outfile="${launch4j.jsxe.exe}" + jarPath="${launch4j.jsxe.jar}" + /> + + <mkdir dir="${installer.win.dir}"/> + <copy file="${jsxe.exe}" todir="${installer.win.dir}" /> + + <tar basedir="${installer.win.dir}" includes="**/*" tarfile="${installer.build.dir}/${app.name}-${app_version}-win.tar"/> + <bzip2 src="${installer.build.dir}/${app.name}-${app_version}-win.tar" destfile="${installer.build.win.tar}"/> + <delete file="${installer.build.dir}/${app.name}-${app_version}-win.tar"/> + + <!-- find the file size of the files on disk and compressed files --> + <filesize property="comp.4.disk-size"> + <fileset dir="${installer.win.dir}"> + <include name="**/*"/> + </fileset> + </filesize> + + <filesize property="comp.4.real-size"> + <fileset file="${installer.build.win.tar}"/> + </filesize> + + <!-- }}} --> + <!-- {{{ create the install.props file --> <propertyfile comment="${app.name}'s installer properties" file="${install.props}"> <entry key="app.name" value="${app.name}"/> @@ -593,6 +624,12 @@ <entry key="comp.3.disk-size" value="${comp.3.disk-size}"/> <entry key="comp.3.real-size" value="${comp.3.real-size}"/> <entry key="comp.3.fileset" value="${comp.3.fileset}"/> + + <entry key="comp.4.name" value="${comp.4.name}"/> + <entry key="comp.4.disk-size" value="${comp.4.disk-size}"/> + <entry key="comp.4.real-size" value="${comp.4.real-size}"/> + <entry key="comp.4.fileset" value="${comp.4.fileset}"/> + <entry key="comp.4.os" value="${comp.4.os}"/> </propertyfile> <!-- }}} --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ian...@us...> - 2006-08-12 18:51:31
|
Revision: 1143 Author: ian_lewis Date: 2006-08-12 11:51:25 -0700 (Sat, 12 Aug 2006) ViewCVS: http://svn.sourceforge.net/jsxe/?rev=1143&view=rev Log Message: ----------- Fixed how jsXe installs on Unix/Linux; Added support for desktop launchers in Unix Modified Paths: -------------- tags/05pre3/jsxe/build.xml tags/05pre3/jsxe/installer/src/installer/OperatingSystem.java Added Paths: ----------- tags/05pre3/jsxe/installer/jsxe.desktop tags/05pre3/jsxe/installer/jsxe.png Modified: tags/05pre3/jsxe/build.xml =================================================================== --- tags/05pre3/jsxe/build.xml 2006-08-12 17:22:38 UTC (rev 1142) +++ tags/05pre3/jsxe/build.xml 2006-08-12 18:51:25 UTC (rev 1143) @@ -78,6 +78,7 @@ <property name="installer.treeview.dir" value="${installer.build.dir}/treeview"/> <property name="installer.sourceview.dir" value="${installer.build.dir}/sourceview"/> <property name="installer.win.dir" value="${installer.build.dir}/win"/> + <property name="installer.gnome.dir" value="${installer.build.dir}/gnome"/> <property name="installer.build.src" value="${installer.build.dir}/src"/> <property name="installer.build.dest" value="${installer.build.dir}/build"/> <property name="install.props" value="${installer.build.dest}/installer/install.props"/> @@ -97,6 +98,10 @@ <property name="app.license" value="gpl.html"/> <property name="ostask.unix-script.label" value="Install shortcut in:"/> <property name="ostask.unix-man.label" value="Install manual page in:"/> + <property name="ostask.unix-desktop.label" value="Install desktop launchers in:"/> + <property name="ostask.unix-desktop.shortcut" value="jsxe.desktop"/> + <property name="ostask.unix-desktop.pixmap" value="jsxe.png"/> + <!--<property name="ostask.unix-man.manpage" value="jsxe.1"/>--> <property name="comp.count" value="5"/> @@ -140,7 +145,6 @@ <property name="comp.4.fileset" value="jsxe-win"/> <property name="comp.4.os" value="Windows"/> <property name="installer.build.win.tar" value="${installer.build.dest}/installer/${comp.4.fileset}.tar.bz2"/> - <!-- }}} --> <!-- {{{ java build properties --> <property name="javac.debug" value="on"/> @@ -402,7 +406,13 @@ size += file.length(); } - project.setNewProperty(attributes.get("property"), Math.round(size/1024)); + + roundedSize = Math.round(size/1024); + + echo = project.createTask("echo"); + echo.setMessage("Size: "+roundedSize+"Kb"); + echo.perform(); + project.setNewProperty(attributes.get("property"), roundedSize); } ]]> </scriptdef> @@ -425,10 +435,18 @@ <!-- copy html files --> <copy todir="${installer.build.dest}/installer"> <fileset dir="${installer.dir}"> - <include name="**/*.html"/> + <include name="*.html"/> </fileset> </copy> + <!-- copy other files --> + <copy todir="${installer.build.dest}"> + <fileset dir="${installer.dir}"> + <exclude name="*.html"/> + <include name="*"/> + </fileset> + </copy> + <!-- {{{ create the program tar.bz2 file --> <mkdir dir="${installer.program.dir}"/> @@ -600,9 +618,10 @@ <entry key="app.license.title" value="${app.license.title}"/> <entry key="app.license" value="${app.license}"/> <entry key="ostask.unix-script.label" value="${ostask.unix-script.label}"/> + <entry key="ostask.unix-desktop.label" value="${ostask.unix-desktop.label}"/> + <entry key="ostask.unix-desktop.pixmap" value="${ostask.unix-desktop.pixmap}"/> + <entry key="ostask.unix-desktop.shortcut" value="${ostask.unix-desktop.shortcut}"/> - <entry key="extra.vm.args" value="-Djava.endorsed.dirs=lib"/> - <!--<entry key="ostask.unix-man.label" value="${ostask.unix-man.label}"/>--> <entry key="comp.count" value="${comp.count}"/> <entry key="comp.0.name" value="${comp.0.name}"/> @@ -630,6 +649,7 @@ <entry key="comp.4.real-size" value="${comp.4.real-size}"/> <entry key="comp.4.fileset" value="${comp.4.fileset}"/> <entry key="comp.4.os" value="${comp.4.os}"/> + </propertyfile> <!-- }}} --> Added: tags/05pre3/jsxe/installer/jsxe.desktop =================================================================== --- tags/05pre3/jsxe/installer/jsxe.desktop (rev 0) +++ tags/05pre3/jsxe/installer/jsxe.desktop 2006-08-12 18:51:25 UTC (rev 1143) @@ -0,0 +1,14 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=jsXe XML Editor +Name[ja]=jsXe XML エディタ +GenericName=XML Editor +GenericName[ja]= +Comment=Edit XML Documents +Comment[ja]= +Exec=jsxe +Icon=jsxe.png +StartupNotify=true +Terminal=false +Type=Application +Categories=GNOME;Application;Utility; \ No newline at end of file Added: tags/05pre3/jsxe/installer/jsxe.png =================================================================== (Binary files differ) Property changes on: tags/05pre3/jsxe/installer/jsxe.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: tags/05pre3/jsxe/installer/src/installer/OperatingSystem.java =================================================================== --- tags/05pre3/jsxe/installer/src/installer/OperatingSystem.java 2006-08-12 17:22:38 UTC (rev 1142) +++ tags/05pre3/jsxe/installer/src/installer/OperatingSystem.java 2006-08-12 18:51:25 UTC (rev 1143) @@ -153,7 +153,10 @@ mkdirs(directory); String name = installer.getProperty("app.name"); - String vmArgs = installer.getProperty("extra.vm.args"); + + //jsxe specific: this is needed for java to load our xerces rather + // than the one included with java. + String vmArgs = "-Djava.endorsed.dirs=\""+installDir + File.separator+"lib\""; // create app start script String script = directory + File.separatorChar @@ -193,7 +196,50 @@ exec(chmodArgs); } } + + public class DesktopOSTask extends OSTask { + + public DesktopOSTask(Install installer) { + super(installer,"unix-desktop"); + } + public String getDefaultDirectory(Install installer) { + String dir = "/usr/local/"; + if (!new File(dir).canWrite()) { + dir = System.getProperty("user.home"); + } + + return new File(dir,"share").getPath(); + } + + public void perform(String installDir, + Vector filesets) throws IOException + { + if (!enabled) { + return; + } + + mkdirs(directory); + mkdirs(directory+"/applications"); + mkdirs(directory+"/pixmaps"); + + String name = installer.getProperty("app.name"); + + // install shortcut + String shortcut = installer.getProperty("ostask.unix-desktop.shortcut"); + String pixmap = installer.getProperty("ostask.unix-desktop.pixmap"); + + if (shortcut != null) { + InputStream in = getClass().getResourceAsStream("/" + shortcut); + installer.copy(in, new File(directory+"/applications",shortcut).getPath(), null); + } + if (pixmap != null) { + InputStream in = getClass().getResourceAsStream("/" + pixmap); + installer.copy(in, new File(directory+"/pixmaps", pixmap).getPath(), null); + } + } + } + public class ManPageOSTask extends OSTask { public ManPageOSTask(Install installer) @@ -233,7 +279,7 @@ public OSTask[] getOSTasks(Install installer) { return new OSTask[] { new ScriptOSTask(installer), - new ManPageOSTask(installer) }; + new ManPageOSTask(installer), new DesktopOSTask(installer) }; } public void mkdirs(String directory) throws IOException This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ian...@us...> - 2006-08-17 20:32:05
|
Revision: 1149 Author: ian_lewis Date: 2006-08-17 13:31:48 -0700 (Thu, 17 Aug 2006) ViewCVS: http://svn.sourceforge.net/jsxe/?rev=1149&view=rev Log Message: ----------- Updated German translation Modified Paths: -------------- tags/05pre3/jsxe/Changelog tags/05pre3/jsxe/messages/messages tags/05pre3/jsxe/messages/messages.de tags/05pre3/jsxe/messages/messages.ja tags/05pre3/jsxe/messages/messages.ru tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/Messages.java Modified: tags/05pre3/jsxe/Changelog =================================================================== --- tags/05pre3/jsxe/Changelog 2006-08-14 14:24:27 UTC (rev 1148) +++ tags/05pre3/jsxe/Changelog 2006-08-17 20:31:48 UTC (rev 1149) @@ -1,3 +1,7 @@ +08/17/2006 Ian Lewis <Ian...@me...> + + * Updated the German translation thanks to Dieter Steiner + 08/12/2006 Ian Lewis <Ian...@me...> * Added support for running jsXe in a wrapped exe using launch4j. Modified: tags/05pre3/jsxe/messages/messages =================================================================== --- tags/05pre3/jsxe/messages/messages 2006-08-14 14:24:27 UTC (rev 1148) +++ tags/05pre3/jsxe/messages/messages 2006-08-17 20:31:48 UTC (rev 1149) @@ -280,6 +280,7 @@ \ \ \ \ Trish Hartnett <tri...@us...>\n\n\ Translators:\n\ \ \ \ \ German (de) - Bianca Shöen\n\ + \ \ \ \ German (de) - Dieter Steiner <spo...@gm...>\n\ \ \ \ \ Swedish (sv) - Patrik Johansson <pa...@it...>\n\ \ \ \ \ Russian (ru) - Alexandr Gridnev <ale...@ya...>\n\n\ Past Contributers:\n\ Modified: tags/05pre3/jsxe/messages/messages.de =================================================================== (Binary files differ) Modified: tags/05pre3/jsxe/messages/messages.ja =================================================================== --- tags/05pre3/jsxe/messages/messages.ja 2006-08-14 14:24:27 UTC (rev 1148) +++ tags/05pre3/jsxe/messages/messages.ja 2006-08-17 20:31:48 UTC (rev 1149) @@ -1,23 +1,23 @@ -# JSXE Japanese properties file -# $Id$ -# Maintained by Ian Lewis -#:mode=properties: -#:tabSize=4:indentSize=4:noTabs=true: -#:folding=explicit:collapseFolds=1: - -#{{{ common properties - -common.ok=決定 -common.cancel=キャンセル +# JSXE Japanese properties file +# $Id$ +# Maintained by Ian Lewis +#:mode=properties: +#:tabSize=4:indentSize=4:noTabs=true: +#:folding=explicit:collapseFolds=1: + +#{{{ common properties + +common.ok=決定 +common.cancel=キャンセル common.open=開く common.save=保存 common.save.as=名前を付けて保存 common.close=閉じる -common.apply=適用 +common.apply=適用 common.more=次 common.insert=インサート -common.add=追加 -common.remove=削除 +common.add=追加 +common.remove=削除 common.moveUp=上げる common.moveDown=下げる @@ -25,41 +25,41 @@ #common.alt=Alt #common.shift=Shift #common.meta=Meta - + #}}} -#{{{ XML Terminology - -#{{{ XML Node Types -xml.element=要素 -xml.processing.instruction=処理命令 -xml.cdata=CDATAセクション -xml.text=テキスト +#{{{ XML Terminology + +#{{{ XML Node Types +xml.element=要素 +xml.processing.instruction=処理命令 +xml.cdata=CDATAセクション +xml.text=テキスト xml.entity.reference=エンティティ参照 -#xml.declaration=Element Declaration -xml.notation=表記法 +#xml.declaration=Element Declaration +xml.notation=表記法 xml.entity=エンティティ -#xml.entity=Entity Declaration -xml.comment=コメント -xml.attribute=属性 -xml.doctype=文書型 -#}}} - -xml.attribute.value.short=値 -xml.attribute.value=属性値 -xml.document=XMLドキュメント -xml.namespace=ネームスペース -xml.namespace.prefix=ネームスペース前置修飾子 +#xml.entity=Entity Declaration +xml.comment=コメント +xml.attribute=属性 +xml.doctype=文書型 +#}}} + +xml.attribute.value.short=値 +xml.attribute.value=属性値 +xml.document=XMLドキュメント +xml.namespace=ネームスペース +xml.namespace.prefix=ネームスペース前置修飾子 xml.namespace.prefix.short=前置修飾子 -#xml.namespace.decl=Namespace Declaration -xml.doctypedef=文書型 -xml.doctype.name=DTDの名前 -xml.doctype.public=公開識別子 -xml.doctype.system=システム識別子 -xml.schema=XMLスキーマ - -#}}} +#xml.namespace.decl=Namespace Declaration +xml.doctypedef=文書型 +xml.doctype.name=DTDの名前 +xml.doctype.public=公開識別子 +xml.doctype.system=システム識別子 +xml.schema=XMLスキーマ +#}}} + #{{{ Global Options Global.Options.Dialog.Title=Global Options Global.Options.Title=General @@ -91,20 +91,20 @@ 新しいショットカットは選択されてなかった。\n\ 今のショットカットを削除? #}}} - -#{{{ Document Options -Document.Options.Title=ドキュメント設定 -Document.Options.Encoding=エンコーディング: -#}}} - -#{{{ Menu Items - -File.Menu=ファイル -Edit.Menu=編集 -Help.Menu=ヘルプ -Tools.Menu=ツール -View.Menu=表示 - + +#{{{ Document Options +Document.Options.Title=ドキュメント設定 +Document.Options.Encoding=エンコーディング: +#}}} + +#{{{ Menu Items + +File.Menu=ファイル +Edit.Menu=編集 +Help.Menu=ヘルプ +Tools.Menu=ツール +View.Menu=表示 + #{{{ Action Labels new-file.label=新規作成 open-file.label=開く... @@ -127,28 +127,29 @@ document-options.label=ドキュメント設定... plugin-manager.label=プラグインマネジャー... -about-jsxe.label=jsXeについて... -#}}} - -#}}} - -#{{{ Dialogs - -#{{{ About dialag -about.title=jsXeについて -about.message=Released under the terms of the GNU General Public License\n\n\ - Active Contributors:\n\ - \ \ \ \ Ian Lewis <Ian...@me...>\n\ - \ \ \ \ Trish Hartnett <tri...@us...>\n\n\ - 翻訳者:\n\ - \ \ \ \ ドイツ語 (de) - Bianca Shöen\n\ - \ \ \ \ スウェーデン語 (sv) - Patrik Johansson <pa...@it...>\n\n\ - Past Contributers:\n\ - \ \ \ \ Aaron Flatten <afl...@us...>\n\ - \ \ \ \ Bilel Remmache <rb...@us...>\n\ - \ \ \ \ SVM <svm...@us...>\n\n\ - ホームページ: http://jsxe.sourceforge.net/ -#}}} - +about-jsxe.label=jsXeについて... #}}} +#}}} + +#{{{ Dialogs + +#{{{ About dialag +about.title=jsXeについて +about.message=Released under the terms of the GNU General Public License\n\n\ + Active Contributors:\n\ + \ \ \ \ Ian Lewis <Ian...@me...>\n\ + \ \ \ \ Trish Hartnett <tri...@us...>\n\n\ + 翻訳者:\n\ + \ \ \ \ ドイツ語 (de) - Bianca Shöen\n\ + \ \ \ \ ドイツ語 (de) - Dieter Steiner <spo...@gm...>\n\ + \ \ \ \ スウェーデン語 (sv) - Patrik Johansson <pa...@it...>\n\n\ + Past Contributers:\n\ + \ \ \ \ Aaron Flatten <afl...@us...>\n\ + \ \ \ \ Bilel Remmache <rb...@us...>\n\ + \ \ \ \ SVM <svm...@us...>\n\n\ + ホームページ: http://jsxe.sourceforge.net/ +#}}} + +#}}} + Modified: tags/05pre3/jsxe/messages/messages.ru =================================================================== --- tags/05pre3/jsxe/messages/messages.ru 2006-08-14 14:24:27 UTC (rev 1148) +++ tags/05pre3/jsxe/messages/messages.ru 2006-08-17 20:31:48 UTC (rev 1149) @@ -271,6 +271,7 @@ \ \ \ \ Trish Hartnett <tri...@us...>\n\n\ Переводчики:\n\ \ \ \ \ German (de) - Bianca Sh\u00f6en\n\ + \ \ \ \ German (de) - Dieter Steiner <spo...@gm...>\n\ \ \ \ \ Swedish (sv) - Patrik Johansson <pa...@it...>\n\n\ В прошлом учавствовали в разработке:\n\ \ \ \ \ Aaron Flatten <afl...@us...>\n\ Modified: tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/Messages.java =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/Messages.java 2006-08-14 14:24:27 UTC (rev 1148) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/Messages.java 2006-08-17 20:31:48 UTC (rev 1149) @@ -90,12 +90,12 @@ */ private static Properties m_pluginMessages; - // static { - // // Locale.setDefault(new Locale("sv")); - // // Locale.setDefault(Locale.GERMANY); - // // Locale.setDefault(Locale.JAPAN); - // Locale.setDefault(new Locale("ru", "RU")); - // } + static { + // Locale.setDefault(new Locale("sv")); + // Locale.setDefault(Locale.GERMANY); + // Locale.setDefault(Locale.JAPAN); + Locale.setDefault(new Locale("ru", "RU")); + } private static Locale m_locale = Locale.getDefault(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ian...@us...> - 2006-08-18 18:38:30
|
Revision: 1157 Author: ian_lewis Date: 2006-08-18 11:38:21 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/jsxe/?rev=1157&view=rev Log Message: ----------- Added a hack to disable actions that aren't implemented by the current view from the menus Modified Paths: -------------- tags/05pre3/jsxe/Changelog tags/05pre3/jsxe/src/net/sourceforge/jsxe/ActionManager.java tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java Modified: tags/05pre3/jsxe/Changelog =================================================================== --- tags/05pre3/jsxe/Changelog 2006-08-18 16:07:10 UTC (rev 1156) +++ tags/05pre3/jsxe/Changelog 2006-08-18 18:38:21 UTC (rev 1157) @@ -1,3 +1,8 @@ +08/18/2006 Ian Lewis <Ian...@me...> + + * Added a hack to disable view specific actions that aren't implemented by + the view. + 08/17/2006 Ian Lewis <Ian...@me...> * Updated the German translation thanks to Dieter Steiner Modified: tags/05pre3/jsxe/src/net/sourceforge/jsxe/ActionManager.java =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/ActionManager.java 2006-08-18 16:07:10 UTC (rev 1156) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/ActionManager.java 2006-08-18 18:38:21 UTC (rev 1157) @@ -33,6 +33,7 @@ import net.sourceforge.jsxe.util.Log; import net.sourceforge.jsxe.util.MiscUtilities; import net.sourceforge.jsxe.msg.PropertyChanged; +import net.sourceforge.jsxe.action.ViewSpecificAction; //}}} //{{{ Java classes Modified: tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java 2006-08-18 16:07:10 UTC (rev 1156) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java 2006-08-18 18:38:21 UTC (rev 1157) @@ -428,6 +428,7 @@ menubar.add(m_fileMenu); + createEditMenu(); menubar.add(m_editMenu); //Add View Specific Menus @@ -572,6 +573,86 @@ }//}}} + //{{{ createEditMenu() + + private void createEditMenu() { + m_editMenu = new JMenu(Messages.getMessage("Edit.Menu")); + m_editMenu.setMnemonic('E'); + + DocumentView view = getDocumentView(); + JMenuItem menuItem = new JMenuItem(ActionManager.getAction("undo")); + m_editMenu.add(menuItem); + menuItem = new JMenuItem(ActionManager.getAction("redo")); + m_editMenu.add(menuItem); + m_editMenu.addSeparator(); + Action action = ActionManager.getAction("cut"); + if (view != null) { + String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".cut"; + if (ActionManager.getLocalizedAction(name) == null) { + action.setEnabled(false); + } else { + action.setEnabled(true); + } + } else { + action.setEnabled(false); + } + menuItem = new JMenuItem(action); + m_editMenu.add(menuItem); + action = ActionManager.getAction("copy"); + if (view != null) { + String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".copy"; + if (ActionManager.getLocalizedAction(name) == null) { + action.setEnabled(false); + } else { + action.setEnabled(true); + } + } else { + action.setEnabled(false); + } + menuItem = new JMenuItem(action); + m_editMenu.add(menuItem); + action = ActionManager.getAction("paste"); + if (view != null) { + String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".paste"; + if (ActionManager.getLocalizedAction(name) == null) { + action.setEnabled(false); + } else { + action.setEnabled(true); + } + } else { + action.setEnabled(false); + } + menuItem = new JMenuItem(action); + m_editMenu.add(menuItem); + m_editMenu.addSeparator(); + action = ActionManager.getAction("find"); + if (view != null) { + String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".find"; + if (ActionManager.getLocalizedAction(name) == null) { + action.setEnabled(false); + } else { + action.setEnabled(true); + } + } else { + action.setEnabled(false); + } + menuItem = new JMenuItem(action); + m_editMenu.add(menuItem); + action = ActionManager.getAction("findnext"); + if (view != null) { + String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".findnext"; + if (ActionManager.getLocalizedAction(name) == null) { + action.setEnabled(false); + } else { + action.setEnabled(true); + } + } else { + action.setEnabled(false); + } + menuItem = new JMenuItem(action); + m_editMenu.add(menuItem); + }//}}} + //{{{ createDefaultMenuItems() private void createDefaultMenuItems() { @@ -606,24 +687,7 @@ //}}} //{{{ Create Edit Menu - m_editMenu = new JMenu(Messages.getMessage("Edit.Menu")); - m_editMenu.setMnemonic('E'); - menuItem = new JMenuItem(ActionManager.getAction("undo")); - m_editMenu.add(menuItem); - menuItem = new JMenuItem(ActionManager.getAction("redo")); - m_editMenu.add(menuItem); - m_editMenu.addSeparator(); - menuItem = new JMenuItem(ActionManager.getAction("cut")); - m_editMenu.add(menuItem); - menuItem = new JMenuItem(ActionManager.getAction("copy")); - m_editMenu.add(menuItem); - menuItem = new JMenuItem(ActionManager.getAction("paste")); - m_editMenu.add(menuItem); - m_editMenu.addSeparator(); - menuItem = new JMenuItem(ActionManager.getAction("find")); - m_editMenu.add(menuItem); - menuItem = new JMenuItem(ActionManager.getAction("findnext")); - m_editMenu.add(menuItem); + createEditMenu(); //}}} //{{{ Create View Menu This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ian...@us...> - 2006-08-22 02:15:31
|
Revision: 1161 Author: ian_lewis Date: 2006-08-21 19:15:23 -0700 (Mon, 21 Aug 2006) ViewCVS: http://svn.sourceforge.net/jsxe/?rev=1161&view=rev Log Message: ----------- Updated russian translation Modified Paths: -------------- tags/05pre3/jsxe/Changelog tags/05pre3/jsxe/messages/messages.ru Modified: tags/05pre3/jsxe/Changelog =================================================================== --- tags/05pre3/jsxe/Changelog 2006-08-22 02:11:41 UTC (rev 1160) +++ tags/05pre3/jsxe/Changelog 2006-08-22 02:15:23 UTC (rev 1161) @@ -1,3 +1,7 @@ +08/21/2006 Ian Lewis <Ian...@me...> + + * Updated russian translation. + 08/18/2006 Ian Lewis <Ian...@me...> * Added a hack to disable view specific actions that aren't implemented by Modified: tags/05pre3/jsxe/messages/messages.ru =================================================================== --- tags/05pre3/jsxe/messages/messages.ru 2006-08-22 02:11:41 UTC (rev 1160) +++ tags/05pre3/jsxe/messages/messages.ru 2006-08-22 02:15:23 UTC (rev 1161) @@ -1,12 +1,12 @@ -# JSXE English properties file -# $Id: -# Maintained by Alexandr Gridnev (ale...@ya...) -#:mode=properties: -#:tabSize=4:indentSize=4:noTabs=true: -#:folding=explicit:collapseFolds=1: - -#{{{ common properties - +# JSXE English properties file +# $Id: messages 1158 2006-08-18 18:42:18Z ian_lewis $ +# Maintained by Alexandr Gridnev (ale...@ya...) +#:mode=properties: +#:tabSize=4:indentSize=4:noTabs=true: +#:folding=explicit:collapseFolds=1: + +#{{{ common properties + common.ok=Принять common.cancel=Отменить common.open=Открыть @@ -20,22 +20,18 @@ common.remove=Удалить common.moveUp=Поднять common.moveDown=Опустить -common.cut=Вырезать -common.copy=Копировать -common.paste=Вставить -common.find=Искать... -common.findnext=Искать следующий - -common.ctrl=Ctrl -common.alt=Alt -common.shift=Shift -common.meta=Meta - -#}}} - -#{{{ XML Terminology - -#{{{ XML Node Types +common.find=Искать + +common.ctrl=Ctrl +common.alt=Alt +common.shift=Shift +common.meta=Meta + +#}}} + +#{{{ XML Terminology + +#{{{ XML Node Types xml.element=Элемент xml.processing.instruction=Правило обработки xml.cdata=Секция CDATA @@ -52,7 +48,7 @@ xml.attribute.value.short=Значение xml.attribute.value=Значение свойства xml.document=документ XML -xml.namespace=Пространство имен +xml.namespace=Пространство имен xml.namespace.prefix=Префикс пространства имен xml.namespace.prefix.short=Префикс xml.namespace.decl=Объявление пространства имен @@ -72,21 +68,23 @@ Global.Options.network-cache=Кешировать удаленные файлы только спросив разрешения Global.Options.network-always=Скачивать всегда, без спросу Global.Options.network=Скачивание DTD и схемы: -Global.Options.Menu.Spill.Over=Меню выпадают после: - +Global.Options.Menu.Spill.Over=Меню выпадают после: +Global.Options.Undos.To.Remember=Запомнить действий: +Global.Options.Undos.To.Remember.ToolTip=<HTML>jsXe запомнит столько действий и потом их можно будет отменить.<BR> Однако он не может запомнить действия, выполненные после переключения видов</HTML> + Shortcuts.Options.Title=Горячие клавиши Shortcuts.Options.Select.Label=Редактировать горячие клавиши: Shortcuts.Options.Shortcut=Горячая клавиша -Shortcuts.Options.Command=Команда - +Shortcuts.Options.Command=Команда + Grab.Key.title=Нажмите клавишу Grab.Key.caption=Нажмите клавишу для команды "{0}", а котом нажмите Принять. Grab.Key.keyboard-test=Input the key strokes that are causing problems. Grab.Key.assigned-to=Уже назначено для: {0} Grab.Key.assigned-to.none=<ничего> Grab.Key.clear=Очистить -Grab.Key.remove=Удалить текущее - +Grab.Key.remove=Удалить текущее + Grab.Key.remove-ask.title=Удалить клавишу? Grab.Key.remove-ask.message=\ Вы не назначили новую клавишу.\n\ @@ -111,7 +109,7 @@ Document.Options.Line.Separator=Разделитель строк: Document.Options.Line.Separator.ToolTip=Разделитель строк. По умолчанию выбирается традиционный для вашей операционной системы. Document.Options.Encoding=Кодировка: -Document.Options.Encoding.ToolTip=Кодировка, которую jsXe использует для записи текстовой инфы в файл. +Document.Options.Encoding.ToolTip=Кодировка, которую jsXe использует для записи текстовой инфы в файл. Document.Options.Indent.Width=Ширина отступа: Document.Options.Indent.Width.ToolTip=Ширина используемая при форматировании и отображении символов табуляции. Document.Options.Format.XML=Форматировать выводимый XML @@ -136,32 +134,44 @@ File.Menu=Файл Edit.Menu=Правка -View.Menu=Вид +View.Menu=Вид Tools.Menu=Инструменты -Help.Menu=Справка - -#{{{ File Menu Items +Help.Menu=Справка + + +#}}} + +#{{{ Action Labels new-file.label=Новый open-file.label=Открыть... File.Recent=Ранее открытые файлы File.Recent.None=Нэма нифигга save-file.label=Сохранить save-as.label=Сохранить как... -reload-file.label=Открыть еще раз +reload-file.label=Открыть еще раз +File.Recent=Ранее открытые файлы close-file.label=Закрыть close-all.label=Закрыть все -exit.label=Выход -#}}} - +exit.label=Выход + +undo.label=Отменить +redo.label=Повторить +cut.label=Вырезать +copy.label=Копировать +paste.label=Вставить +find.label=Искать... +findnext.label=Искать далее + general-options.label=Глобальные опции... document-options.label=Опции документа... plugin-manager.label=Менеджер плагинов... validation-errors.label=Ошибки подтверждения... -about-jsxe.label=О программе jsXe... -#}}} - -#{{{ Messages - +about-jsxe.label=О программе jsXe... + +#}}} + +#{{{ Messages + DocumentView.Open.Message="Не могу открыть буффер в каком-либо из установленных document view-ов" #{0} file name @@ -186,7 +196,7 @@ # {0} plugin name Plugin.Error.title=Ошибка плагина Plugin.Error.List.message=Следующие плагины не могут быть загружены: -Plugin.Load.Already.Loaded=Плагин {0} уже загружен. +Plugin.Load.Already.Loaded=Плагин {0} уже загружен. Plugin.Load.Wrong.Main.Class=Главный класс не является классом плагина. Plugin.Load.No.Plugin.Class=Класс плагина не был определен. Plugin.Load.No.Plugin.Name=Имя плагина не было определено. @@ -211,7 +221,7 @@ # {0} invalid version Plugin.Dependency.Invalid.jsXe.Version=Неправильный номер версии jsXe: {0} # {0} plugin name -# {1} requirement name +# {1} requirement name Plugin.Dependency.No.Version=Не могу загрузить плагин {0}, потому что у {1} не подписана версия. # {0} plugin name # {1} requirement name @@ -236,7 +246,7 @@ #{0} URL xml.download-resource.message=Этот XML-файл зависит от ресурсов, которые расколожены\n\ по следующему адресу в интернете:\n\ - \n\ + \n\ {0}\n\ \n\ Хотите ли вы чтобы плагин XML скачал ресурсы и закешировал их\n\ @@ -261,28 +271,27 @@ activity-log.label = Лог активности ActivityLogDialog.Dialog.Title = Лог активности ActivityLogDialog.Dialog.Message = Содержимое лога активности: -#}}} - -#{{{ About dialag +#}}} + +#{{{ About dialag about.title=О программе jsXe about.message=Распространяется на условиях GNU General Public License\n\n\ - Активные разработчики:\n\ - \ \ \ \ Ian Lewis <Ian...@me...>\n\ - \ \ \ \ Trish Hartnett <tri...@us...>\n\n\ - Переводчики:\n\ - \ \ \ \ German (de) - Bianca Sh\u00f6en\n\ - \ \ \ \ German (de) - Dieter Steiner <spo...@gm...>\n\ - \ \ \ \ Swedish (sv) - Patrik Johansson <pa...@it...>\n\n\ - В прошлом учавствовали в разработке:\n\ - \ \ \ \ Aaron Flatten <afl...@us...>\n\ - \ \ \ \ Bilel Remmache <rb...@us...>\n\ - \ \ \ \ SVM <svm...@us...>\n\n\ - Страница проекта: http://jsxe.sourceforge.net/ -#}}} - -#{{{ Validation Errors Dialog + Активные разработчики:\n\ + \ \ \ \ Ian Lewis <Ian...@me...>\n\ + \ \ \ \ Trish Hartnett <tri...@us...>\n\n\ + Переводчики:\n\ + \ \ \ \ German (de) - Bianca Shöen\n\ + \ \ \ \ Swedish (sv) - Patrik Johansson <pa...@it...>\n\ + \ \ \ \ Russian (ru) - Александр Гриднев <ale...@ya...>\n\n\ + Past Contributers:\n\ + \ \ \ \ Aaron Flatten <afl...@us...>\n\ + \ \ \ \ Bilel Remmache <rb...@us...>\n\n\ + Страница проекта: http://jsxe.sourceforge.net/ +#}}} + +#{{{ Validation Errors Dialog ValidationErrors.title=Ошибки подтверждения -ValidationErrors.message=Ошибки подтверждения +ValidationErrors.message=Ошибки подтверждения +#}}} + #}}} - -#}}} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ian...@us...> - 2006-08-27 14:55:39
|
Revision: 1170 Author: ian_lewis Date: 2006-08-27 07:55:31 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/jsxe/?rev=1170&view=rev Log Message: ----------- Fixed launch4j properties. We now require launch4j 3.0.0pre1 or later Modified Paths: -------------- tags/05pre3/jsxe/Changelog tags/05pre3/jsxe/INSTALL tags/05pre3/jsxe/installer/launch4j.xml tags/05pre3/jsxe/launch4j.xml Modified: tags/05pre3/jsxe/Changelog =================================================================== --- tags/05pre3/jsxe/Changelog 2006-08-27 13:57:20 UTC (rev 1169) +++ tags/05pre3/jsxe/Changelog 2006-08-27 14:55:31 UTC (rev 1170) @@ -1,3 +1,10 @@ +08/27/2006 Ian Lewis <Ian...@me...> + + * Updated the launch4j script to set the absolute path of the lib directory + in the jre option to set the endorsed dirs. This will allow jsXe to be + launched from anywhere and still be able to find the right version of + Xerces. + 08/21/2006 Ian Lewis <Ian...@me...> * Updated russian translation. Modified: tags/05pre3/jsxe/INSTALL =================================================================== --- tags/05pre3/jsxe/INSTALL 2006-08-27 13:57:20 UTC (rev 1169) +++ tags/05pre3/jsxe/INSTALL 2006-08-27 14:55:31 UTC (rev 1170) @@ -1,8 +1,8 @@ REQUIREMENTS -Java 1.4.2 -Xerces 2.8.0 -launch4j (for building the installer from source) +Java >= 1.4.2 +Xerces >= 2.8.0 +launch4j >= 3.0.0pre1 (for building the installer from source) GETTING jsXe Modified: tags/05pre3/jsxe/installer/launch4j.xml =================================================================== --- tags/05pre3/jsxe/installer/launch4j.xml 2006-08-27 13:57:20 UTC (rev 1169) +++ tags/05pre3/jsxe/installer/launch4j.xml 2006-08-27 14:55:31 UTC (rev 1170) @@ -10,11 +10,8 @@ <stayAlive>false</stayAlive> <icon>jsxe-installer.ico</icon> <jre> - <path></path> <minVersion>1.4.2</minVersion> - <maxVersion></maxVersion> <initialHeapSize>16</initialHeapSize> <maxHeapSize>64</maxHeapSize> - <args></args> </jre> </launch4jConfig> \ No newline at end of file Modified: tags/05pre3/jsxe/launch4j.xml =================================================================== --- tags/05pre3/jsxe/launch4j.xml 2006-08-27 13:57:20 UTC (rev 1169) +++ tags/05pre3/jsxe/launch4j.xml 2006-08-27 14:55:31 UTC (rev 1170) @@ -1,20 +1,19 @@ <launch4jConfig> <dontWrapJar>true</dontWrapJar> - <headerType>0</headerType> + <headerType>gui</headerType> <jar>jsXe.jar</jar> <outfile>build\jsXe.exe</outfile> <errTitle>jsXe</errTitle> - <jarArgs></jarArgs> + <cmdLine></cmdLine> <chdir></chdir> <customProcName>true</customProcName> <stayAlive>false</stayAlive> <icon>jsxe.ico</icon> <jre> - <path></path> <minVersion>1.4.2</minVersion> - <maxVersion></maxVersion> + <dontUsePrivateJres>false</dontUsePrivateJres> <initialHeapSize>16</initialHeapSize> <maxHeapSize>64</maxHeapSize> - <opt>-Djava.endorsed.dirs=%EXEDIR%\\lib</opt> + <opt>-Dlaunch4j.exedir="%EXEDIR%"</opt> </jre> </launch4jConfig> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ian...@us...> - 2006-08-27 23:17:07
|
Revision: 1176 Author: ian_lewis Date: 2006-08-27 16:16:56 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/jsxe/?rev=1176&view=rev Log Message: ----------- Updated unix installer script to use java that is in the environment path Modified Paths: -------------- tags/05pre3/jsxe/Changelog tags/05pre3/jsxe/installer/src/installer/OperatingSystem.java Modified: tags/05pre3/jsxe/Changelog =================================================================== --- tags/05pre3/jsxe/Changelog 2006-08-27 20:20:25 UTC (rev 1175) +++ tags/05pre3/jsxe/Changelog 2006-08-27 23:16:56 UTC (rev 1176) @@ -4,6 +4,9 @@ in the jre option to set the endorsed dirs. This will allow jsXe to be launched from anywhere and still be able to find the right version of Xerces. + * Updated the installer to create a script file in unix that uses the java + in the environment path and use the HotSpot server so that jsXe runs + faster at the cost of startup time and memory footprint. 08/21/2006 Ian Lewis <Ian...@me...> Modified: tags/05pre3/jsxe/installer/src/installer/OperatingSystem.java =================================================================== --- tags/05pre3/jsxe/installer/src/installer/OperatingSystem.java 2006-08-27 20:20:25 UTC (rev 1175) +++ tags/05pre3/jsxe/installer/src/installer/OperatingSystem.java 2006-08-27 23:16:56 UTC (rev 1176) @@ -170,15 +170,18 @@ out.write("#!/bin/sh\n"); out.write("# Java heap size, in megabytes\n"); out.write("JAVA_HEAP_SIZE=32\n"); - out.write("DEFAULT_JAVA_HOME=\"" + out.write("#DEFAULT_JAVA_HOME=\"" + System.getProperty("java.home") + "\"\n"); - out.write("if [ \"$JAVA_HOME\" = \"\" ]; then\n"); - out.write("JAVA_HOME=\"$DEFAULT_JAVA_HOME\"\n"); - out.write("fi\n"); + out.write("#if [ \"$JAVA_HOME\" = \"\" ]; then\n"); + out.write("#JAVA_HOME=\"$DEFAULT_JAVA_HOME\"\n"); + out.write("#fi\n"); - out.write("exec \"$JAVA_HOME" - + "/bin/java\" -mx${JAVA_HEAP_SIZE}m "+vmArgs+" ${" + // out.write("exec \"$JAVA_HOME" + // + "/bin/java\" -mx${JAVA_HEAP_SIZE}m "+vmArgs+" ${" + // + name.toUpperCase() + "} "); + // use java in the path and run using the HotSpot server + out.write("exec java -server -mx${JAVA_HEAP_SIZE}m "+vmArgs+" ${" + name.toUpperCase() + "} "); // String jar = installDir + File.separator This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ian...@us...> - 2006-08-28 21:54:02
|
Revision: 1189 Author: ian_lewis Date: 2006-08-28 14:53:57 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/jsxe/?rev=1189&view=rev Log Message: ----------- Fixed default key binding for exit Modified Paths: -------------- tags/05pre3/jsxe/Changelog tags/05pre3/jsxe/src/net/sourceforge/jsxe/properties Modified: tags/05pre3/jsxe/Changelog =================================================================== --- tags/05pre3/jsxe/Changelog 2006-08-28 20:01:40 UTC (rev 1188) +++ tags/05pre3/jsxe/Changelog 2006-08-28 21:53:57 UTC (rev 1189) @@ -1,3 +1,7 @@ +08/28/2006 Ian Lewis <Ian...@me...> + + * Fixed default key binding for exit. + 08/27/2006 Ian Lewis <Ian...@me...> * Updated the launch4j script to set the absolute path of the lib directory Modified: tags/05pre3/jsxe/src/net/sourceforge/jsxe/properties =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/properties 2006-08-28 20:01:40 UTC (rev 1188) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/properties 2006-08-28 21:53:57 UTC (rev 1189) @@ -55,7 +55,7 @@ #{{{ Default key bindings open-file.shortcut=C+o -exit.shortcut=C+x +exit.shortcut=C+q close-file.shortcut=C+w new-file.shortcut=C+n save-file.shortcut=C+s This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ian...@us...> - 2006-08-29 16:00:31
|
Revision: 1194 Author: ian_lewis Date: 2006-08-29 08:59:28 -0700 (Tue, 29 Aug 2006) ViewCVS: http://svn.sourceforge.net/jsxe/?rev=1194&view=rev Log Message: ----------- Fixed memory leak bug 1548245 and 1548210 Modified Paths: -------------- tags/05pre3/jsxe/Changelog tags/05pre3/jsxe/build.xml tags/05pre3/jsxe/src/net/sourceforge/jsxe/ActionManager.java tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/menu/WrappingMenu.java Modified: tags/05pre3/jsxe/Changelog =================================================================== --- tags/05pre3/jsxe/Changelog 2006-08-29 14:42:52 UTC (rev 1193) +++ tags/05pre3/jsxe/Changelog 2006-08-29 15:59:28 UTC (rev 1194) @@ -1,3 +1,9 @@ +08/29/2006 Ian Lewis <Ian...@me...> + + * Fixed a memory leak with JMenuItems. ActionManager kept a cache of + Wrapper Action objects. JMenu items register listeners with those Actions + so the JMenuItems would never be Garbage collected. + 08/28/2006 Ian Lewis <Ian...@me...> * Fixed default key binding for exit. Modified: tags/05pre3/jsxe/build.xml =================================================================== --- tags/05pre3/jsxe/build.xml 2006-08-29 14:42:52 UTC (rev 1193) +++ tags/05pre3/jsxe/build.xml 2006-08-29 15:59:28 UTC (rev 1194) @@ -266,6 +266,15 @@ </fileset> </copy> + <!-- copy the lib directory so that the jsXe.exe can be run + from the build dir --> + <mkdir dir="${build.lib}"/> + <copy todir="${build.lib}"> + <fileset dir="${lib.dir}"> + <include name="**/*"/> + </fileset> + </copy> + <!-- set the build properties --> <propertyfile comment="${app.name}'s build properties" file="${build.dest}/net/sourceforge/jsxe/build.properties"> <entry key="application.name" value="${app.name}"/> @@ -328,13 +337,6 @@ <!-- }}} --> <!-- {{{ ============ Prepares for a build ============================= --> <target depends="init" name="prepare-build"> - <!-- lib --> - <mkdir dir="${build.dir}/lib"/> - <copy todir="${build.dir}/lib"> - <fileset dir="${lib.dir}"> - <include name="**/*"/> - </fileset> - </copy> <!-- bin --> <mkdir dir="${build.dir}/bin"/> <copy todir="${build.dir}/bin"> @@ -571,15 +573,6 @@ <!-- {{{ create the win tar.bz2 file --> - <!-- copy the lib directory so that the jsXe.exe can be run - from the build dir --> - <mkdir dir="${build.dir}/lib"/> - <copy todir="${build.dir}/lib"> - <fileset dir="${build.lib}"> - <include name="**/*"/> - </fileset> - </copy> - <!-- create the windows exe --> <taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask" Modified: tags/05pre3/jsxe/src/net/sourceforge/jsxe/ActionManager.java =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/ActionManager.java 2006-08-29 14:42:52 UTC (rev 1193) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/ActionManager.java 2006-08-29 15:59:28 UTC (rev 1194) @@ -118,8 +118,11 @@ * @param name the name of the action. */ public static Action getAction(String name) { - Action action = (Action)m_actionMap.get(name); - if (action == null) { + // We can't keep a cache of Wrappers because JMenuItems register + //listeners with them and would never be GCed. + Action action = null; + // Action action = (Action)m_actionMap.get(name); + // if (action == null) { LocalizedAction editAction = getLocalizedAction(name); if (editAction != null) { action = new Wrapper(name); @@ -135,11 +138,11 @@ action.putValue(Action.ACCELERATOR_KEY, KeyEventTranslator.getKeyStroke(keyBinding)); } - m_actionMap.put(name, action); + // m_actionMap.put(name, action); } else { Log.log(Log.WARNING,ActionManager.class,"Unknown action: "+ name); } - } + // } return action; }//}}} @@ -326,7 +329,7 @@ /** * This is an name to Wrapper mapping. */ - private static HashMap m_actionMap = new HashMap(); + // private static HashMap m_actionMap = new HashMap(); private static ArrayList m_actionSets = new ArrayList(); private static boolean initialized = false; Modified: tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java 2006-08-29 14:42:52 UTC (rev 1193) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java 2006-08-29 15:59:28 UTC (rev 1194) @@ -462,17 +462,16 @@ m_recentFilesMenu.removeAll(); ArrayList historyEntries = jsXe.getBufferHistory().getEntries(); int index = 0; - JMenu addMenu = m_recentFilesMenu; Iterator historyItr = historyEntries.iterator(); while (historyItr.hasNext()) { BufferHistory.BufferHistoryEntry entry = (BufferHistory.BufferHistoryEntry)historyItr.next(); - addMenu.add(new JMenuItem(new OpenRecentFileAction(this, entry))); + m_recentFilesMenu.add(new JMenuItem(new OpenRecentFileAction(this, entry))); index++; } - if (addMenu.getItemCount() == 0) { + if (m_recentFilesMenu.getMenuComponentCount() == 0) { JMenuItem nullItem = new JMenuItem(Messages.getMessage("File.Recent.None")); nullItem.setEnabled(false); - addMenu.add(nullItem); + m_recentFilesMenu.add(nullItem); } }//}}} @@ -667,7 +666,7 @@ //Add recent files menu m_recentFilesMenu = new WrappingMenu(Messages.getMessage("File.Recent"), jsXe.getIntegerProperty("menu.spill.over", 20)); - m_fileMenu.add(m_recentFilesMenu); + m_fileMenu.add(m_recentFilesMenu.getJMenu()); m_fileMenu.addSeparator(); menuItem = new JMenuItem(ActionManager.getAction("save-file")); Modified: tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/menu/WrappingMenu.java =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/menu/WrappingMenu.java 2006-08-29 14:42:52 UTC (rev 1193) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/menu/WrappingMenu.java 2006-08-29 15:59:28 UTC (rev 1194) @@ -28,7 +28,6 @@ //{{{ jsXe classes import net.sourceforge.jsxe.gui.Messages; -import net.sourceforge.jsxe.EBListener; //}}} //{{{ Java classes @@ -47,15 +46,14 @@ * @author Ian Lewis (<a href="mailto:Ian...@me...">Ian...@me...</a>) * @version $Id$ */ -public class WrappingMenu extends JMenu { +public class WrappingMenu { //{{{ WrappingMenu constructor /** * Constructs a WrappingMenu without an "invoker" and the default wrap count of 20. */ public WrappingMenu() { - super(); - m_addToMenus.push(this); + m_addToMenus.push(new JMenu()); }//}}} //{{{ WrappingMenu constructor @@ -66,9 +64,8 @@ * it wraps. */ public WrappingMenu(int wrapCount) { - super(); m_wrapCount = wrapCount; - m_addToMenus.push(this); + m_addToMenus.push(new JMenu()); }//}}} //{{{ WrappingMenu constructor @@ -80,9 +77,8 @@ * it wraps. */ public WrappingMenu(String label, int wrapCount) { - super(label); m_wrapCount = wrapCount; - m_addToMenus.push(this); + m_addToMenus.push(new JMenu(label)); }//}}} //{{{ add() @@ -91,11 +87,7 @@ maybeAddMenu(); JMenuItem r; JMenu menu = getCurrentMenu(); - if (menu == this) { - r = super.add(a); - } else { - r = menu.add(a); - } + r = menu.add(a); m_menuHash.put(r, getCurrentMenu()); return r; }//}}} @@ -106,11 +98,7 @@ maybeAddMenu(); Component r; JMenu menu = getCurrentMenu(); - if (menu == this) { - r = super.add(c); - } else { - r = menu.add(c); - } + r = menu.add(c); m_menuHash.put(r, getCurrentMenu()); return r; }//}}} @@ -126,11 +114,7 @@ int addIndex = (int)(index / m_wrapCount); int addSubIndex = (index % m_wrapCount); JMenu menu = (JMenu)m_addToMenus.get(addIndex); - if (menu == this) { - r = super.add(c, addSubIndex); - } else { - r = menu.add(c, addSubIndex); - } + r = menu.add(c, addSubIndex); updateSubMenus(); } return r; @@ -145,11 +129,7 @@ } JMenuItem r; JMenu menu = getCurrentMenu(); - if (menu == this) { - r = super.add(menuItem); - } else { - r = menu.add(menuItem); - } + r = menu.add(menuItem); return r; }//}}} @@ -159,11 +139,7 @@ maybeAddMenu(); JMenuItem r; JMenu menu = getCurrentMenu(); - if (menu == this) { - r = super.add(s); - } else { - r = menu.add(s); - } + r = menu.add(s); m_menuHash.put(r, getCurrentMenu()); return r; }//}}} @@ -179,11 +155,7 @@ int addIndex = (int)(pos / m_wrapCount); int addSubIndex = (pos % m_wrapCount); JMenu menu = (JMenu)m_addToMenus.get(addIndex); - if (menu == this) { - r = super.insert(a, addSubIndex); - } else { - r = menu.insert(a, addSubIndex); - } + r = menu.insert(a, addSubIndex); updateSubMenus(); } return r; @@ -200,17 +172,13 @@ int addIndex = (int)(pos / m_wrapCount); int addSubIndex = (pos % m_wrapCount); JMenu menu = (JMenu)m_addToMenus.get(addIndex); - if (menu == this) { - r = super.insert(mi, addSubIndex); - } else { - r = menu.insert(mi, addSubIndex); - } + r = menu.insert(mi, addSubIndex); updateSubMenus(); } return r; }//}}} - //{{{ insert + //{{{ insert() public void insert(String s, int pos) { if (pos == -1) { @@ -220,11 +188,7 @@ int addIndex = (int)(pos / m_wrapCount); int addSubIndex = (pos % m_wrapCount); JMenu menu = (JMenu)m_addToMenus.get(addIndex); - if (menu == this) { - super.insert(s, addSubIndex); - } else { - menu.insert(s, addSubIndex); - } + menu.insert(s, addSubIndex); updateSubMenus(); } }//}}} @@ -233,12 +197,7 @@ public void remove(Component c) { JMenu menu = (JMenu)m_menuHash.get(c); - if (menu == this) { - super.remove(c); - } else { - menu.remove(c); - } - + menu.remove(c); m_menuHash.remove(c); updateSubMenus(); }//}}} @@ -253,11 +212,7 @@ public void remove(JMenuItem item) { JMenu menu = (JMenu)m_menuHash.get(item); - if (menu == this) { - super.remove(item); - } else { - menu.remove(item); - } + menu.remove(item); m_menuHash.remove(item); updateSubMenus(); }//}}} @@ -265,10 +220,11 @@ //{{{ removeAll() public void removeAll() { + JMenu menu = getJMenu(); + menu.removeAll(); m_menuHash = new HashMap(); m_addToMenus = new Stack(); - m_addToMenus.push(this); - super.removeAll(); + m_addToMenus.push(menu); }//}}} //{{{ getMenuComponent() @@ -280,14 +236,10 @@ int addIndex = (int)(n / m_wrapCount); int addSubIndex = (n % m_wrapCount); JMenu menu = (JMenu)m_addToMenus.get(addIndex); - if (menu == this) { - return super.getMenuComponent(addSubIndex); - } else { - return menu.getMenuComponent(addSubIndex); - } + return menu.getMenuComponent(addSubIndex); }//}}} - //{{{ getMenuComponentCount + //{{{ getMenuComponentCount() /** * Gets the total number of components in this menu * and submenus. @@ -297,6 +249,14 @@ return m_menuHash.keySet().size(); }//}}} + //{{{ getJMenu() + /** + * Gets the JMenu that is used by Swing for this WrappingMenu. + */ + public JMenu getJMenu() { + return (JMenu)m_addToMenus.get(0); + }//}}} + //{{{ MoreMenu class /** * A submenu used by the <code>WrappingMenu</code>. Classes that extend @@ -328,18 +288,6 @@ //{{{ Private members - //{{{ getTrueMenuItemCount() - /** - * Gets the true item count for a sub-menu - */ - private int getTrueMenuItemCount(JMenu menu) { - if (menu == this) { - return super.getMenuComponentCount(); - } else { - return menu.getMenuComponentCount(); - } - }//}}} - //{{{ getCurrentMenu() /** * Gets the current menu that we are adding to. @@ -358,7 +306,7 @@ JMenu menu = (JMenu)m_addToMenus.get(i); //greater than wrap count + 1 because of the "More" menu item. - while (getTrueMenuItemCount(menu) > m_wrapCount + 1) { + while (menu.getMenuComponentCount() > m_wrapCount + 1) { //If we need another menu then make one. JMenu nextMenu; @@ -371,25 +319,21 @@ nextMenu = moreMenu; } - int index = getTrueMenuItemCount(menu)-2; + int index = menu.getMenuComponentCount()-2; Component menuComponent = menu.getComponent(index); menu.remove(index); nextMenu.add(menuComponent, 0); } //while there are less than we want in the menu and it's not the last menu - while (getTrueMenuItemCount(menu) < m_wrapCount + 1 && i+1 < m_addToMenus.size()) { + while (menu.getMenuComponentCount() < m_wrapCount + 1 && i+1 < m_addToMenus.size()) { JMenu nextMenu = (JMenu)m_addToMenus.get(i+1); Component menuComponent = nextMenu.getMenuComponent(0); nextMenu.remove(0); - if (menu == this) { - super.add(menuComponent, getTrueMenuItemCount(this)-1); - } else { - menu.add(menuComponent, getTrueMenuItemCount(menu)-1); - } + menu.add(menuComponent, menu.getMenuComponentCount()-1); - if (getTrueMenuItemCount(nextMenu) == 0) { + if (nextMenu.getMenuComponentCount() == 0) { menu.remove(nextMenu); m_addToMenus.pop(); //if it's empty it must be the last menu. } @@ -402,7 +346,7 @@ * Updates the menu that we are truly adding to. */ private void maybeAddMenu() { - int componentCount = getTrueMenuItemCount(getCurrentMenu()); + int componentCount = getCurrentMenu().getMenuComponentCount(); if (componentCount >= m_wrapCount) { MoreMenu menu = createMoreMenu(); ((JMenu)m_addToMenus.peek()).add(menu); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ian...@us...> - 2006-08-30 04:56:55
|
Revision: 1205 Author: ian_lewis Date: 2006-08-29 21:56:43 -0700 (Tue, 29 Aug 2006) ViewCVS: http://svn.sourceforge.net/jsxe/?rev=1205&view=rev Log Message: ----------- Fixed default shortcut for Find Modified Paths: -------------- tags/05pre3/jsxe/Changelog tags/05pre3/jsxe/src/net/sourceforge/jsxe/properties Modified: tags/05pre3/jsxe/Changelog =================================================================== --- tags/05pre3/jsxe/Changelog 2006-08-30 04:41:27 UTC (rev 1204) +++ tags/05pre3/jsxe/Changelog 2006-08-30 04:56:43 UTC (rev 1205) @@ -3,6 +3,8 @@ * Fixed a memory leak with JMenuItems. ActionManager kept a cache of Wrapper Action objects. JMenu items register listeners with those Actions so the JMenuItems would never be Garbage collected. + * Fixed that the Find action had Ctrl-v as the default shortcut. Changed it + to Ctrl-f 08/28/2006 Ian Lewis <Ian...@me...> Modified: tags/05pre3/jsxe/src/net/sourceforge/jsxe/properties =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/properties 2006-08-30 04:41:27 UTC (rev 1204) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/properties 2006-08-30 04:56:43 UTC (rev 1205) @@ -62,7 +62,7 @@ cut.shortcut=C+x copy.shortcut=C+c paste.shortcut=C+v -find.shortcut=C+v +find.shortcut=C+f findnext.shortcut=C+g undo.shortcut=C+z redo.shortcut=C+y This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ian...@us...> - 2006-08-31 20:19:17
|
Revision: 1211 http://svn.sourceforge.net/jsxe/?rev=1211&view=rev Author: ian_lewis Date: 2006-08-31 13:19:03 -0700 (Thu, 31 Aug 2006) Log Message: ----------- Added new ContextSpecificActions to replace ViewSpecificActions. Nowactions such as cut and paste can be registered for specific componentsnot just a specific view. Modified Paths: -------------- tags/05pre3/jsxe/Changelog tags/05pre3/jsxe/src/net/sourceforge/jsxe/ActionManager.java tags/05pre3/jsxe/src/net/sourceforge/jsxe/LocalizedAction.java tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/CopyAction.java tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/CutAction.java tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/FindAction.java tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/FindNextAction.java tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/PasteAction.java tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/GUIUtilities.java tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java tags/05pre3/jsxe/src/net/sourceforge/jsxe/options/ShortcutsOptionPane.java Added Paths: ----------- tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/ContextSpecificAction.java Removed Paths: ------------- tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/ViewSpecificAction.java Modified: tags/05pre3/jsxe/Changelog =================================================================== --- tags/05pre3/jsxe/Changelog 2006-08-31 16:25:08 UTC (rev 1210) +++ tags/05pre3/jsxe/Changelog 2006-08-31 20:19:03 UTC (rev 1211) @@ -1,3 +1,9 @@ +08/31/2006 Ian Lewis <Ian...@me...> + + * Added new ContextSpecificActions to replace ViewSpecificActions. Now + actions such as cut and paste can be registered for specific components + not just a specific view. + 08/29/2006 Ian Lewis <Ian...@me...> * Fixed a memory leak with JMenuItems. ActionManager kept a cache of Modified: tags/05pre3/jsxe/src/net/sourceforge/jsxe/ActionManager.java =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/ActionManager.java 2006-08-31 16:25:08 UTC (rev 1210) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/ActionManager.java 2006-08-31 20:19:03 UTC (rev 1211) @@ -27,13 +27,13 @@ //{{{ imports //{{{ jsXe classes +import net.sourceforge.jsxe.action.ContextSpecificAction; import net.sourceforge.jsxe.gui.Messages; import net.sourceforge.jsxe.gui.GUIUtilities; import net.sourceforge.jsxe.gui.KeyEventTranslator; import net.sourceforge.jsxe.util.Log; import net.sourceforge.jsxe.util.MiscUtilities; import net.sourceforge.jsxe.msg.PropertyChanged; -import net.sourceforge.jsxe.action.ViewSpecificAction; //}}} //{{{ Java classes @@ -49,6 +49,7 @@ //}}} //{{{ AWT classes +import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; //}}} @@ -73,16 +74,6 @@ */ public class ActionManager { - //{{{ Public static identifiers - - public static final String CUT_SUFFIX = ".cut"; - public static final String COPY_SUFFIX = ".copy"; - public static final String PASTE_SUFFIX = ".paste"; - public static final String FIND_SUFFIX = ".find"; - public static final String FIND_NEXT_SUFFIX = ".findnext"; - - //}}} - //{{{ addActionSet() /** * Adds a set of actions to the jsXe's pool of action sets. @@ -94,11 +85,51 @@ m_actionSets.add(set); }//}}} + //{{{ addActionImplementation() + /** + * Register an ActionImplementation with a registered ContextSpecificAction. + * If the ContextSpecificAction isn't registered this method does nothing. + * @param actionName the name of the ContextSpecificAction + * @param comp the component context the recieves the action + * @param imp the action implementation + */ + public static void addActionImplementation(String actionName, Component comp, ContextSpecificAction.ActionImplementation imp) { + ContextSpecificAction action = getContextSpecificAction(actionName); + if (action != null) { + action.registerComponent(comp, imp); + } + }//}}} + + //{{{ removeActionImplementation() + /** + * Removes the ActionImplementation from the registered + * ContextSpecificAction. + */ + public static void removeActionImplementation(String actionName, Component comp) { + ContextSpecificAction action = getContextSpecificAction(actionName); + if (action != null) { + action.removeComponent(comp); + } + }//}}} + + //{{{ getContextSpecificAction() + /** + * Gets a context specific action or null if no context specific action + * exists with that name. + */ + public static ContextSpecificAction getContextSpecificAction(String name) { + LocalizedAction action = getLocalizedAction(name); + if (action instanceof ContextSpecificAction) { + return (ContextSpecificAction)action; + } + return null; + }//}}} + //{{{ getLocalizedAction() /** * Gets the LocalizedAction set with the given name - * @param the name of the action set. - * @return the action set that matches the name, or null if none match. + * @param the name of the action. + * @return the action that matches the name, or null if none match. */ public static LocalizedAction getLocalizedAction(String name) { for (int i = 0; i < m_actionSets.size(); i++) { @@ -113,8 +144,8 @@ //{{{ getAction() /** - * Gets a true action for the LocalizedAction with the given name. This can be - * used in menus and toobars etc. + * Creates a true action for the LocalizedAction with the given name. This + * can be used in menus and toobars etc. * @param name the name of the action. */ public static Action getAction(String name) { @@ -267,18 +298,6 @@ } }//}}} - //{{{ isDocviewSpecific() - /** - * Returns whether the action with the given name is document view specific. - */ - public static boolean isDocViewSpecific(String actionName) { - return (actionName.endsWith(CUT_SUFFIX) || - actionName.endsWith(COPY_SUFFIX) || - actionName.endsWith(PASTE_SUFFIX) || - actionName.endsWith(FIND_SUFFIX) || - actionName.endsWith(FIND_NEXT_SUFFIX)); - }//}}} - //{{{ Wrapper class /** * The Wrapper class wraps LocalizedActions so they can be invoked Modified: tags/05pre3/jsxe/src/net/sourceforge/jsxe/LocalizedAction.java =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/LocalizedAction.java 2006-08-31 16:25:08 UTC (rev 1210) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/LocalizedAction.java 2006-08-31 20:19:03 UTC (rev 1211) @@ -45,7 +45,7 @@ * @version $Id$ * @see jsXe * @see ActionSet - * @see InputManager + * @see ActionManager * @since jsXe 0.5 pre1 */ public abstract class LocalizedAction { Copied: tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/ContextSpecificAction.java (from rev 1210, tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/ViewSpecificAction.java) =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/ContextSpecificAction.java (rev 0) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/ContextSpecificAction.java 2006-08-31 20:19:03 UTC (rev 1211) @@ -0,0 +1,146 @@ +/* +ContextSpecificAction.java +:tabSize=4:indentSize=4:noTabs=true: +:folding=explicit:collapseFolds=1: + +Copyright (C) 2006 Ian Lewis (Ian...@me...) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +Optionally, you may find a copy of the GNU General Public License +from http://www.fsf.org/copyleft/gpl.txt +*/ + +package net.sourceforge.jsxe.action; + +//{{{ imports + +//{{{ jsXe classes +import net.sourceforge.jsxe.jsXe; +import net.sourceforge.jsxe.ActionManager; +import net.sourceforge.jsxe.LocalizedAction; +import net.sourceforge.jsxe.gui.TabbedView; +import net.sourceforge.jsxe.gui.GUIUtilities; +//}}} + +//{{{ Java classes +import java.io.IOException; +import java.util.HashMap; +import java.util.Iterator; +//}}} + +//{{{ AWT components +import java.awt.event.ActionEvent; +import java.awt.Component; +import java.awt.KeyboardFocusManager; +//}}} + +//}}} + +/** + * The ContextSpecificAction is a class that defines actions that are + * context specific. i.e. Actions that are defined by jsXe but whose + * implementation is determined by the context or component that + * currently has focus. + * + * The ContextSpecificAction class allows components to be assocatied + * with a specific action implementation that is specific to that context + * (component). When the ContextSpecificAction is run, the action will + * search the registered components. If the component that has focus is owned + * by registered component then the action implementation associated with + * that component is then invoked. + * + * The order of the search is not specified and the first match that is found + * will be invoked. + * + * Examples where this class may be useful is cut, copy, paste, insert, or + * delete where the implementation may depend on the components implementation. + * + * @author Ian Lewis (<a href="mailto:Ian...@me...">Ian...@me...</a>) + * @version $Id$ + * @since jsXe 0.5 pre3 + */ +public abstract class ContextSpecificAction extends LocalizedAction { + + //{{{ ContextSpecificAction constructor + public ContextSpecificAction(String name) { + super(name); + }//}}} + + //{{{ invoke() + /** + * Invokes the specific ActionImplementation for the component in + * the current context. This method should generally not be overridden by + * subclasses. + */ + public void invoke(TabbedView view, ActionEvent evt) { + /* + Invoke the action registered for the current component named + */ + Component comp = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner(); + Iterator itr = m_actionMap.keySet().iterator(); + while (itr.hasNext()) { + Component key = (Component)itr.next(); + if (GUIUtilities.isComponentParentOf(key, comp)) { + ActionImplementation imp = (ActionImplementation)m_actionMap.get(key); + imp.invoke(view, key, evt); + return; + } + } + }//}}} + + //{{{ registerComponent() + /** + * Adds a component and implementation to the action map for this + * action. + * @param comp The component that will recieve the action + * @param imp the action implementation that implements the action for the + * given component. + */ + public void registerComponent(Component comp, ActionImplementation imp) { + m_actionMap.put(comp, imp); + }//}}} + + //{{{ removeComponent() + /** + * Removes the component from the action map for this action + */ + public void removeComponent(Component comp) { + m_actionMap.remove(comp); + }//}}} + + //{{{ interface ActionImplementation + /** + * An ActionImplementation is an implementation of an action that can be + * registered with a ContextSpecificAction and run in a context. + */ + public static interface ActionImplementation { + + /** + * This method is run when the ContextSpecificAction is run and + * the registered component has focus. + * @param view the view that invoked the action + * @param comp the registered component + * @param evt the event that triggered the action + */ + public void invoke(TabbedView view, Component comp, ActionEvent evt); + + }//}}} + + //{{{ Private Members + + private HashMap m_actionMap = new HashMap(); + + //}}} +} Modified: tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/CopyAction.java =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/CopyAction.java 2006-08-31 16:25:08 UTC (rev 1210) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/CopyAction.java 2006-08-31 20:19:03 UTC (rev 1211) @@ -40,9 +40,13 @@ //}}} //{{{ AWT components +import java.awt.Component; +import java.awt.KeyboardFocusManager; import java.awt.event.ActionEvent; //}}} +import javax.swing.text.JTextComponent; + //}}} /** @@ -53,11 +57,23 @@ * @version $Id$ * @since jsXe 0.5 pre1 */ -public class CopyAction extends ViewSpecificAction { +public class CopyAction extends ContextSpecificAction { //{{{ CopyAction constructor public CopyAction() { super("copy"); }//}}} + //{{{ invoke() + public void invoke(TabbedView view, ActionEvent evt) { + /* + Invoke the action registered for the current component named + */ + Component comp = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner(); + if (comp instanceof JTextComponent) { + ((JTextComponent)comp).copy(); + } else { + super.invoke(view, evt); + } + }//}}} } Modified: tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/CutAction.java =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/CutAction.java 2006-08-31 16:25:08 UTC (rev 1210) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/CutAction.java 2006-08-31 20:19:03 UTC (rev 1211) @@ -40,9 +40,13 @@ //}}} //{{{ AWT components +import java.awt.Component; +import java.awt.KeyboardFocusManager; import java.awt.event.ActionEvent; //}}} +import javax.swing.text.JTextComponent; + //}}} /** @@ -52,11 +56,24 @@ * @version $Id$ * @since jsXe 0.5 pre1 */ -public class CutAction extends ViewSpecificAction { +public class CutAction extends ContextSpecificAction { //{{{ CutAction constructor public CutAction() { super("cut"); }//}}} + //{{{ invoke() + public void invoke(TabbedView view, ActionEvent evt) { + /* + Invoke the action registered for the current component named + */ + Component comp = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner(); + if (comp instanceof JTextComponent) { + ((JTextComponent)comp).cut(); + } else { + super.invoke(view, evt); + } + }//}}} + } Modified: tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/FindAction.java =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/FindAction.java 2006-08-31 16:25:08 UTC (rev 1210) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/FindAction.java 2006-08-31 20:19:03 UTC (rev 1211) @@ -53,7 +53,7 @@ * @version $Id$ * @since jsXe 0.5 pre1 */ -public class FindAction extends ViewSpecificAction { +public class FindAction extends ContextSpecificAction { //{{{ FindAction constructor public FindAction() { Modified: tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/FindNextAction.java =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/FindNextAction.java 2006-08-31 16:25:08 UTC (rev 1210) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/FindNextAction.java 2006-08-31 20:19:03 UTC (rev 1211) @@ -53,7 +53,7 @@ * @version $Id$ * @since jsXe 0.5 pre1 */ -public class FindNextAction extends ViewSpecificAction { +public class FindNextAction extends ContextSpecificAction { //{{{ FindNextAction constructor public FindNextAction() { Modified: tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/PasteAction.java =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/PasteAction.java 2006-08-31 16:25:08 UTC (rev 1210) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/PasteAction.java 2006-08-31 20:19:03 UTC (rev 1211) @@ -40,9 +40,13 @@ //}}} //{{{ AWT components +import java.awt.Component; +import java.awt.KeyboardFocusManager; import java.awt.event.ActionEvent; //}}} +import javax.swing.text.JTextComponent; + //}}} /** @@ -53,11 +57,24 @@ * @version $Id$ * @since jsXe 0.5 pre1 */ -public class PasteAction extends ViewSpecificAction { +public class PasteAction extends ContextSpecificAction { //{{{ PasteAction constructor public PasteAction() { super("paste"); }//}}} -} + //{{{ invoke() + public void invoke(TabbedView view, ActionEvent evt) { + /* + Invoke the action registered for the current component named + */ + Component comp = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner(); + if (comp instanceof JTextComponent) { + ((JTextComponent)comp).paste(); + } else { + super.invoke(view, evt); + } + }//}}} + +} \ No newline at end of file Deleted: tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/ViewSpecificAction.java =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/ViewSpecificAction.java 2006-08-31 16:25:08 UTC (rev 1210) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/ViewSpecificAction.java 2006-08-31 20:19:03 UTC (rev 1211) @@ -1,81 +0,0 @@ -/* -ViewSpecificAction.java -:tabSize=4:indentSize=4:noTabs=true: -:folding=explicit:collapseFolds=1: - -Copyright (C) 2006 Ian Lewis (Ian...@me...) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -Optionally, you may find a copy of the GNU General Public License -from http://www.fsf.org/copyleft/gpl.txt -*/ - -package net.sourceforge.jsxe.action; - -//{{{ imports - -//{{{ jsXe classes -import net.sourceforge.jsxe.jsXe; -import net.sourceforge.jsxe.JARClassLoader; -import net.sourceforge.jsxe.ActionManager; -import net.sourceforge.jsxe.LocalizedAction; -import net.sourceforge.jsxe.gui.TabbedView; -import net.sourceforge.jsxe.gui.Messages; -//}}} - -//{{{ Java classes -import java.io.IOException; -//}}} - -//{{{ AWT components -import java.awt.event.ActionEvent; -//}}} - -//}}} - -/** - * The ViewSpecificAction is a class that defines actions that are - * view specific. i.e. Actions that are defined by jsXe but whose - * implementation is determined by the currently active view. - * - * @author Ian Lewis (<a href="mailto:Ian...@me...">Ian...@me...</a>) - * @version $Id$ - * @since jsXe 0.5 pre3 - */ -public abstract class ViewSpecificAction extends LocalizedAction { - - //{{{ ViewSpecificAction constructor - public ViewSpecificAction(String name) { - super(name); - }//}}} - - //{{{ invoke() - public void invoke(TabbedView view, ActionEvent evt) { - /* - invoke the action registered for the current DocumentView named - viewname.actionname if there is one. - */ - ActionManager.invokeAction(getViewActionName(view), evt); - }//}}} - - //{{{ getViewActionName() - /** - * Gets the view specific action name for the current DocumentView in the - * given TabbedView. - */ - private String getViewActionName(TabbedView view) { - return jsXe.getPluginLoader().getPluginProperty(view.getDocumentView().getViewPlugin(), JARClassLoader.PLUGIN_NAME)+"."+getName(); - }//}}} -} Modified: tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/GUIUtilities.java =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/GUIUtilities.java 2006-08-31 16:25:08 UTC (rev 1210) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/GUIUtilities.java 2006-08-31 20:19:03 UTC (rev 1211) @@ -1271,6 +1271,40 @@ return (p instanceof JDialog) ? (JDialog) p : null; } //}}} + //{{{ isComponentParentOf() method + /** + * Returns true if the parent is a parent component of child. + * @param parent the parent component + * @param child the child component + * @since jsXe 0.5 pre3 + */ + public static boolean isComponentParentOf(Component parent, Component child) { + Component comp = child; + for(;;) { + if (comp == null) { + break; + } + + if (comp instanceof JComponent) { + Component real = (Component)((JComponent)comp).getClientProperty("KORTE_REAL_FRAME"); + if (real != null) { + comp = real; + } + } + + if (comp.equals(parent)) { + return true; + } else { + if (comp instanceof JPopupMenu) { + comp = ((JPopupMenu)comp).getInvoker(); + } else { + comp = comp.getParent(); + } + } + } + return false; + }//}}} + //{{{ getComponentParent() method /** * Finds a parent of the specified component. Modified: tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java 2006-08-31 16:25:08 UTC (rev 1210) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java 2006-08-31 20:19:03 UTC (rev 1211) @@ -585,69 +585,68 @@ m_editMenu.add(menuItem); m_editMenu.addSeparator(); Action action = ActionManager.getAction("cut"); - if (view != null) { - String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".cut"; - if (ActionManager.getLocalizedAction(name) == null) { - action.setEnabled(false); - } else { - action.setEnabled(true); - } - } else { - action.setEnabled(false); - } + // if (view != null) { + // if (ActionManager.getLocalizedAction(name) == null) { + // action.setEnabled(false); + // } else { + // action.setEnabled(true); + // } + // } else { + // action.setEnabled(false); + // } menuItem = new JMenuItem(action); m_editMenu.add(menuItem); action = ActionManager.getAction("copy"); - if (view != null) { - String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".copy"; - if (ActionManager.getLocalizedAction(name) == null) { - action.setEnabled(false); - } else { - action.setEnabled(true); - } - } else { - action.setEnabled(false); - } + // if (view != null) { + // String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".copy"; + // if (ActionManager.getLocalizedAction(name) == null) { + // action.setEnabled(false); + // } else { + // action.setEnabled(true); + // } + // } else { + // action.setEnabled(false); + // } menuItem = new JMenuItem(action); m_editMenu.add(menuItem); action = ActionManager.getAction("paste"); - if (view != null) { - String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".paste"; - if (ActionManager.getLocalizedAction(name) == null) { - action.setEnabled(false); - } else { - action.setEnabled(true); - } - } else { - action.setEnabled(false); - } + // if (view != null) { + // String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".paste"; + // if (ActionManager.getLocalizedAction(name) == null) { + // action.setEnabled(false); + // } else { + // action.setEnabled(true); + // } + // } else { + // action.setEnabled(false); + // } menuItem = new JMenuItem(action); m_editMenu.add(menuItem); m_editMenu.addSeparator(); action = ActionManager.getAction("find"); - if (view != null) { - String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".find"; - if (ActionManager.getLocalizedAction(name) == null) { - action.setEnabled(false); - } else { - action.setEnabled(true); - } - } else { - action.setEnabled(false); - } + // if (view != null) { + // String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".find"; + // if (ActionManager.getLocalizedAction(name) == null) { + // action.setEnabled(false); + // } else { + // action.setEnabled(true); + // } + // } else { + // action.setEnabled(false); + // } menuItem = new JMenuItem(action); m_editMenu.add(menuItem); action = ActionManager.getAction("findnext"); - if (view != null) { - String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".findnext"; - if (ActionManager.getLocalizedAction(name) == null) { - action.setEnabled(false); - } else { - action.setEnabled(true); - } - } else { - action.setEnabled(false); - } + // if (view != null) { + // String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".findnext"; + // if (ActionManager.getLocalizedAction(name) == null) { + // action.setEnabled(false); + // } else { + // action.setEnabled(true); + // } + // } else { + // action.setEnabled(false); + // } menuItem = new JMenuItem(action); m_editMenu.add(menuItem); }//}}} Modified: tags/05pre3/jsxe/src/net/sourceforge/jsxe/options/ShortcutsOptionPane.java =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/options/ShortcutsOptionPane.java 2006-08-31 16:25:08 UTC (rev 1210) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/options/ShortcutsOptionPane.java 2006-08-31 20:19:03 UTC (rev 1211) @@ -146,10 +146,8 @@ if (label == null) { Log.log(Log.WARNING, this, names[i]+" has a null label"); } else { - if (!ActionManager.isDocViewSpecific(names[i])) { - String binding = jsXe.getProperty(names[i]+".shortcut"); - m_set.add(new GrabKeyDialog.KeyBinding(names[i], label, binding)); - } + String binding = jsXe.getProperty(names[i]+".shortcut"); + m_set.add(new GrabKeyDialog.KeyBinding(names[i], label, binding)); } } MiscUtilities.quicksort(m_set, new KeyCompare()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ian...@us...> - 2006-10-24 07:45:26
|
Revision: 1268 http://svn.sourceforge.net/jsxe/?rev=1268&view=rev Author: ian_lewis Date: 2006-10-24 00:45:16 -0700 (Tue, 24 Oct 2006) Log Message: ----------- Fixed bug 1582667 Modified Paths: -------------- tags/05pre3/jsxe/Changelog tags/05pre3/jsxe/src/net/sourceforge/jsxe/dom/AdapterNode.java Modified: tags/05pre3/jsxe/Changelog =================================================================== --- tags/05pre3/jsxe/Changelog 2006-10-24 05:24:10 UTC (rev 1267) +++ tags/05pre3/jsxe/Changelog 2006-10-24 07:45:16 UTC (rev 1268) @@ -1,3 +1,8 @@ +10/24/2006 Ian Lewis <Ian...@me...> + + * Fixed bug 1582667. Now if you drag and drop a node onto itself it doesn't + delete the node. + 08/31/2006 Ian Lewis <Ian...@me...> * Added new ContextSpecificActions to replace ViewSpecificActions. Now Modified: tags/05pre3/jsxe/src/net/sourceforge/jsxe/dom/AdapterNode.java =================================================================== --- tags/05pre3/jsxe/src/net/sourceforge/jsxe/dom/AdapterNode.java 2006-10-24 05:24:10 UTC (rev 1267) +++ tags/05pre3/jsxe/src/net/sourceforge/jsxe/dom/AdapterNode.java 2006-10-24 07:45:16 UTC (rev 1268) @@ -530,11 +530,11 @@ } } else { - /* if the node is already contained in this node then we are effectively moving the node. */ + boolean differentParent = false; if (m_children.contains(node)) { if (location > m_children.indexOf(node)) { location -= 1; @@ -543,13 +543,7 @@ m_children.remove(node); addUndoableEdit(new RemoveNodeChange(this, node, index)); } else { - //Remove from previous parent - AdapterNode previousParent = node.getParentNode(); - if (previousParent != this) { - if (previousParent != null) { - previousParent.removeChild(node); - } - } + differentParent = true; } if (location >= m_children.size()) { m_domNode.appendChild(node.getNode()); @@ -560,6 +554,19 @@ m_children.add(location, node); } + /* + Only remove from previous parent if the previous parent + is different from the new one. + */ + if (differentParent) { + AdapterNode previousParent = node.getParentNode(); + if (previousParent != this) { + if (previousParent != null) { + previousParent.removeChild(node); + } + } + } + node.setParent(this); fireNodeAdded(this, node, location); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |