|
a/tool/src/script/Plugin.java |
|
b/tool/src/script/Plugin.java |
|
... |
|
... |
50 |
public Plugin(){
|
50 |
public Plugin(){
|
51 |
settingsFile = new File(thisFolder, settingsFileName);
|
51 |
settingsFile = new File(thisFolder, settingsFileName);
|
52 |
settings = new Settings(settingsFile, "Settings for this folder");
|
52 |
settings = new Settings(settingsFile, "Settings for this folder");
|
53 |
}
|
53 |
}
|
54 |
|
54 |
|
|
|
55 |
public TreeNodeSPDX
|
|
|
56 |
thisNode = null; // our pointer for the treeview node (if used)
|
|
|
57 |
|
55 |
|
58 |
|
56 |
public void startup(){
|
59 |
public void startup(){
|
57 |
}
|
60 |
}
|
58 |
|
61 |
|
59 |
public void main(WebRequest request){
|
62 |
public void main(WebRequest request){
|
60 |
request.setAnswer("<h1>In construction</h1>"
|
63 |
request.setAnswer("<h1>In construction</h1>"
|
61 |
+ "There is nothing (yet) to be displayed on this page.");
|
64 |
+ "There is nothing (yet) to be displayed on this page.");
|
62 |
}
|
65 |
}
|
63 |
|
66 |
|
64 |
/**
|
67 |
/**
|
65 |
* Adds a tree node on the default User Interface when desired by the
|
68 |
* Adds a tree node on the default User Interface when desired by the
|
66 |
* plugin
|
69 |
* plugin
|
67 |
* @param title Title for the tree node that is shown to user
|
70 |
* @param title Title for the tree node that is shown to user
|
68 |
* @param iconName Icon from our archive that is used for the node
|
71 |
* @param iconName Icon from our archive that is used for the node
|
69 |
* @param methodName The method that is called when the node is clicked
|
72 |
* @param methodName The method that is called when the node is clicked
|
70 |
*/
|
73 |
*/
|
71 |
protected void addTreeNode(String title, String iconName,
|
74 |
protected void addTreeNode(String title, String iconName,
|
72 |
String methodName){
|
75 |
String methodName){
|
73 |
// get the saved node on our temporary storage
|
76 |
// get the saved node on our temporary storage
|
74 |
TreeNodeSPDX nodeRoot = (TreeNodeSPDX) core.temp.get("nodeTree");
|
77 |
TreeNodeSPDX nodeRoot = (TreeNodeSPDX) core.temp.get("nodeTree");
|
75 |
// add it up to our tree
|
78 |
// add it up to our tree
|
76 |
TreeNodeSPDX node = swingUtils.addNode(title, iconName, nodeRoot);
|
79 |
thisNode = swingUtils.addNode(title, iconName, nodeRoot);
|
77 |
// set the associated script that we want to run
|
80 |
// set the associated script that we want to run
|
78 |
node.scriptFile = thisFile;
|
81 |
thisNode.scriptFile = thisFile;
|
79 |
node.scriptFolder = thisFolder;
|
82 |
thisNode.scriptFolder = thisFolder;
|
80 |
node.scriptMethod = methodName;
|
83 |
thisNode.scriptMethod = methodName;
|
81 |
|
84 |
|
82 |
// all done
|
85 |
// all done
|
83 |
log.write(is.COMPLETED, "Added tool: %1", title);
|
86 |
log.write(is.COMPLETED, "Added tool: %1", title);
|
84 |
}
|
87 |
}
|
85 |
|
88 |
|
|
|
89 |
|
|
|
90 |
/**
|
|
|
91 |
* Adds a child node on the default User Interface when desired by the
|
|
|
92 |
* plugin
|
|
|
93 |
* @param title Title for the tree node that is shown to user
|
|
|
94 |
* @param iconName Icon from our archive that is used for the node
|
|
|
95 |
* @param methodName The method that is called when the node is clicked
|
|
|
96 |
*/
|
|
|
97 |
protected void addChildNode(String title, String iconName,
|
|
|
98 |
String methodName){
|
|
|
99 |
// we need that a root node exists
|
|
|
100 |
if(thisNode == null){
|
|
|
101 |
return;
|
|
|
102 |
}
|
|
|
103 |
|
|
|
104 |
// add it up
|
|
|
105 |
TreeNodeSPDX node = swingUtils.addNode(title, iconName, thisNode);
|
|
|
106 |
// set the associated script that we want to run
|
|
|
107 |
node.scriptFile = thisFile;
|
|
|
108 |
node.scriptFolder = thisFolder;
|
|
|
109 |
node.scriptMethod = methodName;
|
|
|
110 |
}
|
86 |
|
111 |
|
87 |
/**
|
112 |
/**
|
88 |
* Loads a given template file from the local folder. This template file
|
113 |
* Loads a given template file from the local folder. This template file
|
89 |
* will automatically inherit the saved values from the local settings
|
114 |
* will automatically inherit the saved values from the local settings
|
90 |
* file.
|
115 |
* file.
|