当前位置: 首页>>代码示例>>Java>>正文


Java ProjectUtils.getAuxiliaryConfiguration方法代码示例

本文整理汇总了Java中org.netbeans.api.project.ProjectUtils.getAuxiliaryConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectUtils.getAuxiliaryConfiguration方法的具体用法?Java ProjectUtils.getAuxiliaryConfiguration怎么用?Java ProjectUtils.getAuxiliaryConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.netbeans.api.project.ProjectUtils的用法示例。


在下文中一共展示了ProjectUtils.getAuxiliaryConfiguration方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProjectLibraryManager

import org.netbeans.api.project.ProjectUtils; //导入方法依赖的package包/类
/**
 * Gets a library manager of the given project.
 * There is no guarantee that the manager is the same object from call to call
 * even if the project is the same; in particular, it is <em>not</em> guaranteed that
 * the manager match that returned from {@link Library#getManager} for libraries added
 * from {@link #createLibraryReference}.
 * @return a library manager associated with project's libraries or null if project is 
 *  not shared (will not include {@link LibraryManager#getDefault})
 *  {@link LibraryManager#getDefault})
 * @since org.netbeans.modules.project.ant/1 1.19
 */
public static LibraryManager getProjectLibraryManager(Project p) {
    AuxiliaryConfiguration aux = ProjectUtils.getAuxiliaryConfiguration(p);
    File libFile = ProjectLibraryProvider.getLibrariesLocation(aux, 
            FileUtil.toFile(p.getProjectDirectory()));
    if (libFile != null) {
        try {
            return LibraryManager.forLocation(BaseUtilities.toURI(libFile).toURL());
        } catch (MalformedURLException e) {
            // ok, no project manager
            Logger.getLogger(ReferenceHelper.class.getName()).info(
                "library manager cannot be found for "+libFile+". "+e.toString()); //NOI18N
        }
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:ReferenceHelper.java

示例2: testFallbackAuxiliaryConfigurationExists

import org.netbeans.api.project.ProjectUtils; //导入方法依赖的package包/类
public void testFallbackAuxiliaryConfigurationExists() throws Exception {
    Project prj = new PrjNoAC();
    AuxiliaryConfiguration ac = ProjectUtils.getAuxiliaryConfiguration(prj);
    assertNotNull(ac);
    String namespace = "http://nowhere.net/test";
    assertNull(ac.getConfigurationFragment("x", namespace, true));
    ac.putConfigurationFragment(makeElement("x", namespace), true);
    Element e = ac.getConfigurationFragment("x", namespace, true);
    assertNotNull(e);
    assertEquals("x", e.getLocalName());
    assertEquals(namespace, e.getNamespaceURI());
    assertNull(ac.getConfigurationFragment("x", namespace, false));
    ac.removeConfigurationFragment("x", namespace, true);
    assertNull(ac.getConfigurationFragment("x", namespace, true));
    ac.putConfigurationFragment(makeElement("y", namespace), false);
    prj = new PrjNoAC();
    ac = ProjectUtils.getAuxiliaryConfiguration(prj);
    e = ac.getConfigurationFragment("y", namespace, false);
    assertNotNull(e);
    assertEquals("y", e.getLocalName());
    assertEquals(namespace, e.getNamespaceURI());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:AuxiliaryConfigImplTest.java

示例3: getProjectDictionary

import org.netbeans.api.project.ProjectUtils; //导入方法依赖的package包/类
public static synchronized DictionaryImpl getProjectDictionary(Project p, Locale locale) {
    Reference<DictionaryImpl> r = project2Reference.get(p);
    DictionaryImpl d = r != null ? r.get() : null;
    
    if (d == null) {
        AuxiliaryConfiguration ac = ProjectUtils.getAuxiliaryConfiguration(p);
        project2Reference.put(p, new WeakReference<DictionaryImpl>(d = new DictionaryImpl(p, ac, locale)));
    }
    
    return d;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:ComponentPeer.java

示例4: getOpenFilesUrls

import org.netbeans.api.project.ProjectUtils; //导入方法依赖的package包/类
private static Set<String> getOpenFilesUrls(Project p, String groupName) {
    AuxiliaryConfiguration aux = ProjectUtils.getAuxiliaryConfiguration(p);
    
    Element openFiles = aux.getConfigurationFragment (OPEN_FILES_ELEMENT, OPEN_FILES_NS2, false);
    if (openFiles == null) {
        return Collections.emptySet();
    }

    Element groupEl = null;
    
    NodeList groups = openFiles.getElementsByTagNameNS(OPEN_FILES_NS2, GROUP_ELEMENT);
    for (int i = 0; i < groups.getLength(); i++) {
        Element g = (Element) groups.item(i);
        String attr = g.getAttribute(NAME_ATTR);
        if (attr.equals(groupName) || (attr.equals("") && groupName == null)) {
            groupEl = g;
            break;
        }
    }
    
    if (groupEl == null) {
        return Collections.emptySet();
    }
    
    NodeList list = groupEl.getElementsByTagNameNS(OPEN_FILES_NS2, FILE_ELEMENT);
    Set<String> toRet = new HashSet<String>();
    for (int i = 0; i < list.getLength (); i++) {
        String url = list.item (i).getChildNodes ().item (0).getNodeValue ();
        toRet.add(url);
    }    
    return toRet;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:33,代码来源:ProjectUtilities.java

示例5: testSharedStorage

import org.netbeans.api.project.ProjectUtils; //导入方法依赖的package包/类
public void testSharedStorage() throws Exception {
    Project prj = new PrjNoAC();
    AuxiliaryConfiguration ac = ProjectUtils.getAuxiliaryConfiguration(prj);
    ac.putConfigurationFragment(makeElement("x", "one"), true);
    ac.putConfigurationFragment(makeElement("x", "two"), true);
    ac.putConfigurationFragment(makeElement("y", "two"), true);
    ac.putConfigurationFragment(makeElement("y", "one"), true);
    FileObject netbeansXml = prjdir.getFileObject(AuxiliaryConfigImpl.AUX_CONFIG_FILENAME);
    assertNotNull(netbeansXml);
    assertEquals("<auxiliary-configuration xmlns=\"http://www.netbeans.org/ns/auxiliary-configuration/1\">" +
            "<x xmlns=\"one\"/>" +
            "<x xmlns=\"two\"/>" +
            "<y xmlns=\"one\"/>" +
            "<y xmlns=\"two\"/>" +
            "</auxiliary-configuration>",
            loadXML(netbeansXml));
    Element x = makeElement("x", "two");
    x.appendChild(x.getOwnerDocument().createElementNS("two", "xx"));
    ac.putConfigurationFragment(x, true);
    ac.removeConfigurationFragment("y", "one", true);
    assertEquals("<auxiliary-configuration xmlns=\"http://www.netbeans.org/ns/auxiliary-configuration/1\">" +
            "<x xmlns=\"one\"/>" +
            "<x xmlns=\"two\"><xx/></x>" +
            "<y xmlns=\"two\"/>" +
            "</auxiliary-configuration>",
            loadXML(netbeansXml));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:AuxiliaryConfigImplTest.java

示例6: testPrivateStorage

import org.netbeans.api.project.ProjectUtils; //导入方法依赖的package包/类
public void testPrivateStorage() throws Exception {
    Project prj = new PrjNoAC();
    AuxiliaryConfiguration ac = ProjectUtils.getAuxiliaryConfiguration(prj);
    ac.putConfigurationFragment(makeElement("x", "ns"), false);
    String attr = AuxiliaryConfigImpl.AUX_CONFIG_ATTR_BASE + ".ns#x";
    assertEquals("<x xmlns=\"ns\"/>", prjdir.getAttribute(attr));
    Element x = makeElement("x", "ns");
    x.appendChild(x.getOwnerDocument().createElementNS("ns", "xx"));
    ac.putConfigurationFragment(x, false);
    assertEquals("<x xmlns=\"ns\"><xx/></x>", prjdir.getAttribute(attr));
    ac.removeConfigurationFragment("x", "ns", false);
    assertEquals(null, prjdir.getAttribute(attr));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:AuxiliaryConfigImplTest.java

示例7: isEnabled

import org.netbeans.api.project.ProjectUtils; //导入方法依赖的package包/类
public static boolean isEnabled(Project project) {
    AuxiliaryConfiguration config = ProjectUtils.getAuxiliaryConfiguration(project);
    Element configurationFragment = config.getConfigurationFragment("coverage", COVERAGE_NAMESPACE_URI, false); // NOI18N
    if (configurationFragment == null) {
        return false;
    }
    return configurationFragment.getAttribute("enabled").equals("true"); // NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:CoverageProviderHelper.java

示例8: isAggregating

import org.netbeans.api.project.ProjectUtils; //导入方法依赖的package包/类
public static boolean isAggregating(Project project) {
    AuxiliaryConfiguration config = ProjectUtils.getAuxiliaryConfiguration(project);
    Element configurationFragment = config.getConfigurationFragment("coverage", COVERAGE_NAMESPACE_URI, false); // NOI18N
    if (configurationFragment == null) {
        return false;
    }
    return configurationFragment.getAttribute("aggregating").equals("true"); // NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:CoverageProviderHelper.java

示例9: ProjectConfigFileManagerImpl

import org.netbeans.api.project.ProjectUtils; //导入方法依赖的package包/类
public ProjectConfigFileManagerImpl(Project project) {
    this.project = project;
    auxConfig = ProjectUtils.getAuxiliaryConfiguration(project);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:ProjectConfigFileManagerImpl.java


注:本文中的org.netbeans.api.project.ProjectUtils.getAuxiliaryConfiguration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。