Download this file

Web.java    65 lines (49 with data), 0 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* Makes possible the web user interface. Allows users to control the program
* using a web browser.
*/
package webserver;
import definitions.Messages;
import main.core;
import org.simpleframework.transport.connect.Connection;
import org.simpleframework.util.thread.Scheduler;
import script.Plugin;
import script.log;
import www.WebRequest;
import www.WebServer;
/**
*
* @author Nuno Brito, 9th of January 2013 in Darmstadt, Germany.
*/
public class Web extends Plugin{
// title for this plugin
private final String id = "Web Interface";
Scheduler queue;
Connection connection;
public String webOutput = "";
@Override
public void startup(){
// add our node to the tree right after the "Tools" node is added
log.hooks.addAction(Messages.AddingTools, thisFile, "addNode");
startServer();
}
/**
* Add our toolbox node to the treeview.
*/
public void addNode(){
addTreeNode(id, "network-clouds.png", "showServerStatus");
}
/**
* Displays the menu for creating new SPDX documents
* @param request the request for this method
*/
public void showServerStatus(WebRequest request){
request.setPage("serverSettings.html");
}
/** Start our instance */
public void startServer(){
WebServer server = new WebServer();
server.startServer();
core.temp.put("server", server);
}
}