热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.eclipse.emf.common.util.URI.isPlatformResource()方法的使用及代码示例

本文整理了Java中org.eclipse.emf.common.util.URI.isPlatformResource()方法的一些代码示例,展示了URI

本文整理了Java中org.eclipse.emf.common.util.URI.isPlatformResource()方法的一些代码示例,展示了URI.isPlatformResource()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。URI.isPlatformResource()方法的具体详情如下:
包路径:org.eclipse.emf.common.util.URI
类名称:URI
方法名:isPlatformResource

URI.isPlatformResource介绍

[英]Returns true if this is a platform resource URI, that is, a #isPlatform whose first segment is "resource"; false is returned otherwise.
[中]如果这是平台资源URI,即第一段为“资源”的#isPlatform,则返回true;否则返回false

代码示例

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.emf.common

@Override
public boolean isPlatformResource()
{
return uri.isPlatformResource();
}

代码示例来源:origin: org.eclipse.emf/org.eclipse.emf.ecore

@Override
public boolean canHandle(URI uri)
{
return uri.isPlatformResource();
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.emf.ecore

@Override
public boolean canHandle(URI uri)
{
return uri.isPlatformResource();
}

代码示例来源:origin: fr.inria.atlanmod.neoemf/neoemf-core

@Override
public boolean isPlatformResource() {
return internalUri.isPlatformResource();
}

代码示例来源:origin: atlanmod/NeoEMF

@Override
public boolean isPlatformResource() {
return base.isPlatformResource();
}

代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.common.types

/**
* @since 2.9
*/
protected boolean isProjectLocal(URI uri, final String encodedProjectName) {
if (uri == null || uri.segmentCount() <2 || !uri.isPlatformResource())
return false;
else
return !uri.segment(1).equals(encodedProjectName);
}

代码示例来源:origin: org.eclipse/xtext

public CharSequence wrapWithTraceData(CharSequence sequence, URI originResourceURI, int originOffset, int originLength, int originLineNumber, int originEndLineNumber) {
if (!originResourceURI.isPlatformResource()) {
throw new IllegalArgumentException("URI has to be a platform resource uri but was: " + originResourceURI+ ". Use #wrapWithTraceData(CharSequence, URI, String, int, int) instead.");
}
return wrapWithTraceData(sequence, originResourceURI, originResourceURI.segment(1), originOffset, originLength, originLineNumber, originEndLineNumber);
}

代码示例来源:origin: org.eclipse.xtext/ui

@SuppressWarnings("unchecked")
public T getAdapter(Class adapterType) {
URI uri = resource.getURI();
if ((adapterType == IFile.class || adapterType == IResource.class) && uri.isPlatformResource()) {
return (T) ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(uri.toPlatformString(true)));
}
return null;
}

代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml

public static void validateFile(URI modelPath) {
if (modelPath.isPlatformResource()) {
IFile file;
try {
file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(modelPath.toPlatformString(true)));
} catch (Exception e) {
throw new RuntimeException(format("The model file '%s' does not exist.", modelPath));
}
if (file == null || !file.exists()) {
throw new RuntimeException(format("The model file '%s' does not exist.", modelPath));
}
if (file.getType() != IResource.FILE) {
throw new RuntimeException(format("The '%s' path is not a file.", modelPath));
}
}
}

代码示例来源:origin: org.codehaus.openxma/dsl-generator

private File getOutletFolder(URI uri) {
if (uri.isPlatformResource()) {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IFolder folder = root.getFolder((IPath) toPath(uri));
return new File(folder.getLocationURI());
}
return new File(uri.toFileString());
}

代码示例来源:origin: org.codehaus.openxma/dsl-generator

