用 XML 描述的 Java GUI [英] Java GUI described in XML

查看:22
本文介绍了用 XML 描述的 Java GUI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我公司目前正在评估 Java FAT 客户端的开发.它应该支持动态 GUI,并在服务器端具有尽可能多的逻辑.因此,出现了将屏幕作为 XML 发送到 FAT 客户端的想法,将其显示给用户并将类似于html 表单"的输入数据以如下结构发送回:

My company currently evaluates the development of a Java FAT client. It should support a dynamic GUI and has as much logic as possible on the server side. Hence the idea came up to send the screen as XML to the FAT client, show it to the user and send the entered data similar to "html form" back in a structure like:

<fields>
  <field type="checkbox" name="active" checked="false" x="10" y="10" />
  <field type="textbox" name="username" value="dummy" x="10" y="30" />
  <field type="selection" name="group" selectedIndex="1" x="10" y="50">
     <data index="0">user</data>
     <data index="1">admin</data>
  </field>
  <field type="button" name="ok" x="10" y="70" />
  <field type="button" name="cancel" x="10" y="90" />
</field>

背景
发起人正在寻找一个数据输入和审查应用程序,他们可以通过简单地更改配置来适应他们的需求.因此,我们必须为他们的管理员提供一种设计所谓的屏幕"(又称表单)的可能性,并提供一个客户端/服务器系统,使他们能够将这些内容分发给最终用户.传入的数据(即用户输入的数据)随后将被转发到处理业务逻辑的现有工作流引擎.

Background
The sponsor is looking for an data entry and review application which they can adapt to their needs by simply changing the configuration. Hence we have to provide a possibility for their administrators to design so called "screens" (aka forms) and provide a client/server system enabling them to distribute those to their end users. Incoming data (i.e. data entered by an user) will be then forwarded to an already existing workflow engine which is handling the business logic.

问题
有没有人开发过类似的东西?你会推荐哪些图书馆?任何专业人士缺点?非常感谢!

Question
Has anybody out there developed something similar? Which libraries would you suggest? Any pro & cons? Many thanks!

更新
非常感谢您的意见,Thinlet 看起来和 JavaFX - 我会研究两者.

Update
Many thanks for your input, Thinlet looks very promising as well as JavaFX - I will look into both.

推荐答案

当我上次寻找这样的东西时,有两个选项是 ThinletApache Jelly.

When I last looked for such a thing, two options were Thinlet and Apache Jelly.

优点是您可以将应用程序的接线和构造与行为分开.我不确定他们中的任何一个这样做的可行性,但我猜可能有一些功能可以转换成另一个工具包,就像 Lazlo 可以翻译成 AJAX 和 Flash.

The plus points were that you could separate the wiring and construction of your application from the behaviour. I'm not sure of the viability of either of them to do this, but I guess there could be some functionality for translating into another toolkit, much as Lazlo can translate into AJAX and Flash.

在我发现这些之前,我已经编写了一个类似的工具包(当 Echo 是最前沿的,并且Java 1.3 是最前沿的),基于 JHTMLEditor.它有效,但侦听器与渲染器在同一 VM 中运行.

Before I found these, I had written a similar toolkit (when Echo was the cutting edge, and Java 1.3 was bleeding edge), based upon the JHTMLEditor. It worked, but listeners were running in the same VM as the renderer.

这提出了@Draemon 提出的观点,在客户端/服务器上下文中,我不得不问这是否是解决更大问题的有效方法.我猜您想将大量 CPU 周期卸载到客户端?或许如果您再添加一点,我们可以提出更多建议?这确实指出了一种将应用程序作为 localhost 网络服务器部署在桌面上的方法,并将页面提供给本地浏览器.

Which brings up the point that @Draemon makes, in a client/server context, I would have to ask if this is a fruitful way to solve the larger problem. I am guessing that you want to offload a lot of CPU cycles onto the client? Perhaps if you add a bit more, we can make more suggestions? This does point to an approach where your application is deployed on the desktop as a localhost webserver, and you serve pages to a local browser.

如果你可以等待,我会等待 JavaFX,因为这将使构建小程序的声明性更强,并且还将减少渲染库的初始下载.

If you can wait, I would, and wait for JavaFX, as this will make building applets a good deal more declarative, and will also cut down on the initial download of the rendering library.

这篇关于用 XML 描述的 Java GUI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