本文整理匯總了Java中org.eclipse.core.resources.IFile.isAccessible方法的典型用法代碼示例。如果您正苦於以下問題:Java IFile.isAccessible方法的具體用法?Java IFile.isAccessible怎麽用?Java IFile.isAccessible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.core.resources.IFile
的用法示例。
在下文中一共展示了IFile.isAccessible方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: displayComparisonView
import org.eclipse.core.resources.IFile; //導入方法依賴的package包/類
/**
* Display comparison view of test file with expected and actual xpect expectation
*/
private void displayComparisonView(ComparisonFailure cf, Description desc) {
IXpectURIProvider uriProfider = XpectRunner.INSTANCE.getUriProvider();
IFile fileTest = null;
if (uriProfider instanceof N4IDEXpectTestURIProvider) {
N4IDEXpectTestURIProvider fileCollector = (N4IDEXpectTestURIProvider) uriProfider;
fileTest = ResourcesPlugin.getWorkspace().getRoot()
.getFileForLocation(new Path(fileCollector.findRawLocation(desc)));
}
if (fileTest != null && fileTest.isAccessible()) {
N4IDEXpectCompareEditorInput inp = new N4IDEXpectCompareEditorInput(fileTest, cf);
CompareUI.openCompareEditor(inp);
} else {
throw new RuntimeException("paths in descriptions changed!");
}
}
示例2: onDoubleClick
import org.eclipse.core.resources.IFile; //導入方法依賴的package包/類
/**
* Invoked when user double-clicks a result node in the UI.
*/
protected void onDoubleClick() {
final ISelection selection = testTreeViewer.getSelection();
final ResultNode resultNode = (ResultNode) ((IStructuredSelection) selection).getFirstElement();
if (resultNode == null) {
return;
}
TestElement testElement = resultNode.getElement();
if (testElement instanceof TestCase) {
final URI testCaseURI = ((TestCase) testElement).getURI();
if (testCaseURI == null) {
return;
}
final IN4JSEclipseProject project = core.findProject(testCaseURI).orNull();
if (null != project && project.exists()) {
final URI moduleLocation = testCaseURI.trimFragment();
final String[] projectRelativeSegments = moduleLocation.deresolve(project.getLocation()).segments();
final String path = Joiner.on(SEPARATOR)
.join(copyOfRange(projectRelativeSegments, 1, projectRelativeSegments.length));
final IFile module = project.getProject().getFile(path);
if (null != module && module.isAccessible()) {
uriOpener.open(testCaseURI, true);
} else {
openError(getShell(), "Cannot open editor", "Test class not found in selected project.");
}
} else {
openError(getShell(), "Cannot open editor", "The container project not found in the workspace.");
}
}
}