protected String toRelativePath(URI uri) {
String relativePath = null;
if (uri.isPlatformResource()) {
IFolder folder = EcorePlugin.getWorkspaceRoot().getFolder((IPath) toPath(uri));
relativePath = folder.getProjectRelativePath().toString() + File.separator;
} else {
relativePath = new File(getConfiguration().getProjectFolder().toFileString()).toURI().relativize(
new File(uri.toFileString()).toURI()).getPath();
relativePath = relativePath + File.separator;
}
return relativePath;
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.emf.edit

/**
* Returns whether to expect that the resource corresponding to the given URI form will be read only.
* @deprecated this method is no longer called by {@link #isReadOnly(Resource)}
*/
@Deprecated
protected boolean isReadOnlyURI(URI uri)
{
if (uri.isArchive())
{
return isReadOnlyURI(URI.createURI(uri.authority()));
}
return !uri.isPlatformResource() && (uri.isRelative() || !uri.isFile());
}

代码示例来源:origin: org.codehaus.openxma/dsl-generator

private Outlet createOutlet(String name, URI uri, boolean overwrite, boolean required, PostProcessor postProcessor) {
Outlet outlet = null;
if (uri.isPlatformResource()) {
outlet = createResourceOutlet(name, uri, overwrite, required);
} else if (uri.isFile()) {
outlet = createOutlet(name, uri, overwrite, required);
}
if (outlet != null && postProcessor != null) {
outlet.addPostprocessor(postProcessor);
}
return outlet;
}

代码示例来源:origin: org.eclipse.viatra/org.eclipse.viatra.query.patternlanguage.emf

@Override
public boolean isStandaloneFileURI(EObject context, URI uri) {
if (uri.isPlatformResource() && context.eResource() != null) {
IProjectConfig project = projectConfigurationProvider.getProjectConfig(context.eResource().getResourceSet());
if (project != null) {
return project.findSourceFolderContaining(uri) == null;
}
}
return true;
}
}

代码示例来源:origin: org.eclipse.xtext/ui

private IProject getProject(Resource resource) {
URI uri = resource.getURI();
if (uri.isPlatformResource()) {
final IProject project = getWorkspaceRoot().getProject(uri.segment(1));
if (project.isAccessible())
return project;
}
return null;
}

代码示例来源:origin: org.eclipse.xtext/ui

public Iterable> getStorages(URI uri) {
if (!uri.isPlatformResource()) {
// support storage lookup by absolute file URI as it is possibly resolved by importURI references
if (uri.isFile()) {
IPath path = new Path(uri.toFileString());
if (path.isAbsolute()) {
IFile file = getWorkspaceRoot().getFileForLocation(path);
return getStorages(file);
}
}
return emptySet();
}
IFile file = getWorkspaceRoot().getFile(new Path(uri.toPlatformString(true)));
return getStorages(file);
}

代码示例来源:origin: org.eclipse.xtext/ui

protected boolean isValidTargetFile(Resource resource, StatusWrapper status) {
IFile targetFile = projectUtil.findFileStorage(resource.getURI(), true);
if (targetFile != null)
return true;
String path = (resource.getURI().isPlatformResource())
? resource.getURI().toPlatformString(true)
: resource.getURI().toString();
status.add(FATAL, "Rename target file '" + path + "' cannot be accessed", resource.getURI());
return false;
}

代码示例来源:origin: org.codehaus.openxma/dsl-generator

private File getProjectDirectoryFile() {
if (projectDirectory == null) {
if (getConfiguration().getProjectFolder().isPlatformResource()) {
IProject project = EcorePlugin.getWorkspaceRoot().getProject(
getConfiguration().getProjectFolder().lastSegment());
projectDirectory = new File(project.getLocationURI());
} else {
projectDirectory = new File(getConfiguration().getProjectFolder().toFileString());
}
}
return projectDirectory;
}

代码示例来源:origin: org.eclipse/xtext

/**
* @return the resources uri in the normalized form or as is if it is a platform:/resource URI.
* @since 2.4
*/
public static URI getPlatformResourceOrNormalizedURI(Resource resource) {
URI rawURI = resource.getURI();
if (rawURI.isPlatformResource()) {
return rawURI;
}
if(resource.getResourceSet() != null) {
return resource.getResourceSet().getURIConverter().normalize(rawURI);
} else {
return URIConverter.INSTANCE.normalize(rawURI);
}
}

代码示例来源:origin: org.eclipse.xtext/ui

/**
* Produces hyperlinks for the given {@code region} that point to the referenced {@code target}.
*/
public void createHyperlinksTo(XtextResource from, Region region, EObject target, IHyperlinkAcceptor acceptor) {
final URIConverter uriCOnverter= from.getResourceSet().getURIConverter();
final String hyperlinkText = labelProvider.getText(target);
final URI uri = EcoreUtil.getURI(target);
final URI normalized = uri.isPlatformResource() ? uri : uriConverter.normalize(uri);
XtextHyperlink result = hyperlinkProvider.get();
result.setHyperlinkRegion(region);
result.setURI(normalized);
result.setHyperlinkText(hyperlinkText);
acceptor.accept(result);
}

