diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BackgroundHackListView.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BackgroundHackListView.java index 53ae09db422..dd2b80a851f 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BackgroundHackListView.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BackgroundHackListView.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Hacked ListView to workaround old Java bug on Unix +*/ + // when who what // 06/27/97 jband added this class to implement Unix hack // @@ -41,7 +45,7 @@ class BackgroundHackListView extends ListView super(x,y,dx,dy); } - public void drawViewBackground(Graphics g, int x, int y, int width,int height) + public void drawViewBackground(Graphics g, int x, int y, int width,int height) { if(!isTransparent()) { @@ -50,8 +54,8 @@ class BackgroundHackListView extends ListView { g.setColor(bc); - // XXX: hackage to deal with Unix problem - // (see bugsplat bug #78027) + // XXX: hackage to deal with Unix problem + // (see bugsplat bug #78027) java.awt.Graphics awtg = AWTCompatibility.awtGraphicsForGraphics(g); awtg.setColor(java.awt.Color.white); awtg.setColor(AWTCompatibility.awtColorForColor(bc)); @@ -60,4 +64,4 @@ class BackgroundHackListView extends ListView } } } -} +} diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/Breakpoint.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/Breakpoint.java index 1e88d740b1a..a9dff6380be 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/Breakpoint.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/Breakpoint.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Breakpoint with support for break on condition +*/ + // when who what // 06/27/97 jband added this header to my code // @@ -27,7 +31,7 @@ import netscape.application.*; import netscape.util.*; import com.netscape.jsdebugging.api.*; -public class Breakpoint +public class Breakpoint implements Comparable, Codable { @@ -61,7 +65,7 @@ public class Breakpoint public Location getLocation() {return _loc;} public String getURL() {return _loc.getURL(); } public int getLine() {return _loc.getLine();} - + public String getBreakCondition() {return _breakCondition;} public void setBreakCondition(String bc) {_breakCondition=bc;} diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointEditorDialog.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointEditorDialog.java index e15efed4c6b..e9630e2dad2 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointEditorDialog.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointEditorDialog.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Dialog UI for editing single breakpoint and its condition +*/ + // when who what // 10/14/97 jband created class // @@ -40,22 +44,22 @@ class BreakpointEditorDialog private static final int _spacerDX = 5; private static final int _spacerDY = 5; - public BreakpointEditorDialog(String title, - int line, - String url, - String condition, + public BreakpointEditorDialog(String title, + int line, + String url, + String condition, Font font, boolean isNew ) { super(); - + setTitle(title); setCloseable( false ); setResizable( false ); - + int contentDX = _labelDX + _editDX + _spacerDX * 3; int contentDY = _editDY * 3 + _spacerDY * 5 + _buttonDY; - int buttonY = _editDY * 3 + _spacerDY * 4; + int buttonY = _editDY * 3 + _spacerDY * 4; int buttonX2 = contentDX - _spacerDX - _buttonDX; int buttonX1 = buttonX2 - _spacerDX - _buttonDX; int labelX = _spacerDX; @@ -64,7 +68,7 @@ class BreakpointEditorDialog int Y1 = _spacerDY; int Y2 = Y1 + _editDY + _spacerDY; int Y3 = Y2 + _editDY + _spacerDY; - + Size size = windowSizeForContentSize(contentDX, contentDY); setBounds(0,0,size.width,size.height); @@ -86,22 +90,22 @@ class BreakpointEditorDialog _textFieldCondition.setStringValue(new String(condition)); _textFieldCondition.setFont(font); addSubview(_textFieldCondition); - + Button button; - + button = new Button(buttonX1,buttonY,_buttonDX,_buttonDY); button.setTitle("OK"); button.setTarget(this); button.setCommand(OK_CMD); addSubview(button); - + button = new Button(buttonX2,buttonY,_buttonDX,_buttonDY); button.setTitle("Cancel"); button.setTarget(this); button.setCommand(CANCEL_CMD); addSubview(button); - if( isNew ) + if( isNew ) setFocusedView( _textFieldLine ); else setFocusedView( _textFieldCondition ); @@ -119,7 +123,7 @@ class BreakpointEditorDialog label.setBorder(null); return label; } - + // implement target interface public void performCommand(String cmd, Object data) { @@ -131,13 +135,13 @@ class BreakpointEditorDialog if( null == _URL || 0 == _URL.trim().length() ) { Alert.runAlertInternally( Alert.notificationImage(), - "invalid entry", + "invalid entry", "you must enter a valid url", - "OK", null,null ); + "OK", null,null ); setFocusedView( _textFieldURL ); return; } - + _condition = _textFieldCondition.stringValue(); if( null == _condition || 0 == _condition.trim().length() ) { @@ -158,9 +162,9 @@ class BreakpointEditorDialog if( _line <= 0 ) { Alert.runAlertInternally( Alert.notificationImage(), - "invalid entry", + "invalid entry", "line number must be >= 1", - "OK", null,null ); + "OK", null,null ); setFocusedView( _textFieldLine ); return; } @@ -172,14 +176,14 @@ class BreakpointEditorDialog { hide(); } - } - + } + public boolean okPressed() {return _ok;} public String getURL() {return _URL;} public String getCondition() {return _condition;} public int getLine() {return _line;} - + private TextField _textFieldLine; private TextField _textFieldURL; private TextField _textFieldCondition; @@ -189,6 +193,6 @@ class BreakpointEditorDialog private boolean _ok = false; private static final String OK_CMD = "OK_CMD"; private static final String CANCEL_CMD = "CANCEL_CMD"; -} +} diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointHook.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointHook.java index becdf215d42..9f2cca859c1 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointHook.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointHook.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Hook (with conditional support) for breakpoints +*/ + // when who what // 06/27/97 jband added this header to my code // @@ -25,7 +29,7 @@ package com.netscape.jsdebugging.ifcui; import netscape.security.PrivilegeManager; import com.netscape.jsdebugging.api.*; -class BreakpointHook +class BreakpointHook extends InstructionHook implements ChainableHook, JSErrorReporter { @@ -35,7 +39,7 @@ class BreakpointHook _emperor = emperor; setTyrant(tyrant); setBreakpoint(bp); - } + } public void aboutToExecute(ThreadStateBase debug) { @@ -61,37 +65,37 @@ class BreakpointHook public void setTyrant(Object tyrant) {_ctrlTyrant = (ControlTyrant) tyrant;} public void setNextHook(Hook nextHook) {_nextHook = (InstructionHook) nextHook;} public InstructionHook getNextHook() {return _nextHook;} - - + + private boolean _shouldStop(JSThreadState threadState) { // System.out.println( "1) in _shouldStop" ); if( null == _ctrlTyrant || null == _bp ) return false; - + // System.out.println( "2) in _shouldStop" ); // currently don't stopping when already stopped if( ControlTyrant.STOPPED == _ctrlTyrant.getState() ) return false; - + String breakCondition = _bp.getBreakCondition(); if( null == breakCondition ) return true; - + // System.out.println( "3) in _shouldStop" ); JSErrorReporter oldER = null; try { PrivilegeManager.enablePrivilege("Debugger"); DebugController dc = _emperor.getDebugController(); - + String filename; - if( _ctrlTyrant.getEmperor().isPre40b6() || + if( _ctrlTyrant.getEmperor().isPre40b6() || Emperor.REMOTE_SERVER == _ctrlTyrant.getEmperor().getHostMode() ) filename = "HiddenBreakpointEval"; else filename = _bp.getURL(); - + JSStackFrameInfo frame = (JSStackFrameInfo) threadState.getCurrentFrame(); _errorString = null; @@ -101,8 +105,8 @@ class BreakpointHook } // System.out.println( "4) in _shouldStop, condition = " + breakCondition); - - ExecResult fullresult = + + ExecResult fullresult = dc.executeScriptInStackFrame(frame,breakCondition,filename,1); String result = fullresult.getResult(); @@ -112,11 +116,11 @@ class BreakpointHook _ctrlTyrant.setErrorReporter(oldER); oldER = null; } - + // System.out.println( "5) in _shouldStop"); if( null != _errorString ) return false; - + // System.out.println( "6) in _shouldStop, result = " + result ); if( null == result || ! result.equals("true") ) return false; @@ -133,7 +137,7 @@ class BreakpointHook // System.out.println( "9) in _shouldStop"); return true; } - + // implement JSErrorReporter interface public synchronized int reportError( String msg, String filename, @@ -143,7 +147,7 @@ class BreakpointHook { _errorString = msg; return JSErrorReporter.RETURN; - } + } private Emperor _emperor; private ControlTyrant _ctrlTyrant; diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointSaver.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointSaver.java index 56c79bba413..5d6208d174a 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointSaver.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointSaver.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Persistence support for breakpoints +*/ + // when who what // 07/31/97 jband created this file // diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointTyrant.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointTyrant.java index b429f9c2666..7a911046fc3 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointTyrant.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointTyrant.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* 'Model' that manages breakpoints +*/ + // when who what // 06/27/97 jband added this header to my code // @@ -33,7 +37,7 @@ import netscape.security.PrivilegeManager; // scripts stored in a Vector with newest scripts at the high end public class BreakpointTyrant - extends Observable + extends Observable implements Observer, PrefsSupport { public BreakpointTyrant(Emperor emperor) @@ -170,7 +174,7 @@ public class BreakpointTyrant // we reverse the list so that newest scripts are first for( int i = count-1; i >= 0; i-- ) - a[count-(i+1)] = _scripts.elementAt(i); + a[count-(i+1)] = _scripts.elementAt(i); return a; } @@ -183,7 +187,7 @@ public class BreakpointTyrant int count = _scripts.count(); for( int i = count-1; i >= 0; i-- ) { - Script script = (Script) _scripts.elementAt(i); + Script script = (Script) _scripts.elementAt(i); if( url.equals(script.getURL()) ) vret.addElement(script); } @@ -194,12 +198,12 @@ public class BreakpointTyrant { return getScriptsVectorForURL(url).elementArray(); } - + public void modifiedBreakpoint( Breakpoint bp ) { _notifyObservers(BreakpointTyrantUpdate.MODIFIED_ONE, bp); } - + /*******************************/ private boolean _isNonShadowedLocationInScript(Location loc, Script script) @@ -259,7 +263,7 @@ public class BreakpointTyrant int count = _scripts.count(); for( int i = count-1; i >= 0; i-- ) { - Script script = (Script) _scripts.elementAt(i); + Script script = (Script) _scripts.elementAt(i); if( _isLocationInScript(loc, script) ) { if( null != script.getFunction() ) @@ -305,7 +309,7 @@ public class BreakpointTyrant int count = _scripts.count(); for( int i = 0; i < count; i++ ) { - Script script = (Script) _scripts.elementAt(i); + Script script = (Script) _scripts.elementAt(i); if( ! _isNonShadowedLocationInScript(loc, script) ) continue; @@ -416,7 +420,7 @@ public class BreakpointTyrant // this is called on native thread, can not do notify!!! // _notifyObservers(BreakpointTyrantUpdate.DEACTIVATED_ONE, bp); - } + } } // implement observer interface @@ -482,15 +486,15 @@ public class BreakpointTyrant "com.netscape.jsdebugging.ifcui.BreakpointSaver" ); if( -1 != id ) { - BreakpointSaver bs = (BreakpointSaver) + BreakpointSaver bs = (BreakpointSaver) unarchiver.unarchiveIdentifier(id); bs.sendToTyrant(this); } } - // data... - + // data... + private Emperor _emperor; private ControlTyrant _controlTyrant; private DebugController _dc; @@ -501,10 +505,10 @@ public class BreakpointTyrant private BPTyrantScriptHook _scriptHook; private boolean _enabled = false; private Thread _uiThreadForAssertCheck = null; -} +} // used here only... -class BPTyrantScriptHook +class BPTyrantScriptHook extends ScriptHook implements ChainableHook { diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointTyrantUpdate.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointTyrantUpdate.java index f6e1e76dc5b..e88cc85a052 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointTyrantUpdate.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointTyrantUpdate.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Information to describe a breakpoint update event +*/ + // when who what // 06/27/97 jband added this header to my code // @@ -43,5 +47,5 @@ class BreakpointTyrantUpdate public int type; public Breakpoint bp; -} +} diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointView.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointView.java index a6e9a7a224a..7213b337f94 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointView.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BreakpointView.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* 'View' to manage all breakpoints +*/ + // when who what // 06/27/97 jband added this header to my code // @@ -29,7 +33,7 @@ import netscape.util.*; import com.netscape.jsdebugging.ifcui.palomar.util.*; import com.netscape.jsdebugging.ifcui.palomar.widget.layout.*; -public class BreakpointView +public class BreakpointView extends InternalWindow implements Observer, Target { @@ -37,10 +41,10 @@ public class BreakpointView private static final int _buttonHeight = 24; private static final int _buttonYSpace = 5; private static final int _buttonXSpace = 5; - + private int _nextButtonX; private int _nextButtonY; - + public BreakpointView( Emperor emperor, Rect rect ) { super(rect); @@ -59,16 +63,16 @@ public class BreakpointView Size size = contentSize(); int listwidth = size.width - (_buttonWidth + (_buttonXSpace * 2)); Rect rectSG = new Rect(0, 0, listwidth, size.height); - + _nextButtonX = listwidth + _buttonXSpace; - _nextButtonY = _buttonYSpace; - + _nextButtonY = _buttonYSpace; + _addButton( "New", NEW_CMD ); _addButton( "Edit", EDIT_CMD); _addButton( "Delete", DEL_CMD ); _nextButtonY += _buttonYSpace * 2; _addButton( "Done", DONE_CMD); - + ScrollGroup sg = new ScrollGroup(rectSG); sg.setHorizScrollBarDisplay( ScrollGroup.AS_NEEDED_DISPLAY ); sg.setVertScrollBarDisplay( ScrollGroup.AS_NEEDED_DISPLAY ); @@ -76,8 +80,8 @@ public class BreakpointView sg.setAutoResizeSubviews(true); sg.contentView().setLayoutManager( new MarginLayout() ); sg.setBackgroundColor(_emperor.getBackgroundColor()); - - setCloseable( false ); + + setCloseable( false ); setResizable( false ); setTitle( "Breakpoints" ); addSubview(sg); @@ -96,10 +100,10 @@ public class BreakpointView refresh(); - layoutView(1,1); - layoutView(-1,-1); + layoutView(1,1); + layoutView(-1,-1); } - + private Button _addButton( String title, String cmd ) { Button button = new Button(_nextButtonX,_nextButtonY, @@ -129,7 +133,7 @@ public class BreakpointView if( cmd.equals(NEW_CMD ) ) { newBreakpoint(); - } + } else if( cmd.equals(EDIT_CMD) ) { int index = _listview.selectedIndex(); @@ -141,7 +145,7 @@ public class BreakpointView return; editBreakpoint(bp); - } + } else if( cmd.equals(DEL_CMD ) ) { int index = _listview.selectedIndex(); @@ -152,7 +156,7 @@ public class BreakpointView _breakpointTyrant.removeBreakpoint(bp); // will be refreshed upon notification from _breakpointTyrant - } + } else if( cmd.equals(DONE_CMD) ) { Application.application().performCommandLater( @@ -172,7 +176,7 @@ public class BreakpointView selBP = (Breakpoint) selItem.data(); _listview.removeAllItems(); - + Font linefont = _emperor.getFixedFont(); int maxlinelen = 0; @@ -192,7 +196,7 @@ public class BreakpointView // find the max lengths for later formating of each item int maxLineno = 0; - int maxFilenameChars = 0; + int maxFilenameChars = 0; for( i = 0; i < itemCount; i++ ) { @@ -208,11 +212,11 @@ public class BreakpointView for( i = 0; i < itemCount; i++ ) { Breakpoint bp = (Breakpoint) breakpoints.elementAt(i); - + // format text... buf.setLength(0); - + // padded line number int lineno = bp.getLine(); buf.append(lineno); @@ -246,10 +250,10 @@ public class BreakpointView item.setFont( linefont ); item.setSelectedColor(_emperor.getSelectionColor()); _listview.addItem( item ); - + if( 0 == i ) _listview.selectItemAt(i); // make sure SOMETHING selected - + if( null != selBP && selBP == bp ) { _listview.selectItemAt(i); @@ -261,7 +265,7 @@ public class BreakpointView _listview.setBounds( 0, 0, (maxlinelen+1) * fm.charWidth('X'),0 ); _listview.sizeToMinSize(); - layoutView(0,0); + layoutView(0,0); _listview.draw(); } @@ -269,9 +273,9 @@ public class BreakpointView public boolean newBreakpoint() { - BreakpointEditorDialog bed = + BreakpointEditorDialog bed = new BreakpointEditorDialog( "New Breakpoint", - 1, "", "true", + 1, "", "true", _emperor.getFixedFont(), true ); bed.showModally(); @@ -293,7 +297,7 @@ public class BreakpointView bp.setBreakCondition(condition); - _breakpointTyrant.modifiedBreakpoint(bp); + _breakpointTyrant.modifiedBreakpoint(bp); // select the new item int i = _indexOfListItemWithBP(bp); @@ -302,7 +306,7 @@ public class BreakpointView return true; } return false; - + } public boolean editBreakpoint( Breakpoint bp ) @@ -313,7 +317,7 @@ public class BreakpointView if( null == condition ) condition = "true"; - BreakpointEditorDialog bed = + BreakpointEditorDialog bed = new BreakpointEditorDialog( "Edit Breakpoint", bp.getLine(), bp.getURL(), @@ -335,13 +339,13 @@ public class BreakpointView bed.getLine() != bp.getLine() ) { // we need to construct a new breakpoint! - _breakpointTyrant.removeBreakpoint(bp); + _breakpointTyrant.removeBreakpoint(bp); Location loc = new Location( bed.getURL(), bed.getLine() ); bp = _breakpointTyrant.addBreakpoint(loc); } bp.setBreakCondition(condition); - _breakpointTyrant.modifiedBreakpoint(bp); + _breakpointTyrant.modifiedBreakpoint(bp); // select the new item int i = _indexOfListItemWithBP(bp); @@ -360,7 +364,7 @@ public class BreakpointView return i; } // failed to find it... - return -1; + return -1; } @@ -373,6 +377,6 @@ public class BreakpointView private static final String EDIT_CMD = "EDIT_CMD"; private static final String DEL_CMD = "DEL_CMD"; private static final String DONE_CMD = "DONE_CMD"; -} +} diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BuildDate.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BuildDate.java index 416c54942fd..198536faecb 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BuildDate.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/BuildDate.java @@ -5,9 +5,9 @@ package com.netscape.jsdebugging.ifcui; class BuildDate { - // Wednesday, September 16, 1998 at 11:58 AM + // Friday, September 18, 1998 at 12:54 PM - public static final long buildDate = 905972322000L; + public static final long buildDate = 906148451000L; public static final java.util.Date date() { diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/CallChain.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/CallChain.java index ba2a762ab67..6cbf5e360c6 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/CallChain.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/CallChain.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Store and compare call chains (for stepping) +*/ + // when who what // 06/27/97 jband added this header to my code // @@ -83,4 +87,4 @@ class CallChain } private Script[] _chain; -} +} diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ChainableHook.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ChainableHook.java index f3ceeadbbe7..aa0d5df9d48 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ChainableHook.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ChainableHook.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Base class for hooks to support chaining +*/ + // when who what // 06/27/97 jband added this header to my code // @@ -28,5 +32,5 @@ interface ChainableHook { public void setTyrant( Object tyrant); public void setNextHook(Hook nextHook); -} +} diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/CmdState.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/CmdState.java index 3ad4e607486..5937e733b9c 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/CmdState.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/CmdState.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Maintain state for a command (used to update menus and toolbars) +*/ + // when who what // 06/27/97 jband added this header to my code // @@ -38,5 +42,5 @@ class CmdState public String name; public boolean enabled; public boolean checked; -} +} diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/CommandTyrant.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/CommandTyrant.java index 88aa1b1fa6a..6ae5b43f625 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/CommandTyrant.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/CommandTyrant.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Manages validating and routing user commands +*/ + // when who what // 06/27/97 jband added this header to my code // @@ -32,12 +36,12 @@ import com.netscape.jsdebugging.ifcui.palomar.widget.PopupButton; import com.netscape.jsdebugging.api.*; public class CommandTyrant - extends Observable + extends Observable implements Observer, Target { // this list of ids must start with 0 and be contiguous and have count set // ............................................ - public static final int RUN = 0; + public static final int RUN = 0; public static final int ABORT = 1; public static final int STEP_OVER = 2; public static final int STEP_INTO = 3; @@ -66,7 +70,7 @@ public class CommandTyrant public static final int COPY_STRING = 26; public static final int CUT = 27; public static final int TEST = 28; - // XXX add the rest... + // XXX add the rest... public static final int CMD_COUNT = 29; // just a count of the above // ............................................ @@ -77,19 +81,19 @@ public class CommandTyrant _cmdStatesArray = new CmdState[CMD_COUNT]; for( i = 0; i < CMD_COUNT; i++ ) _cmdStatesArray[i] = new CmdState(i,null,true,false); - - // add the names + + // add the names // these must match the full list above // ............................................ - _cmdStatesArray[RUN ].name = "RUN"; - _cmdStatesArray[ABORT ].name = "ABORT"; - _cmdStatesArray[STEP_OVER ].name = "STEP_OVER"; - _cmdStatesArray[STEP_INTO ].name = "STEP_INTO"; - _cmdStatesArray[STEP_OUT ].name = "STEP_OUT"; - _cmdStatesArray[INTERRUPT ].name = "INTERRUPT"; - _cmdStatesArray[PAGELIST_CLICK ].name = "PAGELIST_CLICK"; - _cmdStatesArray[PAGELIST_DBLCLICK ].name = "PAGELIST_DBLCLICK"; - _cmdStatesArray[PAGELIST_SHOW_HIDE ].name = "PAGELIST_SHOW_HIDE"; + _cmdStatesArray[RUN ].name = "RUN"; + _cmdStatesArray[ABORT ].name = "ABORT"; + _cmdStatesArray[STEP_OVER ].name = "STEP_OVER"; + _cmdStatesArray[STEP_INTO ].name = "STEP_INTO"; + _cmdStatesArray[STEP_OUT ].name = "STEP_OUT"; + _cmdStatesArray[INTERRUPT ].name = "INTERRUPT"; + _cmdStatesArray[PAGELIST_CLICK ].name = "PAGELIST_CLICK"; + _cmdStatesArray[PAGELIST_DBLCLICK ].name = "PAGELIST_DBLCLICK"; + _cmdStatesArray[PAGELIST_SHOW_HIDE ].name = "PAGELIST_SHOW_HIDE"; _cmdStatesArray[REFRESH_ALL ].name = "REFRESH_ALL"; _cmdStatesArray[STACKVIEW_CLICK ].name = "STACKVIEW_CLICK"; _cmdStatesArray[STACKVIEW_DBLCLICK ].name = "STACKVIEW_DBLCLICK"; @@ -110,8 +114,8 @@ public class CommandTyrant _cmdStatesArray[COPY_STRING ].name = "COPY_STRING"; _cmdStatesArray[CUT ].name = "CUT"; _cmdStatesArray[TEST ].name = "TEST"; - -// _cmdStatesArray[].name = ""; + +// _cmdStatesArray[].name = ""; // XXX add the rest... // ............................................ @@ -184,7 +188,7 @@ public class CommandTyrant _cmdStatesArray[PAGELIST_SHOW_HIDE ].checked = false; else _cmdStatesArray[PAGELIST_SHOW_HIDE ].checked = true; - + if( null == _watchView || ! _watchView.isVisible() ) _cmdStatesArray[WATCHES_SHOW_HIDE ].checked = false; else @@ -194,12 +198,12 @@ public class CommandTyrant _cmdStatesArray[BREAKPOINTS_SHOW_HIDE ].checked = false; else _cmdStatesArray[BREAKPOINTS_SHOW_HIDE ].checked = true; - + if( null == _inspectorView || ! _inspectorView.isVisible() ) _cmdStatesArray[INSPECTOR_SHOW_HIDE ].checked = false; else _cmdStatesArray[INSPECTOR_SHOW_HIDE ].checked = true; - + if( null == _sourceViewManager || ! _sourceViewManager.getShowLineNumbers() ) _cmdStatesArray[SHOW_LINE_NUMBERS ].checked = false; else @@ -235,7 +239,7 @@ public class CommandTyrant } } - if( null == _consoleView || + if( null == _consoleView || null == _inspectorView || null == _sourceTyrant ) { @@ -246,7 +250,7 @@ public class CommandTyrant } else { - if( null != _sourceTyrant.getSelectedText() || + if( null != _sourceTyrant.getSelectedText() || _inspectorView.canCopy() || _consoleView.canCopy() ) { @@ -290,7 +294,7 @@ public class CommandTyrant Class.forName("java.awt.datatransfer.Clipboard"); Class.forName("netscape.application.jdk11compatibility.JDKClipboard"); // if(AS.DEBUG)System.out.println( "using native clipboard"); - } + } catch(Exception e) { _usingLocalClipboard = true; @@ -353,22 +357,22 @@ public class CommandTyrant } switch(cmdState.id) { - case RUN: + case RUN: _controlTyrant.runit(); break; - case ABORT: + case ABORT: _controlTyrant.abort(); break; - case STEP_OVER: + case STEP_OVER: _controlTyrant.stepOver(); break; - case STEP_INTO: + case STEP_INTO: _controlTyrant.stepInto(); break; - case STEP_OUT : + case STEP_OUT : _controlTyrant.stepOut(); break; - case INTERRUPT: + case INTERRUPT: if( null != _controlTyrant ) _controlTyrant.interrupt(! _controlTyrant.getInterrupt()); refreshCmdStatesAndNotifyObservers(); @@ -376,7 +380,7 @@ public class CommandTyrant case PAGELIST_CLICK: _updateSelectedPageListItem( (ListView)data ); break; - case PAGELIST_DBLCLICK: + case PAGELIST_DBLCLICK: _updateSelectedPageListItem( (ListView)data ); SourceTextItem sti = _sourceTyrant.getSelectedSourceItem(); if( null != sti && null != _sourceViewManager ) @@ -483,7 +487,7 @@ public class CommandTyrant _watchView.show(); } refreshCmdStatesAndNotifyObservers(); - break; + break; case COPY_TO_WATCH: String str = _getCopyText(); if( null != str ) @@ -493,7 +497,7 @@ public class CommandTyrant if( null != _watchView ) _watchView.refresh(); - + refreshCmdStatesAndNotifyObservers(); } break; @@ -515,7 +519,7 @@ public class CommandTyrant if( null != bp ) _breakpointView.editBreakpoint(bp); // redraw done on notification from BreakpointTyrant... - break; + break; case BREAKPOINTS_SHOW_HIDE: if( null == _breakpointView ) break; @@ -527,7 +531,7 @@ public class CommandTyrant _breakpointView.show(); } refreshCmdStatesAndNotifyObservers(); - break; + break; case INSPECTOR_SHOW_HIDE: if( null == _inspectorView ) break; @@ -539,7 +543,7 @@ public class CommandTyrant _inspectorView.show(); } refreshCmdStatesAndNotifyObservers(); - break; + break; case INSPECT_SEL_STRING: if( null != _sourceTyrant && null != _sourceTyrant.getSelectedText()) { @@ -565,7 +569,7 @@ public class CommandTyrant if( null != _watchView ) _watchView.refresh(); - + refreshCmdStatesAndNotifyObservers(); } break; @@ -593,7 +597,7 @@ public class CommandTyrant break; default: if(AS.S)ER.T( false, "cmdState id not handled: " + cmdState.id, this); - break; + break; } } @@ -633,11 +637,11 @@ public class CommandTyrant } return _localClipboard; } - + private String _getCopyText() { String s = null; - + if( null != _sourceTyrant ) s = _sourceTyrant.getSelectedText(); if( null == s ) @@ -649,11 +653,11 @@ public class CommandTyrant } return s; } - + private String _getCutText() { String s = null; - + if( null != _inspectorView && _inspectorView.canCopy() ) s = _inspectorView.cut(); else if( null != _consoleView && _consoleView.canCopy() ) @@ -695,7 +699,7 @@ public class CommandTyrant if( null == _inspectorView ) _inspectorView = _emperor.getInspectorView(); - _haveAllViews = + _haveAllViews = null != _pageListView && null != _sourceViewManager && null != _commandView && @@ -705,10 +709,10 @@ public class CommandTyrant null != _breakpointView && null != _inspectorView ; } - - // data... - - private Application _app; + + // data... + + private Application _app; private Emperor _emperor; private ControlTyrant _controlTyrant ; private BreakpointTyrant _breakpointTyrant; @@ -735,7 +739,7 @@ public class CommandTyrant private CmdState[] _cmdStatesArray; private Hashtable _cmdStatesHashtable; -} +} + - diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/CommandView.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/CommandView.java index fb27219ebb8..4a90c1940fd 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/CommandView.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/CommandView.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Manages menus and toolbar +*/ + // when who what // 06/27/97 jband added this header to my code // @@ -47,12 +51,12 @@ class CmdViewItem public boolean checked; public String checkedText; public String uncheckedText; -} +} public class CommandView implements Observer { - public CommandView( Emperor emperor, + public CommandView( Emperor emperor, Menu mainMenu, MenuItem fileMenu, int originY ) @@ -126,7 +130,7 @@ public class CommandView RootView rv = _emperor.getRootView(); minSize = _toolBarWindow.windowSizeForContentSize(rv.width(), minSize.height); _toolBarWindow.sizeTo(minSize.width, minSize.height); - + _emperor.setToolbarHeight(minSize.height); _emperor.setToolBarWindow(_toolBarWindow); @@ -228,21 +232,21 @@ public class CommandView private Bitmap _loadBitmap(String name, boolean fromJar) { - java.awt.Image image = null; + java.awt.Image image = null; Bitmap bitmap = null; if(!fromJar) return Bitmap.bitmapNamed(name); try - { + { java.io.InputStream in = null; String fullname = "images/"+name; ClassLoader loader = getClass().getClassLoader(); if(null != loader) { // if(AS.DEBUG)System.out.println("using loader.getResourceAsStream()"); - in = loader.getResourceAsStream(fullname); + in = loader.getResourceAsStream(fullname); } else { @@ -252,26 +256,26 @@ public class CommandView if(null != in) { -// System.err.println("good stream"); - byte[] buf = new byte[in.available()]; - in.read(buf); - image = java.awt.Toolkit.getDefaultToolkit().createImage(buf); +// System.err.println("good stream"); + byte[] buf = new byte[in.available()]; + in.read(buf); + image = java.awt.Toolkit.getDefaultToolkit().createImage(buf); } // else -// System.err.println("bad stream"); - } +// System.err.println("bad stream"); + } catch (java.io.IOException e) - { -// System.err.println("Unable to read image."); -// e.printStackTrace(); - } + { +// System.err.println("Unable to read image."); +// e.printStackTrace(); + } if(null != image) { int width; int height; // XXX pretty iffy! - while(-1 == (width = image.getWidth(null)) || + while(-1 == (width = image.getWidth(null)) || -1 == (height = image.getHeight(null))) Thread.currentThread().yield(); @@ -280,8 +284,8 @@ public class CommandView int[] pix = new int[width*height]; - java.awt.image.PixelGrabber grabber = - new java.awt.image.PixelGrabber(image, 0, 0, width, height, + java.awt.image.PixelGrabber grabber = + new java.awt.image.PixelGrabber(image, 0, 0, width, height, pix, 0, width); try @@ -291,8 +295,8 @@ public class CommandView } catch(InterruptedException ie) { -// System.err.println("grabber interrupted"); -// ie.printStackTrace(); +// System.err.println("grabber interrupted"); +// ie.printStackTrace(); } } if(null == bitmap) @@ -300,7 +304,7 @@ public class CommandView if(AS.DEBUG)System.err.println("loading bitmap from jar failed, trying Bitmap.bitmapNamed()"); bitmap = Bitmap.bitmapNamed(name); } - + return bitmap; } @@ -312,7 +316,7 @@ public class CommandView if( null != item.button ) { - if( force || + if( force || item.enabled != state.enabled || item.checked != state.checked ) { @@ -328,9 +332,9 @@ public class CommandView if( force || item.checked != state.checked ) { if( state.checked && null != item.checkedText ) - item.menuItem.setTitle( item.checkedText ); + item.menuItem.setTitle( item.checkedText ); else if( ! state.checked && null != item.uncheckedText ) - item.menuItem.setTitle( item.uncheckedText ); + item.menuItem.setTitle( item.uncheckedText ); } } item.enabled = state.enabled; diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ConsolePrinter.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ConsolePrinter.java index 208914143d6..05de3c51db5 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ConsolePrinter.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ConsolePrinter.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Interface to support sending strings to consloe +*/ + // when who what // 06/27/97 jband added this header to my code // @@ -25,5 +29,5 @@ package com.netscape.jsdebugging.ifcui; interface ConsolePrinter { public void print(String stringToPrint, boolean isOutput); -} +} diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ConsoleTyrant.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ConsoleTyrant.java index 543cd22bb71..cea6811b9ab 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ConsoleTyrant.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ConsoleTyrant.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* 'Model' for Console +*/ + // when who what // 06/27/97 jband added this header to my code // @@ -32,7 +36,7 @@ import netscape.security.ForbiddenTargetException; import com.netscape.jsdebugging.api.*; public class ConsoleTyrant - extends Observable + extends Observable implements Observer, Target, JSErrorReporter // , SimulatorPrinter // XXX Sim Hack { public ConsoleTyrant(Emperor emperor) @@ -51,17 +55,17 @@ public class ConsoleTyrant } - public void setPrinter(ConsolePrinter printer) + public void setPrinter(ConsolePrinter printer) { _printer = printer; // XXX need to plant this hook (or our own pass through) into JSD } - + /* - * NOTE: this ErrorReporter may be called on a thread other than - * the IFC UI thread + * NOTE: this ErrorReporter may be called on a thread other than + * the IFC UI thread */ - + // implement JSErrorReporter interface public int reportError( String msg, String filename, @@ -71,7 +75,7 @@ public class ConsoleTyrant { _errorString = msg; return JSErrorReporter.RETURN; - } + } public void eval(String input) { @@ -83,7 +87,7 @@ public class ConsoleTyrant /* * In order to allow the user to enter functions on multiple lines, - * this hack accumulates line which go to the console printer, but + * this hack accumulates line which go to the console printer, but * are not sent to JSD until the end is reached. * The rule is that when not accumulating if a line ends with '{' * then it is assumed to be the end of a function definition line and @@ -140,7 +144,7 @@ public class ConsoleTyrant _emperor.setWaitCursor(true); PrivilegeManager.enablePrivilege("Debugger"); - + String result = ""; _errorString = null; @@ -152,7 +156,7 @@ public class ConsoleTyrant DebugController dc = _emperor.getDebugController(); if( null != dc && null != frame ) { - ExecResult fullresult = + ExecResult fullresult = dc.executeScriptInStackFrame(frame,eval,filename,evalLine); result = fullresult.getResult(); @@ -192,7 +196,7 @@ public class ConsoleTyrant { } -/* +/* // implement SimulatorPrinter interface public void print(String stringToPrint) { @@ -227,9 +231,9 @@ public class ConsoleTyrant private Emperor _emperor; private ControlTyrant _controlTyrant; private StackTyrant _stackTyrant; - private int _lineno; + private int _lineno; private String _accumulator = null; private int _accumulatorLine; private ConsolePrinter _printer; private String _errorString; -} +} diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ConsoleView.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ConsoleView.java index af60a65a8d9..6825d5a4ac0 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ConsoleView.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ConsoleView.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* 'View' for console +*/ + // when who what // 06/27/97 jband added this header to my code // @@ -125,7 +129,7 @@ public class ConsoleView if ( o == _controlTyrant ) _setTextFieldEnabledState(); } - + private void _setTextFieldEnabledState() { if( ControlTyrant.STOPPED == _controlTyrant.getState() ) @@ -139,7 +143,7 @@ public class ConsoleView _textfield.setEditable(false); } } - + // implement ConsolePrinter interface public synchronized void print(String stringToPrint, boolean isOutput) diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ControlTyrant.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ControlTyrant.java index 35e26fb264a..e4014c27773 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ControlTyrant.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ControlTyrant.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* 'Model' that manages most interaction with debug API +*/ + // when who what // 06/27/97 jband added this header to my code // @@ -31,8 +35,8 @@ import netscape.security.PrivilegeManager; import netscape.security.ForbiddenTargetException; import com.netscape.jsdebugging.api.*; -public class ControlTyrant - extends Observable +public class ControlTyrant + extends Observable implements Observer, Target, JSErrorReporter { public static final int RUNNING = 0; @@ -79,7 +83,7 @@ public class ControlTyrant } // accessors - + public int getState() {return _state;} public boolean getInterrupt() {return _interrupt;} public boolean getEnabled() {return _enabled;} @@ -110,7 +114,7 @@ public class ControlTyrant } // command handlers - + public synchronized void interrupt(boolean b) { PrivilegeManager.enablePrivilege("Debugger"); @@ -321,7 +325,7 @@ public class ControlTyrant _semaphore.release(); return; } - + // save arguments _threadState = debug; @@ -329,7 +333,7 @@ public class ControlTyrant if(AS.DEBUG)Log.trace("ControlTyrant.aboutToExecute", "6) about to call _pc.getSourceLocation()"); _sourceLocation = (JSSourceLocation) _pc.getSourceLocation(); if(AS.DEBUG)Log.trace("ControlTyrant.aboutToExecute", "7) _pc.getSourceLocation() returned"); - + if(false) { String leadin = "interrupted at:"; @@ -430,13 +434,13 @@ public class ControlTyrant Sound.soundNamed("droplet.au").play(); // AWTCompatibility.awtToolkit().beep(); - ErrorReporterDialog erd = + ErrorReporterDialog erd = new ErrorReporterDialog(_emperor, (ErrorReport) data); - + _emperor.enableAppClose(false); - erd.showModally(); + erd.showModally(); _emperor.enableAppClose(true); - + _debugBreakResponse = erd.getAnswer(); notify(); } @@ -450,19 +454,19 @@ public class ControlTyrant // implement observer interface public void update(Observable o, Object arg) { - + } /* - * NOTE: this ErrorReporter may be called on a thread other than - * the IFC UI thread + * NOTE: this ErrorReporter may be called on a thread other than + * the IFC UI thread */ public synchronized JSErrorReporter setErrorReporter(JSErrorReporter er) { JSErrorReporter old = _errorReporter; - _errorReporter = er; + _errorReporter = er; return old; - + } public JSErrorReporter getErrorReporter() { @@ -478,7 +482,7 @@ public class ControlTyrant { if( ! _enabled ) return JSErrorReporter.PASS_ALONG; - + if( null != _errorReporter && this != _errorReporter ) return _errorReporter.reportError(msg,filename,lineno,linebuf,tokenOffset); @@ -492,7 +496,7 @@ public class ControlTyrant while( -1 == _debugBreakResponse && _enabled ) { - try + try { wait(); } @@ -524,8 +528,8 @@ public class ControlTyrant } - // data... - private Application _app; + // data... + private Application _app; private int _state; private boolean _interrupt; private Emperor _emperor; @@ -553,11 +557,11 @@ public class ControlTyrant private final String HIT_EXEC_HOOK = "HIT_EXEC_HOOK"; private final String HIT_ERROR_REPORTER = "HIT_ERROR_REPORTER"; - + } /***************************************************************************/ -// used internally only... +// used internally only... class CtrlSemaphore { public boolean available() {return _available;} @@ -569,12 +573,12 @@ class CtrlSemaphore _available = false; return true; } - + private boolean _available = true; } -// used internally only... -class CtrlInterruptHook +// used internally only... +class CtrlInterruptHook extends InterruptHook implements ChainableHook { @@ -606,11 +610,11 @@ class CtrlInterruptHook private ControlTyrant _ctrlTyrant; private InterruptHook _nextHook; - -} -// used internally only... -class CtrlDebugBreakHook +} + +// used internally only... +class CtrlDebugBreakHook extends DebugBreakHook implements ChainableHook { @@ -640,5 +644,5 @@ class CtrlDebugBreakHook private ControlTyrant _ctrlTyrant; private DebugBreakHook _nextHook; -} +} diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ControlTyrantUpdate.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ControlTyrantUpdate.java index 264c694a632..9410db404e5 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ControlTyrantUpdate.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ControlTyrantUpdate.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Information sent with update events from CommandTyrant +*/ + // when who what // 06/27/97 jband added this header to my code // @@ -34,5 +38,5 @@ class ControlTyrantUpdate } public int type; public int state; -} +} diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/EditKeyTextFilter.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/EditKeyTextFilter.java index 8b261a0a3e2..0a25656eca1 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/EditKeyTextFilter.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/EditKeyTextFilter.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Windows style Cut/Copy/Paste hotkey support +*/ + // when who what // 11/19/97 jband added this class // @@ -25,7 +29,7 @@ package com.netscape.jsdebugging.ifcui; import netscape.application.*; import netscape.util.*; -public class EditKeyTextFilter +public class EditKeyTextFilter implements TextFilter { public EditKeyTextFilter(CommandTyrant commandTyrant) @@ -42,27 +46,27 @@ public class EditKeyTextFilter { case 'c': Application.application().performCommandLater( - _commandTyrant, - _commandTyrant.cmdString(CommandTyrant.COPY), + _commandTyrant, + _commandTyrant.cmdString(CommandTyrant.COPY), null); return false; case 'v': Application.application().performCommandLater( - _commandTyrant, - _commandTyrant.cmdString(CommandTyrant.PASTE), + _commandTyrant, + _commandTyrant.cmdString(CommandTyrant.PASTE), null); return false; case 'x': Application.application().performCommandLater( - _commandTyrant, - _commandTyrant.cmdString(CommandTyrant.CUT), + _commandTyrant, + _commandTyrant.cmdString(CommandTyrant.CUT), null); return false; default: break; } } - return true; + return true; } private CommandTyrant _commandTyrant; diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/Emperor.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/Emperor.java index 8b0e7b7477b..31f7e3c00fe 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/Emperor.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/Emperor.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Central 'Model' that creates and coordinates all models and views +*/ + // when who what // 06/27/97 jband added this header to my code // @@ -44,7 +48,7 @@ public class Emperor Menu mainMenu, MenuItem fileMenu, MenuView menuView, - int hostMode, + int hostMode, String host, StatusWindow statusWindow ) @@ -62,7 +66,7 @@ public class Emperor _mainWindow.setHidesWhenPaused(false); _fixedFont = new Font( "Courier", Font.PLAIN, 13 ); - + _debuggerIsActive = true; if(AS.DEBUG) @@ -96,11 +100,11 @@ public class Emperor public static final int REMOTE_SERVER = 1; public static final int RHINO = 2; - public static final String LOCAL_LOADER_NAME = + public static final String LOCAL_LOADER_NAME = "com.netscape.jsdebugging.api.local.AdapterLoaderLocal"; - public static final String SERVER_LOADER_NAME = + public static final String SERVER_LOADER_NAME = "com.netscape.jsdebugging.api.corba.AdapterLoaderCorba"; - public static final String RHINO_LOADER_NAME = + public static final String RHINO_LOADER_NAME = "com.netscape.jsdebugging.api.rhino.AdapterLoaderRhino"; public static boolean isDebuggingSupported(int which, String host) @@ -118,7 +122,7 @@ public class Emperor loaderName = RHINO_LOADER_NAME; break; default: - return false; + return false; } try @@ -151,7 +155,7 @@ public class Emperor loaderName = RHINO_LOADER_NAME; break; default: - return false; + return false; } try @@ -192,8 +196,8 @@ public class Emperor { if( null != _menuView ) _menuViewHeight = _menuView.itemHeight(); - - _commandView = new CommandView( this, _mainMenu, fileMenu, _menuViewHeight ); + + _commandView = new CommandView( this, _mainMenu, fileMenu, _menuViewHeight ); Rect rectCanvas = getClientRect(); // hack for space for native menu @@ -211,11 +215,11 @@ public class Emperor Rect rectWatchView = new Rect(rectCanvas.x+20,rectCanvas.y+20,popupDX,popupDY); Rect rectBreakpointView = new Rect(rectCanvas.x+40,rectCanvas.y+40,popupDX,popupDY); Rect rectInspectorView = new Rect(rectCanvas.x+60,rectCanvas.y+60,popupDX,popupDY); - Rect rectStackView = new Rect( 0, lowerWindowY, - stackViewWidth, + Rect rectStackView = new Rect( 0, lowerWindowY, + stackViewWidth, _lowerWindowDY ); Rect rectConsole = new Rect( stackViewWidth, lowerWindowY, - rectCanvas.width-stackViewWidth, + rectCanvas.width-stackViewWidth, _lowerWindowDY); // hack for "unsigned window" subwindow @@ -226,7 +230,7 @@ public class Emperor _pageListView = new PageListView( this, rectPageList ); _sourceViewManager = new SourceViewManager(this); _sourceViewManager.setPreferedNewViewRect( rectSrc ); - _stackView = new StackView( this, rectStackView ); + _stackView = new StackView( this, rectStackView ); _consoleView = new ConsoleView(this, rectConsole ); _watchView = new WatchView(this, rectWatchView); _breakpointView = new BreakpointView(this, rectBreakpointView); @@ -282,10 +286,10 @@ public class Emperor if( null != _sourceViewManager ) _sourceViewManager.prefsRead( unarchiver ); - + if( null != _watchTyrant ) _watchTyrant.prefsRead( unarchiver ); - + // add the rest... @@ -298,7 +302,7 @@ public class Emperor // print and eat System.out.println(e); } - + } @@ -338,7 +342,7 @@ public class Emperor System.out.println(e); } - + } private void _debuggerIsClosing() @@ -373,7 +377,7 @@ public class Emperor return false; return true; } - public void windowDidHide(Window aWindow) + public void windowDidHide(Window aWindow) { if( null == _mainWindow || _mainWindow != aWindow || _ignoreHide ) return; @@ -441,7 +445,7 @@ public class Emperor { String linetext; while( null != (linetext = s.readLine()) ) - { + { String url; String condition; int sep1; @@ -532,7 +536,7 @@ public class Emperor return new Rect(0,_toolbarHeight+_menuViewHeight, s.width,s.height-_toolbarHeight-_menuViewHeight); } - + private Rect getPreferedNewSourceViewRect() { Rect rect = getClientRect(); @@ -621,7 +625,7 @@ public class Emperor private int _toolbarHeight; private RootView _rootView; private boolean _appCanClose = true; - + private ControlTyrant _controlTyrant ; private BreakpointTyrant _breakpointTyrant; private SourceTyrant _sourceTyrant ; @@ -645,10 +649,10 @@ public class Emperor private int _lowerWindowDY; - private static final Color _backgroundColor = Color.white; - private static final Color _disabledBackgroundColor = Color.lightGray; + private static final Color _backgroundColor = Color.white; + private static final Color _disabledBackgroundColor = Color.lightGray; private static final Color _selectionColor = Color.lightGray; -// private static final Color _backgroundColor = Color.lightGray; +// private static final Color _backgroundColor = Color.lightGray; // private static final Color _selectionColor = Color.white; private static final String _prefsFilenameClient = "jsdcpref.txt"; diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/EmperorOwner.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/EmperorOwner.java index 42baebdac88..854e0fb7b2a 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/EmperorOwner.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/EmperorOwner.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Interface to help decouple Emperor from debugger embedding windows +*/ + // when who what // 11/10/97 jband added file // @@ -25,4 +29,4 @@ package com.netscape.jsdebugging.ifcui; public interface EmperorOwner { public void setWaitCursor(boolean set); -} \ No newline at end of file +} \ No newline at end of file diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/Env.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/Env.java index a5acd7b68b0..215bb375fab 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/Env.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/Env.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Platform specific support for detecting platform and locating prefs files +*/ + // when who what // 12/06/97 jband added this file // @@ -77,7 +81,7 @@ public class Env _coursePlatformType = ENV_MAC; else _coursePlatformType = ENV_UNIX; - } + } catch(Exception e) { System.out.println(e); @@ -103,7 +107,7 @@ public class Env if(null != loadDir) _codebaseDir = loadDir.replace('/', File.separatorChar); - // unescape the path + // unescape the path StringBuffer sb = new StringBuffer(); int len = _codebaseDir.length(); for(int i = 0; i < len; i++ ) @@ -120,7 +124,7 @@ public class Env i += 2; } } - sb.append(c); + sb.append(c); } _codebaseDir = sb.toString(); @@ -136,9 +140,9 @@ public class Env } // hack to lose the leading slash in Mac filenames - // + // // REMOVED! Mac Java in Nav wants leading slash! - // + // // if( ENV_MAC == _coursePlatformType && // _codebaseDir.length() >= 2 && // _codebaseDir.charAt(0) == File.separatorChar ) @@ -157,7 +161,7 @@ public class Env } // hack to get a 'normal' filename on Windows - if( ENV_WIN == _coursePlatformType && _codebaseDir.charAt(1) == '|' ) + if( ENV_WIN == _coursePlatformType && _codebaseDir.charAt(1) == '|' ) _codebaseDir = _codebaseDir.charAt(0)+":"+ _codebaseDir.substring(2); } @@ -188,17 +192,17 @@ public class Env int sep = _codebaseDir.indexOf(File.separatorChar,1); if(-1 != sep) { - _prefsDir = _codebaseDir.substring(0,sep+1) + + _prefsDir = _codebaseDir.substring(0,sep+1) + "System Folder" + File.separatorChar + "Preferences" + File.separatorChar; } } - } + } private static int _coursePlatformType = 0; private static String _codebaseDir = null; private static String _prefsDir = null; -} +} diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ErrorReport.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ErrorReport.java index 04b78d2c0ac..f45d4ccb9c7 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ErrorReport.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ErrorReport.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Holds error state information +*/ + // when who what // 06/30/97 jband added this simple dumb data class // diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ErrorReporterDialog.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ErrorReporterDialog.java index 4e7d92b777f..96d424a25bf 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ErrorReporterDialog.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/ErrorReporterDialog.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Dialog to display error info and get user's response +*/ + // when who what // 06/30/97 jband added this class // @@ -54,16 +58,16 @@ class ErrorReporterDialog Size sz = icon.minSize(); icon.sizeTo(sz.width,sz.height); addSubview(icon); - + int boxTop = _spacerDY + sz.height + _spacerDY; - + int contentDX = _boxDX + _spacerDX * 2; int contentDY = boxTop + _boxDY + _spacerDY * 3 + _buttonDY; - int buttonY = boxTop + _boxDY + _spacerDY * 2; + int buttonY = boxTop + _boxDY + _spacerDY * 2; int buttonX3 = _boxDX + _spacerDX - _buttonDX; int buttonX2 = buttonX3 - _spacerDX - _buttonDX; int buttonX1 = buttonX2 - _spacerDX - _buttonDX; - + Size size = windowSizeForContentSize(contentDX, contentDY); setBounds(0,0,size.width,size.height); @@ -77,35 +81,35 @@ class ErrorReporterDialog title.setBackgroundColor(Color.lightGray); title.setEditable(false); addSubview(title); - + ERDListView lv = new ERDListView( emperor.getFixedFont() ); - + lv.setAllowsEmptySelection(true); lv.setAllowsMultipleSelection(false); lv.setBackgroundColor(Color.lightGray); - + if( null != er.filename ) { lv.addLine( "IN "+ er.filename ); lv.addLine( "LINE "+ er.lineno ); lv.addLine( "" ); } - + lv.addLine( er.msg ); - + if( null != er.linebuf ) { StringBuffer sb = new StringBuffer(er.tokenOffset+2); for(int i = 0; i < er.tokenOffset; i++ ) sb.append('.'); sb.append('^'); - + lv.addLine( "" ); lv.addLine( er.linebuf ); lv.addLine( sb.toString() ); } lv.sizeToContent(); - + ScrollGroup sg1 = new ScrollGroup(_spacerDX,boxTop,_boxDX,_boxDY); sg1.setHorizScrollBarDisplay( ScrollGroup.AS_NEEDED_DISPLAY ); sg1.setVertScrollBarDisplay( ScrollGroup.AS_NEEDED_DISPLAY ); @@ -114,15 +118,15 @@ class ErrorReporterDialog sg1.contentView().setLayoutManager( new MarginLayout() ); sg1.setBackgroundColor(Color.lightGray); addSubview(sg1); - + Button button; - + button = new Button(buttonX1,buttonY,_buttonDX,_buttonDY); button.setTitle("OK"); button.setTarget(this); button.setCommand(OK_CMD); addSubview(button); - + button = new Button(buttonX2,buttonY,_buttonDX,_buttonDY); button.setTitle("Debug"); button.setTarget(this); @@ -130,16 +134,16 @@ class ErrorReporterDialog if( "syntax error".equals(er.msg) ) button.setEnabled(false); addSubview(button); - + button = new Button(buttonX3,buttonY,_buttonDX,_buttonDY); button.setTitle("Pass On"); button.setTarget(this); button.setCommand(PASS_ON_CMD); addSubview(button); - + center(); } - + // implement target interface public void performCommand(String cmd, Object data) { @@ -152,25 +156,25 @@ class ErrorReporterDialog else return; hide(); - } - + } + public int getAnswer() {return _answer;} - + private int _answer = JSErrorReporter.RETURN; - + private static final String OK_CMD = "OK_CMD"; private static final String DEBUG_CMD = "DEBUG_CMD"; private static final String PASS_ON_CMD = "PASS_ON_CMD"; -} +} class ERDListView extends BackgroundHackListView { public ERDListView( Font font ) { - super(); + super(); _linefont = font; } - + public void addLine( String text ) { ListItem item = new ListItem(); @@ -180,19 +184,19 @@ class ERDListView extends BackgroundHackListView _maxlinelen = Math.max( _maxlinelen, text.length() ); } - + public void sizeToContent() { FontMetrics fm = _linefont.fontMetrics(); setBounds( 0, 0, (_maxlinelen+1) * fm.charWidth('X'),0 ); sizeToMinSize(); } - + // don't allow selection... public boolean mouseDown(MouseEvent me) {return false;} public void mouseDragged(MouseEvent me) {} public void mouseUp(MouseEvent me) {} - + private Font _linefont = null; private int _maxlinelen = 0; } diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/HostNameDialog.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/HostNameDialog.java index 759d2d26bbc..19ecdf02de3 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/HostNameDialog.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/HostNameDialog.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Dialog used in remote debugging to choose server +*/ + // when who what // 11/10/97 jband added this file // @@ -42,16 +46,16 @@ class HostNameDialog public HostNameDialog(String title, String label, String hostname) { super(); - + setTitle(title); setCloseable( false ); setResizable( false ); - + int contentDX = _editDX + _spacerDX * 2; int contentDY = _labelDY + _editDY + _buttonDY + _spacerDY * 4; int labelY = _spacerDY; int editY = _labelDY + _spacerDY * 2; - int buttonY = _labelDY + _editDY + _spacerDY * 3; + int buttonY = _labelDY + _editDY + _spacerDY * 3; int labelX = _spacerDX; int editX = _spacerDX; @@ -59,7 +63,7 @@ class HostNameDialog int buttonX3 = contentDX - _spacerDX - _buttonDX; int buttonX2 = buttonX3 - _spacerDX - _buttonDX; int buttonX1 = buttonX2 - _spacerDX - _buttonDX; - + Size size = windowSizeForContentSize(contentDX, contentDY); setBounds(0,0,size.width,size.height); @@ -73,13 +77,13 @@ class HostNameDialog addSubview(_textField); Button button; - + button = new Button(buttonX1,buttonY,_buttonDX,_buttonDY); button.setTitle("OK"); button.setTarget(this); button.setCommand(OK_CMD); addSubview(button); - + button = new Button(buttonX2,buttonY,_buttonDX,_buttonDY); button.setTitle("Localhost"); button.setTarget(this); @@ -106,7 +110,7 @@ class HostNameDialog label.setBorder(null); return label; } - + // implement target interface public void performCommand(String cmd, Object data) { @@ -120,11 +124,11 @@ class HostNameDialog if( null == _hostName || 0 == _hostName.length() ) { _hostName = _hostName.trim(); - Alert.runAlertInternally( + Alert.runAlertInternally( Alert.notificationImage(), - "invalid entry", + "invalid entry", "you must enter a valid hostname or ip address", - "OK", null,null ); + "OK", null,null ); setFocusedView( _textField ); return; } @@ -142,7 +146,7 @@ class HostNameDialog _keyPressed = CANCEL; hide(); } - } + } // implement TextFilter interface public boolean acceptsEvent(Object o, KeyEvent ke , Vector vec) @@ -152,7 +156,7 @@ class HostNameDialog Application.application().performCommandLater(this, OK_CMD, null); return false; } - return true; + return true; } public void showModally() @@ -176,7 +180,7 @@ class HostNameDialog public String getHostName() {return _hostName;} public int getKeyPressed() {return _keyPressed;} - + private TextField _textField; private int _keyPressed; private String _hostName; @@ -184,6 +188,6 @@ class HostNameDialog private static final String CANCEL_CMD = "CANCEL_CMD"; private static final String LOCALHOST_CMD = "LOCALHOST_CMD"; private static final String OK_CMD = "OK_CMD"; -} +} diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/InspectorNodeModel.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/InspectorNodeModel.java index 200a68e0cde..778645e1297 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/InspectorNodeModel.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/InspectorNodeModel.java @@ -16,10 +16,14 @@ * Reserved. */ +/* +* 'Model' to manage inspector info about a singe value +*/ + // when who what // 10/30/97 jband added this file // - + package com.netscape.jsdebugging.ifcui; import netscape.application.*; @@ -28,9 +32,9 @@ import com.netscape.jsdebugging.ifcui.palomar.util.*; public class InspectorNodeModel { - public InspectorNodeModel( String name, + public InspectorNodeModel( String name, int depth, - InspectorNodeModel parent, + InspectorNodeModel parent, InspectorTyrant tyrant ) { _name = name.trim(); @@ -82,7 +86,7 @@ public class InspectorNodeModel prev = cur; } } - return childCount; + return childCount; } public synchronized void clearLinks() @@ -149,4 +153,4 @@ public class InspectorNodeModel private boolean _hasProperties; private String _type; private boolean _isValid; -} +} diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/InspectorTyrant.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/InspectorTyrant.java index 4f9f308d674..c1a8cd4ce13 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/InspectorTyrant.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/InspectorTyrant.java @@ -16,10 +16,14 @@ * Reserved. */ +/* +* 'Model' to do tree of data inspection +*/ + // when who what // 10/30/97 jband added this file // - + package com.netscape.jsdebugging.ifcui; import java.util.Observable; @@ -32,7 +36,7 @@ import netscape.security.ForbiddenTargetException; import com.netscape.jsdebugging.api.*; public class InspectorTyrant - extends Observable + extends Observable implements Observer, Target, JSErrorReporter // , SimulatorPrinter // XXX Sim Hack { public InspectorTyrant(Emperor emperor) @@ -71,11 +75,11 @@ public class InspectorTyrant // It is important that our function name not conflict with anything // in the user's namespace. I think this should be safe :) - private static final String _propEnumeratorFunctionName = + private static final String _propEnumeratorFunctionName = "__John_Bandhauer_Says_This_Is_A_Unique_Identifier__"; // Rhino currently does not like this form -// private static final String _propEnumeratorFunction = +// private static final String _propEnumeratorFunction = // "function "+_propEnumeratorFunctionName+"(ob)\n"+ // "{\n"+ // " var retval = \"\";\n"+ @@ -85,7 +89,7 @@ public class InspectorTyrant // " return retval;\n"+ // "}\n"; - private static final String _propEnumeratorFunction = + private static final String _propEnumeratorFunction = _propEnumeratorFunctionName+" = new Function(\"ob\",\""+ " var retval = new String();"+ " var prop;"+ @@ -123,7 +127,7 @@ public class InspectorTyrant // we build both a string and a number vector so that we can // seperately sort them before concating them. NOTE that numVec - // actually holds strings representing numbers, rather than the + // actually holds strings representing numbers, rather than the // numbers themselves - we don't want rounding & conversions errors Vector stringVec = new Vector(); Vector numVec = new Vector(); @@ -164,9 +168,9 @@ public class InspectorTyrant } else { - // the below deals with cases where the property - // name is not a number, but is not a valid - // identifier either. + // the below deals with cases where the property + // name is not a number, but is not a valid + // identifier either. // e.g. window["foo/bar"] // the navigator.mimeTypes array has such properties String nameToAdd = null; @@ -185,7 +189,7 @@ public class InspectorTyrant stringVec.addElement(nameToAdd); } } - start = i+1; + start = i+1; } } @@ -207,7 +211,7 @@ public class InspectorTyrant } } - return retval; + return retval; } public String eval(String input) @@ -230,14 +234,14 @@ public class InspectorTyrant return null; String filename; - if( _emperor.isPre40b6() || + if( _emperor.isPre40b6() || Emperor.REMOTE_SERVER == _emperor.getHostMode() ) filename = "inspector"; else filename = loc.getURL(); PrivilegeManager.enablePrivilege("Debugger"); - + String result = ""; _errorString = null; @@ -249,7 +253,7 @@ public class InspectorTyrant DebugController dc = _emperor.getDebugController(); if( null != dc && null != frame ) { - ExecResult fullresult = + ExecResult fullresult = dc.executeScriptInStackFrame(frame,eval,filename,1); result = fullresult.getResult(); @@ -273,10 +277,10 @@ public class InspectorTyrant } /* - * NOTE: this ErrorReporter may be called on a thread other than - * the IFC UI thread + * NOTE: this ErrorReporter may be called on a thread other than + * the IFC UI thread */ - + // implement JSErrorReporter interface public int reportError( String msg, String filename, @@ -286,7 +290,7 @@ public class InspectorTyrant { _errorString = msg; return JSErrorReporter.RETURN; - } + } // implement observer interface public void update(Observable o, Object arg) @@ -320,4 +324,4 @@ public class InspectorTyrant private StackTyrant _stackTyrant; private String _errorString; private InspectorNodeModel _rootNode; -} +} diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/InspectorView.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/InspectorView.java index fd9ea152cf3..ca80ca89538 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/InspectorView.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/InspectorView.java @@ -16,10 +16,14 @@ * Reserved. */ +/* +* 'View' to interactively do inspection of a tree of data +*/ + // when who what // 10/30/97 jband added this file // - + package com.netscape.jsdebugging.ifcui; import java.util.Observable; @@ -29,7 +33,7 @@ import netscape.util.*; import com.netscape.jsdebugging.ifcui.palomar.util.*; import com.netscape.jsdebugging.ifcui.palomar.widget.layout.*; -public class InspectorView +public class InspectorView extends InternalWindow implements Observer, Target, TextFilter { @@ -38,10 +42,10 @@ public class InspectorView private static final int _buttonHeight = 24; private static final int _spacerDY = 5; private static final int _spacerDX = 5; - + private int _nextButtonX; private int _nextButtonY; - + public InspectorView( Emperor emperor, Rect rect ) { super(rect); @@ -68,10 +72,10 @@ public class InspectorView Rect rectEdit = new Rect(_spacerDX, _spacerDY, listwidth, _editDY); Rect rectSG = new Rect(_spacerDX, listtop, listwidth, _listheight); - + _nextButtonX = listwidth + (_spacerDX * 2); - _nextButtonY = _spacerDY; - + _nextButtonY = _spacerDY; + _inspectButton = _addButton( "Inspect", INSPECT_CMD ); _nextButtonY += _spacerDY * 2; _evalButton = _addButton( "Eval", EVAL_CMD ); @@ -86,7 +90,7 @@ public class InspectorView _textfield.setFont(_emperor.getFixedFont()); _textfield.setFilter(this); // to catch return key and edit cmds addSubview(_textfield); - + ScrollGroup sg = new ScrollGroup(rectSG); sg.setHorizScrollBarDisplay( ScrollGroup.AS_NEEDED_DISPLAY ); sg.setVertScrollBarDisplay( ScrollGroup.AS_NEEDED_DISPLAY ); @@ -94,8 +98,8 @@ public class InspectorView sg.setAutoResizeSubviews(true); sg.contentView().setLayoutManager( new MarginLayout() ); sg.setBackgroundColor(_emperor.getBackgroundColor()); - - setCloseable( false ); + + setCloseable( false ); setResizable( false ); setTitle( "Inspector" ); addSubview(sg); @@ -123,10 +127,10 @@ public class InspectorView refresh(); - layoutView(1,1); - layoutView(-1,-1); + layoutView(1,1); + layoutView(-1,-1); } - + private Button _addButton( String title, String cmd ) { Button button = new Button(_nextButtonX,_nextButtonY, @@ -191,7 +195,7 @@ public class InspectorView _inspectorTyrant.setNewRootNode(s); } // update done on notification... - } + } else if( cmd.equals(EVAL_CMD) ) { if( ControlTyrant.STOPPED != _controlTyrant.getState() ) @@ -209,7 +213,7 @@ public class InspectorView s ); } } - } + } else if( cmd.equals(ADD_WATCH_CMD) ) { String s = _textfield.stringValue(); @@ -280,7 +284,7 @@ public class InspectorView _textfield.setFocusedView(); if( _fixupSizes() ) - layoutView(0,0); + layoutView(0,0); _listview.draw(); _emperor.setWaitCursor(false); @@ -333,7 +337,7 @@ public class InspectorView newitem.setSelectedColor(_emperor.getSelectionColor()); child = child.getNextSib(); } - + if( draw && anyChildren ) { if( _fixupSizes() ) @@ -361,11 +365,11 @@ public class InspectorView break; _listview.removeItemAt(index+1); } - + if( draw ) { if( _fixupSizes() ) - layoutView(0,0); + layoutView(0,0); _listview.scrollItemAtToVisible(index); _listview.draw(); } @@ -455,8 +459,8 @@ public class InspectorView private static final String COPY_VALUE_CMD = "COPY_VALUE_CMD"; private static final String DONE_CMD = "DONE_CMD"; - -} + +} /***************************************************************************/ @@ -474,7 +478,7 @@ final class InspectorListView extends SmartItemListView private InspectorView _iv; private InspectorListItem _mousedItem; - + } /***************************************************************************/ @@ -597,8 +601,8 @@ final class InspectorListItem extends SmartListItem private InspectorItemDrawer _drawer; private InspectorNodeModel _model; - -} + +} /***************************************************************************/ @@ -628,8 +632,8 @@ final class InspectorItemDrawer } - public void draw( Graphics g, - Rect boundsRect, + public void draw( Graphics g, + Rect boundsRect, InspectorListItem item, InspectorNodeModel model ) { @@ -726,7 +730,7 @@ final class InspectorItemDrawer if( r.intersects( g.clipRect() ) ) { item.setTextColor(_leftTextColor); - item.drawStringInRect(g,name,_font,r,Graphics.LEFT_JUSTIFIED); + item.drawStringInRect(g,name,_font,r,Graphics.LEFT_JUSTIFIED); } } @@ -747,7 +751,7 @@ final class InspectorItemDrawer item.setTextColor(_rightTextFunctionColor); else item.setTextColor(_rightTextColor); - item.drawStringInRect(g,value,_font,r,Graphics.LEFT_JUSTIFIED); + item.drawStringInRect(g,value,_font,r,Graphics.LEFT_JUSTIFIED); } } @@ -801,4 +805,4 @@ final class InspectorItemDrawer private static final int _spacerDY = 3; private static final int _boxDim = 11; -} +} diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/JSDebuggerApp.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/JSDebuggerApp.java index 041136a39df..6df6dd6ab4b 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/JSDebuggerApp.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/JSDebuggerApp.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Core Application class for debugger (used both when app or applet) +*/ + // when who what // 06/27/97 jband added this header to my code // @@ -90,7 +94,7 @@ public class JSDebuggerApp PrivilegeManager.enablePrivilege("Debugger"); PrivilegeManager.enablePrivilege("UniversalFileRead"); - // It doesn't really matter that much if the user says no to + // It doesn't really matter that much if the user says no to // these (at this point) try { @@ -124,7 +128,7 @@ public class JSDebuggerApp { int platform = Env.getCoursePlatformType(); - System.out.println("JSD platform is " + + System.out.println("JSD platform is " + (platform == Env.ENV_WIN ? "Windows" : platform == Env.ENV_MAC ? @@ -249,8 +253,8 @@ public class JSDebuggerApp if( Emperor.REMOTE_SERVER == _mode && null == _host ) { String hostname = _readHostName(); - HostNameDialog dlg = new - HostNameDialog("Choose Server", + HostNameDialog dlg = new + HostNameDialog("Choose Server", "Enter Hostname or ip address of Server", hostname); while(true) @@ -270,10 +274,10 @@ public class JSDebuggerApp break; setWaitCursor(false); - if( Alert.DEFAULT_OPTION == + if( Alert.DEFAULT_OPTION == Alert.runAlertInternally( Alert.warningImage(), "Error", - "JavaScript Debugger support was not found in "+ _host+"\n" + "JavaScript Debugger support was not found in "+ _host+"\n" + "\n" + "Try a different Server?", "Yes", "No", null ) ) @@ -330,7 +334,7 @@ public class JSDebuggerApp setWaitCursor(false); Alert.runAlertInternally( Alert.warningImage(), "Error", - core_msg + core_msg + "\n\n" + suggestion + "Please see the Debugger release notes for troubleshooting information\n" @@ -349,7 +353,7 @@ public class JSDebuggerApp MenuItem fileMenu = mainMenu.addItemWithSubmenu("File"); MenuItem item; - _emperor = new Emperor( this, _mainWindow, mainMenu, fileMenu, + _emperor = new Emperor( this, _mainWindow, mainMenu, fileMenu, menuView, _mode, _host, statusWindow ); addSeparator(fileMenu); @@ -429,7 +433,7 @@ public class JSDebuggerApp String licenseHtmlFilename = baseDir+"license.html"; - LicenseViewer v = + LicenseViewer v = new LicenseViewer("Netscape JavaScript Debugger License", licenseHtmlFilename); if( ! v.HtmlLoadedSuccesfully() ) @@ -478,7 +482,7 @@ public class JSDebuggerApp { String title = "About"; String msg; - + msg = "Netscape JavaScript Debugger\n"; msg += "Version "+MAJOR_VERSION+"."+MINOR_VERSION; if( PREVIEW_VERSION != 0 ) @@ -663,7 +667,7 @@ public class JSDebuggerApp if(AS.S)ER.T(_waitCount >= 0,"_waitCount went negative", this ); if(AS.S)ER.T(Thread.currentThread()==_uiThreadForAssertCheck,"setWaitCursor() called on non-UI thread",this); - + if( (1 == _waitCount && set) || (0 == _waitCount && !set) ) { Vector windows = externalWindows(); @@ -672,13 +676,13 @@ public class JSDebuggerApp { ExternalWindow window = (ExternalWindow)windows.elementAt(i); FoundationPanel panel = window.panel(); - + if (set) panel.setCursor(View.WAIT_CURSOR); else panel.setCursor(View.ARROW_CURSOR); } - } + } } diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/JSDebuggerApplet.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/JSDebuggerApplet.java index d47093377ac..57e0b34a78c 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/JSDebuggerApplet.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/JSDebuggerApplet.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* IFC FoundationApplet startup support class +*/ + package com.netscape.jsdebugging.ifcui; import netscape.application.*; diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/LicenseViewer.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/LicenseViewer.java index 80de9476b8e..2e0ab3f3e57 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/LicenseViewer.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/LicenseViewer.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Simple html viewer to show licence and get acceptance +*/ + // when who what // 11/10/97 jband added this file // @@ -44,17 +48,17 @@ class LicenseViewer setTitle(title); setCloseable(true); setResizable(false); - + int contentDX = _editDX + _spacerDX * 2; int contentDY = _editDY + _buttonDY + _spacerDY * 3; int labelY = _spacerDY; int editY = _spacerDY * 1; - int buttonY = _editDY + _spacerDY * 2; + int buttonY = _editDY + _spacerDY * 2; int editX = _spacerDX; int buttonX2 = contentDX - _spacerDX - _buttonDX; int buttonX1 = buttonX2 - _spacerDX - _buttonDX; - + Size size = windowSizeForContentSize(contentDX, contentDY); setBounds(0,0,size.width,size.height); @@ -89,7 +93,7 @@ class LicenseViewer _HtmlLoadedSuccesfully = true; Button button; - + button = new Button(buttonX1,buttonY,_buttonDX,_buttonDY); button.setTitle("I Accept"); button.setTarget(this); @@ -117,7 +121,7 @@ class LicenseViewer { hide(); } - } + } public void showModally() { @@ -127,12 +131,12 @@ class LicenseViewer public boolean userPressedAccept() {return _userPressedAccept;} public boolean HtmlLoadedSuccesfully() {return _HtmlLoadedSuccesfully;} - + private boolean _userPressedAccept = false; private boolean _HtmlLoadedSuccesfully = false; private TextView _textView; private static final String CANCEL_CMD = "CANCEL_CMD"; private static final String ACCEPT_CMD = "ACCEPT_CMD"; -} +} diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/Location.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/Location.java index e972304b00e..760419a1785 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/Location.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/Location.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Source location (file,line) with persistence support +*/ + // when who what // 06/27/97 jband added this header to my code // @@ -32,7 +36,7 @@ import com.netscape.jsdebugging.ifcui.palomar.util.*; import netscape.util.*; -public class Location +public class Location implements Comparable, Codable { @@ -48,9 +52,9 @@ public class Location if(AS.S)ER.T(null!=url,"null url in Location ctor",this); if(AS.S)ER.T(line >=0,"negative line in Location ctor",this); - _url = url; + _url = url; _line = line; - _stringRep = new String( _url + "#" + _line ); + _stringRep = new String( _url + "#" + _line ); } // for Codable @@ -114,10 +118,10 @@ public class Location } public void finishDecoding() throws CodingException { - _stringRep = new String( _url + "#" + _line ); + _stringRep = new String( _url + "#" + _line ); } - private String _url; + private String _url; private int _line; private String _stringRep; } diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/Log.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/Log.java index 08568a70012..debe02b2304 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/Log.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/Log.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Flexible Logging support +*/ + // when who what // 09/30/97 jband created file // @@ -78,7 +82,7 @@ public final class Log if( _logToConsole ) System.out.println(buf); } - + public static boolean getEnabled() { return _enabled; @@ -98,7 +102,7 @@ public final class Log { _typeEnabled[type] = enabled; } - + public static boolean getShowDate() { return _showDate; @@ -108,7 +112,7 @@ public final class Log { _showDate = b; } - + public static boolean getShowThreadName() { return _showThreadName; @@ -189,7 +193,7 @@ public final class Log return null != _out; } - + private static void _finish() { if( null != _out ) @@ -236,5 +240,5 @@ public final class Log private static boolean _useCodebase = false; private static String _fullFilename = null; private static String _baseFilename = "jsdlog.log"; -} +} diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/MouseMenuView.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/MouseMenuView.java index 8c6e348c722..aef6a6104bf 100644 --- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/MouseMenuView.java +++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/MouseMenuView.java @@ -16,6 +16,10 @@ * Reserved. */ +/* +* Popup (floating) menu support +*/ + // By Jennifer Lateiner @@ -45,7 +49,7 @@ import netscape.application.*; * * Also note: getTitle on a menu displayed by MouseMenuView * will have 4 leading spaces. - * + * *
* History:
* 07/30/97: Created by Jenni
@@ -75,7 +79,7 @@ public class MouseMenuView extends MenuView {
}
/** Constructs a MouseMenuView with bounds (x, y, width,
- * height).
+ * height).
*/
public MouseMenuView(int x, int y, int width, int height) {
this(x, y, width, height, null, null);
@@ -109,7 +113,7 @@ public class MouseMenuView extends MenuView {
* we can track it.
*/
protected InternalWindow createMenuWindow() {
-
+
_window = new InternalWindow(0, 0, 0, 0);
_window.setType(InternalWindow.BLANK_TYPE);
_window.setLayer(InternalWindow.IGNORE_WINDOW_CLIPVIEW_LAYER+11);
@@ -160,7 +164,7 @@ public class MouseMenuView extends MenuView {
}
}
return;
- }
+ }
super.mouseUp(event);
} catch (java.lang.NullPointerException e) {
@@ -185,7 +189,7 @@ public class MouseMenuView extends MenuView {
}
- /** Displays the menu in its own InternalWindow
+ /** Displays the menu in its own InternalWindow
*/
public void show(RootView rootView, MouseEvent event) {
boolean canRightFlip=true;
@@ -220,12 +224,12 @@ public class MouseMenuView extends MenuView {
}
- sizeToMinSize();
+ sizeToMinSize();
super.show(rootView, event);
/* Move the menu over and to the left a little from the
- * mouse event (which is the standard IFC
+ * mouse event (which is the standard IFC
if(owner() == null) {
_window.setBounds(_window.bounds.x-5, _window.bounds.y-5,
_window.bounds.width,
@@ -250,7 +254,7 @@ public class MouseMenuView extends MenuView {
_window.bounds.height);
canRightFlip = false;
-
+
}
}
@@ -269,7 +273,7 @@ public class MouseMenuView extends MenuView {
_window.bounds.height);
}
}
-
+
if(_window.bounds.y + _window.bounds.height >
rootView.bounds.height) {
_window.setBounds(_window.bounds.x,
diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/PageListView.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/PageListView.java
index 222f8c27a67..0d128f706da 100644
--- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/PageListView.java
+++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/PageListView.java
@@ -16,6 +16,10 @@
* Reserved.
*/
+/*
+* 'View' of list of sources
+*/
+
// when who what
// 06/27/97 jband added this header to my code
//
@@ -30,7 +34,7 @@ import com.netscape.jsdebugging.ifcui.palomar.util.*;
import com.netscape.jsdebugging.ifcui.palomar.widget.layout.*;
import com.netscape.jsdebugging.api.*;
-public class PageListView
+public class PageListView
extends InternalWindow
implements Observer, Target
{
@@ -80,8 +84,8 @@ public class PageListView
sg.setAutoResizeSubviews(true);
sg.contentView().setLayoutManager( new MarginLayout() );
sg.setBackgroundColor(_emperor.getBackgroundColor());
-
- setCloseable( false );
+
+ setCloseable( false );
setResizable( false );
setTitle( "Open" );
addSubview(sg);
@@ -104,8 +108,8 @@ public class PageListView
_refresh();
- layoutView(1,1);
- layoutView(-1,-1);
+ layoutView(1,1);
+ layoutView(-1,-1);
// show();
}
@@ -129,7 +133,7 @@ public class PageListView
{
// XXX update list on stop
}
-
+
}
// implement target interface
@@ -153,7 +157,7 @@ public class PageListView
boolean sort = _emperor.getHostMode() != Emperor.LOCAL;
_listview.removeAllItems();
-
+
SourceTextItem[] array = _sourceTyrant.getSourceTextItemArray();
Font linefont = Font.defaultFont();
@@ -183,7 +187,7 @@ public class PageListView
{
SourceTextItem src = array[i];
ListItem item = new ListItem();
-
+
String text = src.getURL();
maxlinelen = Math.max( maxlinelen, text.length() );
item.setTitle( text );
@@ -222,7 +226,7 @@ public class PageListView
_listview.setBounds( 0, 0, (maxlinelen+1) * fm.charWidth('X'),0 );
_listview.sizeToMinSize();
- layoutView(0,0);
+ layoutView(0,0);
_listview.draw();
}
@@ -240,7 +244,7 @@ public class PageListView
private static final String CLOSE_CMD = "CLOSE_CMD";
private static final String OPEN_CMD = "OPEN_CMD";
-}
+}
+
-
diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/PrefsSupport.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/PrefsSupport.java
index 48c333e504f..184a1669423 100644
--- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/PrefsSupport.java
+++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/PrefsSupport.java
@@ -16,6 +16,10 @@
* Reserved.
*/
+/*
+* Interface to support persistence
+*/
+
// when who what
// 08/01/97 jband created this file
//
@@ -30,4 +34,4 @@ public interface PrefsSupport
{
public void prefsWrite(Archiver archiver) throws CodingException;
public void prefsRead(Unarchiver unarchiver) throws CodingException;
-}
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/README b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/README
index c134505e66b..16fbd97d713 100644
--- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/README
+++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/README
@@ -9,3 +9,5 @@ from:
This code can be used to run in Navigator or with the standalone JS engines.
+This can be built on Windows and packaged in various ways using the build system
+in js/jsdj/build.
\ No newline at end of file
diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SmartItemListView.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SmartItemListView.java
index df67e803cad..1ee9cedb5a7 100644
--- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SmartItemListView.java
+++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SmartItemListView.java
@@ -16,6 +16,10 @@
* Reserved.
*/
+/*
+* ListView that supports letting ListItems handle their own events
+*/
+
// when who what
// 10/31/97 jband added this file
//
@@ -72,6 +76,6 @@ public class SmartItemListView extends BackgroundHackListView
{
return (SmartListItem) itemForPoint(me.x, me.y);
}
-}
+}
diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SmartListItem.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SmartListItem.java
index 4aa65f78298..2aa5544f739 100644
--- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SmartListItem.java
+++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SmartListItem.java
@@ -16,6 +16,10 @@
* Reserved.
*/
+/*
+* ListItems that can handle their own events
+*/
+
// when who what
// 10/31/97 jband added this file
//
@@ -58,7 +62,7 @@ public class SmartListItem extends ListItem
if(AS.S)ER.T(lv!=null,"ListItem with no parent called myRect()",this);
return lv.rectForItem(this);
}
-
-}
+
+}
diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceLineItemModel.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceLineItemModel.java
index 2037394e5f8..3f3ed307ff3 100644
--- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceLineItemModel.java
+++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceLineItemModel.java
@@ -16,6 +16,10 @@
* Reserved.
*/
+/*
+* 'Model' to hold info on one line of text in source viewer
+*/
+
// when who what
// 06/27/97 jband added this header to my code
//
@@ -37,5 +41,5 @@ class SourceLineItemModel
public Breakpoint bp;
public boolean executing; // is this line currently executing?
public String adjustmentChar;
-}
+}
diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceTyrant.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceTyrant.java
index a1f7e142b6f..732a4250ff4 100644
--- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceTyrant.java
+++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceTyrant.java
@@ -16,6 +16,10 @@
* Reserved.
*/
+/*
+* 'Model' to manage sources
+*/
+
// when who what
// 06/27/97 jband added this header to my code
//
@@ -32,7 +36,7 @@ import netscape.security.ForbiddenTargetException;
import com.netscape.jsdebugging.api.*;
public class SourceTyrant
- extends Observable
+ extends Observable
implements Observer
{
public SourceTyrant(Emperor emperor) throws ForbiddenTargetException
@@ -88,13 +92,13 @@ public class SourceTyrant
return sti;
}
- public SourceTextItem[] getSourceTextItemArray()
+ public SourceTextItem[] getSourceTextItemArray()
{
PrivilegeManager.enablePrivilege("Debugger");
return _sourceTextProvider.getItems();
}
public SourceTextItem getSelectedSourceItem() {return _selectedSourceTextItem;}
- public void setSelectedSourceItem(SourceTextItem s)
+ public void setSelectedSourceItem(SourceTextItem s)
{
if( _selectedSourceTextItem == s )
return;
@@ -158,7 +162,7 @@ public class SourceTyrant
/* jband - 06/04/97 - new scheme for user souce line adjustment */
public synchronized void clearAllAdjustmentsForItem( SourceTextItem sti )
-
+
{
if( null == _adjustments )
return;
@@ -326,8 +330,8 @@ public class SourceTyrant
//////////////////////////////////////////////////////////////////
-
- // data...
+
+ // data...
private Emperor _emperor;
private ControlTyrant _controlTyrant;
@@ -339,7 +343,7 @@ public class SourceTyrant
private String _selectedText = null;
private Hashtable _adjustments = null;
-}
+}
class AdjustmentItem
{
@@ -351,4 +355,4 @@ class AdjustmentItem
public int line;
public int offset;
public int cummulative_offset;
-}
+}
diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceTyrantUpdate.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceTyrantUpdate.java
index 1db7a2331ce..e0b1967b83a 100644
--- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceTyrantUpdate.java
+++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceTyrantUpdate.java
@@ -16,6 +16,10 @@
* Reserved.
*/
+/*
+* Info sent with SourceTyrant update events
+*/
+
// when who what
// 06/27/97 jband added this header to my code
//
@@ -23,7 +27,7 @@
package com.netscape.jsdebugging.ifcui;
import com.netscape.jsdebugging.api.*;
-
+
class SourceTyrantUpdate
{
public static final int SELECT_CHANGED = 0;
@@ -38,6 +42,6 @@ class SourceTyrantUpdate
}
public int type;
public SourceTextItem item;
-}
+}
diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceView.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceView.java
index e33a22fb453..5efb4a1eaae 100644
--- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceView.java
+++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceView.java
@@ -16,6 +16,10 @@
* Reserved.
*/
+/*
+* 'View' for interactive viewing of source code
+*/
+
// when who what
// 06/27/97 jband added this header to my code
//
@@ -59,8 +63,8 @@ public class SourceView extends InternalWindow
if(AS.S)ER.T(null!=_sourceViewManager,"emperor init order problem", this);
if(AS.S)ER.T(null!=_stackTyrant,"emperor init order problem", this);
- _sourceLineVectorModel =
- new SourceLineVectorModel(this, _controlTyrant, _stackTyrant,
+ _sourceLineVectorModel =
+ new SourceLineVectorModel(this, _controlTyrant, _stackTyrant,
_sourceTyrant, item);
_listview = new SourceTextListView(this);
@@ -73,7 +77,7 @@ public class SourceView extends InternalWindow
sg.setAutoResizeSubviews(true);
sg.contentView().setLayoutManager( new MarginLayout() );
sg.setBackgroundColor(_emperor.getBackgroundColor());
-
+
setCloseable( true );
setResizable( true );
// setTitle( "Source for: " + item.getURL() );
@@ -93,8 +97,8 @@ public class SourceView extends InternalWindow
_refresh(true);
- layoutView(1,1);
- layoutView(-1,-1);
+ layoutView(1,1);
+ layoutView(-1,-1);
show();
}
@@ -163,7 +167,7 @@ public class SourceView extends InternalWindow
_refresh(false);
updateMarks();
}
-
+
}
public void forceRefresh()
@@ -202,7 +206,7 @@ public class SourceView extends InternalWindow
{
_emperor.setWaitCursor(true);
-// System.out.println(" _refreshing: " + _item.getURL() +
+// System.out.println(" _refreshing: " + _item.getURL() +
// " _item.getDirty() returned: " +
// (_item.getDirty() ? "true" : "false") +
// "_item.getAlterCount() returned: " +
@@ -221,7 +225,7 @@ public class SourceView extends InternalWindow
boolean showNumbers = _sourceViewManager.getShowLineNumbers();
SourceTextItemDrawer drawer = new SourceTextItemDrawer();
-
+
_listview.setItemDrawer(drawer);
int maxwidth = 0;
@@ -238,7 +242,7 @@ public class SourceView extends InternalWindow
newlistitem.setSelectedColor(_emperor.getSelectionColor());
_listview.addItem( newlistitem );
-
+
if( 0 == i )
{
itemHeight = _listview.rectForItem(newlistitem).height;
@@ -246,11 +250,11 @@ public class SourceView extends InternalWindow
}
maxwidth = Math.max( maxwidth, newlistitem.minWidth() );
}
-
+
_listview.setBounds(0,0,maxwidth,0);
_listview.sizeToMinSize();
- layoutView(0,0);
+ layoutView(0,0);
_listview.draw();
_item.setDirty(false);
@@ -294,8 +298,8 @@ public class SourceView extends InternalWindow
private String _selectedText = null;
private int _selectedLineNumber = 0;
-
-}
+
+}
/***************************************************************************/
@@ -308,7 +312,7 @@ final class SourceTextListView extends SmartItemListView
}
- public boolean mouseDown(MouseEvent me)
+ public boolean mouseDown(MouseEvent me)
{
_dragOrigin = -1;
@@ -422,8 +426,8 @@ final class SourceTextListView extends SmartItemListView
// calc marks rect for item and call draw()
Rect rItem = rectForItemAt(i);
Rect r = new Rect( rItem.x,
- rItem.y,
- _drawer.marksRect().width,
+ rItem.y,
+ _drawer.marksRect().width,
rItem.height );
// System.out.println( "draw marks rect for single item: " + r );
draw(r);
@@ -459,16 +463,16 @@ final class SourceTextListView extends SmartItemListView
private int _dragOrigin = -1;
private int _dragLast;
private int _dragAdjLineOrigin;
-
-}
+
+}
/***************************************************************************/
final class SourceTextItemDrawer
{
public SourceTextItemDrawer() {}
-
- public void init( Font font, boolean showLineNumbers,
+
+ public void init( Font font, boolean showLineNumbers,
int lineCount, int itemHeight )
{
_font = font;
@@ -479,7 +483,7 @@ final class SourceTextItemDrawer
_height = itemHeight;
_charWidth = font.fontMetrics().charWidth('0');
- _rectBP = new Rect( 0, 0,
+ _rectBP = new Rect( 0, 0,
_height, _height);
Rect rectExec = new Rect( _rectBP.x + _rectBP.width, 0,
_height/2, _height);
@@ -514,8 +518,8 @@ final class SourceTextItemDrawer
_ptText = new Point( _width, 0 );
}
- public void draw( Graphics g,
- Rect boundsRect,
+ public void draw( Graphics g,
+ Rect boundsRect,
SourceTextListItem item,
int lineNumber,
boolean hasBreakpoint,
@@ -539,7 +543,7 @@ final class SourceTextItemDrawer
boundsRect.height - _ptText.y );
if( r.intersects( g.clipRect() ) )
- item.drawStringInRect(g,text,_font,r,Graphics.LEFT_JUSTIFIED);
+ item.drawStringInRect(g,text,_font,r,Graphics.LEFT_JUSTIFIED);
}
if( hasBreakpoint )
@@ -553,7 +557,7 @@ final class SourceTextItemDrawer
{
if( hasConditionalBreakpoint )
g.setColor( Color.orange );
- else
+ else
g.setColor( Color.red );
g.fillOval( r );
}
@@ -606,7 +610,7 @@ final class SourceTextItemDrawer
g.setColor( Color.blue );
g.fillPolygon( x,y,count);
-
+
}
if( _showLineNumbers )
{
@@ -663,8 +667,8 @@ final class SourceTextItemDrawer
private boolean _showLineNumbers;
private int _charWidth;
-
-}
+
+}
final class SourceTextListItem extends SmartListItem
{
@@ -675,7 +679,7 @@ final class SourceTextListItem extends SmartListItem
_charCount = charCount;
}
- public boolean mouseDown(MouseEvent me)
+ public boolean mouseDown(MouseEvent me)
{
/*
System.out.println(".......................");
@@ -791,7 +795,7 @@ final class SourceTextListItem extends SmartListItem
_dragOrigin = start;
v.setSelRange(start, end);
-
+
if( null != oldItem )
v.drawItemAt( v.indexOfItem(oldItem) );
v.draw( rectOfRangeInRect(start, end, rectText) );
@@ -928,7 +932,7 @@ final class SourceTextListItem extends SmartListItem
drawBackground(g, boundsRect);
SourceLineItemModel model = (SourceLineItemModel) data();
- _drawer.draw( g, boundsRect, this,
+ _drawer.draw( g, boundsRect, this,
model.lineNumber,
model.bp != null,
model.bp != null?model.bp.getBreakCondition()!=null:false,
@@ -980,13 +984,13 @@ final class SourceTextListItem extends SmartListItem
private int _dragOrigin = -1;
private int _charCount;
private SourceTextItemDrawer _drawer;
-}
+}
/***************************************************************************/
final class SourceLineVectorModel
{
- public SourceLineVectorModel( SourceView sourceView,
+ public SourceLineVectorModel( SourceView sourceView,
ControlTyrant controlTyrant,
StackTyrant stackTyrant,
SourceTyrant sourceTyrant,
@@ -1013,16 +1017,16 @@ final class SourceLineVectorModel
String linetext;
int lineNumber = 1;
while( null != (linetext = s.readLine()) )
- {
+ {
SourceLineItemModel item = new SourceLineItemModel();
-
+
item.lineNumber = lineNumber;
item.text = Util.expandTabs(linetext,8);
item.type = SourceLineItemModel.NO_SCRIPT;
item.bp = null; // XXX
item.executing = false;
item.adjustmentChar = null;
-
+
vec.addElement( item );
lineNumber++ ;
}
@@ -1030,11 +1034,11 @@ final class SourceLineVectorModel
}
}
catch( Exception e ) {}
-
+
_sourceLineItemVector = vec;
updateLineItemVector();
}
-
+
public synchronized void updateLineItemVector()
{
/*
@@ -1043,11 +1047,11 @@ final class SourceLineVectorModel
if( null == sp )
return;
*/
-
+
int i;
int count;
-
- // clear all line
+
+ // clear all line
int maxLineItemIndex = _sourceLineItemVector.size() - 1;
@@ -1056,14 +1060,14 @@ final class SourceLineVectorModel
return;
for( i = 0; i < count; i++ )
{
- SourceLineItemModel item =
+ SourceLineItemModel item =
(SourceLineItemModel) _sourceLineItemVector.elementAt(i);
item.type = SourceLineItemModel.NO_SCRIPT;
item.bp = null;
item.executing = false;
item.adjustmentChar = null;
}
-
+
// walk through the scripts and mark lines with scripts
String url = _sourceTextItem.getURL();
@@ -1085,7 +1089,7 @@ final class SourceLineVectorModel
{
int base = sections[n].getBaseLineNumber();
int extent = sections[n].getLineExtent();
-
+
for( int k = base; k < (base+extent); k++ )
{
if( k > maxLineItemIndex+1 )
@@ -1093,11 +1097,11 @@ final class SourceLineVectorModel
int j = _sourceTyrant.systemLine2UserLine(_sourceTextItem,k);
if( j > maxLineItemIndex+1 )
continue;
- SourceLineItemModel item =
+ SourceLineItemModel item =
(SourceLineItemModel) _sourceLineItemVector.elementAt(j-1);
-
+
// don't overwrite function with top level script
-
+
if( fun )
item.type = SourceLineItemModel.FUNCTION_BODY;
else if( item.type != SourceLineItemModel.FUNCTION_BODY )
@@ -1119,7 +1123,7 @@ final class SourceLineVectorModel
if( line > maxLineItemIndex+1 )
continue;
- SourceLineItemModel item = (SourceLineItemModel)
+ SourceLineItemModel item = (SourceLineItemModel)
_sourceLineItemVector.elementAt(line-1);
item.bp = bp;
}
@@ -1139,7 +1143,7 @@ final class SourceLineVectorModel
if( index < 1 )
index = 1;
- SourceLineItemModel item = (SourceLineItemModel)
+ SourceLineItemModel item = (SourceLineItemModel)
_sourceLineItemVector.elementAt(index-1);
item.executing = true;
}
@@ -1161,7 +1165,7 @@ final class SourceLineVectorModel
}
else
adjChar = "+";
- SourceLineItemModel item = (SourceLineItemModel)
+ SourceLineItemModel item = (SourceLineItemModel)
_sourceLineItemVector.elementAt(line-1);
item.adjustmentChar = adjChar;
}
@@ -1171,25 +1175,25 @@ final class SourceLineVectorModel
// This is out of date. If anyone wants to reserect it then they
// had better update this to do the right things!
-/*
+/*
public synchronized void updateSingleLineItem( int lineNumber )
{
BreakpointTyrant bpt = _sourceView.getBreakpointTyrant();
- Breakpoint bp = bpt.findBreakpoint(
+ Breakpoint bp = bpt.findBreakpoint(
new Location(_sourceTextItem.getURL(),lineNumber));
int maxLineItemIndex = _sourceLineItemVector.size() - 1;
if( lineNumber > maxLineItemIndex+1 )
lineNumber = maxLineItemIndex+1;
- SourceLineItemModel item = (SourceLineItemModel)
+ SourceLineItemModel item = (SourceLineItemModel)
_sourceLineItemVector.elementAt(lineNumber-1);
item.bp = bp;
}
-*/
-
+*/
+
public Vector getLineItemVector() {return _sourceLineItemVector;}
- public SourceTextItem getSourceTextItem() {return _sourceTextItem;}
+ public SourceTextItem getSourceTextItem() {return _sourceTextItem;}
private SourceView _sourceView;
private SourceTyrant _sourceTyrant;
@@ -1197,7 +1201,7 @@ final class SourceLineVectorModel
private StackTyrant _stackTyrant;
private SourceTextItem _sourceTextItem; // has url, text, and fullness status
private Vector _sourceLineItemVector;
-}
+}
diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceViewManager.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceViewManager.java
index 0aebceaa57e..b76b8f7ee0b 100644
--- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceViewManager.java
+++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceViewManager.java
@@ -16,6 +16,10 @@
* Reserved.
*/
+/*
+* 'Model' to manage all the source views
+*/
+
// when who what
// 06/27/97 jband added this header to my code
//
@@ -88,7 +92,7 @@ public class SourceViewManager
if(null == loc )
return;
- SourceTextItem sti =
+ SourceTextItem sti =
_sourceTyrant.findSourceItem( loc.getURL() );
if(AS.S)ER.T(null!=sti,"could not find SourceTextItem for " + loc.getURL(),this);
if(null == sti)
@@ -202,7 +206,7 @@ public class SourceViewManager
}
public void selectionInSourceViewChanged( SourceView sv, String s, int lineno)
- {
+ {
if( _mainSourceView != sv )
return;
@@ -258,14 +262,14 @@ public class SourceViewManager
"com.netscape.jsdebugging.ifcui.SourceViewSaver" );
if( -1 != id )
{
- SourceViewSaver svs = (SourceViewSaver)
+ SourceViewSaver svs = (SourceViewSaver)
unarchiver.unarchiveIdentifier(id);
svs.sendToManager(this);
}
}
- // data...
-
+ // data...
+
private Emperor _emperor;
private ControlTyrant _controlTyrant;
private SourceTyrant _sourceTyrant;
@@ -280,7 +284,7 @@ public class SourceViewManager
private String _selectedTextInMainSourceView = null;
private static final String UPDATE_MARKS = "UPDATE_MARKS";
-}
+}
+
-
diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceViewSaver.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceViewSaver.java
index 75ed9db3c4b..fad0a67f2f2 100644
--- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceViewSaver.java
+++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/SourceViewSaver.java
@@ -16,6 +16,10 @@
* Reserved.
*/
+/*
+* Persistence support for source viewer options
+*/
+
// when who what
// 08/01/97 jband created this file
//
diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/StackTyrant.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/StackTyrant.java
index ab7dcf8a5a2..6cb6c229f29 100644
--- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/StackTyrant.java
+++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/StackTyrant.java
@@ -16,6 +16,10 @@
* Reserved.
*/
+/*
+* 'Model' of stack information of stopped thread
+*/
+
// when who what
// 06/27/97 jband added this header to my code
//
@@ -30,7 +34,7 @@ import com.netscape.jsdebugging.ifcui.palomar.util.*;
import com.netscape.jsdebugging.api.*;
public class StackTyrant
- extends Observable
+ extends Observable
implements Observer
{
public StackTyrant(Emperor emperor)
@@ -148,15 +152,15 @@ public class StackTyrant
notifyObservers(new StackTyrantUpdate(StackTyrantUpdate.ARRAY_CHANGED,_currentFrameIndex));
}
-
- // data...
-
+
+ // data...
+
private Emperor _emperor;
private ControlTyrant _controlTyrant;
private int _currentFrameIndex;
private StackFrameInfo[] _frameArray;
-}
+}
class StackTyrantUpdate
{
@@ -170,6 +174,6 @@ class StackTyrantUpdate
}
public int type;
public int sel;
-}
+}
+
-
diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/StackView.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/StackView.java
index 610eedbfd88..de7ffce0bd4 100644
--- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/StackView.java
+++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/StackView.java
@@ -16,6 +16,10 @@
* Reserved.
*/
+/*
+* 'View' for interactive viewing of call stack
+*/
+
// when who what
// 06/27/97 jband added this header to my code
//
@@ -60,7 +64,7 @@ public class StackView extends InternalWindow
sg.setAutoResizeSubviews(true);
sg.contentView().setLayoutManager( new MarginLayout() );
sg.setBackgroundColor(_emperor.getBackgroundColor());
-
+
setCloseable( false );
setResizable( true );
setTitle( "Call Stack" );
@@ -82,8 +86,8 @@ public class StackView extends InternalWindow
_refresh();
- layoutView(1,1);
- layoutView(-1,-1);
+ layoutView(1,1);
+ layoutView(-1,-1);
// show();
@@ -92,13 +96,13 @@ public class StackView extends InternalWindow
private synchronized void _refresh()
{
// refill all
-
+
_listview.removeAllItems();
if( ControlTyrant.STOPPED != _controlTyrant.getState() )
{
_listview.draw();
- return;
+ return;
}
StackFrameInfo[] array = _stackTyrant.getFrameArray();
@@ -113,7 +117,7 @@ public class StackView extends InternalWindow
ListItem newlistitem = new StackViewListItem(drawer);
StackFrameInfo frame = array[i];
-
+
String text;
if( frame instanceof JSStackFrameInfo )
@@ -161,12 +165,12 @@ public class StackView extends InternalWindow
newlistitem.setData( null );
maxwidth = Math.max( maxwidth, newlistitem.minWidth() );
- _listview.addItem( newlistitem );
+ _listview.addItem( newlistitem );
}
_listview.selectItemAt( _stackTyrant.getCurrentFrameIndex() );
_listview.setBounds(0,0,maxwidth,0);
_listview.sizeToMinSize();
- layoutView(0,0);
+ layoutView(0,0);
}
_listview.draw();
}
@@ -203,9 +207,9 @@ public class StackView extends InternalWindow
private ListView _listview;
-
+
}
-
+
class StackViewListItem extends ListItem
{
public StackViewListItem(StackViewItemDrawer drawer)
@@ -232,8 +236,8 @@ class StackViewListItem extends ListItem
private StackViewItemDrawer _drawer;
-
-}
+
+}
class StackViewItemDrawer
{
@@ -261,8 +265,8 @@ class StackViewItemDrawer
_ptText = new Point( _width, 0 );
}
- public void draw( Graphics g,
- Rect boundsRect,
+ public void draw( Graphics g,
+ Rect boundsRect,
StackViewListItem item,
boolean isExecPoint )
{
@@ -280,7 +284,7 @@ class StackViewItemDrawer
boundsRect.width - _ptText.x,
boundsRect.height - _ptText.y );
- item.drawStringInRect(g,text,_font,r,Graphics.LEFT_JUSTIFIED);
+ item.drawStringInRect(g,text,_font,r,Graphics.LEFT_JUSTIFIED);
}
if( isExecPoint )
{
@@ -306,4 +310,4 @@ class StackViewItemDrawer
private int _height;
private Polygon _polyExecPoint;
private Point _ptText;
-}
+}
diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/StatusWindow.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/StatusWindow.java
index 5836d31fd8d..3286bdd8936 100644
--- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/StatusWindow.java
+++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/StatusWindow.java
@@ -16,6 +16,10 @@
* Reserved.
*/
+/*
+* Window used to give startup status to users (lest they think we're dead)
+*/
+
// when who what
// 11/10/97 jband added this file
//
@@ -37,16 +41,16 @@ class StatusWindow
public StatusWindow()
{
super();
-
+
setBorder(LineBorder.blackLine());
setCloseable( false );
setResizable( false );
-
+
int contentDX = _labelDX + _spacerDX * 2;
int contentDY = _labelDY + _spacerDY * 2;
int labelY = _spacerDY;
int labelX = _spacerDX;
-
+
Size size = windowSizeForContentSize(contentDX, contentDY);
setBounds(0,0,size.width,size.height);
@@ -73,8 +77,8 @@ class StatusWindow
label.setBorder(null);
return label;
}
-
+
private TextField _label;
-}
+}
diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/StepHandler.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/StepHandler.java
index 6e0c61f30d1..583728e40ef 100644
--- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/StepHandler.java
+++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/StepHandler.java
@@ -16,6 +16,10 @@
* Reserved.
*/
+/*
+* Interface to handle client-side stepping
+*/
+
// when who what
// 06/27/97 jband added this header to my code
//
@@ -30,8 +34,8 @@ interface StepHandler
public static final int CONTINUE_SEND_INTERRUPT = 1;
public static final int CONTINUE_DONE = 2;
- public int step( JSThreadState threadState,
- JSPC pc,
+ public int step( JSThreadState threadState,
+ JSPC pc,
JSSourceLocation sourceLocation,
Hook hook );
-}
+}
diff --git a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/StepInto.java b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/StepInto.java
index 6969801c8e1..d7aa6a54c38 100644
--- a/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/StepInto.java
+++ b/mozilla/js/jsdj/classes/com/netscape/jsdebugging/ifcui/StepInto.java
@@ -16,6 +16,10 @@
* Reserved.
*/
+/*
+* Handle stepping into funtions
+*/
+
// when who what
// 06/27/97 jband added this header to my code
//
@@ -34,8 +38,8 @@ class StepInto implements StepHandler
}
// implement StepHandler
- public int step( JSThreadState threadState,
- JSPC pc,
+ public int step( JSThreadState threadState,
+ JSPC pc,
JSSourceLocation sourceLocation,
Hook hook )
{
@@ -44,7 +48,7 @@ class StepInto implements StepHandler
return STOP;
//
- // NOTE: This little dance is necessary because line numbers for PCs
+ // NOTE: This little dance is necessary because line numbers for PCs
// are not always acending. e,g, in:
//
// for(i=0;i