debian/0000755000000000000000000000000012203644340007164 5ustar debian/control0000644000000000000000000000474712203644340010603 0ustar Source: rhino Section: interpreters Priority: optional Maintainer: Debian Java Maintainers Uploaders: Paul Cager , Marcus Better , Damien Raude-Morvan , Jakub Adam Build-Depends: ant, cdbs, debhelper (>= 7), default-jdk, javahelper, libxmlbeans-java, maven-repo-helper Standards-Version: 3.9.4 Homepage: http://www.mozilla.org/rhino/ Vcs-Git: git://anonscm.debian.org/pkg-java/rhino.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-java/rhino.git Package: rhino Architecture: all Depends: default-jre-headless (>= 1.5) | java5-runtime-headless, libjline-java, librhino-java (= ${source:Version}), ${misc:Depends} Suggests: librhino-java-doc Description: JavaScript engine written in Java Rhino is an implementation of the JavaScript language written entirely in Java. It is typically embedded into Java applications to provide scripting to end users. Package: librhino-java Section: java Architecture: all Replaces: rhino (<< 1.7R3~pre-2) Conflicts: rhino (<< 1.7R3~pre-2) Depends: ${misc:Depends} Suggests: rhino Description: Libraries for rhino Java Script Engine Rhino is an implementation of the JavaScript language written entirely in Java. It is typically embedded into Java applications to provide scripting to end users. . This package contains only Java library and no interpreter. For Rhino interpreter, you install rhino package. Package: rhino-doc Depends: librhino-java-doc, ${misc:Depends} Architecture: all Section: oldlibs Description: transitional dummy package for new librhino-java-doc Rhino is an implementation of the JavaScript language written entirely in Java. It is typically embedded into Java applications to provide scripting to end users. . This is a dummy package for transition to new librhino-java-doc. Package: librhino-java-doc Section: doc Architecture: all Replaces: rhino-doc (<< 1.7R3~pre-2) Conflicts: rhino-doc (<< 1.7R3~pre-2) Depends: ${misc:Depends} Suggests: rhino Description: Documentation for rhino Java Script Engine Rhino is an implementation of the JavaScript language written entirely in Java. It is typically embedded into Java applications to provide scripting to end users. . This is the documentation, including API JavaDoc, for the Rhino JavaScript engine. debian/librhino-java-doc.examples0000644000000000000000000000001312203644340014206 0ustar examples/* debian/rules0000755000000000000000000000420312203644340010243 0ustar #!/usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/javahelper.mk include /usr/share/cdbs/1/class/ant.mk JAVA_HOME := /usr/lib/jvm/default-java DEB_ANT_BUILD_TARGET := jar javadoc UVERSION := $(shell echo $(DEB_UPSTREAM_VERSION) | sed "s/~RC.//" | sed "s/~pre/pre/") BUILDDIRVERSION := $(subst .,_,$(UVERSION)) BUILDDIR=build/rhino$(BUILDDIRVERSION) POM_VERSION := $(UVERSION) MAVEN_REPO := http://repository.sonatype.org/service/local/repositories/central/content clean:: rm -rf toolsrc/org/mozilla/javascript/tools/debugger/downloaded/* rm -rf build mh_clean # The upstream build file (toolsrc/org/mozilla/javascript/tools/debugger/build.xml) downloads # a ZIP file containing some sample swing code, which is then modified and used as part of the # debugger. This is obviously not permitted during a Debian build. # Fortunately the sample code is DFSG-free, so it has been included in the debian directory (in # its modified format). Copying it to the "downloaded" directory prevents the upstream # build.xml from attempting to download it. configure/rhino:: mkdir -p toolsrc/org/mozilla/javascript/tools/debugger/downloaded cp debian/src_from_treetable_article_see_bug409629/AbstractCellEditor.java toolsrc/org/mozilla/javascript/tools/debugger/downloaded/ cp debian/src_from_treetable_article_see_bug409629/JTreeTable.java toolsrc/org/mozilla/javascript/tools/debugger/downloaded/ cp debian/src_from_treetable_article_see_bug409629/TreeTableModel.java toolsrc/org/mozilla/javascript/tools/debugger/downloaded/ cp debian/src_from_treetable_article_see_bug409629/TreeTableModelAdapter.java toolsrc/org/mozilla/javascript/tools/debugger/downloaded/ install/librhino-java:: mh_installpom -plibrhino-java -e$(UVERSION) debian/pom.xml mh_installjar -plibrhino-java -e$(UVERSION) -l debian/pom.xml $(BUILDDIR)/js.jar install/librhino-java-doc:: mv $(BUILDDIR)/javadoc $(BUILDDIR)/api dh_install -plibrhino-java-doc $(BUILDDIR)/api /usr/share/doc/rhino/ get-orig-source: uscan --force-download get-orig-pom: wget -O debian/pom.xml $(MAVEN_REPO)/rhino/js/$(POM_VERSION)/js-$(POM_VERSION).pom debian/orig-tar.exclude0000644000000000000000000000003312203644340012257 0ustar javadoc/* js.jar js-14.jar debian/rhino-doc.lintian-overrides0000644000000000000000000000022012203644340014420 0ustar # Lintian match "GNU General Public License" in MPL-2.0 licence content rhino-doc binary: copyright-should-refer-to-common-license-file-for-gpl debian/rhino.postinst0000644000000000000000000000040312203644340012105 0ustar #!/bin/bash set -e if [ "$1" = "configure" -o "$1" = "abort-upgrade" ]; then update-alternatives --install /usr/bin/js js /usr/bin/rhino 100 \ --slave /usr/share/man/man1/js.1.gz js.1.gz /usr/share/man/man1/rhino.1.gz fi #DEBHELPER# debian/rhino-jsc.10000644000000000000000000000710612203644340011146 0ustar .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH RHINO-JSC 1 "February 12, 2005" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME rhino-jsc \- invokes the rhino JavaScript compiler .SH SYNOPSIS .B rhino-jsc .I [options] .I file1.js .I [file2.js\&.\&.\&.] .SH DESCRIPTION This manual page documents briefly the .B rhino-jsc command. This manual page was written for the Debian distribution because the original program does not have a manual page. It is written according to the html documentation. .PP \fBrhino-jsc\fP is a start script for the rhino JavaScript compiler. The JavaScript compiler translates JavaScript source into Java class files. The resulting Java class files can then be loaded and executed at another time, providing a convenient method for transferring JavaScript, and for avoiding translation cost. Note that the top-level functions available to the shell (such as print) are not available to compiled scripts when they are run outside the shell. .SH OPTIONS .IP -extends\ \fIjava_class_name\fP Specifies that a java class extending the Java class java_class_name should be generated from the incoming JavaScript source file. Each global function in the source file is made a method of the generated class, overriding any methods in the base class by the same name. .IP -implements\ \fIjava_intf_name\fP Specifies that a java class implementing the Java interface java_intf_name should be generated from the incoming JavaScript source file. Each global function in the source file is made a method of the generated class, implementing any methods in the interface by the same name. .IP -debug,\ -g Specifies that debug information should be generated. May not be combined with optimization at an optLevel greater than zero. .IP -nosource Does not save the source in the class file. Functions and scripts compiled this way cannot be decompiled. This option can be used to avoid distributing source or simply to save space in the resulting class file. .IP -o\ \fIoutputFile\fP Writes the class file to the given file (which should end in .class). The string outputFile must be a writable filename. .IP -opt,\ -O\ \fIoptLevel\fP Optimizes at level optLevel, which must be an integer between 0 and 9. .IP -package\ \fIpackageName\fP Specifies the package to generate the class into. The string packageName must be composed of valid identifier characters optionally separated by periods. .IP -version\ \fIversionNumber\fP Specifies the language version to compile with. The string versionNumber must be one of 100, 110, 120, 130, or 140. See JavaScript Language Versions for more information on language versions. .SH EXAMPLE Example compiling the NervousText.js applet written in JavaScript. The example is provided in the librhino-java-doc package. $ rhino-jsc \-extends java.applet.Applet \-implements java.lang.Runnable NervousText.js .SH SEE ALSO The online documentation under http://www.mozilla.org/rhino/jsc.html .SH AUTHOR This manual page was written by Wolfgang Baer , for the Debian project (but may be used by others). debian/source/0000755000000000000000000000000012203644340010464 5ustar debian/source/format0000644000000000000000000000001412203644340011672 0ustar 3.0 (quilt) debian/ant.properties0000644000000000000000000000026112203644340012063 0ustar xbean.jar=/usr/share/java/xmlbeans.jar # JSR 173 (StAX) in included in JDK 6 # Just set property to xmlbeans, to get build system happy jsr173.jar=/usr/share/java/xmlbeans.jar debian/patches/0000755000000000000000000000000012203644340010613 5ustar debian/patches/01_rhino-nowarn.patch0000644000000000000000000000120312203644340014551 0ustar Description: Pass "nowarn" to javac ant task to disable printing of warning during compilation. --- a/src/build.xml +++ b/src/build.xml @@ -62,6 +62,7 @@ includes="org/**/*.java" excludes="org/**/jdk15/*.java" deprecation="on" + nowarn="true" debug="${debug}" includeAntRuntime="false" target="${target-jvm}" @@ -80,6 +81,7 @@ destdir="${classes}" includes="org/**/jdk15/*.java" deprecation="on" + nowarn="true" debug="${debug}" includeAntRuntime="false" target="${target-jvm}" debian/patches/series0000644000000000000000000000013012203644340012022 0ustar 01_rhino-nowarn.patch 02_exclude-jdk15.patch 03_public_getSourcePositionFromStack.patch debian/patches/02_exclude-jdk15.patch0000644000000000000000000000060312203644340014501 0ustar Description: Exclude everything except "jdk1.5/**" when building 1.5 specific source code. --- a/src/build.xml +++ b/src/build.xml @@ -79,6 +79,7 @@ Subject: Make getSourcePositionFromStack() pulic Forwarded: no Last-Update: 2011-12-08 This is needed by package geogebra. Index: rhino-1.7R3/src/org/mozilla/javascript/Context.java =================================================================== --- rhino-1.7R3.orig/src/org/mozilla/javascript/Context.java 2011-12-18 11:43:21.000000000 +0100 +++ rhino-1.7R3/src/org/mozilla/javascript/Context.java 2011-12-18 11:43:57.000000000 +0100 @@ -2481,7 +2481,7 @@ return (Evaluator)Kit.newInstanceOrNull(interpreterClass); } - static String getSourcePositionFromStack(int[] linep) + public static String getSourcePositionFromStack(int[] linep) { Context cx = getCurrentContext(); if (cx == null) debian/bin/0000755000000000000000000000000012203644340007734 5ustar debian/bin/rhino-debugger0000644000000000000000000000032112203644340012554 0ustar #!/bin/sh JAVA_CMD="/usr/bin/java" JAVA_OPTS="" JAVA_CLASSPATH="/usr/share/java/js.jar" JAVA_MAIN="org.mozilla.javascript.tools.debugger.Main" $JAVA_CMD $JAVA_OPTS -classpath $JAVA_CLASSPATH $JAVA_MAIN "$@" debian/bin/rhino-jsc0000644000000000000000000000031512203644340011552 0ustar #!/bin/sh JAVA_CMD="/usr/bin/java" JAVA_OPTS="" JAVA_CLASSPATH="/usr/share/java/js.jar" JAVA_MAIN="org.mozilla.javascript.tools.jsc.Main" $JAVA_CMD $JAVA_OPTS -classpath $JAVA_CLASSPATH $JAVA_MAIN "$@" debian/bin/rhino0000644000000000000000000000110312203644340010771 0ustar #!/bin/sh JAVA_CMD="/usr/bin/java" JAVA_OPTS="" JAVA_CLASSPATH="/usr/share/java/js.jar:/usr/share/java/jline.jar" JAVA_MAIN="org.mozilla.javascript.tools.shell.Main" ## ## Remove bootclasspath overriding for OpenJDK since ## it now use a mangled version of Rhino (in sun.org.mozilla.rhino package) ## ## References: ## ## ## ## $JAVA_CMD $JAVA_OPTS -classpath $JAVA_CLASSPATH $JAVA_MAIN "$@" debian/rhino.manpages0000644000000000000000000000007212203644340012017 0ustar debian/rhino.1 debian/rhino-jsc.1 debian/rhino-debugger.1 debian/pom.xml0000644000000000000000000000150012203644340010475 0ustar 4.0.0 rhino js 1.7R3 jar Rhino Rhino is an open-source implementation of JavaScript written entirely in Java. It is typically embedded into Java applications to provide scripting to end users. http://www.mozilla.org/rhino/ Mozilla Public License http://www.mozilla.org/MPL/MPL-1.1.html repo debian/rhino-debugger.10000644000000000000000000000454612203644340012160 0ustar .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH RHINO-DEBUGGER 1 "Friday 17, 2009" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME rhino-debugger \- invokes the rhino JavaScript debugger GUI .SH SYNOPSIS .B rhino-debugger .I [options] .I script_filename_or_url .I [script_arguments] .SH DESCRIPTION This manual page documents briefly the .B rhino-debugger command. This manual page was written for the Debian distribution because the original program does not have a manual page. It is written according to the html documentation. .PP \fBrhino-debugger\fP is a start script for the rhino JavaScript debugger. The Rhino JavaScript debugger is a GUI that allows debugging of interpreted JavaScript scripts run in Rhino. Note that this debugger will not work with JavaScript scripts run in the mozilla browser since Rhino is not the engine used in such environments. .SH OPTIONS .IP -e\ \fIscript_source\fP Executes script_source as a JavaScript script. .IP -f\ \fIscript_filename_or_url\fP Reads script_filename_or_url content and execute it as a JavaScript script. .IP -opt,\ -O\ \fIoptLevel\fP Optimizes at level optLevel, which must be an integer between 0 and 9. .IP -version\ \fIversionNumber\fP Specifies the language version to compile with. The string versionNumber must be one of 100, 110, 120, 130, or 140. See JavaScript Language Versions for more information on language versions. .IP -strict Enable strict mode. .SH EXAMPLE Example debugging the NervousText.js applet written in JavaScript. The example is provided in the librhino-java-doc package. $ rhino-debugger NervousText.js .SH SEE ALSO The online documentation under http://www.mozilla.org/rhino/debugger.html .SH AUTHOR This manual page was written by Damien Raude-Morvan , for the Debian project (but may be used by others). debian/librhino-java.manifest0000644000000000000000000000243312203644340013443 0ustar usr/share/java/js.jar: Bundle-ManifestVersion: 2 Bundle-Name: Rhino Javascript interpreter Bundle-Vendor: Mozilla Foundation Bundle-Version: 1.7 Bundle-SymbolicName: org.mozilla.javascript Export-Package: org.mozilla.javascript;version="1.7",org.mozilla.javascript.annotations;version="1.7",org.mozilla.javascript.ast;version="1.7",org.mozilla.javascript;version="1.7",org.mozilla.javascript.commonjs.module;version="1.7",org.mozilla.javascript.commonjs.module.provider;version="1.7",org.mozilla.javascript.debug;version="1.7",org.mozilla.javascript.jdk13;version="1.7",org.mozilla.javascript.json;version="1.7",org.mozilla.javascript.optimizer;version="1.7",org.mozilla.javascript.regexp;version="1.7",org.mozilla.javascript.serialize;version="1.7",org.mozilla.javascript.tools;version="1.7",org.mozilla.javascript.tools.debugger;version="1.7",org.mozilla.javascript.tools.debugger.downloaded;version="1.7",org.mozilla.javascript.tools.debugger.treetable;version="1.7",org.mozilla.javascript.tools.idswitch;version="1.7",org.mozilla.javascript.tools.jsc;version="1.7",org.mozilla.javascript.tools.shell;version="1.7",org.mozilla.javascript.xml;version="1.7",org.mozilla.javascript.tools.xml.impl.xmlbeans;version="1.7",org.mozilla.javascript.xmlimpl;version="1.7",org.mozilla.classfile;version="1.7" debian/changelog0000644000000000000000000002645312203644340011050 0ustar rhino (1.7R4-2) unstable; urgency=low * Upload to unstable. - closure-compiler FTBFS will be fixed. -- Damien Raude-Morvan Sat, 17 Aug 2013 11:55:09 +0200 rhino (1.7R4-1) experimental; urgency=low [ Thomas Koch ] * New upstream version (Closes: #699352, #661277, #630341). * Switched packaging to Git [ Damien Raude-Morvan ] * d/copyright: Update license to MPL 2.0. * d/control: Bump Standards-Version to 3.9.4 (no changes needed). * Add lintian overrides for 'copyright-should-refer-to-common-license-file-for-gpl'. -- Damien Raude-Morvan Sat, 16 Feb 2013 22:46:55 +0100 rhino (1.7R3-5) unstable; urgency=low [ Giovanni Mascellani ] * Making getSourcePositionFromStack public (used by geogebra). Closes: #659619. [ Damien Raude-Morvan ] * Upload to unstable. * Remove Michael Koch from Uploaders (Closes: #654130). * d/control: Wrap-and-sort -- Damien Raude-Morvan Mon, 13 Feb 2012 23:52:51 +0100 rhino (1.7R3-4) unstable; urgency=low * Add OSGi metadata to jar manifest * Add javahelper to Build-Depends: * Add Jakub Adam to Uploaders: -- Jakub Adam Wed, 23 Nov 2011 10:21:50 +0100 rhino (1.7R3-3) unstable; urgency=low * Since OpenJDK{6,7} now use a mangled version of Rhino (in "sun.org.mozilla.rhino" package), there is no need to override bootclasspath : - Fix "Incorrect classpath prevents running on AMD64" (Closes: #649131) - Fix "js: Error occurred during initialization ov VM" (Closes: #649281) -- Damien Raude-Morvan Sun, 20 Nov 2011 12:15:19 +0100 rhino (1.7R3-2) unstable; urgency=low * Upload to unstable. -- Damien Raude-Morvan Sun, 12 Jun 2011 21:56:54 +0200 rhino (1.7R3-1) experimental; urgency=low * New upstream release: - Upstream changelog - Refresh all patches. * Bump Standards-Version to 3.9.2 (no changes needed). * d/rules: replace "rm debian/tmp" by mh_clean call. -- Damien Raude-Morvan Wed, 25 May 2011 23:43:56 +0200 rhino (1.7R3~pre-2) experimental; urgency=low * Fix parsing of command line arguments by using quotes. Thanks to Chris Lamb and Chris West for bugreport and patch (Closes: #609965). * Update rhino packaging to follow latest Debian Java Policy: - move javadoc to a librhino-java-doc package. - make rhino-doc package an empty transitional package. - move jar/pom to a librhino-java package (which doesn't depends on any java runtime). - keep rhino interpreter in his own rhino package with a depends on java5-runtime. -- Damien Raude-Morvan Sat, 12 Mar 2011 02:08:43 +0100 rhino (1.7R3~pre-1) experimental; urgency=low * New upstream snapshot of 1.7R3: - Needed by OpenJDK7 >= b126 - d/patches/*: Refresh all patches - d/rules: Force version installed by mh_* tools * Bump Standards-Version to 3.9.1 (no changes needed) * Switch to 3.0 (quilt) source format -- Damien Raude-Morvan Mon, 24 Jan 2011 19:49:04 +0100 rhino (1.7R2-4) unstable; urgency=low * Enable E4X support: - Build-Depends on libxmlbeans-java - Set JAR location in debian/ant.properties - Should fix (Closes: #567847) and (LP: #304702) * Bump Standards-Version to 3.8.4 (no changes needed) * Fix small typo in rhino-jsc manpage * Fix debian/copyright: don't use symlink to license -- Damien Raude-Morvan Sat, 06 Feb 2010 21:19:47 +0100 rhino (1.7R2-3) unstable; urgency=low * Maven POMs: - debian/control: add a Build-Depends on maven-repo-helper - debian/rules: use mh_installpoms and mh_installjar to install the POM and the jar to the Maven repository - debian/pom.xml: Debian pom.xml file as upstream doesn't provide one - debian/rules: new get-orig-pom to update debian/pom.xml at new upstream release. * Bump debhelper version to >= 7 * debian/rhino.1: Describe more precisly optimization levels and add missing level '-1'. Thanks to Marcus Better for notifying (Closes: #558086) * Remove Arnaud Vandyck from Uploaders * Add description to debian/patches/*.diff -- Damien Raude-Morvan Sat, 12 Dec 2009 15:18:24 +0100 rhino (1.7R2-2) unstable; urgency=low * Switch to Quilt patch system: - Refresh all patches - Add B-D on quilt - Include patchsys-quilt.mk in debian/rules * Bump Standards-Version to 3.8.3: - Add a README.source to describe patch system * Add a manpage for rhino-debugger script * Build-Depends on default-jdk instead of default-jdk-builddep because we don't build a native GCJ package * Move api documentation to /usr/share/doc/rhino/api/ * debian/control: Improve rhino-doc package long description * debian/copyright: Add missing BSD licence (3 clauses) for files under toolsrc/org/mozilla/javascript/tools/debugger/treetable * Update my email address -- Damien Raude-Morvan Fri, 02 Oct 2009 22:23:46 +0200 rhino (1.7R2-1) unstable; urgency=low [ Marcus Better ] * Updated package descriptions. [ Matthias Klose ] * (Build-)depend on default-jre-headless/-jdk. * Drop alternate dependencies on java2-runtime-headless and java2-runtime-headless. The binary package is currently built to require a java5 runtime. [ Damien Raude-Morvan ] * New upstream release. - new 02_exclude-jdk15 patch to exclude already compiled classes for jdk15 rebuild: gcj doesn't handle compiling classes already on its classpath - new "rhino-debugger" launcher for Rhino Debugger Swing UI - update "rhino" launcher to exclude OpenJDK bundled rhino (Closes: #512498) * debian/{postinst,prerm }: scripts should take care of errors, add set -e before any instruction * debian/rules: add new get-orig-source target using uscan * debian/control: - Build-Depends on specialized default-jdk-builddep instead of default-jdk - Bump Standards-Version to 3.8.1: Wrap Uploaders field - add Depends on ${misc:Depends} -- Damien Raude-Morvan Mon, 13 Apr 2009 02:40:15 +0200 rhino (1.7R2~pre-2) experimental; urgency=low * Really include the debugger. Closes: #474046. -- Michael Koch Sat, 05 Apr 2008 15:03:43 +0200 rhino (1.7R2~pre-1) experimental; urgency=low * New upstream release. * Upload to experimental. * Enable build of debugger. Closes: #474046. -- Michael Koch Fri, 04 Apr 2008 10:32:47 +0200 rhino (1.7R1-1) unstable; urgency=low * New upstream release. -- Michael Koch Sat, 22 Mar 2008 13:49:49 +0100 rhino (1.7R1~RC3-1) experimental; urgency=low * New upstream version. * Fixed hyphen in rhino-jsc manpage. * Updated watch file to handle upstream RC versions. * Updated Standards-Version to 3.7.3. -- Michael Koch Tue, 19 Feb 2008 11:17:45 +0100 rhino (1.6.R7-2) unstable; urgency=low * Fixed bashism in debian/rules. Closes: #453766. * Fixed names of Homepage, Vcs-Svn and Vcs-Browser fields. * Added myself to Uploaders. -- Michael Koch Sat, 01 Dec 2007 11:56:31 +0100 rhino (1.6.R7-1) unstable; urgency=low * New upstream version. -- Marcus Better Thu, 11 Oct 2007 15:50:42 +0200 rhino (1.6.R5-3) unstable; urgency=low * Removed Wolfgang Baer from Uploaders and added myself. * Fixed FTBFS: java.net.ConnectException: Connection refused. Was trying to download xmlbeans Jar, which is not allowed. As this Jar is not (yet) in Debian, rhino has been built with XML implementation disabled. A bug in 1.6.R5-2 meant that it was still trying to download the "treetable" source. This has been fixed in debian/rules by copying the sample source code into the "downloaded" directory (the sample source code had to be modified). (Closes: #424466) * Moved "-doc" package to doc section. -- Paul Cager Sun, 15 Jul 2007 00:32:12 +0100 rhino (1.6.R5-2) unstable; urgency=low * added java classes from a tutorial from Sun (BSD license as mentionned in #409629), thanks to Roktas, Filipe Lautert and Bruno Harbulot for filing bug, giving infos and proposed a patch (even if it's not used). I've just removed the 02-dont_build-toolsrc.patch. I added the classes examples if needed but it seems not to be the case (closes: #409629). -- Arnaud Vandyck Fri, 11 May 2007 14:07:21 +0200 rhino (1.6.R5-1) unstable; urgency=low * New upstream maintenance release. -- Matthias Klose Sat, 3 Feb 2007 16:46:28 +0100 rhino (1.6R2-3) unstable; urgency=low * debian/patches/02-dont_build-toolsrc.patch: added. Don't build toolsrc and xmlimplsrc because they use Sun classes to build. If you want to build them, just remove the file (closes: #395525). -- Arnaud Vandyck Mon, 6 Nov 2006 12:54:28 +0100 rhino (1.6R2-2) unstable; urgency=low * Changed the dependency from kaffe to java-gcj-compat. -- Arnaud Vandyck Sun, 5 Nov 2006 17:45:52 +0100 rhino (1.6R2-1) unstable; urgency=low * New upstream (closes: #350971). * Removed Takashi Okamoto from uploaders (closes: #352992) * Updated Standards-Version to 3.7.2: moved debhelper and cdbs to Build-Depends. * Build with java-gcj-compat. * debian/copyright: updated the download url. * debian/watch: new file. -- Arnaud Vandyck Mon, 17 Jul 2006 14:50:36 +0200 rhino (1.5.R5-5) unstable; urgency=low * Removed explicit usage of jikes build compiler property for kaffe jikes -> ecj transition -- Wolfgang Baer Fri, 6 Jan 2006 18:54:28 +0100 rhino (1.5.R5-4) unstable; urgency=low * libant1.6-java to ant transition * Removed dependency on java-common * Added suggests to rhino-doc and other way round * Registered documentation with doc-base * Fixed lintian warning in postinst and added override for false positive lintian warning * Standards-Version 3.6.2 (no changes) -- Wolfgang Baer Sat, 24 Sep 2005 23:31:36 +0200 rhino (1.5.R5-3) unstable; urgency=low * Added java2-runtime to runtime choices * Removed build.xml workaround patch which is no longer needed with the current kaffe in sarge/unstable -- Wolfgang Baer Wed, 13 Apr 2005 19:30:40 +0200 rhino (1.5.R5-2) unstable; urgency=low * Closes: #283651: alternative without a manpage * upload to main: uses kaffe,jikes to build * provide JavaScript compiler as rhino-jsc with manpage * Arnaud Vandyck did sponsor this package. As a member of pkg-java Alioth's project, I added Wolfgang as uploaders -- Wolfgang Baer Sat, 12 Feb 2005 11:56:06 +0000 rhino (1.5.R5-1) unstable; urgency=low * New upstream release * changed the build system to cdbs -- Arnaud Vandyck Sun, 21 Nov 2004 14:29:34 +0100 rhino (1.5.R2-2) unstable; urgency=low * Add alternative for /usr/bin/js. The patch is provided by Brian Bassett. (Closes:#122669) -- Takashi Okamoto Sat, 8 Dec 2001 10:45:06 +0900 rhino (1.5.R2-1) unstable; urgency=low * Initial Release. -- Takashi Okamoto Fri, 16 Nov 2001 23:51:38 +0900 debian/copyright0000644000000000000000000005052212203644340011123 0ustar This package was debianized by Takashi Okamoto on Fri, 16 Nov 2001 23:51:38 +0900. It is currently maintained by the Debian Java Maintainers . It was downloaded from . Debian packaging : Copyright (C) 2007 Marcus Better Copyright (C) 2012-2013 Damien Raude-Morvan The majority of Rhino is licensed under the MPL 2.0 Mozilla Public License Version 2.0 ================================== 1. Definitions -------------- 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. 1.3. "Contribution" means Covered Software of a particular Contributor. 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. "Incompatible With Secondary Licenses" means (a) that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or (b) that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. "Executable Form" means any form of the work other than Source Code Form. 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. "License" means this document. 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. "Modifications" means any of the following: (a) any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or (b) any new file in Source Code Form that contains any Covered Software. 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. "Source Code Form" means the form of the work preferred for making modifications. 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions -------------------------------- 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and (b) under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: (a) for any code that a Contributor has removed from Covered Software; or (b) for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or (c) under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities ------------------- 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: (a) such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and (b) You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation --------------------------------------------------- If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination -------------- 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. ************************************************************************ * * * 6. Disclaimer of Warranty * * ------------------------- * * * * Covered Software is provided under this License on an "as is" * * basis, without warranty of any kind, either expressed, implied, or * * statutory, including, without limitation, warranties that the * * Covered Software is free of defects, merchantable, fit for a * * particular purpose or non-infringing. The entire risk as to the * * quality and performance of the Covered Software is with You. * * Should any Covered Software prove defective in any respect, You * * (not any Contributor) assume the cost of any necessary servicing, * * repair, or correction. This disclaimer of warranty constitutes an * * essential part of this License. No use of any Covered Software is * * authorized under this License except under this disclaimer. * * * ************************************************************************ ************************************************************************ * * * 7. Limitation of Liability * * -------------------------- * * * * Under no circumstances and under no legal theory, whether tort * * (including negligence), contract, or otherwise, shall any * * Contributor, or anyone who distributes Covered Software as * * permitted above, be liable to You for any direct, indirect, * * special, incidental, or consequential damages of any character * * including, without limitation, damages for lost profits, loss of * * goodwill, work stoppage, computer failure or malfunction, or any * * and all other commercial damages or losses, even if such party * * shall have been informed of the possibility of such damages. This * * limitation of liability shall not apply to liability for death or * * personal injury resulting from such party's negligence to the * * extent applicable law prohibits such limitation. Some * * jurisdictions do not allow the exclusion or limitation of * * incidental or consequential damages, so this exclusion and * * limitation may not apply to You. * * * ************************************************************************ 8. Litigation ------------- Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. 9. Miscellaneous ---------------- This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License --------------------------- 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice ------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - "Incompatible With Secondary Licenses" Notice --------------------------------------------------------- This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. Contents of src/org/mozilla/javascript/v8dtoa/ are available only under the following license: Copyright 2010 the V8 project authors. All rights reserved. ============================================================================ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ============================================================================ Contents of toolsrc/org/mozilla/javascript/tools/debugger/treetable/ are available only under the following license: Copyright 1997, 1998 Sun Microsystems, Inc. All Rights Reserved. ============================================================================ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * - Neither the name of Sun Microsystems nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ============================================================================ debian/orig-tar.sh0000755000000000000000000000036312203644340011251 0ustar #!/bin/sh -e # called by uscan with '--upstream-version' DIR=rhino-$2 TAR=rhino_$2.orig.tar.gz # Repack upstream source to tar.gz unzip $3 mv rhino* $DIR GZIP=--best tar czf $TAR -X debian/orig-tar.exclude $DIR rm -rf $DIR debian/rhino.prerm0000644000000000000000000000016012203644340011347 0ustar #!/bin/sh set -e if [ "$1" = "remove" ]; then update-alternatives --remove js /usr/bin/rhino fi #DEBHELPER# debian/src_from_treetable_article_see_bug409629/0000755000000000000000000000000012203644340016717 5ustar debian/src_from_treetable_article_see_bug409629/FileSystemModel2.java0000644000000000000000000004673312203644340022726 0ustar /* * FileSystemModel2.java * * Copyright (c) 1998 Sun Microsystems, Inc. All Rights Reserved. * * This software is the confidential and proprietary information of Sun * Microsystems, Inc. ("Confidential Information"). You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into * with Sun. * * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING * THIS SOFTWARE OR ITS DERIVATIVES. * */ import java.io.IOException; import java.io.File; import java.util.Date; import java.util.Stack; import javax.swing.SwingUtilities; import javax.swing.tree.TreePath; /** * FileSystemModel2 is a TreeTableModel representing a hierarchical file * system.

