`
youngerbaby
  • 浏览: 111963 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
GMF默认生成的outline很成问题,只能显示top level的图形,比如在logic例子中,画板中图形元素和outline对应如下:   可见非top level的图形并没有与之对应的Tree Item显示在outline tree上。 其实用过gef的人都很容易知道原因,因为outline上每一个节点对应的也是一个tree editpart,每个tree editpart复用对应画板图形元素相同的数据模型。因此很显然,GMF生成的outline 和TreeEditPart并不能满足具体应用的需求,用户需要自己订制每个图形元素对应的outline 元素,也就是为每个图形元素实现一个Tr ...
在基于EMF模型的应用中经常会有这样的需求: 当一个模型对象被一个特定的对象引用后,就不可以再被其他的对象引用。如何获取一个模型被那些其他模型引用了这个信息呢? 当然一种解决方案是在建模的时候,把引用设成双向的。然而这样会造成一定的冗余,使你的模型稍显臃肿和复杂。其实如果你是用EMF来表示你的模型,通过EMF提供的API可以获得所有引用某个model的model列表: 代码如下: EObject referencedModel = getReferencedModel();  // 被引用的对象 List adapters = referencedModel .eAdapters();     ...
在eclipse插件开发过程中有时会遇到插件循环依赖的问题,其实本可以避免的,但谁也不能保证当初的设计会有问题。俺就遇到了这个问题,不过有一种解决办法就是通过写扩展点。 比如插件A和插件B,A是项目中所有插件的核心,所有的插件必须依赖于插件A,所有插件都使用A提供的接口和服务。但有时为了降低插件的耦合性,或者保持插件的独立性,一些个性的操作接口,都应该尽量定义在每个插件中,尽量不要定义在A中。比如,在插件B中定义了一个个性wizard,但是A要实例化这个wizard,问什么不在B中直接实例化?唉!不是说了嘛,设计失误,没辙B要使用A中的接口,而A要实例化B中的类,循环了!这可咋办?想来想去,只好 ...
Object Management Group (OMG) standards Meta-Object Facility (MOF) Unified Modeling Language (UML) and UML Profiles not falling within the scope of other projects Model-Driven Architecture (MDA) related specifications Query, View, Transformation (QVT) MOF to Text (MOF2T) Diagram Interchange S ...
实际上就是对eclipse actionSets扩展点的应用   <extension point="org.eclipse.ui.actionSets"><actionSet        id="my.actionSet"        label="Sample Action Set"        visible="true">        <menu                  id="sampleMenu"                  lab ...
在GMF中当使用XYLayout时经常会遇到这样的问题: 1。在create一个新figure时,figure会跑到它的parent figure的外面。 2。在move或者resize时跑到parent figure的外面。 如下图logic example中的问题: 一般的情况下,用户会challenge这个现象,如果在resize的时候,即便把figure的边界拖出parent,figure可以自动保持在parent的内部就比较好。 做到这个也不难,重载XYLayoutEditPolicy中的public Object getConstraintFor(Rectangle r) 方法就 ...
EditorPart[] parts = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditors();   或者 IEditorReference[] parts = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences();
前几天问了一个同事EMF模型操作的问题,还没来的验证,先记下再说! 当在EditDomain下操作模型时,所有对模型的修改需要在Command中完成,并且涉及到了EMF事务处理。不在EditDomain下操作模型,不涉及事务,但需要自己写自己的模型监听器。在EditDomain下操作模型,在ResourceSet里面注册监听器就可以监听模型的变化!
开始用Windows live writer了,感觉比较方便!
Some methods are really tidy and powerfull in eclipse, but a big problem is when I want to use them I ofen forget how to use them.Here is the method to get the projects list of current workspace.IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
a)    First, in class DiagramDocumentEditor, the method public void doSave(IProgressMonitor progressMonitor) { }b)    Second, the method above call the methon:protected void performSave(boolean overwrite, IProgressMonitor progressMonitor) {}this method is in class DiagramDocumentEditor.c)AbstractDocu ...
1. 创建element type的一段代码 private Element createElement(Element container, IElementType type,            EReference containmentFeature, IProgressMonitor progressMonitor) {        CreateElementRequest createRequest = new CreateElementRequest(            getEditingDomain(), container, type, containmentFea ...
2006年5月9日讨论了关于gmf的一些feature2006年5月14日1.阅读文章“Learn how to implement the Command pattern in Java ”http://www.javaworld.com/javaworld/javatips/jw-javatip68.html该文章主要讲了设计基于java语言特性的Command框架设计。figure 1 关于Receiver和Invoker交互关系的序列图 <basefont>The key idea here is that the concrete command registers its ...
Resource通过两种方式实现XML和XMI。1.XML实现Resource存储的重要方法是save, 只有在方法eIsSet()返回true时,相关的属性和引用才会被序列化到xml中。对于存储的xml文件的格式可以通过设置OPTION_XML_MAP属性来完成,如下面原文: There are several reasons why you might want to use OPTION_XML_MAP when saving a resource: You want to save your data so that it conforms to a particu ...
关于EMF的序列化对于EMF的序列化有几个比较重要的接口:Resource,ResourceSet,Resource.Factory,URIConverter。这些接口的主要作用就是保存模型到持久化存储介质,或者从持久化存储介质加载模型。1.关于URI(Uniform Resource Identifier)在EMF 中是通过URI来标识package的,并且同过URI来唯一的确定resources。URI包括三个部分:a scheme, a scheme-specific part和an optional fragment。scheme主要决定了访问资源的协议;比如:Platform:/res ...
Global site tag (gtag.js) - Google Analytics