Updated JavaScript Template

This commit is contained in:
Konloch 2022-02-13 13:47:35 -06:00
parent 74fb0f191c
commit 17ecc2b7e1
1 changed files with 21 additions and 10 deletions

View File

@ -3,34 +3,45 @@ var PluginConsole = Java.type("the.bytecode.club.bytecodeviewer.api.PluginConsol
var gui; var gui;
/** /**
* Main function ** [plugin description goes here]
**
** @author [your name goes here]
**/
/**
* execute function - this gets executed when the plugin is ran
*/ */
function execute(classNodeList) function execute(classNodeList)
{ {
//create & show the console
gui = new PluginConsole("Javascript Template"); gui = new PluginConsole("Javascript Template");
gui.setVisible(true); //show the console gui.setVisible(true);
out("Class Nodes: " + classNodeList.size());
//print to the console
print("Class Nodes: " + classNodeList.size());
//iterate through each class node //iterate through each class node
for (index = 0; index < classNodeList.length; index++) for (index = 0; index < classNodeList.length; index++)
process(classNodeList[index]); processClassNode(classNodeList[index]);
BCV.hideFrame(gui, 10000); //hides the console after 10 seconds //hide the console after 10 seconds
BCV.hideFrame(gui, 10000);
} }
/** /**
* Process each class node * process each class node
*/ */
function process(cn) function processClassNode(cn)
{ {
out("Node: " + cn.name + ".class"); print("Node: " + cn.name + ".class");
//TODO developer plugin code goes here //TODO developer plugin code goes here
} }
/** /**
* Print to console * print to console
*/ */
function out(text) function print(text)
{ {
gui.appendText(text); gui.appendText(text);
} }