本文整理汇总了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;
}
示例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());
}
示例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;
}
示例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;
}
示例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));
}
示例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));
}
示例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
}
示例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
}
示例9: ProjectConfigFileManagerImpl
import org.netbeans.api.project.ProjectUtils; //导入方法依赖的package包/类
public ProjectConfigFileManagerImpl(Project project) {
this.project = project;
auxConfig = ProjectUtils.getAuxiliaryConfiguration(project);
}