Blog do projektu Open Source JavaHotel

wtorek, 15 listopada 2011

My next Eclipse plugin

I created my next simple Eclipse plugin in shape of application launcher. The source code is available here.
Introduction
Assume that we want to create a launcher for an external application. The behavior of this application can be customized by a list (tree) of features. Our purpose is to create an application launcher which contains tab allowing to select/enable/disable features available. We also expect current features selection to be persisted.
The output looks like:
























By virtue of the application launcher manager it is possible to create and use more than one feature set.
Additional information
This plugin does not contain any logic to define external application to run. The launch extension is empty. The purpose is only to implement displaying and handling list of features.
Handling (displaying) tree of features is done by a separate package. This package can be reused outside configuration launcher context. It contains also 'Main' class to be launched as SWT application.
In the ILaunchConfigurationWorkingCopy interface only features value (true/false) are persisted, without tree structure. So in order to save and restore the content it is necessary to apply the same (here pre-order) tree traverse algorithm.
Future extension
  • The tree structure is hardcoded in the plugin. It could be nice to read the tree structure from external resource (e.g. XML file)
  • Only tree values (without tree structure) are persisted. In case of modifying tree structure the actual list of features could not match the changed tree structure. It could be the cause of problems. This problem can be mitigated by keeping additional tree identifier. In case of changing this modifier simply reset the list to default values.

Brak komentarzy:

Prześlij komentarz