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


Java View.eResource方法代码示例

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


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

示例1: validate

import org.eclipse.gmf.runtime.notation.View; //导入方法依赖的package包/类
/**
 * @generated
 */
private static void validate(DiagramEditPart diagramEditPart, View view) {
	IFile target = view.eResource() != null ? WorkspaceSynchronizer
			.getFile(view.eResource()) : null;
	if (target != null) {
		StatemachineMarkerNavigationProvider.deleteMarkers(target);
	}
	Diagnostic diagnostic = runEMFValidator(view);
	createMarkers(target, diagnostic, diagramEditPart);
	IBatchValidator validator = (IBatchValidator) ModelValidationService
			.getInstance().newValidator(EvaluationMode.BATCH);
	validator.setIncludeLiveConstraints(true);
	if (view.isSetElement() && view.getElement() != null) {
		IStatus status = validator.validate(view.getElement());
		createMarkers(target, status, diagramEditPart);
	}
}
 
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:20,代码来源:ValidateAction.java

示例2: refresh

import org.eclipse.gmf.runtime.notation.View; //导入方法依赖的package包/类
@Override
public void refresh() {
	removeDecoration();
	boolean showLabels = DiagramActivator.getDefault().getPreferenceStore()
			.getBoolean(StatechartPreferenceConstants.PREF_PRIORITY_LABELS);
	if (!showLabels)
		return;
	View view = (View) getDecoratorTarget().getAdapter(View.class);
	if (view == null || view.eResource() == null) {
		return;
	}
	IGraphicalEditPart editPart = (IGraphicalEditPart) getDecoratorTarget().getAdapter(EditPart.class);
	if (editPart == null || editPart.getViewer() == null) {
		return;
	}
	if (needsDecoration(editPart))
		createDecorators(editPart);
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:19,代码来源:AbstractPriorityDecorationProvider.java

示例3: refresh

import org.eclipse.gmf.runtime.notation.View; //导入方法依赖的package包/类
public void refresh() {
	removeDecoration();
	View view = (View) getDecoratorTarget().getAdapter(View.class);
	if (view == null || view.eResource() == null) {
		return;
	}
	EditPart editPart = (EditPart) getDecoratorTarget().getAdapter(EditPart.class);
	if (editPart == null || editPart.getViewer() == null) {
		return;
	}

	IResource resource = WorkspaceSynchronizer.getFile(view.eResource());
	if (resource == null || !resource.exists()) {
		return;
	}
	List<IMarker> markers = new ArrayList<IMarker>();
	try {
		markers.addAll(Arrays.asList(resource.findMarkers(getMarkerType(), true, IResource.DEPTH_INFINITE)));
	} catch (CoreException e) {
		e.printStackTrace();
	}
	if (markers == null || markers.size() == 0) {
		return;
	}
	createDecorators(view, markers);
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:27,代码来源:AbstractMarkerBasedDecorationProvider.java

示例4: getTargetView

import org.eclipse.gmf.runtime.notation.View; //导入方法依赖的package包/类
private Optional<View> getTargetView() {
	View view = (View) getDecoratorTarget().getAdapter(View.class);
	if (view == null || view.eResource() == null) {
		return Optional.empty();
	}
	return Optional.of(view);
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:8,代码来源:StatechartValidationDecorationProvider.java


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