stopping server on internalCloseRunner (window closing etc)

This commit is contained in:
fjenett
2011-06-04 06:06:04 +00:00
parent fbbc1cddd2
commit 82335af6cd
2 changed files with 19 additions and 8 deletions

View File

@@ -440,9 +440,16 @@ public class JavaScriptEditor extends Editor
null);
}
/** JavaScript mode has no runner. This method is empty. */
public void internalCloseRunner () { }
/**
* Called when the window is going to be reused for another sketch.
*/
public void internalCloseRunner()
{
handleStopServer();
}
/** JavaScript mode does not run anything. This method is empty. */
public void deactivateRun () { }
public void deactivateRun ()
{
// not sure what to do here ..
}
}

View File

@@ -1,5 +1,8 @@
package processing.mode.javascript;
import java.awt.event.WindowEvent;
import java.awt.event.WindowAdapter;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
@@ -19,11 +22,14 @@ import processing.mode.java.JavaMode;
* replacement for the normal runner.
*/
public class JavaScriptMode extends Mode
{
{
private JavaScriptEditor jsEditor;
// create a new editor with the mode
public Editor createEditor( Base base, String path, int[] location )
{
return new JavaScriptEditor( base, path, location, this );
jsEditor = new JavaScriptEditor( base, path, location, this );
return jsEditor;
}
public JavaScriptMode( Base base, File folder )
@@ -77,8 +83,6 @@ public class JavaScriptMode extends Mode
// public Formatter createFormatter() { }
// public Editor createEditor(Base ibase, String path, int[] location) { }
// abstract public void internalCloseRunner();
// ------------------------------------------------