Re: Luxor XUL as a GUI engine for Beanshell scripts
Gerald Bauer <[email protected]> Tue, 4 Nov 2003 08:58:57 -0800 (PST)
| Newsgroups | gmane.comp.java.luxor-xul.user |
|---|---|
| Message-ID | <[email protected]> |
Hello Dimitri,
> Now, I've thought about whether it is possible to
> simplify the
> development according to this scheme by means of
> simplifiying one of
> the most tedious tasks - creation of GUI forms (we
> are doing it with
> Together ControCenter 6.0 at the moment).
>
> I want to be able to do following:
>
> <example>
> fileName = "someFile.xml";
> dialog = createDialgog(fileName);
> dialog.show();
> if (dialog.isClosedWithOk())
> {
> valueA = (String)dialog.getValue("A");
> valueB = (Double)dialog.getValue("B");
> }
>
> </example>
>
> That is, first I write a description of the UI and
> store it in a file,
> like an HTML form. Then, Luxor creates a dialog box
> from this file,
> and this dialog box is made visible.
>
> After ther user closed the dialog, I check whether
> he pressed OK or
> Cancel and then retrieve the data he entered.
>
> I would like to know, whether there is a simple way
> to do this with
> Luxor. I've played a bit around with it, but did not
> find a solution.
> Could you give me some hints about how to implement
> this in the most
> simple way?
Well, first you might wonna check out Swix online @
http://www.swixml.org as a Luxor alternative.
Now, on to Luxor. Unfortunately, your use case
doesn't work out-of-box for now. However, it isn't
hard to add the missing wrapper code to offer a simple
and easy-to-use API.
It looks you need two pieces:
First, wrapping up the resource loader setup and
parsing into a single API call. For examples, check
out the Luxilla source @
http://luxilla.sourceforge.net or check out the Sahara
- Luxor XUL "Sandbox".
Second, you need to wrap a dialog/box so you can
easily lookup controls and get their value. This
should be fairly simple and straight-forward.
For example, check out the latest examples in the
Luxor SWT package. If you use Swing you can use
JPanelEx/JFrameEx as an example to get started. Check
out the Salsa source for details.
> Do I really need the server inside Luxor for just
> displaying a simple form?
No, you don't. Everything works fine without a web
server. By default Luxor doesn't start the web server.
You have to start the web server yourself if you want
to use it e.g new WebServer(...) etc.
For more about Luxor and BeanShell check out
Anakrewn Meidis' Luxor and Batik Beanshell example.
See
http://article.gmane.org/gmane.comp.java.luxor-xul.user/434
for details.
- Gerald
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/