使模块的xml层对其他模块可见 [英] make a module's xml layer visible to other modules

查看:126
本文介绍了使模块的xml层对其他模块可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Netbeans平台中,我有一个模块监视xml文件系统,并在其他模块更改它时作出响应.

In Netbeans Platform I'm having one module watch the xml filesystem and respond when it's changed by other modules.

我在另一个模块中创建了layer.xml.当我在监视模块中单击XML层节点并打开时,更改将显示在IDE中.但是,在运行时,当监视模块正在查看xml文件系统时,其他模块的更改就不存在.另一个模块 可以在运行时看到自己的更改.

I've created a layer.xml in another module. The changes show up in the IDE when in the watching module I click on XML layer node and open up . However during runtime when the watching module is looking at the xml filesystem the changes from the other module aren't there. The other module can see its own changes during runtime.

某个模块的某个位置是否有设置,可以让其他模块查看其xml层?

Is there a setting somewhere for a module that lets other modules see its xml layer?

这是我在运行时用于检查xml文件系统的代码-将所有节点的名称打印到文件中,当所有模块打开并运行时,我会通过按钮触发它.

This is the code I'm using to inspect the xml filesystem during runtime - it prints the names of all nodes into a file, and I trigger it from a button when all modules are open and running.

private void btn1ActionPerformed(java.awt.event.ActionEvent evt)                                      
{                                       
    try {
        BufferedWriter writer = Files.newBufferedWriter(Paths.get("filesystemOut.txt"), Charset.forName("UTF-8"));
        exportFilesystem(FileUtil.getConfigRoot(), writer, 0);
        writer.close();
    } catch (IOException e) {
        System.err.println("couldn't write filesystem structure");
    }
}

void exportFilesystem(FileObject root, BufferedWriter writer, int depth) throws IOException
{
    for (int i = 0; i < depth * 4; ++i)
    {
        writer.write(' ');
    }
    writer.write(root.getName());
    writer.newLine();
    FileObject[] children = root.getChildren();
    for (FileObject child : children)
    {
        exportFilesystem(child, writer, depth + 1);
    }
}    

推荐答案

使用需要可见的xml层打开模块的属性对话框.选择API Versioning,然后在Public packages下选择包含xml文件的软件包.点击OK.

Open the properties dialog of the module with the xml layer that needs to be visible. Select API Versioning and under Public packages select the package that contains the xml file. Click OK.

这篇关于使模块的xml层对其他模块可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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