本文整理汇总了Java中org.openide.modules.ModuleInfo类的典型用法代码示例。如果您正苦于以下问题:Java ModuleInfo类的具体用法?Java ModuleInfo怎么用?Java ModuleInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModuleInfo类属于org.openide.modules包,在下文中一共展示了ModuleInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testMemoryConsumption
import org.openide.modules.ModuleInfo; //导入依赖的package包/类
public void testMemoryConsumption() throws Exception { // #90195
assertSize("java.project is not too big", Arrays.asList(javaProjectProject.evaluator(), javaProjectProject.getHelper()), 2345678, new MemoryFilter() {
final Class<?>[] REJECTED = {
Project.class,
FileObject.class,
ClassLoader.class,
Class.class,
ModuleInfo.class,
LogManager.class,
RequestProcessor.class,
ResourceBundle.class,
};
public @Override boolean reject(Object obj) {
for (Class<?> c : REJECTED) {
if (c.isInstance(obj)) {
return true;
}
}
return false;
}
});
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:NbModuleProjectTest.java
示例2: stopLoader
import org.openide.modules.ModuleInfo; //导入依赖的package包/类
@Override
protected void stopLoader(ModuleInfo m, ClassLoader loader) {
NetigsoLoader nl = (NetigsoLoader)loader;
Bundle b = nl.bundle;
try {
assert b != null;
try {
LOG.log(Level.FINE, "Stopping bundle {0}", m.getCodeNameBase());
b.stop();
} catch (BundleException possible) {
if (isRealBundle(b)) {
throw possible;
}
LOG.log(Level.FINE, "Not stopping fragment {0}", m.getCodeNameBase());
}
} catch (BundleException ex) {
throw new IllegalStateException(ex);
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:Netigso.java
示例3: getModulesResult
import org.openide.modules.ModuleInfo; //导入依赖的package包/类
private Lookup.Result<ModuleInfo> getModulesResult() {
synchronized (this) {
if (modulesResult == null) {
Lookup lookup = getModuleLookup();
modulesResult = lookup.
lookup(new Lookup.Template<ModuleInfo>(ModuleInfo.class));
modulesResult.addLookupListener(new LookupListener() {
public void resultChanged(LookupEvent ev) {
Collection<? extends ModuleInfo> l = getModulesResult().allInstances();
XMLSettingsSupport.err.fine("Modules changed: " + l); // NOI18N
List reloaded;
synchronized (this) {
fillModules(l);
reloaded = replaceReloadedModules();
XMLSettingsSupport.err.fine("Reloaded modules: " + reloaded); // NOI18N
}
notifyReloads(reloaded);
}
});
}
return modulesResult;
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:ModuleInfoManager.java
示例4: OpenProjectList
import org.openide.modules.ModuleInfo; //导入依赖的package包/类
OpenProjectList() {
LOAD = new LoadOpenProjects(0);
openProjects = new ArrayList<Project>();
openProjectsModuleInfos = new HashMap<ModuleInfo, List<Project>>();
infoListener = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evn) {
if (ModuleInfo.PROP_ENABLED.equals(evn.getPropertyName())) {
checkModuleInfo((ModuleInfo)evn.getSource());
}
}
};
pchSupport = new PropertyChangeSupport( this );
recentProjects = new RecentProjectList(10); // #47134
recentTemplates = new ArrayList<String>();
projectGroupSupport = new ArrayList<ProjectGroupChangeListener>();
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:OpenProjectList.java
示例5: addModuleInfo
import org.openide.modules.ModuleInfo; //导入依赖的package包/类
private void addModuleInfo(final Project prj) {
final ModuleInfo info = Modules.getDefault().ownerOf(prj.getClass());
if (info != null) {
// is null in tests..
MUTEX.writeAccess(new Mutex.Action<Void>() {
public @Override Void run() {
if (!openProjectsModuleInfos.containsKey(info)) {
openProjectsModuleInfos.put(info, new ArrayList<Project>());
info.addPropertyChangeListener(infoListener);
}
openProjectsModuleInfos.get(info).add(prj);
return null;
}
});
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:OpenProjectList.java
示例6: setUp
import org.openide.modules.ModuleInfo; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
super.setUp();
Lookup.getDefault().lookup(ModuleInfo.class);
// We need to set up netbeans.dirs so that the NBInst URLMapper correctly
// finds the mysql jar file
File jarFile = new File(JDBCDriverManager.class.getProtectionDomain().getCodeSource().getLocation().toURI());
File clusterDir = jarFile.getParentFile().getParentFile();
System.setProperty("netbeans.dirs", clusterDir.getAbsolutePath());
getProperties();
server = MySQLDatabaseServer.getDefault();
server.setUser(getUser());
server.setPassword(getPassword());
server.setHost(getHost());
server.setPort(getPort());
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:MySQLDatabaseServerTest.java
示例7: testStoppingFalse
import org.openide.modules.ModuleInfo; //导入依赖的package包/类
public void testStoppingFalse() {
final boolean[] ok = { false };
onStartStop.initialize();
onStartStop.waitOnStart();
final Callable<Boolean> run = new Callable<Boolean>() {
@Override public Boolean call() {
ok[0] = true;
return false;
}
};
stop.add(run);
List<ModuleInfo> modules = Collections.singletonList(Modules.getDefault().ownerOf(run.getClass()));
assertFalse("Close rejected", onStartStop.closing(modules));
assertTrue("Initialized", ok[0]);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:NbStartStopTest.java
示例8: testStop
import org.openide.modules.ModuleInfo; //导入依赖的package包/类
public void testStop() {
final boolean[] ok = { false };
onStartStop.initialize();
onStartStop.waitOnStart();
final Runnable run = new Runnable() {
@Override public void run() {
ok[0] = true;
}
};
stop.add(run);
List<ModuleInfo> modules = Collections.singletonList(Modules.getDefault().ownerOf(run.getClass()));
for (Task t : onStartStop.startClose(modules)) {
t.waitFinished();
}
assertTrue("Initialized", ok[0]);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:NbStartStopTest.java
示例9: setUp
import org.openide.modules.ModuleInfo; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
UIHandler.flushImmediatelly();
MetricsHandler.flushImmediatelly();
System.setProperty("netbeans.user", getWorkDirPath());
clearWorkDir();
Locale.setDefault(new Locale("ts", "AU"));
NbPreferences.root().node("org/netbeans/core").putBoolean("usageStatisticsEnabled", true);
installer = Installer.findObject(Installer.class, true);
assertNotNull(installer);
//checkHandlers("After Installer find object", Logger.getLogger(Installer.UI_LOGGER_NAME));
MockServices.setServices(A.class, D.class);
//checkHandlers("After mock services set up", Logger.getLogger(Installer.UI_LOGGER_NAME));
// Initialize the module system:
Lookup.getDefault().lookupAll(ModuleInfo.class);
//checkHandlers("After initialization of module system", Logger.getLogger(Installer.UI_LOGGER_NAME));
MemoryURL.initialize();
//checkHandlers("After all set up", Logger.getLogger(Installer.UI_LOGGER_NAME));
installer.restored();
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:AutoSubmitTest.java
示例10: setPreferredLoader
import org.openide.modules.ModuleInfo; //导入依赖的package包/类
/** Utility method to mark a file as belonging to a loader.
* When the file is to be recognized this loader will be used first.
*
* @param fo file to mark
* @param loader the loader to assign to the file or null if previous
* association should be cleared
* @exception IOException if setting the file's attribute failed
*/
public static void setPreferredLoader (FileObject fo, DataLoader loader)
throws IOException {
DataLoader prev = getPreferredLoader (fo);
if (prev == loader) {
return;
}
if (loader == null) {
fo.setAttribute(DataObject.EA_ASSIGNED_LOADER, null);
} else {
Class c = loader.getClass();
fo.setAttribute (DataObject.EA_ASSIGNED_LOADER, c.getName ());
ModuleInfo module = Modules.getDefault().ownerOf(c);
if (module != null) {
fo.setAttribute(DataObject.EA_ASSIGNED_LOADER_MODULE, module.getCodeNameBase());
}
}
Set<FileObject> one = new HashSet<FileObject>();
one.add(fo);
if (!DataObjectPool.getPOOL().revalidate(one).isEmpty()) {
DataObject.LOG.log(Level.FINE, "It was not possible to invalidate data object: {0}", fo); // NOI18N
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:33,代码来源:DataLoaderPool.java
示例11: createInstanceDataObject
import org.openide.modules.ModuleInfo; //导入依赖的package包/类
/** see InstanceDataObject.create */
public static InstanceDataObject createInstanceDataObject (
DataFolder folder, String name, Object instance, ModuleInfo mi,
boolean create) throws IOException {
synchronized (me) {
me.mi = mi;
me.folder = folder;
me.instance = instance;
me.name = name;
me.create = create;
DataObjectPool.getPOOL().runAtomicActionSimple (folder.getPrimaryFile(), me);
me.mi = null;
me.folder = null;
me.instance = null;
me.name = null;
InstanceDataObject result = me.result;
me.result = null;
return result;
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:InstanceDataObject.java
示例12: storeModule
import org.openide.modules.ModuleInfo; //导入依赖的package包/类
private static void storeModule(ModuleInfo mi, PrintWriter pw)
throws IOException {
if (mi == null) return;
String modulName = mi.getCodeName();
SpecificationVersion spec = mi.getSpecificationVersion();
StringBuffer sb = new StringBuffer (80);
sb.append(" <module"); // NOI18N
if (modulName != null && modulName.length() != 0) {
sb.append(" name=\"").append(modulName).append('"');// NOI18N
}
if (spec != null) {
sb.append(" spec=\"").append(spec.toString()).append('"');// NOI18N
}
sb.append("/>"); // NOI18N
pw.println(sb.toString());
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:XMLSettingsSupport.java
示例13: acceptTCRef
import org.openide.modules.ModuleInfo; //导入依赖的package包/类
/** Checks if module for given tcRef exists.
* @return true if tcRef is valid - its module exists
*/
private boolean acceptTCRef (TCRefParser tcRefParser, TCRefConfig config) {
InternalConfig cfg = tcRefParser.getInternalConfig();
//Check module info
if (cfg.moduleCodeNameBase != null) {
ModuleInfo curModuleInfo = PersistenceManager.findModule
(cfg.moduleCodeNameBase, cfg.moduleCodeNameRelease,
cfg.moduleSpecificationVersion);
if (curModuleInfo == null) {
PersistenceManager.LOG.fine("Cannot find module \'" +
cfg.moduleCodeNameBase + " " + cfg.moduleCodeNameRelease + " " +
cfg.moduleSpecificationVersion + "\' for tcref with id \'" + config.tc_id + "\'"); // NOI18N
}
return (curModuleInfo != null) && curModuleInfo.isEnabled();
} else {
//No module info
return true;
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:ModeParser.java
示例14: acceptMode
import org.openide.modules.ModuleInfo; //导入依赖的package包/类
/** Checks if module for given mode exists.
* @return true if mode is valid - its module exists
*/
private boolean acceptMode (ModeParser modeParser, ModeConfig config) {
InternalConfig cfg = modeParser.getInternalConfig();
//Check module info
if (cfg.moduleCodeNameBase != null) {
ModuleInfo curModuleInfo = PersistenceManager.findModule
(cfg.moduleCodeNameBase, cfg.moduleCodeNameRelease,
cfg.moduleSpecificationVersion);
if (curModuleInfo == null) {
PersistenceManager.LOG.info("Cannot find module \'" +
cfg.moduleCodeNameBase + " " + cfg.moduleCodeNameRelease + " " +
cfg.moduleSpecificationVersion + "\' for wsmode with name \'" + config.name + "\'"); // NOI18N
}
if ((curModuleInfo != null) && curModuleInfo.isEnabled()) {
//Module is present and is enabled
return true;
} else {
//Module is NOT present (it could be deleted offline)
//or is NOT enabled
return false;
}
} else {
//No module info
return true;
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:WindowManagerParser.java
示例15: acceptGroup
import org.openide.modules.ModuleInfo; //导入依赖的package包/类
/** Checks if module for given group exists.
* @return true if group is valid - its module exists
*/
private boolean acceptGroup (GroupParser groupParser, GroupConfig config) {
InternalConfig cfg = groupParser.getInternalConfig();
//Check module info
if (cfg.moduleCodeNameBase != null) {
ModuleInfo curModuleInfo = PersistenceManager.findModule
(cfg.moduleCodeNameBase, cfg.moduleCodeNameRelease,
cfg.moduleSpecificationVersion);
if (curModuleInfo == null) {
PersistenceManager.LOG.log(Level.FINE, "Cannot find module \'" +
cfg.moduleCodeNameBase + " " + cfg.moduleCodeNameRelease + " " +
cfg.moduleSpecificationVersion + "\' for group with name \'" + config.name + "\'"); // NOI18N
}
if ((curModuleInfo != null) && curModuleInfo.isEnabled()) {
//Module is present and is enabled
return true;
} else {
return false;
}
} else {
//No module info
return true;
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:WindowManagerParser.java
示例16: testSaveWindowSystem
import org.openide.modules.ModuleInfo; //导入依赖的package包/类
/**
* Make sure that closed TCs are not deserialized during saving window system ie. also
* during IDE exit. Test creates test TC and overwrites method readExternal. This method
* should not be called.
*/
public void testSaveWindowSystem () throws Exception {
Lookup.getDefault().lookup(ModuleInfo.class);
IDEInitializer.addLayers
(new String [] {"org/netbeans/core/windows/resources/layer-PersistenceHandlerTest.xml"});
//Verify that test layer was added to default filesystem
assertNotNull(FileUtil.getConfigFile("Windows2/Modes/editor/component00.wstcref"));
PersistenceHandler.getDefault().load();
//Check that test TopComponent is not instantiated before
assertFalse
("Closed TopComponent was instantiated before window system save but it should not.",
Component00.wasDeserialized());
PersistenceHandler.getDefault().save();
//Check if test TopComponent was instantiated
assertFalse
("Closed TopComponent was instantiated during window system save but it should not.",
Component00.wasDeserialized());
IDEInitializer.removeLayers();
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:31,代码来源:PersistenceHandlerTest.java
示例17: storeToXML10
import org.openide.modules.ModuleInfo; //导入依赖的package包/类
/** Store settings version 1.0
* @param inst settings instance
* @param os output
*/
public static void storeToXML10 (Object inst, Writer os, ModuleInfo mi)
throws IOException {
PrintWriter pw = new PrintWriter (os);
pw.println ("<?xml version=\"1.0\"?>"); // NOI18N
pw.println ("<!DOCTYPE settings PUBLIC \""+INSTANCE_DTD_ID+ // NOI18N
"\" \""+INSTANCE_DTD_WWW+"\">"); // NOI18N
pw.println ("<settings version=\"1.0\">"); // NOI18N
storeModule(mi, pw);
storeInstanceOf(getSuperClasses(inst.getClass(), null), pw);
// default storage has been implemented by serialization
storeSerialData(inst, pw);
pw.println ("</settings>"); // NOI18N
pw.flush ();
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:XMLSettingsSupport.java
示例18: getModuleInfos
import org.openide.modules.ModuleInfo; //导入依赖的package包/类
@Override
public List<ModuleInfo> getModuleInfos(boolean recursive) {
List<ModuleInfo> infos = new ArrayList<ModuleInfo>();
for (ModuleUpdateElementImpl impl : getContainedModuleElements()) {
if (! infos.contains(impl.getModuleInfo())) {
infos.add(impl.getModuleInfo());
}
}
if (recursive) {
for (FeatureUpdateElementImpl featureImpl : getDependingFeatures()) {
for (ModuleUpdateElementImpl modImpl : featureImpl.getContainedModuleElements()) {
if (! infos.contains(modImpl.getModuleInfo())) {
infos.add(modImpl.getModuleInfo());
}
}
}
}
return infos;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:FeatureUpdateElementImpl.java
示例19: foundUpdateTracking
import org.openide.modules.ModuleInfo; //导入依赖的package包/类
private boolean foundUpdateTracking (ModuleInfo moduleInfo) {
File updateTracking = Utilities.locateUpdateTracking (moduleInfo);
if (updateTracking != null && updateTracking.exists ()) {
//err.log ("Find UPDATE_TRACKING: " + updateTracking + " found.");
// check the write permission
if (! Utilities.canWrite (updateTracking)) {
err.log(Level.FINE,
"Cannot delete module " + moduleInfo.getCodeName() +
" because is forbidden to write in directory " +
updateTracking.getParentFile ().getParent ());
return false;
} else {
return true;
}
} else {
err.log(Level.FINE,
"Cannot delete module " + moduleInfo.getCodeName() +
" because no update_tracking file found.");
return false;
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:ModuleDeleterImpl.java
示例20: fillModules
import org.openide.modules.ModuleInfo; //导入依赖的package包/类
/** recompute accessible modules.
* @param l a collection of module infos
*/
private void fillModules(Collection<? extends ModuleInfo> l) {
HashMap<String, ModuleInfo> m = new HashMap<String, ModuleInfo>((l.size() << 2) / 3 + 1);
for (ModuleInfo mi: l) {
m.put(mi.getCodeNameBase(), mi);
}
modules = m;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:ModuleInfoManager.java
注:本文中的org.openide.modules.ModuleInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论