views:

170

answers:

1

Hi,

This is more of a question about tools that are out there instead of a programming question on one particular stuff. So apologies in advance if the question does not belong here.

I have an application that I want to develop a GUI configuration tool for. At the moment config files for the application are found in a couple of directories,

application/directory1/.../config1.txt
application/directory1/.../config2.txt
application/directory1/.../config3.txt
....
application/directory2/.../config4.txt
application/directory2/.../config5.txt
...
application/directory3/.../config6.xml
application/directory3/.../config7.xml
...

Now I want my users to be able to edit these files using a GUI tool. More specifically, I want to be able to define the properties available, possible values they can take, and a default value. So if config1.txt has,

property1=value11
property2=value22

I want to be able to tell the tool that there should be two properties in config1.txt, that property1 can have possible values of, let us say value11, value12, value13, and that the default is value12. property2 can be value21 and value22, default is value22, etc. The tool can then give me a drop down box to see available options.

Also, I want the tool to know where to look for config files. So instead of the user browsing to each of these directories, the tool should guide the user somehow. Maybe by looking into these directories itself and loading all the files it gets or something of that sort. I know that I should put config files together as much as possible. But because my application is run inside Tomcat, I have to deal with Tomcat config files too.

Maybe I'm asking too much :) But I hope not to reinvent the wheel. If such a tool is not available, it would still be useful to know about related tools so I can build upon those.

Thanks a lot!

+1  A: 

Instead of using XML and property list files, you might want to use the Preferences class, instead. If you take a look at the Java Project Template, it includes the ability to do what you want (using the Preferences class):

  • The option "--prefset name=value" sets the preference key "name" to "value".
  • The option "--prefget name" causes the value for preference key "name" to be printed.
  • The option "--prefdel name" causes the key "name" to be removed.
  • The option "--preflist" causes all the preferences for the application to be printed.
Michael Aaron Safyan
Hi Michael. I downloaded your project but didn't see any documentation for it. There is only source files in there as well.
tilish
Hi, bonga. That is a valid criticism. I will add documentation.
Michael Aaron Safyan
Ok. I added documentation. Please see the following link: http://code.google.com/p/java-project-template/wiki/Basics
Michael Aaron Safyan