本文整理汇总了Java中org.openide.filesystems.FileStateInvalidException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java FileStateInvalidException.printStackTrace方法的具体用法?Java FileStateInvalidException.printStackTrace怎么用?Java FileStateInvalidException.printStackTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openide.filesystems.FileStateInvalidException
的用法示例。
在下文中一共展示了FileStateInvalidException.printStackTrace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: classToSourceURL
import org.openide.filesystems.FileStateInvalidException; //导入方法依赖的package包/类
private String classToSourceURL (FileObject fo) {
try {
ClassPath cp = ClassPath.getClassPath (fo, ClassPath.EXECUTE);
FileObject root = cp.findOwnerRoot (fo);
String resourceName = cp.getResourceName (fo, '/', false);
if (resourceName == null) {
getProject().log("Can not find classpath resource for "+fo+", skipping...", Project.MSG_ERR);
return null;
}
int i = resourceName.indexOf ('$');
if (i > 0)
resourceName = resourceName.substring (0, i);
FileObject[] sRoots = SourceForBinaryQuery.findSourceRoots
(root.getURL ()).getRoots ();
ClassPath sourcePath = ClassPathSupport.createClassPath (sRoots);
FileObject rfo = sourcePath.findResource (resourceName + ".java");
if (rfo == null) return null;
return rfo.getURL ().toExternalForm ();
} catch (FileStateInvalidException ex) {
ex.printStackTrace ();
return null;
}
}
示例2: setTopComponent
import org.openide.filesystems.FileStateInvalidException; //导入方法依赖的package包/类
/** This is called by the multiview elements whenever they are created
* (and given a observer knowing their multiview TopComponent). It is
* important during deserialization and cloning the multiview - i.e. during
* the operations we have no control over. But anytime a multiview is
* created, this method gets called.
*/
void setTopComponent(TopComponent topComp) {
multiviewTC = (CloneableTopComponent)topComp;
String[] titles = getMVTCDisplayName(formDataObject);
multiviewTC.setDisplayName(titles[0]);
multiviewTC.setHtmlDisplayName(titles[1]);
multiviewTC.setToolTipText(getMVTCToolTipText(formDataObject));
opened.add(this);
registerNodeListener();
attachTopComponentsListener();
try {
addStatusListener(formDataObject.getPrimaryFile().getFileSystem());
} catch (FileStateInvalidException fsiex) {
fsiex.printStackTrace();
}
}
示例3: setup
import org.openide.filesystems.FileStateInvalidException; //导入方法依赖的package包/类
/**
* Set the global default lookup with the specified content.
*
* @param layers xml-layer URLs to be present in the system filesystem.
* @param instances object instances to be present in the default lookup.
*/
public static void setup (
String[] layers,
Object[] instances
) {
ClassLoader classLoader = IDEInitializer.class.getClassLoader ();
File workDir = new File (Manager.getWorkDirPath ());
URL[] urls = new URL [layers.length];
int i, k = urls.length;
for (i = 0; i < k; i++)
urls [i] = classLoader.getResource (layers [i]);
// 1) create repository
XMLFileSystem systemFS = new XMLFileSystem ();
lfs = FileUtil.createMemoryFileSystem();
try {
systemFS.setXmlUrls (urls);
} catch (Exception ex) {
ex.printStackTrace ();
}
MyFileSystem myFileSystem = new MyFileSystem (
new FileSystem [] {lfs, systemFS}
);
Repository repository = new Repository (myFileSystem);
Object[] lookupContent = new Object [instances.length + 1];
lookupContent [0] = repository;
System.arraycopy (instances, 0, lookupContent, 1, instances.length);
DEFAULT_LOOKUP.setLookups (new Lookup[] {
Lookups.fixed (lookupContent),
Lookups.metaInfServices (classLoader),
Lookups.singleton (classLoader),
});
try {
Assert.assertEquals (myFileSystem, FileUtil.getConfigRoot().getFileSystem());
} catch (FileStateInvalidException e) {
e.printStackTrace();
}
}