Search in sources :

Example 1 with ActionParameter

use of com.biglybt.pif.ui.config.ActionParameter in project BiglyBT by BiglySoftware.

the class SimpleAPIPlugin method initStage.

@Override
protected void initStage(int num) {
    if (num == 1) {
        BasicPluginConfigModel config = getConfigModel();
        api_key = config.addStringParameter2("apikey", "plugin.simpleapi.apikey", "");
        if (api_key.getValue().isEmpty()) {
            api_key.setValue(createAPIKey());
        }
        ActionParameter change = config.addActionParameter2("plugin.simpleapi.apikey.new", "pairing.srp.setpw.doit");
        change.addListener((n) -> {
            api_key.setValue(createAPIKey());
            updateTestParam();
        });
        test_param = config.addHyperlinkParameter2("plugin.simpleapi.test", "");
    } else if (num == 2) {
        updateTestParam();
    }
}
Also used : ActionParameter(com.biglybt.pif.ui.config.ActionParameter) BasicPluginConfigModel(com.biglybt.pif.ui.model.BasicPluginConfigModel)

Aggregations

ActionParameter (com.biglybt.pif.ui.config.ActionParameter)1 BasicPluginConfigModel (com.biglybt.pif.ui.model.BasicPluginConfigModel)1