I am currently working on an application that receives commands from other devices. I will give an interface that allows others to develop their own interpretation (plugin) of incoming commands. Each of the plugins developed by others can have any user settings that should be provided by users.
For example, a plugin called "KeyboardPlugin" may support settings for setting the delay between keystrokes, and also display a list of all supported keys for pressing. Another plugin can be called, for example, "MouseMovePlugin", where the user can select the accuracy of the mouse and its speed.
Now my problem is that the settings for each plugin should be 1. shown in the user interface, 2. after the settings have been selected by the user, they should be analyzed back to the plugin so that the plugin knows what the user has selected.
I work with Java and the user interface is developed in Swing. There is a parameter panel that shows parameters that are not directly related to the plugin, as general parameters. But in the same panel I want to show the settings provided by the plugin.
Plugin settings are as follows:
- a) "Enter the delay between two keystrokes β [Text field with Int as input] (from min. 1, max. 500).
- b) "bla bla β [Checkbox] (with boolean)"
- c) "Bla bla 2 β [Textbox] (with String values ββas input; refers to setting b!)
- d) " , " [ "a", "b", "c" ]
, , , int, boolean, string, d, .
, ? , , , c b.
1) , , , , , ? , List , .
2) " ". , ?
, , :
(DSL), :
varName: type (min, max, default) "UI question"
:
buttonDelay: boolean(false) "Enable button delay"
if(buttonDelay){
buttonDelayTime: int(1,500,25) "Choose delay between buttons"
}
DSL Java, , .
, ( , / ), , Map, - varName ( : "buttonDelay" "buttonDelaytime" ). , , , , Integer, , ..
, varName, :
public void initPluginSettings(Map<String,SettingsInterface> settingsMap){
BooleanSetting buttonDelay = settingsMap.get("buttonDelay");
IntegerSetting buttonDelayTime = settingsMap.get("buttonDelayTime");
}
- / ? ? , . DSL, .., " ". , , , .
!