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


Java Diagram.eResource方法代码示例

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


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

示例1: getNavigatorSelection

import org.eclipse.gmf.runtime.notation.Diagram; //导入方法依赖的package包/类
/**
 * @generated
 */
private ISelection getNavigatorSelection() {
	IDiagramDocument document = getDiagramDocument();
	if (document == null) {
		return StructuredSelection.EMPTY;
	}
	Diagram diagram = document.getDiagram();
	if (diagram == null || diagram.eResource() == null) {
		return StructuredSelection.EMPTY;
	}
	IFile file = WorkspaceSynchronizer.getFile(diagram.eResource());
	if (file != null) {
		StatemachineNavigatorItem item = new StatemachineNavigatorItem(
				diagram, file, false);
		return new StructuredSelection(item);
	}
	return StructuredSelection.EMPTY;
}
 
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:21,代码来源:StatemachineDiagramEditor.java

示例2: getEditorInput

import org.eclipse.gmf.runtime.notation.Diagram; //导入方法依赖的package包/类
/**
 * @generated
 */
private static IEditorInput getEditorInput(Diagram diagram) {
	Resource diagramResource = diagram.eResource();
	for (EObject nextEObject : diagramResource.getContents()) {
		if (nextEObject == diagram) {
			return new FileEditorInput(
					WorkspaceSynchronizer.getFile(diagramResource));
		}
		if (nextEObject instanceof Diagram) {
			break;
		}
	}
	URI uri = EcoreUtil.getURI(diagram);
	String editorName = uri.lastSegment() + '#'
			+ diagram.eResource().getContents().indexOf(diagram);
	IEditorInput editorInput = new URIEditorInput(uri, editorName);
	return editorInput;
}
 
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:21,代码来源:StatemachineNavigatorLinkHelper.java

示例3: findSelection

import org.eclipse.gmf.runtime.notation.Diagram; //导入方法依赖的package包/类
/**
 * @generated
 */
public IStructuredSelection findSelection(IEditorInput anInput) {
	IDiagramDocument document = StatemachineDiagramEditorPlugin
			.getInstance().getDocumentProvider()
			.getDiagramDocument(anInput);
	if (document == null) {
		return StructuredSelection.EMPTY;
	}
	Diagram diagram = document.getDiagram();
	if (diagram == null || diagram.eResource() == null) {
		return StructuredSelection.EMPTY;
	}
	IFile file = WorkspaceSynchronizer.getFile(diagram.eResource());
	if (file != null) {
		StatemachineNavigatorItem item = new StatemachineNavigatorItem(
				diagram, file, false);
		return new StructuredSelection(item);
	}
	return StructuredSelection.EMPTY;
}
 
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:23,代码来源:StatemachineNavigatorLinkHelper.java

示例4: getEditorInput

import org.eclipse.gmf.runtime.notation.Diagram; //导入方法依赖的package包/类
private static IEditorInput getEditorInput(Diagram diagram) {
	Resource diagramResource = diagram.eResource();
	for (Iterator<EObject> it = diagramResource.getContents().iterator(); it
			.hasNext();) {
		EObject nextEObject = (EObject) it.next();
		if (nextEObject == diagram) {
			return new FileEditorInput(
					WorkspaceSynchronizer.getFile(diagramResource));
		}
		if (nextEObject instanceof Diagram) {
			break;
		}
	}
	URI uri = EcoreUtil.getURI(diagram);
	String editorName = uri.lastSegment() + "#"
			+ diagram.eResource().getContents().indexOf(diagram);
	IEditorInput editorInput = new URIEditorInput(uri, editorName);
	return editorInput;
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:20,代码来源:NavigatorLinkHelper.java


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