X-Meta是一个开源的动态模型语言,它非常简单,有的时候甚至觉得它不能被称为一种语言。所谓模型语言,就是主要使用模型来编程,比如可以使用XML来编程。模型语言和普通的Java编程有比较大的区别,可见下面的示例。这是一个SWT的工作台示例,见截图:
下面是XML的模型代码:
<?xml version="1.0" encoding="utf-8"?> 
  
<!-- 主窗口 -->
<Workbentch name="shell" descriptors="xworker.app.view.swt.app.workbentch.Workbentch" 
    label="Swt Example"> 
    <!-- 菜单 -->
    <menus name="menus"> 
        <Menu name="fileMenu" label="File"> 
            <Menu name="exitItem" label="Exit" type="PUSH" action="exit"></Menu> 
        </Menu> 
    </menus> 
    <!-- 视图 -->
    <views name="views"> 
        <View name="navigationTree" label="Navigation" closeable="false" defaultOpen="true" 
           useRef="true" refPath="example.views.NavigationTree"></View> 
    </views> 
    <!-- 编辑器视图 -->
    <editors name="editors"> 
        <Editor name="buttonExample" label="Button Example" singleInstance="true" useRef="true"
            refPath="example.editors.ButtonExample"></Editor> 
        <Editor name="textExample" id="text" label="Text Example" singleInstance="true" 
            useRef="true" refPath="example.editors.TextExample"></Editor> 
        <Editor name="browserExample" label="Web Browser" singleInstance="true" 
             useRef="true" refPath="example.editors.BrowserExample"></Editor> 
        <Editor name="formExample" label="Form Example" singleInstance="true" 
            useRef="true" refPath="example.editors.FormExample"></Editor> 
        <Editor name="tableExample" label="Table Example" singleInstance="true" 
           useRef="true" refPath="example.editors.TableExample"></Editor> 
    </editors> 
    <!-- 动作,退出菜单的动作 -->
    <actions name="actions"> 
        <ShellNormalActions name="exit" descriptors="xworker.swt.actions.ShellActions/@ShellNormalActions1" 
            shellName="shell"></ShellNormalActions> 
    </actions> 
</Workbentch>完整的SWT示例见这里,X-Meta的主页是这里。欢迎大家前来参观并提出意见,谢谢。