* This will recursively load all the children from the path it is * created with. The loading is done with the method reloadChildren, and * happens in another thread. The method isReloading can be invoked to check * if there are active threads. The total size of all the files are also * accumulated. *

* By default links are not descended. java.io.File does not have a way * to distinguish links, so a file is assumed to be a link if its canonical * path does not start with its parent path. This may not cover all cases, * but works for the time being. *

Reloading happens such that all the files of the directory are * loaded and immediately available. The background thread then recursively * loads all the files of each of those directories. When each directory has * finished loading all its sub files they are attached and an event is * generated in the event dispatching thread. A more ambitious approach * would be to attach each set of directories as they are loaded and generate * an event. Then, once all the direct descendants of the directory being * reloaded have finished loading, it is resorted based on total size. *

* While you can invoke reloadChildren as many times as you want, care * should be taken in doing this. You should not invoke reloadChildren * on a node that is already being reloaded, or going to be reloaded * (meaning its parent is reloading but it hasn't started reloading * that directory yet). If this is done odd results may * happen. FileSystemModel2 does not enforce any policy in this manner, * and it is up to the user of FileSystemModel2 to ensure it doesn't * happen. * * @version 1.12 05/12/98 * @author Philip Milne * @author Scott Violet */ public class FileSystemModel2 extends AbstractTreeTableModel { // Names of the columns. static protected String[] cNames = {"Name", "Size", "Type", "Modified"}; // Types of the columns. static protected Class[] cTypes = { TreeTableModel.class, Integer.class, String.class, Date.class}; // The the returned file length for directories. public static final Integer ZERO = new Integer(0); /** An array of MergeSorter sorters, that will sort based on size. */ static Stack sorters = new Stack(); /** True if the receiver is valid, once set to false all Threads * loading files will stop. */ protected boolean isValid; /** Node currently being reloaded, this becomes somewhat muddy if * reloading is happening in multiple threads. */ protected FileNode reloadNode; /** > 0 indicates reloading some nodes. */ int reloadCount; /** Returns true if links are to be descended. */ protected boolean descendLinks; /** * Returns a MergeSort that can sort on the totalSize of a FileNode. */ protected static MergeSort getSizeSorter() { synchronized(sorters) { if (sorters.size() == 0) { return new SizeSorter(); } return (MergeSort)sorters.pop(); } } /** * Should be invoked when a MergeSort is no longer needed. */ protected static void recycleSorter(MergeSort sorter) { synchronized(sorters) { sorters.push(sorter); } } /** * Creates a FileSystemModel2 rooted at File.separator, which is usually * the root of the file system. This does not load it, you should invoke * reloadChildren with the root to start loading. */ public FileSystemModel2() { this(File.separator); } /** * Creates a FileSystemModel2 with the root being rootPath. * This does not load it, you should invoke * reloadChildren with the root to start loading. */ public FileSystemModel2(String rootPath) { super(null); isValid = true; root = new FileNode(new File(rootPath)); } // // The TreeModel interface // /** * Returns the number of children of node. */ public int getChildCount(Object node) { Object[] children = getChildren(node); return (children == null) ? 0 : children.length; } /** * Returns the child of node at index i. */ public Object getChild(Object node, int i) { return getChildren(node)[i]; } /** * Returns true if the passed in object represents a leaf, false * otherwise. */ public boolean isLeaf(Object node) { return ((FileNode)node).isLeaf(); } // // The TreeTableNode interface. // /** * Returns the number of columns. */ public int getColumnCount() { return cNames.length; } /** * Returns the name for a particular column. */ public String getColumnName(int column) { return cNames[column]; } /** * Returns the class for the particular column. */ public Class getColumnClass(int column) { return cTypes[column]; } /** * Returns the value of the particular column. */ public Object getValueAt(Object node, int column) { FileNode fn = (FileNode)node; try { switch(column) { case 0: return fn.getFile().getName(); case 1: if (fn.isTotalSizeValid()) { return new Integer((int)((FileNode)node).totalSize()); } return null; case 2: return fn.isLeaf() ? "File" : "Directory"; case 3: return fn.lastModified(); } } catch (SecurityException se) { } return null; } // // Some convenience methods. // /** * Reloads the children of the specified node. */ public void reloadChildren(Object node) { FileNode fn = (FileNode)node; synchronized(this) { reloadCount++; } fn.resetSize(); new Thread(new FileNodeLoader((FileNode)node)).start(); } /** * Stops and waits for all threads to finish loading. */ public void stopLoading() { isValid = false; synchronized(this) { while (reloadCount > 0) { try { wait(); } catch (InterruptedException ie) {} } } isValid = true; } /** * If newValue is true, links are descended. Odd results * may happen if you set this while other threads are loading. */ public void setDescendsLinks(boolean newValue) { descendLinks = newValue; } /** * Returns true if links are to be automatically descended. */ public boolean getDescendsLinks() { return descendLinks; } /** * Returns the path node represents. */ public String getPath(Object node) { return ((FileNode)node).getFile().getPath(); } /** * Returns the total size of the receiver. */ public long getTotalSize(Object node) { return ((FileNode)node).totalSize(); } /** * Returns true if the receiver is loading any children. */ public boolean isReloading() { return (reloadCount > 0); } /** * Returns the path to the node that is being loaded. */ public TreePath getPathLoading() { FileNode rn = reloadNode; if (rn != null) { return new TreePath(rn.getPath()); } return null; } /** * Returns the node being loaded. */ public Object getNodeLoading() { return reloadNode; } protected File getFile(Object node) { FileNode fileNode = ((FileNode)node); return fileNode.getFile(); } protected Object[] getChildren(Object node) { FileNode fileNode = ((FileNode)node); return fileNode.getChildren(); } protected static FileNode[] EMPTY_CHILDREN = new FileNode[0]; // Used to sort the file names. static private MergeSort fileMS = new MergeSort() { public int compareElementsAt(int beginLoc, int endLoc) { return ((String)toSort[beginLoc]).compareTo ((String)toSort[endLoc]); } }; /** * A FileNode is a derivative of the File class - though we delegate to * the File object rather than subclassing it. It is used to maintain a * cache of a directory's children and therefore avoid repeated access * to the underlying file system during rendering. */ class FileNode { /** java.io.File the receiver represents. */ protected File file; /** Parent FileNode of the receiver. */ private FileNode parent; /** Children of the receiver. */ protected FileNode[] children; /** Size of the receiver and all its children. */ protected long totalSize; /** Valid if the totalSize has finished being calced. */ protected boolean totalSizeValid; /** Path of the receiver. */ protected String canonicalPath; /** True if the canonicalPath of this instance does not start with * the canonical path of the parent. */ protected boolean isLink; /** Date last modified. */ protected Date lastModified; protected FileNode(File file) { this(null, file); } protected FileNode(FileNode parent, File file) { this.parent = parent; this.file = file; try { canonicalPath = file.getCanonicalPath(); } catch (IOException ioe) { canonicalPath = ""; } if (parent != null) { isLink = !canonicalPath.startsWith(parent.getCanonicalPath()); } else { isLink = false; } if (isLeaf()) { totalSize = file.length(); totalSizeValid = true; } } /** * Returns the date the receiver was last modified. */ public Date lastModified() { if (lastModified == null && file != null) { lastModified = new Date(file.lastModified()); } return lastModified; } /** * Returns the the string to be used to display this leaf in the JTree. */ public String toString() { return file.getName(); } /** * Returns the java.io.File the receiver represents. */ public File getFile() { return file; } /** * Returns size of the receiver and all its children. */ public long totalSize() { return totalSize; } /** * Returns the parent of the receiver. */ public FileNode getParent() { return parent; } /** * Returns true if the receiver represents a leaf, that is it is * isn't a directory. */ public boolean isLeaf() { return file.isFile(); } /** * Returns true if the total size is valid. */ public boolean isTotalSizeValid() { return totalSizeValid; } /** * Clears the date. */ protected void resetLastModified() { lastModified = null; } /** * Sets the size of the receiver to be 0. */ protected void resetSize() { alterTotalSize(-totalSize); } /** * Loads the children, caching the results in the children * instance variable. */ protected FileNode[] getChildren() { return children; } /** * Recursively loads all the children of the receiver. */ protected void loadChildren(MergeSort sorter) { totalSize = file.length(); children = createChildren(null); for (int counter = children.length - 1; counter >= 0; counter--) { Thread.yield(); // Give the GUI CPU time to draw itself. if (!children[counter].isLeaf() && (descendLinks || !children[counter].isLink())) { children[counter].loadChildren(sorter); } totalSize += children[counter].totalSize(); if (!isValid) { counter = 0; } } if (isValid) { if (sorter != null) { sorter.sort(children); } totalSizeValid = true; } } /** * Loads the children of of the receiver. */ protected FileNode[] createChildren(MergeSort sorter) { FileNode[] retArray = null; try { String[] files = file.list(); if(files != null) { if (sorter != null) { sorter.sort(files); } retArray = new FileNode[files.length]; String path = file.getPath(); for(int i = 0; i < files.length; i++) { File childFile = new File(path, files[i]); retArray[i] = new FileNode(this, childFile); } } } catch (SecurityException se) {} if (retArray == null) { retArray = EMPTY_CHILDREN; } return retArray; } /** * Returns true if the children have been loaded. */ protected boolean loadedChildren() { return (file.isFile() || (children != null)); } /** * Gets the path from the root to the receiver. */ public FileNode[] getPath() { return getPathToRoot(this, 0); } /** * Returns the canonical path for the receiver. */ public String getCanonicalPath() { return canonicalPath; } /** * Returns true if the receiver's path does not begin with the * parent's canonical path. */ public boolean isLink() { return isLink; } protected FileNode[] getPathToRoot(FileNode aNode, int depth) { FileNode[] retNodes; if(aNode == null) { if(depth == 0) return null; else retNodes = new FileNode[depth]; } else { depth++; retNodes = getPathToRoot(aNode.getParent(), depth); retNodes[retNodes.length - depth] = aNode; } return retNodes; } /** * Sets the children of the receiver, updates the total size, * and if generateEvent is true a tree structure changed event * is created. */ protected void setChildren(FileNode[] newChildren, boolean generateEvent) { long oldSize = totalSize; totalSize = file.length(); children = newChildren; for (int counter = children.length - 1; counter >= 0; counter--) { totalSize += children[counter].totalSize(); } if (generateEvent) { FileNode[] path = getPath(); fireTreeStructureChanged(FileSystemModel2.this, path, null, null); FileNode parent = getParent(); if (parent != null) { parent.alterTotalSize(totalSize - oldSize); } } } protected synchronized void alterTotalSize(long sizeDelta) { if (sizeDelta != 0 && (parent = getParent()) != null) { totalSize += sizeDelta; nodeChanged(); parent.alterTotalSize(sizeDelta); } else { // Need a way to specify the root. totalSize += sizeDelta; } } /** * This should only be invoked on the event dispatching thread. */ protected synchronized void setTotalSizeValid(boolean newValue) { if (totalSizeValid != newValue) { nodeChanged(); totalSizeValid = newValue; FileNode parent = getParent(); if (parent != null) { parent.childTotalSizeChanged(this); } } } /** * Marks the receivers total size as valid, but does not invoke * node changed, nor message the parent. */ protected synchronized void forceTotalSizeValid() { totalSizeValid = true; } /** * Invoked when a childs total size has changed. */ protected synchronized void childTotalSizeChanged(FileNode child) { if (totalSizeValid != child.isTotalSizeValid()) { if (totalSizeValid) { setTotalSizeValid(false); } else { FileNode[] children = getChildren(); for (int counter = children.length - 1; counter >= 0; counter--) { if (!children[counter].isTotalSizeValid()) { return; } } setTotalSizeValid(true); } } } /** * Can be invoked when a node has changed, will create the * appropriate event. */ protected void nodeChanged() { FileNode parent = getParent(); if (parent != null) { FileNode[] path = parent.getPath(); int[] index = { getIndexOfChild(parent, this) }; Object[] children = { this }; fireTreeNodesChanged(FileSystemModel2.this, path, index, children); } } } /** * FileNodeLoader can be used to reload all the children of a * particular node. It first resets the children of the FileNode * it is created with, and in its run method will reload all of * that nodes children. FileNodeLoader may not be running in the event * dispatching thread. As swing is not thread safe it is important * that we don't generate events in this thread. SwingUtilities.invokeLater * is used so that events are generated in the event dispatching thread. */ class FileNodeLoader implements Runnable { /** Node creating children for. */ FileNode node; /** Sorter. */ MergeSort sizeMS; FileNodeLoader(FileNode node) { this.node = node; node.resetLastModified(); node.setChildren(node.createChildren(fileMS), true); node.setTotalSizeValid(false); } public void run() { FileNode[] children = node.getChildren(); sizeMS = getSizeSorter(); for (int counter = children.length - 1; counter >= 0; counter--) { if (!children[counter].isLeaf()) { reloadNode = children[counter]; loadChildren(children[counter]); reloadNode = null; } if (!isValid) { counter = 0; } } recycleSorter(sizeMS); if (isValid) { SwingUtilities.invokeLater(new Runnable() { public void run() { MergeSort sorter = getSizeSorter(); sorter.sort(node.getChildren()); recycleSorter(sorter); node.setChildren(node.getChildren(), true); synchronized(FileSystemModel2.this) { reloadCount--; FileSystemModel2.this.notifyAll(); } } }); } else { synchronized(FileSystemModel2.this) { reloadCount--; FileSystemModel2.this.notifyAll(); } } } protected void loadChildren(FileNode node) { if (!node.isLeaf() && (descendLinks || !node.isLink())) { final FileNode[] children = node.createChildren(null); for (int counter = children.length - 1; counter >= 0; counter--) { if (!children[counter].isLeaf()) { if (descendLinks || !children[counter].isLink()) { children[counter].loadChildren(sizeMS); } else { children[counter].forceTotalSizeValid(); } } if (!isValid) { counter = 0; } } if (isValid) { final FileNode fn = node; // Reset the children SwingUtilities.invokeLater(new Runnable() { public void run() { MergeSort sorter = getSizeSorter(); sorter.sort(children); recycleSorter(sorter); fn.setChildren(children, true); fn.setTotalSizeValid(true); fn.nodeChanged(); } }); } } else { node.forceTotalSizeValid(); } } } /** * Sorts the contents, which must be instances of FileNode based on * totalSize. */ static class SizeSorter extends MergeSort { public int compareElementsAt(int beginLoc, int endLoc) { long firstSize = ((FileNode)toSort[beginLoc]).totalSize(); long secondSize = ((FileNode)toSort[endLoc]).totalSize(); if (firstSize != secondSize) { return (int)(secondSize - firstSize); } return ((FileNode)toSort[beginLoc]).toString().compareTo (((FileNode)toSort[endLoc]).toString()); } } } debian/src_from_treetable_article_see_bug409629/TreeTableModelAdapter.java0000644000000000000000000000731012203644340023714 0ustar /* * @(#)TreeTableModelAdapter.java 1.2 98/10/27 * * Copyright 1997, 1998 by Sun Microsystems, Inc., * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. * All rights reserved. * * This software is the confidential and proprietary information * of Sun Microsystems, Inc. ("Confidential Information"). You * shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement * you entered into with Sun. */ package org.mozilla.javascript.tools.debugger.downloaded; import javax.swing.JTree; import javax.swing.SwingUtilities; import javax.swing.table.AbstractTableModel; import javax.swing.tree.TreePath; import javax.swing.event.TreeExpansionEvent; import javax.swing.event.TreeExpansionListener; import javax.swing.event.TreeModelEvent; import javax.swing.event.TreeModelListener; /** * This is a wrapper class takes a TreeTableModel and implements * the table model interface. The implementation is trivial, with * all of the event dispatching support provided by the superclass: * the AbstractTableModel. * * @version 1.2 10/27/98 * * @author Philip Milne * @author Scott Violet */ public class TreeTableModelAdapter extends AbstractTableModel { JTree tree; TreeTableModel treeTableModel; public TreeTableModelAdapter(TreeTableModel treeTableModel, JTree tree) { this.tree = tree; this.treeTableModel = treeTableModel; tree.addTreeExpansionListener(new TreeExpansionListener() { // Don't use fireTableRowsInserted() here; the selection model // would get updated twice. public void treeExpanded(TreeExpansionEvent event) { fireTableDataChanged(); } public void treeCollapsed(TreeExpansionEvent event) { fireTableDataChanged(); } }); // Install a TreeModelListener that can update the table when // tree changes. We use delayedFireTableDataChanged as we can // not be guaranteed the tree will have finished processing // the event before us. treeTableModel.addTreeModelListener(new TreeModelListener() { public void treeNodesChanged(TreeModelEvent e) { delayedFireTableDataChanged(); } public void treeNodesInserted(TreeModelEvent e) { delayedFireTableDataChanged(); } public void treeNodesRemoved(TreeModelEvent e) { delayedFireTableDataChanged(); } public void treeStructureChanged(TreeModelEvent e) { delayedFireTableDataChanged(); } }); } // Wrappers, implementing TableModel interface. public int getColumnCount() { return treeTableModel.getColumnCount(); } public String getColumnName(int column) { return treeTableModel.getColumnName(column); } public Class getColumnClass(int column) { return treeTableModel.getColumnClass(column); } public int getRowCount() { return tree.getRowCount(); } protected Object nodeForRow(int row) { TreePath treePath = tree.getPathForRow(row); return treePath.getLastPathComponent(); } public Object getValueAt(int row, int column) { return treeTableModel.getValueAt(nodeForRow(row), column); } public boolean isCellEditable(int row, int column) { return treeTableModel.isCellEditable(nodeForRow(row), column); } public void setValueAt(Object value, int row, int column) { treeTableModel.setValueAt(value, nodeForRow(row), column); } /** * Invokes fireTableDataChanged after all the pending events have been * processed. SwingUtilities.invokeLater is used to handle this. */ protected void delayedFireTableDataChanged() { SwingUtilities.invokeLater(new Runnable() { public void run() { fireTableDataChanged(); } }); } } debian/src_from_treetable_article_see_bug409629/JTreeTable.java0000644000000000000000000002536412203644340021555 0ustar /* * @(#)JTreeTable.java 1.2 98/10/27 * * Copyright 1997, 1998 by Sun Microsystems, Inc., * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. * All rights reserved. * * This software is the confidential and proprietary information * of Sun Microsystems, Inc. ("Confidential Information"). You * shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement * you entered into with Sun. */ package org.mozilla.javascript.tools.debugger.downloaded; import javax.swing.*; import javax.swing.event.*; import javax.swing.tree.*; import javax.swing.table.*; import java.awt.Dimension; import java.awt.Component; import java.awt.Graphics; import java.awt.Rectangle; import java.awt.event.MouseEvent; import java.util.EventObject; /** * This example shows how to create a simple JTreeTable component, * by using a JTree as a renderer (and editor) for the cells in a * particular column in the JTable. * * @version 1.2 10/27/98 * * @author Philip Milne * @author Scott Violet */ public class JTreeTable extends JTable { /** A subclass of JTree. */ protected TreeTableCellRenderer tree; public JTreeTable(TreeTableModel treeTableModel) { super(); // Create the tree. It will be used as a renderer and editor. tree = new TreeTableCellRenderer(treeTableModel); // Install a tableModel representing the visible rows in the tree. super.setModel(new TreeTableModelAdapter(treeTableModel, tree)); // Force the JTable and JTree to share their row selection models. ListToTreeSelectionModelWrapper selectionWrapper = new ListToTreeSelectionModelWrapper(); tree.setSelectionModel(selectionWrapper); setSelectionModel(selectionWrapper.getListSelectionModel()); // Install the tree editor renderer and editor. setDefaultRenderer(TreeTableModel.class, tree); setDefaultEditor(TreeTableModel.class, new TreeTableCellEditor()); // No grid. setShowGrid(false); // No intercell spacing setIntercellSpacing(new Dimension(0, 0)); // And update the height of the trees row to match that of // the table. if (tree.getRowHeight() < 1) { // Metal looks better like this. setRowHeight(18); } } /** * Overridden to message super and forward the method to the tree. * Since the tree is not actually in the component hieachy it will * never receive this unless we forward it in this manner. */ public void updateUI() { super.updateUI(); if(tree != null) { tree.updateUI(); } // Use the tree's default foreground and background colors in the // table. LookAndFeel.installColorsAndFont(this, "Tree.background", "Tree.foreground", "Tree.font"); } /* Workaround for BasicTableUI anomaly. Make sure the UI never tries to * paint the editor. The UI currently uses different techniques to * paint the renderers and editors and overriding setBounds() below * is not the right thing to do for an editor. Returning -1 for the * editing row in this case, ensures the editor is never painted. */ public int getEditingRow() { return (getColumnClass(editingColumn) == TreeTableModel.class) ? -1 : editingRow; } /** * Overridden to pass the new rowHeight to the tree. */ public void setRowHeight(int rowHeight) { super.setRowHeight(rowHeight); if (tree != null && tree.getRowHeight() != rowHeight) { tree.setRowHeight(getRowHeight()); } } /** * Returns the tree that is being shared between the model. */ public JTree getTree() { return tree; } /** * A TreeCellRenderer that displays a JTree. */ public class TreeTableCellRenderer extends JTree implements TableCellRenderer { /** Last table/tree row asked to renderer. */ protected int visibleRow; public TreeTableCellRenderer(TreeModel model) { super(model); } /** * updateUI is overridden to set the colors of the Tree's renderer * to match that of the table. */ public void updateUI() { super.updateUI(); // Make the tree's cell renderer use the table's cell selection // colors. TreeCellRenderer tcr = getCellRenderer(); if (tcr instanceof DefaultTreeCellRenderer) { DefaultTreeCellRenderer dtcr = ((DefaultTreeCellRenderer)tcr); // For 1.1 uncomment this, 1.2 has a bug that will cause an // exception to be thrown if the border selection color is // null. // dtcr.setBorderSelectionColor(null); dtcr.setTextSelectionColor(UIManager.getColor ("Table.selectionForeground")); dtcr.setBackgroundSelectionColor(UIManager.getColor ("Table.selectionBackground")); } } /** * Sets the row height of the tree, and forwards the row height to * the table. */ public void setRowHeight(int rowHeight) { if (rowHeight > 0) { super.setRowHeight(rowHeight); if (JTreeTable.this != null && JTreeTable.this.getRowHeight() != rowHeight) { JTreeTable.this.setRowHeight(getRowHeight()); } } } /** * This is overridden to set the height to match that of the JTable. */ public void setBounds(int x, int y, int w, int h) { super.setBounds(x, 0, w, JTreeTable.this.getHeight()); } /** * Sublcassed to translate the graphics such that the last visible * row will be drawn at 0,0. */ public void paint(Graphics g) { g.translate(0, -visibleRow * getRowHeight()); super.paint(g); } /** * TreeCellRenderer method. Overridden to update the visible row. */ public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if(isSelected) setBackground(table.getSelectionBackground()); else setBackground(table.getBackground()); visibleRow = row; return this; } } /** * TreeTableCellEditor implementation. Component returned is the * JTree. */ public class TreeTableCellEditor extends AbstractCellEditor implements TableCellEditor { public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int r, int c) { return tree; } /** * Overridden to return false, and if the event is a mouse event * it is forwarded to the tree.

* The behavior for this is debatable, and should really be offered * as a property. By returning false, all keyboard actions are * implemented in terms of the table. By returning true, the * tree would get a chance to do something with the keyboard * events. For the most part this is ok. But for certain keys, * such as left/right, the tree will expand/collapse where as * the table focus should really move to a different column. Page * up/down should also be implemented in terms of the table. * By returning false this also has the added benefit that clicking * outside of the bounds of the tree node, but still in the tree * column will select the row, whereas if this returned true * that wouldn't be the case. *

By returning false we are also enforcing the policy that * the tree will never be editable (at least by a key sequence). */ public boolean isCellEditable(EventObject e) { if (e instanceof MouseEvent) { for (int counter = getColumnCount() - 1; counter >= 0; counter--) { if (getColumnClass(counter) == TreeTableModel.class) { MouseEvent me = (MouseEvent)e; MouseEvent newME = new MouseEvent(tree, me.getID(), me.getWhen(), me.getModifiers(), me.getX() - getCellRect(0, counter, true).x, me.getY(), me.getClickCount(), me.isPopupTrigger()); tree.dispatchEvent(newME); break; } } } return false; } } /** * ListToTreeSelectionModelWrapper extends DefaultTreeSelectionModel * to listen for changes in the ListSelectionModel it maintains. Once * a change in the ListSelectionModel happens, the paths are updated * in the DefaultTreeSelectionModel. */ public class ListToTreeSelectionModelWrapper extends DefaultTreeSelectionModel { /** Set to true when we are updating the ListSelectionModel. */ protected boolean updatingListSelectionModel; public ListToTreeSelectionModelWrapper() { super(); getListSelectionModel().addListSelectionListener (createListSelectionListener()); } /** * Returns the list selection model. ListToTreeSelectionModelWrapper * listens for changes to this model and updates the selected paths * accordingly. */ public ListSelectionModel getListSelectionModel() { return listSelectionModel; } /** * This is overridden to set updatingListSelectionModel * and message super. This is the only place DefaultTreeSelectionModel * alters the ListSelectionModel. */ public void resetRowSelection() { if(!updatingListSelectionModel) { updatingListSelectionModel = true; try { super.resetRowSelection(); } finally { updatingListSelectionModel = false; } } // Notice how we don't message super if // updatingListSelectionModel is true. If // updatingListSelectionModel is true, it implies the // ListSelectionModel has already been updated and the // paths are the only thing that needs to be updated. } /** * Creates and returns an instance of ListSelectionHandler. */ protected ListSelectionListener createListSelectionListener() { return new ListSelectionHandler(); } /** * If updatingListSelectionModel is false, this will * reset the selected paths from the selected rows in the list * selection model. */ protected void updateSelectedPathsFromSelectedRows() { if(!updatingListSelectionModel) { updatingListSelectionModel = true; try { // This is way expensive, ListSelectionModel needs an // enumerator for iterating. int min = listSelectionModel.getMinSelectionIndex(); int max = listSelectionModel.getMaxSelectionIndex(); clearSelection(); if(min != -1 && max != -1) { for(int counter = min; counter <= max; counter++) { if(listSelectionModel.isSelectedIndex(counter)) { TreePath selPath = tree.getPathForRow (counter); if(selPath != null) { addSelectionPath(selPath); } } } } } finally { updatingListSelectionModel = false; } } } /** * Class responsible for calling updateSelectedPathsFromSelectedRows * when the selection of the list changse. */ class ListSelectionHandler implements ListSelectionListener { public void valueChanged(ListSelectionEvent e) { updateSelectedPathsFromSelectedRows(); } } } } debian/src_from_treetable_article_see_bug409629/AbstractTreeTableModel.java0000644000000000000000000001614112203644340024101 0ustar /* * @(#)AbstractTreeTableModel.java 1.2 98/10/27 * * Copyright 1997, 1998 by Sun Microsystems, Inc., * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. * All rights reserved. * * This software is the confidential and proprietary information * of Sun Microsystems, Inc. ("Confidential Information"). You * shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement * you entered into with Sun. */ import javax.swing.tree.*; import javax.swing.event.*; /** * @version 1.2 10/27/98 * An abstract implementation of the TreeTableModel interface, handling the list * of listeners. * @author Philip Milne */ public abstract class AbstractTreeTableModel implements TreeTableModel { protected Object root; protected EventListenerList listenerList = new EventListenerList(); public AbstractTreeTableModel(Object root) { this.root = root; } // // Default implmentations for methods in the TreeModel interface. // public Object getRoot() { return root; } public boolean isLeaf(Object node) { return getChildCount(node) == 0; } public void valueForPathChanged(TreePath path, Object newValue) {} // This is not called in the JTree's default mode: use a naive implementation. public int getIndexOfChild(Object parent, Object child) { for (int i = 0; i < getChildCount(parent); i++) { if (getChild(parent, i).equals(child)) { return i; } } return -1; } public void addTreeModelListener(TreeModelListener l) { listenerList.add(TreeModelListener.class, l); } public void removeTreeModelListener(TreeModelListener l) { listenerList.remove(TreeModelListener.class, l); } /* * Notify all listeners that have registered interest for * notification on this event type. The event instance * is lazily created using the parameters passed into * the fire method. * @see EventListenerList */ protected void fireTreeNodesChanged(Object source, Object[] path, int[] childIndices, Object[] children) { // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); TreeModelEvent e = null; // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length-2; i>=0; i-=2) { if (listeners[i]==TreeModelListener.class) { // Lazily create the event: if (e == null) e = new TreeModelEvent(source, path, childIndices, children); ((TreeModelListener)listeners[i+1]).treeNodesChanged(e); } } } /* * Notify all listeners that have registered interest for * notification on this event type. The event instance * is lazily created using the parameters passed into * the fire method. * @see EventListenerList */ protected void fireTreeNodesInserted(Object source, Object[] path, int[] childIndices, Object[] children) { // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); TreeModelEvent e = null; // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length-2; i>=0; i-=2) { if (listeners[i]==TreeModelListener.class) { // Lazily create the event: if (e == null) e = new TreeModelEvent(source, path, childIndices, children); ((TreeModelListener)listeners[i+1]).treeNodesInserted(e); } } } /* * Notify all listeners that have registered interest for * notification on this event type. The event instance * is lazily created using the parameters passed into * the fire method. * @see EventListenerList */ protected void fireTreeNodesRemoved(Object source, Object[] path, int[] childIndices, Object[] children) { // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); TreeModelEvent e = null; // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length-2; i>=0; i-=2) { if (listeners[i]==TreeModelListener.class) { // Lazily create the event: if (e == null) e = new TreeModelEvent(source, path, childIndices, children); ((TreeModelListener)listeners[i+1]).treeNodesRemoved(e); } } } /* * Notify all listeners that have registered interest for * notification on this event type. The event instance * is lazily created using the parameters passed into * the fire method. * @see EventListenerList */ protected void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children) { // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); TreeModelEvent e = null; // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length-2; i>=0; i-=2) { if (listeners[i]==TreeModelListener.class) { // Lazily create the event: if (e == null) e = new TreeModelEvent(source, path, childIndices, children); ((TreeModelListener)listeners[i+1]).treeStructureChanged(e); } } } // // Default impelmentations for methods in the TreeTableModel interface. // public Class getColumnClass(int column) { return Object.class; } /** By default, make the column with the Tree in it the only editable one. * Making this column editable causes the JTable to forward mouse * and keyboard events in the Tree column to the underlying JTree. */ public boolean isCellEditable(Object node, int column) { return getColumnClass(column) == TreeTableModel.class; } public void setValueAt(Object aValue, Object node, int column) {} // Left to be implemented in the subclass: /* * public Object getChild(Object parent, int index) * public int getChildCount(Object parent) * public int getColumnCount() * public String getColumnName(Object node, int column) * public Object getValueAt(Object node, int column) */ } debian/src_from_treetable_article_see_bug409629/TreeTableModel.java0000644000000000000000000000447212203644340022421 0ustar /* * TreeTableModel.java * * Copyright (c) 1998 Sun Microsystems, Inc. All Rights Reserved. * * This software is the confidential and proprietary information of Sun * Microsystems, Inc. ("Confidential Information"). You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into * with Sun. * * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING * THIS SOFTWARE OR ITS DERIVATIVES. * */ package org.mozilla.javascript.tools.debugger.downloaded; import javax.swing.tree.TreeModel; /** * TreeTableModel is the model used by a JTreeTable. It extends TreeModel * to add methods for getting inforamtion about the set of columns each * node in the TreeTableModel may have. Each column, like a column in * a TableModel, has a name and a type associated with it. Each node in * the TreeTableModel can return a value for each of the columns and * set that value if isCellEditable() returns true. * * @author Philip Milne * @author Scott Violet */ public interface TreeTableModel extends TreeModel { /** * Returns the number ofs availible column. */ public int getColumnCount(); /** * Returns the name for column number column. */ public String getColumnName(int column); /** * Returns the type for column number column. */ public Class getColumnClass(int column); /** * Returns the value to be displayed for node node, * at column number column. */ public Object getValueAt(Object node, int column); /** * Indicates whether the the value for node node, * at column number column is editable. */ public boolean isCellEditable(Object node, int column); /** * Sets the value for node node, * at column number column. */ public void setValueAt(Object aValue, Object node, int column); } debian/src_from_treetable_article_see_bug409629/MergeSort.java0000644000000000000000000000440712203644340021476 0ustar /* * MergeSort.java * * Copyright (c) 1998 Sun Microsystems, Inc. All Rights Reserved. * * This software is the confidential and proprietary information of Sun * Microsystems, Inc. ("Confidential Information"). You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into * with Sun. * * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING * THIS SOFTWARE OR ITS DERIVATIVES. * */ /** * An implementation of MergeSort, needs to be subclassed to * compare the terms. * * @author Scott Violet */ public abstract class MergeSort extends Object { protected Object toSort[]; protected Object swapSpace[]; public void sort(Object array[]) { if(array != null && array.length > 1) { int maxLength; maxLength = array.length; swapSpace = new Object[maxLength]; toSort = array; this.mergeSort(0, maxLength - 1); swapSpace = null; toSort = null; } } public abstract int compareElementsAt(int beginLoc, int endLoc); protected void mergeSort(int begin, int end) { if(begin != end) { int mid; mid = (begin + end) / 2; this.mergeSort(begin, mid); this.mergeSort(mid + 1, end); this.merge(begin, mid, end); } } protected void merge(int begin, int middle, int end) { int firstHalf, secondHalf, count; firstHalf = count = begin; secondHalf = middle + 1; while((firstHalf <= middle) && (secondHalf <= end)) { if(this.compareElementsAt(secondHalf, firstHalf) < 0) swapSpace[count++] = toSort[secondHalf++]; else swapSpace[count++] = toSort[firstHalf++]; } if(firstHalf <= middle) { while(firstHalf <= middle) swapSpace[count++] = toSort[firstHalf++]; } else { while(secondHalf <= end) swapSpace[count++] = toSort[secondHalf++]; } for(count = begin;count <= end;count++) toSort[count] = swapSpace[count]; } } debian/src_from_treetable_article_see_bug409629/AbstractCellEditor.java0000644000000000000000000000407112203644340023276 0ustar package org.mozilla.javascript.tools.debugger.downloaded; import java.awt.Component; import java.awt.event.*; import java.awt.AWTEvent; import javax.swing.*; import javax.swing.event.*; import java.util.EventObject; import java.io.Serializable; public class AbstractCellEditor implements CellEditor { protected EventListenerList listenerList = new EventListenerList(); public Object getCellEditorValue() { return null; } public boolean isCellEditable(EventObject e) { return true; } public boolean shouldSelectCell(EventObject anEvent) { return false; } public boolean stopCellEditing() { return true; } public void cancelCellEditing() {} public void addCellEditorListener(CellEditorListener l) { listenerList.add(CellEditorListener.class, l); } public void removeCellEditorListener(CellEditorListener l) { listenerList.remove(CellEditorListener.class, l); } /* * Notify all listeners that have registered interest for * notification on this event type. * @see EventListenerList */ protected void fireEditingStopped() { // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length-2; i>=0; i-=2) { if (listeners[i]==CellEditorListener.class) { ((CellEditorListener)listeners[i+1]).editingStopped(new ChangeEvent(this)); } } } /* * Notify all listeners that have registered interest for * notification on this event type. * @see EventListenerList */ protected void fireEditingCanceled() { // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); // Process the listeners last to first, notifying // those that are interested in this event for (int i = listeners.length-2; i>=0; i-=2) { if (listeners[i]==CellEditorListener.class) { ((CellEditorListener)listeners[i+1]).editingCanceled(new ChangeEvent(this)); } } } } debian/src_from_treetable_article_see_bug409629/TreeTableExample2.java0000644000000000000000000003125312203644340023033 0ustar /* * TreeTableExample2.java * * Copyright (c) 1998 Sun Microsystems, Inc. All Rights Reserved. * * This software is the confidential and proprietary information of Sun * Microsystems, Inc. ("Confidential Information"). You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into * with Sun. * * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING * THIS SOFTWARE OR ITS DERIVATIVES. * */ import javax.swing.*; import javax.swing.border.*; import javax.swing.event.*; import javax.swing.table.*; import javax.swing.tree.*; import java.awt.*; import java.awt.event.*; import java.text.NumberFormat; /** * Assembles the UI. The UI consists of a JTreeTable and a status label. * As nodes are loaded by the FileSystemModel2, in a background thread, * the status label updates as well as the renderer to draw the node that * is being loaded differently. * * @author Scott Violet * @author Philip Milne */ public class TreeTableExample2 { /** Number of instances of TreeTableExample2. */ protected static int ttCount; /** Model for the JTreeTable. */ protected FileSystemModel2 model; /** Used to represent the model. */ protected JTreeTable treeTable; /** Row the is being reloaded. */ protected int reloadRow; /** TreePath being reloaded. */ protected TreePath reloadPath; /** A counter increment as the Timer fies and the same path is * being reloaded. */ protected int reloadCounter; /** Timer used to update reload state. */ protected Timer timer; /** Used to indicate status. */ protected JLabel statusLabel; /** Frame containing everything. */ protected JFrame frame; /** Path created with. */ protected String path; public TreeTableExample2(String path) { this.path = path; ttCount++; frame = createFrame(); Container cPane = frame.getContentPane(); JMenuBar mb = createMenuBar(); model = createModel(path); treeTable = createTreeTable(); statusLabel = createStatusLabel(); cPane.add(new JScrollPane(treeTable)); cPane.add(statusLabel, BorderLayout.SOUTH); reloadRow = -1; frame.setJMenuBar(mb); frame.pack(); frame.show(); SwingUtilities.invokeLater(new Runnable() { public void run() { reload(model.getRoot()); } }); } /** * Creates and return a JLabel that is used to indicate the status * of loading. */ protected JLabel createStatusLabel() { JLabel retLabel = new JLabel(" "); retLabel.setHorizontalAlignment(JLabel.RIGHT); retLabel.setBorder(new BevelBorder(BevelBorder.LOWERED)); return retLabel; } /** * Creates and returns the instanceof JTreeTable that will be used. * This also creates, but does not start, the Timer that is used to * update the display as files are loaded. */ protected JTreeTable createTreeTable() { JTreeTable treeTable = new JTreeTable(model); treeTable.getColumnModel().getColumn(1).setCellRenderer (new IndicatorRenderer()); Reloader rl = new Reloader(); timer = new Timer(700, rl); timer.setRepeats(true); treeTable.getTree().addTreeExpansionListener(rl); return treeTable; } /** * Creates the FileSystemModel2 that will be used. */ protected FileSystemModel2 createModel(String path) { return new FileSystemModel2(path); } /** * Creates the JFrame that will contain everything. */ protected JFrame createFrame() { JFrame retFrame = new JFrame("TreeTable II"); retFrame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { if (--ttCount == 0) { System.exit(0); } } }); return retFrame; } /** * Creates a menu bar. */ protected JMenuBar createMenuBar() { JMenu fileMenu = new JMenu("File"); JMenuItem menuItem; menuItem = new JMenuItem("Open"); menuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { JFileChooser fc = new JFileChooser(path); fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); int result = fc.showOpenDialog(frame); if (result == JFileChooser.APPROVE_OPTION) { String newPath = fc.getSelectedFile().getPath(); new TreeTableExample2(newPath); } } }); fileMenu.add(menuItem); fileMenu.addSeparator(); menuItem = new JMenuItem("Reload"); menuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { TreePath path = treeTable.getTree().getSelectionPath(); if (path != null) { model.stopLoading(); reload(path.getLastPathComponent()); } } }); fileMenu.add(menuItem); menuItem = new JMenuItem("Stop"); menuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { model.stopLoading(); } }); fileMenu.add(menuItem); fileMenu.addSeparator(); menuItem = new JMenuItem("Exit"); menuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { System.exit(0); } }); fileMenu.add(menuItem); // Create a menu bar JMenuBar menuBar = new JMenuBar(); menuBar.add(fileMenu); // Menu for the look and feels (lafs). UIManager.LookAndFeelInfo[] lafs = UIManager. getInstalledLookAndFeels(); ButtonGroup lafGroup = new ButtonGroup(); JMenu optionsMenu = new JMenu("Options"); menuBar.add(optionsMenu); for(int i = 0; i < lafs.length; i++) { JRadioButtonMenuItem rb = new JRadioButtonMenuItem(lafs[i]. getName()); optionsMenu.add(rb); rb.setSelected(UIManager.getLookAndFeel().getName().equals (lafs[i].getName())); rb.putClientProperty("UIKey", lafs[i]); rb.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent ae) { JRadioButtonMenuItem rb2 = (JRadioButtonMenuItem)ae. getSource(); if(rb2.isSelected()) { UIManager.LookAndFeelInfo info = (UIManager.LookAndFeelInfo) rb2.getClientProperty("UIKey"); try { UIManager.setLookAndFeel(info.getClassName()); SwingUtilities.updateComponentTreeUI(frame); } catch (Exception e) { System.err.println("unable to set UI " + e.getMessage()); } } } }); lafGroup.add(rb); } return menuBar; } /** * Invoked to reload the children of a particular node. This will * also restart the timer. */ protected void reload(Object node) { model.reloadChildren(node); if (!timer.isRunning()) { timer.start(); } } /** * Updates the status label based on reloadRow. */ protected void updateStatusLabel() { if (reloadPath != null) { statusLabel.setText("Reloading: " + model.getPath (reloadPath.getLastPathComponent())); if ((reloadCounter % 4) < 2) { statusLabel.setForeground(Color.red); } else { statusLabel.setForeground(Color.blue); } } else if (!model.isReloading()) { statusLabel.setText("Total Size: " + NumberFormat.getInstance(). format(model.getTotalSize(model.getRoot()))); statusLabel.setForeground(Color.black); } } /** * Reloader is the ActionListener used in the Timer. In response to * the timer updating it will reset the reloadRow/reloadPath and * generate the necessary event so that the display will update. It * also implements the TreeExpansionListener so that if the tree is * altered while loading the reloadRow is updated accordingly. */ class Reloader implements ActionListener, TreeExpansionListener { public void actionPerformed(ActionEvent ae) { if (!model.isReloading()) { // No longer loading. timer.stop(); if (reloadRow != -1) { generateChangeEvent(reloadRow); } reloadRow = -1; reloadPath = null; } else { // Still loading, see if paths changed. TreePath newPath = model.getPathLoading(); if (newPath == null) { // Hmm... Will usually indicate the reload thread // completed between time we asked if reloading. if (reloadRow != -1) { generateChangeEvent(reloadRow); } reloadRow = -1; reloadPath = null; } else { // Ok, valid path, see if matches last path. int newRow = treeTable.getTree().getRowForPath (newPath); if (newPath.equals(reloadPath)) { reloadCounter = (reloadCounter + 1) % 8; if (newRow != reloadRow) { int lastRow = reloadRow; reloadRow = newRow; generateChangeEvent(lastRow); } generateChangeEvent(reloadRow); } else { int lastRow = reloadRow; reloadCounter = 0; reloadRow = newRow; reloadPath = newPath; if (lastRow != reloadRow) { generateChangeEvent(lastRow); } generateChangeEvent(reloadRow); } } } updateStatusLabel(); } /** * Generates and update event for the specified row. FileSystemModel2 * could do this, but it would not know when the row has changed * as a result of expanding/collapsing nodes in the tree. */ protected void generateChangeEvent(int row) { if (row != -1) { AbstractTableModel tModel = (AbstractTableModel)treeTable. getModel(); tModel.fireTableChanged(new TableModelEvent (tModel, row, row, 1)); } } // // TreeExpansionListener // /** * Invoked when the tree has expanded. */ public void treeExpanded(TreeExpansionEvent te) { updateRow(); } /** * Invoked when the tree has collapsed. */ public void treeCollapsed(TreeExpansionEvent te) { updateRow(); } /** * Updates the reloadRow and path, this does not genernate a * change event. */ protected void updateRow() { reloadPath = model.getPathLoading(); if (reloadPath != null) { reloadRow = treeTable.getTree().getRowForPath(reloadPath); } } } /** * A renderer that will give an indicator when a cell is being reloaded. */ class IndicatorRenderer extends DefaultTableCellRenderer { /** Makes sure the number of displayed in an internationalized * manner. */ protected NumberFormat formatter; /** Row that is currently being painted. */ protected int lastRow; IndicatorRenderer() { setHorizontalAlignment(JLabel.RIGHT); formatter = NumberFormat.getInstance(); } /** * Invoked as part of DefaultTableCellRenderers implemention. Sets * the text of the label. */ public void setValue(Object value) { setText((value == null) ? "---" : formatter.format(value)); } /** * Returns this. */ public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); lastRow = row; return this; } /** * If the row being painted is also being reloaded this will draw * a little indicator. */ public void paint(Graphics g) { if (lastRow == reloadRow) { int width = getWidth(); int height = getHeight(); g.setColor(getBackground()); g.fillRect(0, 0, width, height); g.setColor(getForeground()); int diameter = Math.min(width, height); if (reloadCounter < 5) { g.fillArc((width - diameter) / 2, (height - diameter) / 2, diameter, diameter, 90, -(reloadCounter * 90)); } else { g.fillArc((width - diameter) / 2, (height - diameter) / 2, diameter, diameter, 90, (4 - reloadCounter % 4) * 90); } } else { super.paint(g); } } } public static void main(String[] args) { if (args.length > 0) { for (int counter = args.length - 1; counter >= 0; counter--) { new TreeTableExample2(args[counter]); } } else { String path; try { path = System.getProperty("user.home"); if (path != null) { new TreeTableExample2(path); } } catch (SecurityException se) { path = null; } if (path == null) { System.out.println("Could not determine home directory"); } } } } debian/rhino.lintian-overrides0000644000000000000000000000021412203644340013660 0ustar # Lintian match "GNU General Public License" in MPL-2.0 licence content rhino binary: copyright-should-refer-to-common-license-file-for-gpl debian/librhino-java-doc.lintian-overrides0000644000000000000000000000023012203644340016027 0ustar # Lintian match "GNU General Public License" in MPL-2.0 licence content librhino-java-doc binary: copyright-should-refer-to-common-license-file-for-gpl debian/librhino-java-doc.doc-base0000644000000000000000000000043712203644340014057 0ustar Document: rhino-doc1 Title: API JavaDoc for Rhino Author: The Mozilla Rhino Developers Abstract: This is the API JavaDoc of Rhino, a JavaScript engine written in Java. Section: Programming Format: HTML Index: /usr/share/doc/rhino/api/index.html Files: /usr/share/doc/rhino/api/*.html debian/watch0000644000000000000000000000022012203644340010207 0ustar version=3 opts=uversionmangle=s/-RC/~RC/;s/pre/~pre/ \ ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino(.*)_(.*)\.zip debian debian/orig-tar.sh debian/librhino-java.lintian-overrides0000644000000000000000000000022412203644340015267 0ustar # Lintian match "GNU General Public License" in MPL-2.0 licence content librhino-java binary: copyright-should-refer-to-common-license-file-for-gpl debian/rhino.10000644000000000000000000001160212203644340010365 0ustar .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH RHINO 1 "February 12, 2005" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME rhino \- invokes the JavaScript shell for running scripts in batch mode or interactive .SH SYNOPSIS .B rhino .I [options] .I script_filename_or_url .I [script_arguments] .SH DESCRIPTION This manual page documents briefly the .B rhino command. This manual page was written for the Debian distribution because the original program does not have a manual page. It is written according to the html documentation. .PP .\" TeX users may be more comfortable with the \fB\fP and .\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. \fBrhino\fP is a start script for the rhino JavaScript shell which provides a simple way to run scripts in batch mode or an interactive environment for exploratory programming. .SH OPTIONS .IP -e\ \fIscript_source\fP Executes script_source as a JavaScript script. .IP -f\ \fIscript_filename_or_url\fP Reads script_filename_or_url content and execute it as a JavaScript script. .IP -opt,\ -O\ \fIoptLevel\fP Optimizes at level optLevel, which must be an integer between -1 and 9. -1 means Interpretive mode is always used. 0 means no optimizations whereas 9 means all optimizations are performed. .IP -version\ \fIversionNumber\fP Specifies the language version to compile with. The string versionNumber must be one of 100, 110, 120, 130, or 140. See JavaScript Language Versions for more information on language versions. .IP -strict Enable strict mode. .SH PREDEFINED PROPERTIES Scripts executing in the shell have access to some additional properties of the top-level object. .IP arguments The arguments object is an array containing the strings of all the arguments given at the command line when the shell was invoked. .IP help() Executing the help function will print usage and help messages. .IP defineClass(\fIclassName\fP) Define an extension using the Java class named with the string argument className. Uses ScriptableObject.defineClass() to define the extension. .IP deserialize(\fIfilename\fP) Restore from the specified file an object previously written by a call to serialize. .IP load(\fI[filename,\&.\&.\&.]\fP) Load JavaScript source files named by string arguments. If multiple arguments are given, each file is read in and executed in turn. .IP loadClass(\fIclassName\fP) Load and execute the class named by the string argument className. The class must be a class that implements the Script interface, as will any script compiled by jsc. .IP print(\fI[expr\&.\&.\&.]\fP) Evaluate and print expressions. Evaluates each expression, converts the result to a string, and prints it. .IP readFile(\fIpath[,characterCoding]\fP) Read given file and convert its bytes to a string using the specified character coding or default character coding if explicit coding argument is not given. .IP readUrl(\fIurl[,characterCoding]\fP) Open an input connection to the given string url, read all its bytes and convert them to a string using the specified character coding or default character coding if explicit coding argument is not given. .IP runCommand(\fIcommandName,[arg,\&.\&.\&.][options]\fP) Execute the specified command with the given argument and options as a separate process and return the exit status of the process. For details, see JavaDoc for org.mozilla.javascript.tools.shell.Global#runCommand. .IP serialize(\fIobject,filename\fP) Serialize the given object to the specified file. .IP spawn(\fIfunctionOrScript\fP) Run the given function or script in a different thread. .IP sync(\fIfunction\fP) creates a synchronized function (in the sense of a Java synchronized method) from an existing function. The new function synchronizes on the this object of its invocation. .IP quit() Quit shell. The shell will also quit in interactive mode if an end-of-file character is typed at the prompt. .IP version(\fI[number]\fP) Get or set JavaScript version number. If no argument is supplied, the current version number is returned. If an argument is supplied, it is expected to be one of 100, 110, 120, 130, or 140 to indicate JavaScript version 1.0, 1.1, 1.2, 1.3, or 1.4 respectively. .SH SEE ALSO The online documentation under http://www.mozilla.org/rhino/shell.html .SH AUTHOR This manual page was written by Wolfgang Baer , for the Debian project (but may be used by others). debian/rhino.install0000644000000000000000000000003112203644340011665 0ustar debian/bin/* usr/bin debian/compat0000644000000000000000000000000212203644340010362 0ustar 7