下面都是从新闻组看到的一些东西,留作以后查看
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...
分享到:
相关推荐
java学习过程中遇到的一些问题,常见的错误及一些快捷健的说明。
内存的管理问题的处理方法
javascript一些问题解答 javascript一些问题解答
IIS的一些问题IIS常遇问题详解 IIS的一些问题 IIS的一些问题
BOM在ERP中的一些运用和问题,BOM是ERP的基础,BOM运用很重要
刚入门c的同学可以看看,是数组的一些关于排序,删除,插入,显示等基本功能,好好看看啊。
对CONST在C++中的应用及STITIC的用法
vue.js集成echarts时遇到的一些问题总结 最近在做Beetlex的数据分析平台,在开发这个产品过程中涉及到大量的数据图表展示功能;由于产品前端使用的是vuejs开发,所以在集成echarts或多或少会碰到一些问题,在这里...
QTP11补丁发布 - 增强WPF对象识别以及修复一些问题 This hotfix fixes the following problems: 1. QuickTest Professional sometimes caused .Net 4 WPF applications with multiple AppDomains to crash. 2. Quick...
N进制计数器的一些问题探讨,大家可以下下来,不错的资料
本章内容跟java有关,对于一些问题给了一些答案
数据库sql的一些问题
三星S2一些问题
学习MFC中见到的一些问题。那来看一下。
WCE6中自己遇到的一些问题
如果你为了一些电脑的问题而发愁!如果有些问题你无法解决!如果你的电脑有小毛病但是你又不知道如何解决! 那就别再犹豫了。我把我说收集的精华编辑成了文档。想要的可以下载下去看看! 我这里就不一一解释了!!
CDS使用中的一些问题 CDS使用中的一些问题 CDS使用中的一些问题
设置共享中的一些问题效果,,,,,,设置共享中的一些问题效果
Myeclipse中无法启动TOmcat的一些问题
算王算量软件常见的一些问题.pdf