当前位置: 首页>>代码示例>>Java>>正文


Java IResource.createMarker方法代码示例

本文整理汇总了Java中org.eclipse.core.resources.IResource.createMarker方法的典型用法代码示例。如果您正苦于以下问题:Java IResource.createMarker方法的具体用法?Java IResource.createMarker怎么用?Java IResource.createMarker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.resources.IResource的用法示例。


在下文中一共展示了IResource.createMarker方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showInstruction

import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
/**
 * Show the given {@link EObject instruction}.
 * 
 * @param editorPart
 *            the opened {@link DialectEditor}
 * @param instruction
 *            the {@link EObject instruction} to show
 */
public static void showInstruction(DialectEditor editorPart, EObject instruction) {
	final URI resourceURI = instruction.eResource().getURI();
	if (resourceURI.isPlatformResource()) {
		final String resourcePath = resourceURI.toPlatformString(true);
		final IResource resource = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(
				resourcePath));
		try {
			final IMarker marker = resource.createMarker(EValidator.MARKER);
			marker.setAttribute(EValidator.URI_ATTRIBUTE, EcoreUtil.getURI(instruction).toString());
			final TraceabilityMarkerNavigationProvider navigationProvider = new TraceabilityMarkerNavigationProvider(
					(DialectEditor)editorPart);
			navigationProvider.gotoMarker(marker);
			marker.delete();
		} catch (CoreException e) {
			DebugSiriusIdeUiPlugin.INSTANCE.log(e);
		}
	}
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:27,代码来源:SiriusEditorUtils.java

示例2: reportError

import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
private void reportError(IResource resource, String message)
{
	try
	{
		IMarker marker = resource.createMarker(JPFClasspathPlugin.MARKER_ID);
		marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
		marker.setAttribute(IMarker.MESSAGE, message);
		marker.setAttribute(IMarker.LINE_NUMBER, 1);
	}
	catch( CoreException e )
	{
		// nothing
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:15,代码来源:JPFManifestBuilder.java

示例3: addMarker

import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
static public void addMarker(IResource resource, String markerType, String message, int lineNumber, int severity) throws CoreException
{
	IMarker marker = resource.createMarker(markerType);
	marker.setAttribute(IMarker.MESSAGE, message);
	marker.setAttribute(IMarker.SEVERITY, severity);
	if (lineNumber == -1) {
		lineNumber = 1;
	}
	marker.setAttribute(IMarker.LINE_NUMBER, lineNumber);
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:11,代码来源:Marker.java

示例4: internalCreateMarker

import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
/**
 * Creates a marker on the given resource with the given type and
 * attributes.
 * <p>
 * This method modifies the workspace (progress is not reported to the
 * user).
 * </p>
 *
 * @param resource
 *            the resource
 * @param attributes
 *            the attribute map
 * @param markerType
 *            the type of marker
 * @throws CoreException
 *             if this method fails
 * @see IResource#createMarker(java.lang.String)
 */
private void internalCreateMarker(final IResource resource, final Map<String, Object> attributes,
		final String markerType) throws CoreException {

	IWorkspaceRunnable r = new IWorkspaceRunnable() {
		@Override
		public void run(IProgressMonitor monitor) throws CoreException {
			IMarker marker = resource.createMarker(markerType);
			marker.setAttributes(attributes);
			handleMarkerAdded(marker);

		}
	};

	resource.getWorkspace().run(r, null, IWorkspace.AVOID_UPDATE, null);
}
 
开发者ID:de-jcup,项目名称:eclipse-batch-editor,代码行数:34,代码来源:AbstractMarkerHelper.java

示例5: createEditorConfigMarker

import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
public static IMarker createEditorConfigMarker(IResource resource) throws CoreException {
	return resource.createMarker(EC_PROBLEM_MARKER_TYPE);
}
 
开发者ID:angelozerr,项目名称:ec4e,代码行数:4,代码来源:MarkerUtils.java


注:本文中的org.eclipse.core.resources.IResource.createMarker方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。