Understanding Options

49 views
Skip to first unread message

Diego FG

unread,
Mar 13, 2014, 11:49:37 AM3/13/14
to js...@googlegroups.com
Hi!
 
I am a newbie with plugins. Where can I find a simple example to to understand Plugin Options, showing all the classes involved?
 
I am trying to develop a framework for prioritization tasks. Each prioritization algorithm must be a plugin, so the user could choose between different algorithms available. I have developed another application that will make use of the prioritization framework. There is a Graphical User Interface, and the idea is to set a ComboBox with all the implemented algorithms (when the app is started, the prioritization framework should provide a list of implemented algorithms -plugins- and the ComboBox will be updated according to that list). When the user clicks on a certain option of the ComboBox, the application will tell the prioritization framework which option has been selected, and the framework must use the right plugin accordingly.
 
I am thinking of the next strategy: using the name of the .jar files containing plugins (or the name of the class stored in the .jar file if possible) to update the ComboBox options in the GUI, and then send the selected option in the ComboBox to the framework to execute the algorithm implemented in the right plugin. So, I guess need to use Options like this:
 
PrioPlugin plugin = pm.getPlugin(PrioPlugin.class, new OptionName("Option_Selected_In_Combo_Box"));
 
Is it a good strategy?
How can I implement the OptionName class? 
Reply all
Reply to author
Forward
0 new messages