推荐阅读
  • 自动轮播,反转播放的ViewPagerAdapter的使用方法和效果展示
    本文介绍了如何使用自动轮播、反转播放的ViewPagerAdapter,并展示了其效果。该ViewPagerAdapter支持无限循环、触摸暂停、切换缩放等功能。同时提供了使用GIF.gif的示例和github地址。通过LoopFragmentPagerAdapter类的getActualCount、getActualItem和getActualPagerTitle方法可以实现自定义的循环效果和标题展示。 ... [详细]
  • CF:3D City Model(小思维)问题解析和代码实现
    本文通过解析CF:3D City Model问题,介绍了问题的背景和要求,并给出了相应的代码实现。该问题涉及到在一个矩形的网格上建造城市的情景,每个网格单元可以作为建筑的基础,建筑由多个立方体叠加而成。文章详细讲解了问题的解决思路,并给出了相应的代码实现供读者参考。 ... [详细]
  • 闭包一直是Java社区中争论不断的话题,很多语言都支持闭包这个语言特性,闭包定义了一个依赖于外部环境的自由变量的函数,这个函数能够访问外部环境的变量。本文以JavaScript的一个闭包为例,介绍了闭包的定义和特性。 ... [详细]
  • 如何自行分析定位SAP BSP错误
    The“BSPtag”Imentionedintheblogtitlemeansforexamplethetagchtmlb:configCelleratorbelowwhichi ... [详细]
  • Java太阳系小游戏分析和源码详解
    本文介绍了一个基于Java的太阳系小游戏的分析和源码详解。通过对面向对象的知识的学习和实践,作者实现了太阳系各行星绕太阳转的效果。文章详细介绍了游戏的设计思路和源码结构,包括工具类、常量、图片加载、面板等。通过这个小游戏的制作,读者可以巩固和应用所学的知识,如类的继承、方法的重载与重写、多态和封装等。 ... [详细]
  • 电话号码的字母组合解题思路和代码示例
    本文介绍了力扣题目《电话号码的字母组合》的解题思路和代码示例。通过使用哈希表和递归求解的方法,可以将给定的电话号码转换为对应的字母组合。详细的解题思路和代码示例可以帮助读者更好地理解和实现该题目。 ... [详细]
  • 在Android开发中,使用Picasso库可以实现对网络图片的等比例缩放。本文介绍了使用Picasso库进行图片缩放的方法,并提供了具体的代码实现。通过获取图片的宽高,计算目标宽度和高度,并创建新图实现等比例缩放。 ... [详细]
  • 本文介绍了设计师伊振华受邀参与沈阳市智慧城市运行管理中心项目的整体设计,并以数字赋能和创新驱动高质量发展的理念,建设了集成、智慧、高效的一体化城市综合管理平台,促进了城市的数字化转型。该中心被称为当代城市的智能心脏,为沈阳市的智慧城市建设做出了重要贡献。 ... [详细]
  • 开发笔记:加密&json&StringIO模块&BytesIO模块
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了加密&json&StringIO模块&BytesIO模块相关的知识,希望对你有一定的参考价值。一、加密加密 ... [详细]
  • Java容器中的compareto方法排序原理解析
    本文从源码解析Java容器中的compareto方法的排序原理,讲解了在使用数组存储数据时的限制以及存储效率的问题。同时提到了Redis的五大数据结构和list、set等知识点,回忆了作者大学时代的Java学习经历。文章以作者做的思维导图作为目录,展示了整个讲解过程。 ... [详细]
  • JavaSE笔试题-接口、抽象类、多态等问题解答
    本文解答了JavaSE笔试题中关于接口、抽象类、多态等问题。包括Math类的取整数方法、接口是否可继承、抽象类是否可实现接口、抽象类是否可继承具体类、抽象类中是否可以有静态main方法等问题。同时介绍了面向对象的特征,以及Java中实现多态的机制。 ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]
  • 生成式对抗网络模型综述摘要生成式对抗网络模型(GAN)是基于深度学习的一种强大的生成模型,可以应用于计算机视觉、自然语言处理、半监督学习等重要领域。生成式对抗网络 ... [详细]
  • Iamtryingtomakeaclassthatwillreadatextfileofnamesintoanarray,thenreturnthatarra ... [详细]
  • 本文介绍了在开发Android新闻App时,搭建本地服务器的步骤。通过使用XAMPP软件,可以一键式搭建起开发环境,包括Apache、MySQL、PHP、PERL。在本地服务器上新建数据库和表,并设置相应的属性。最后,给出了创建new表的SQL语句。这个教程适合初学者参考。 ... [详细]
author-avatar
wonderoil
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有