本文整理汇总了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);
}
}
示例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);
}
示例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);
}
示例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);
}