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