下面都是从新闻组看到的一些东西,留作以后查看
1.could not creat link
Ok. If "true" is returned from XXXCreateCommand.canExecute() then you can try placing a breakpont into XXXViewProvider.createEdge()(in past this method was called "getEdgeViewClass()) operation - this method will be called as a second part of link creation and can be another reason preventing you from second link creation.
(also XXXItemSemanticEditPolicy.getCreateRelationshipCommand())
If you have several links with same underlying domain model meta-element then you have to add some (OCL) constraints to make it possible for GMF to destinguish between these links.
2.How can I make static picture on canvas like the compass in taipan
editor?
It was done by writing custom code - check AquatoryEditPart.createFigure().
3.drawback of providers structure
Try raising priorities of View/EditPart providers registered in a plugin.xml generated by GMF for your diagram - this is a drawback of providers structure - anybody can easily break your diagram by itroducing their own provider.. In near future we are going to generate provider-based implementation only in situations then it is necessary.
4.GMF Editor without FileInput
This could help?
In your DiagramEditor, the method below opens the editor with new EditorInput, you could change it here.
// in Diagram Editor
public static boolean openDiagram(Resource diagram)
throws PartInitException {
IWorkbenchPage page = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage();
>> page.openEditor(new URIEditorInput(diagram.getURI()),
YourDiagramEditor.ID);
return true;
}
.....and make sure the DocumentProvider can handle your new Editor input.
// In Document provider
protected ElementInfo createElementInfo(Object element)
throws CoreException {
if (false == element instanceof URIEditorInput) {
...
}
IEditorInput editorInput = (IEditorInput) element;
IDiagramDocument document = (IDiagramDocument) createDocument(editorInput);
ResourceSetInfo info = new ResourceSetInfo(document, editorInput);
...
}
.... also here you need to hackin to set your content properly, you might
need your version of DiagramDocument
protected void setDocumentContent(IDocument document, IEditorInput element)
throws CoreException {
IDiagramDocument diagramDocument = (IDiagramDocument) document;
TransactionalEditingDomain domain = diagramDocument.getEditingDomain();
......
EObject rootElement = resource.getEObject(uri.fragment());
if (rootElement instanceof Diagram) {
document.setContent((Diagram) rootElement);
return;
}
......
.... Of course the Resource if by default an EMF Resource with certain characteristics. (Like XMI serialization), you could change this by
creating a ResourceFactory and tigh this factory to an extension or protocol.
//plugin.xml
<extension point="org.eclipse.emf.ecore.extension_parser" id="resource-factory">
<?gmfgen generated="true"?>
<parser
type="your extension"
>>class="org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactory">
</parser>
</extension>
....Your factory my need a custom Resource used by the document provider to set the content.
dnd
http://www.eclipse.org/newsportal/article.php?id=16299&group=eclipse.modeling.gmf#16299
to be continued...
分享到:
相关推荐
STM32F407 TIM 编码器模式的一些问题 在调试 STM32F407VG 的过程中,笔者发现了 TIM 编码器模式的一些问题。 TIM 编码器模式是 STM32F407VG 中的一个重要功能,它可以将外部编码器的脉冲信号转换为数字信号,以便于...
高性能计算机技术发展的一些问题 高性能计算机技术发展的一些问题是当前计算机技术发展的热点话题。从计算机发展到目前的云计算,高性能计算机技术发展的一些问题已经成为计算机技术发展的主要方向。下面我们将详细...
BOM在ERP中的一些运用和问题,BOM是ERP的基础,BOM运用很重要
刚入门c的同学可以看看,是数组的一些关于排序,删除,插入,显示等基本功能,好好看看啊。
WCE6中自己遇到的一些问题
QTP11补丁发布 - 增强WPF对象识别以及修复一些问题 This hotfix fixes the following problems: 1. QuickTest Professional sometimes caused .Net 4 WPF applications with multiple AppDomains to crash. 2. Quick...
数据库sql的一些问题
如果你为了一些电脑的问题而发愁!如果有些问题你无法解决!如果你的电脑有小毛病但是你又不知道如何解决! 那就别再犹豫了。我把我说收集的精华编辑成了文档。想要的可以下载下去看看! 我这里就不一一解释了!!
算王算量软件常见的一些问题.pdf
asp比较全面的一些问题,适合ASP初级学习
lstm的一些问题和解决方案
复试面试的一些问题.pdf
这个是我个人在学习中遇到过的问题,希望能够帮大家解决一些问题
环信遇到的一些问题
关于ad域的一些问题和解决方案
此文档是我再做项目时关于Ueditor整合SpringBoot的一些问题的总结
威胁计算机网络安全的一些问题
关于ACP常出错的一些问题整理,欢迎大家吃瓜
( ARM嵌入式常用开发工具介绍和一些问题的处理(更新 ARM嵌入式常用开发工具介绍和一些问题的处理(更新