import javax.swing.text.AttributeSet;
import java.io.IOException;
import java.util.Iterator;
-import java.util.WeakHashMap;
+import java.util.HashMap;
import org.gjt.sp.jedit.jEdit;
import org.gjt.sp.jedit.ServiceManager;
import org.gjt.sp.util.Log;
public FactorShell()
{
super("Factor");
- consoles = new WeakHashMap();
+ consoles = new HashMap();
+ } //}}}
+
+ //{{{ closeConsole() method
+ /**
+ * Called when a Console dockable is closed.
+ * @since Console 4.0.2
+ */
+ public void closeConsole(Console console)
+ {
+ ConsoleState state = (ConsoleState)consoles.get(console);
+ if(state != null)
+ state.closeStream();
} //}}}
//{{{ printInfoMessage() method
} //}}}
//{{{ Private members
- private WeakHashMap consoles;
+ private HashMap consoles;
//{{{ getConsoleState() method
private ConsoleState getConsoleState(Console console)
console.print(console.getInfoColor(),
jEdit.getProperty("factor.shell.closing"));
stream.close();
- stream = null;
}
}
catch(IOException e)
/* We don't care */
Log.log(Log.ERROR,this,e);
}
+
+ stream = null;
}
void packetLoop(Output output) throws Exception
#! The game overrides this.
;
+: :s ( -- ) "error-datastack" get {.} ;
+: :r ( -- ) "error-callstack" get {.} ;
+: :n ( -- ) "error-namestack" get {.} ;
+: :c ( -- ) "error-catchstack" get {.} ;
+
: default-error-handler ( error -- )
#! Print the error and return to the top level.
[
in-parser? [ parse-dump ] [ standard-dump ] ifte
- ":s :r :n :c show stacks at time of error." print
+ [ :s :r :n :c ] [ prettyprint-word " " write ] each
+ "show stacks at time of error." print
java? [ ":j shows Java stack trace." print ] when
error-handler-hook
] when* ;
-
-: :s ( -- ) "error-datastack" get {.} ;
-: :r ( -- ) "error-callstack" get {.} ;
-: :n ( -- ) "error-namestack" get {.} ;
-: :c ( -- ) "error-catchstack" get {.} ;