Ideas for interface design for a function in a custom plugin? [message #1729391] |
Wed, 13 April 2016 12:12 |
Eclipse User |
|
|
|
I'm looking for ideas on how best to present a particular interface to some functionality in an Eclipse plugin. I eventually have to figure out the real mechanics and API details, but I first just want to figure out a practical way to present it.
For some background, the plugin is used to view and edit files written in a particular specification language, the name doesn't matter. Functionally, the language very much resembles CORBA IDL, although not the syntax. It's used to describe the interface to a remote service. The code generated from these specification files presents a REST interface that can take XML or JSON messages. I believe the generated service uses JAX-RS, but I don't believe it provides a WADL.
What I want to implement is a tool to generate sample messages in XML or JSON format.
I'm not concerned at this point with the lower-level code to generate the sample message. I have a parsed syntax tree and a tree walker, which makes it straightforward to generate things like this from the parsed tree.
The harder questions are:
* How much flexibility and customization should I provide for in the generation process?
For instance, I obviously need to provide a choice of XML or JSON, but a harder question is what to put in for sample values. If an element takes a string value, do you generate an empty string, which may render as an "empty XML element", which makes it unclear to the user what variations are possible with that value. On the other hand, do you provide non-empty strings for every string element? How about list elements? I suppose it would be reasonable to provide only a single entry for every list.
* Depending on the previous answer, what should the interface look like?
I like the ability to use a MultiPageEditorPart and allow multiple "views" of the editor to provide features like this. It's a bit of a stretch to say that the sample data would be an alternative "view" of the source file, but it's very convenient to get to the function that way. I look at the "Effective POM" view of the M2E plugin as a model for this.
That would be a little awkward for generating sample data, however. Even if the only choice was XML or JSON, it's not really practical to provide a "subview" of the view. If we decided that additional customization was desirable, that makes it even more awkward.
I suppose it's possible I could render a "panel" inside the view with form fields.
The other obvious choice is just creating a top-level menu item that presents a wizard form. That makes entry of the customization values straightforward, but what I'm unsure about is how to present the finished product? Do I just present a subdialog with a text area, or perhaps a text area in the main wizard form, or do I create the file in the project and open an editor view for the generated file? I can see advantages and disadvantages of these approaches.
|
|
|
Powered by
FUDForum. Page generated in 0.02798 seconds