Skip to content

Commit

Permalink
Add treetable sources needed by the Rhino debugger. Add LICENSE.txt to
Browse files Browse the repository at this point in the history
show the license terms, and propagate that file to the binary distribution.
Remove the debugger download build rules as they are no longer needed.
  • Loading branch information
norrisboyd committed Apr 14, 2008
1 parent 1df4000 commit 2e746cd
Show file tree
Hide file tree
Showing 8 changed files with 779 additions and 30 deletions.
69 changes: 69 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
The majority of Rhino is available under the following license:

* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Rhino code, released
* May 6, 1999.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1997-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* the GNU General Public License Version 2 or later (the "GPL"), in which
* case the provisions of the GPL are applicable instead of those above. If
* you wish to allow use of your version of this file only under the terms of
* the GPL and not to allow others to use your version of this file under the
* MPL, indicate your decision by deleting the provisions above and replacing
* them with the notice and other provisions required by the GPL. If you do
* not delete the provisions above, a recipient may use your version of this
* file under either the MPL or the GPL.
*
* ***** END LICENSE BLOCK ***** */

Additionally, some files (currently the contents of
toolsrc/org/mozilla/javascript/tools/debugger/treetable/) are available
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.
1 change: 1 addition & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
<copy todir="${dist.dir}" file="build.xml"/>
<copy todir="${dist.dir}" file="build.properties"/>
<copy todir="${dist.dir}" file="apiClasses.properties"/>
<copy todir="${dist.dir}" file="LICENSE.txt"/>
</target>

<target name="xmlimplsrc-compile" if="xmlimplsrc-present?">
Expand Down
28 changes: 1 addition & 27 deletions toolsrc/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,12 @@ Requires Ant version 1.2

<target name="properties">
<property file="build.properties"/>
<property name="debugger"
value="org/mozilla/javascript/tools/debugger"/>
</target>

<target name="compile" depends="properties">
<javac srcdir="toolsrc"
destdir="${classes}"
includes="org/**/*.java"
excludes="org/**/debugger/*.java"
deprecation="on"
debug="${debug}"
target="${target-jvm}"
Expand All @@ -66,33 +63,10 @@ Requires Ant version 1.2
<mkdir dir="${dist.dir}/toolsrc"/>
<copy todir="${dist.dir}/toolsrc">
<fileset dir="toolsrc"
includes="**/*.java,**/*.properties,**/*.xml"
excludes="${debugger}/downloaded/**" />
includes="**/*.java,**/*.properties,**/*.xml" />
</copy>
</target>

<target name="download-debugger" depends="properties">
<ant dir="toolsrc/${debugger}" target="download"/>
</target>

<target name="compile-debugger" depends="download-debugger">
<mkdir dir="classes"/>
<javac srcdir="toolsrc"
destdir="classes"
includes="org/**/debugger/*.java,org/**/debugger/downloaded/*.java"
classpath="js.jar"
deprecation="on"
target="${target-jvm}"
source="${source-level}"/>
<copy todir="classes">
<fileset dir="toolsrc" includes="org/**/*.properties" />
</copy>
<jar jarfile="js.jar"
basedir="classes"
update="yes"
/>
</target>

<target name="clean" depends="properties">
<delete includeEmptyDirs="true">
<fileset dir="${classes}"
Expand Down
6 changes: 3 additions & 3 deletions toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@

import org.mozilla.javascript.tools.shell.ConsoleTextArea;

import org.mozilla.javascript.tools.debugger.downloaded.JTreeTable;
import org.mozilla.javascript.tools.debugger.downloaded.TreeTableModel;
import org.mozilla.javascript.tools.debugger.downloaded.TreeTableModelAdapter;
import org.mozilla.javascript.tools.debugger.treetable.JTreeTable;
import org.mozilla.javascript.tools.debugger.treetable.TreeTableModel;
import org.mozilla.javascript.tools.debugger.treetable.TreeTableModelAdapter;

/**
* GUI for the Rhino debugger.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*
* Copyright 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.
*/

package org.mozilla.javascript.tools.debugger.treetable;

import javax.swing.*;
import javax.swing.event.*;
import java.util.EventObject;

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));
}
}
}
}
Loading

0 comments on commit 2e746cd

Please sign in to comment.