Java Code Examples for org.openide.filesystems.XMLFileSystem#findResource()

The following examples show how to use org.openide.filesystems.XMLFileSystem#findResource() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AdditionalProjectFactoryTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
protected void setUp() throws Exception {
    LOG = Logger.getLogger("test." + getName());
    URL u = AdditionalProjectFactoryTest.class.getResource("default.xml");
    assertNotNull("Default layer found", u);
    XMLFileSystem xml = new XMLFileSystem(u);
    FileObject fo = xml.findResource("Menu/Edit_hidden");
    assertNotNull("File found", fo);
}
 
Example 2
Source File: AdditionalAntBasedTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
protected void setUp() throws Exception {
    LOG = Logger.getLogger("org.netbeans.modules.ide.ergonomics.fod." + getName());

    URL u = AdditionalAntBasedTest.class.getResource("default.xml");
    assertNotNull("Default layer found", u);
    XMLFileSystem xml = new XMLFileSystem(u);
    FileObject fo = xml.findResource("Menu/Edit_hidden");
    assertNotNull("File found", fo);
}
 
Example 3
Source File: OpenEditorEnablesEditMenuFactoryTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
protected void setUp() throws Exception {
    clearWorkDir();

    URL u = OpenEditorEnablesEditMenuFactoryTest.class.getResource("default.xml");
    assertNotNull("Default layer found", u);
    XMLFileSystem xml = new XMLFileSystem(u);
    FileObject fo = xml.findResource("Menu/Edit_hidden");
    assertNotNull("File found", fo);
    
    FileObject e = FileUtil.getConfigFile("Menu/Edit");
    assertNull("Default layer is on and Edit is hidden: " + Arrays.toString(FileUtil.getConfigFile("Menu").getChildren()), e);
}
 
Example 4
Source File: DecoratedFileSystem.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
public URL getParentFileSystem (FileObject template) {
    Lookup.Result<PluginInfo> result = consumerVisualVM ().lookupResult (PluginInfo.class);

    String path = template.getPath ();
    for (PluginInfo pi : result.allInstances ()) {
        Internal internal = PluginInfoAccessor.DEFAULT.getInternal (pi);
        XMLFileSystem fs = internal.getXMLFileSystem ();
        if (fs.findResource (path) != null) {
            return fs.getXmlUrl ();
        }
    }
    return null;
}
 
Example 5
Source File: DecoratedFileSystem.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
public String getPluginCodeName (FileObject template) {
    Lookup.Result<PluginInfo> result = consumerVisualVM ().lookupResult (PluginInfo.class);

    String path = template.getPath ();
    for (PluginInfo pi : result.allInstances ()) {
        Internal internal = PluginInfoAccessor.DEFAULT.getInternal (pi);
        XMLFileSystem fs = internal.getXMLFileSystem ();
        if (fs.findResource (path) != null) {
            return PluginInfoAccessor.DEFAULT.getCodeName (pi);
        }
    }
    return null;
}