當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。