addressing xul elements in java code
Tzanko Stefanov <[email protected]>
| Newsgroups | gmane.comp.java.luxor-xul.user |
|---|---|
| Message-ID | <[email protected]> |
Hi folks, I have few questions regarding Luxor and XUL I am working on a java client that will communicate with a server. For now the server will send the response as XML - later I might change to way client and server communicate. But this is not important. So I have the response from the server which should fill the values of the form components. The user basicaly intaracts with different forms, submits the request to the server based on his selection from these forms and then he gets either the same form but with different content of the textinputs and drop-down lists or a new form. Because I have quite many forms and the content of the server response could change I thought that using smth like XML to discribe the forms is a good idea. I stumbled upon Luxor and looked at the doc on the web site and the calculator sample api. Here are few things that I have problem with: 1) When you display the value in display input text you address the display component in yor java code. JTextField jdisplay = (JTextField) _display.getJComponent(); jdisplay.setHorizontalAlignment(JTextField.RIGHT); setValue(String.valueOf((double) 0)); The hole idea of having things in an XML for me is that the programing implemenation is not aware of what are the form components. It is rather the xml element definition and the engine to be responsible for invoking the objects that will produce the values for the graphical component. 2) The same thing with the button. You address all the buttons in CalsForm. new EnterDigit(logic, "0"); If tomorrow I remove a button from the XML or add new one, I have to recompile my CalcForm class. The advantage of having things defined in meta data is that your immplemetation is not aware of what is in that XML as long as it has means to handle the components. I am not criticizing here. XUL and Luxor spare you from working directly with Swing. I am just exposing my point of view looking for solution to my problem. If you could recommend me what to do I will appreciate it a lot. Maybe Luxor and XUL are not good for me? 10x guys. ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf