E4 学习笔记(二)

依赖注入 Annotation

@ProcessAdditions
void initSelection(MApplication application, IEclipseContext context) {

@ProcessAdditions:Use this annotation to describe methods that will participate in the application lifecycle. This  method will be called once the model is loaded.

 

给视图添加最大/最小化按钮

  <addons elementId="MinMax Addon" contributionURI="platform:/plugin/org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon"/>
  <addons elementId="DnD Addon" contributionURI="platform:/plugin/org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.dndaddon.DnDAddon"/>
  <addons elementId="Cleanup Addon" contributionURI="platform:/plugin/org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.cleanupaddon.CleanupAddon"/>

Toolkit Model 的模型与实现事件同步

TM的具体组件事件由ControlBinder的handleEvent(Event event)方法发出,调用模型的control.eSet(feature, event);方法传达给模型。
WidgetsPackageImpl的initializePackageContents方法:
initEClass(buttonEClass, Button.class, "Button", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getButton_SelectionEvent(), this.getRuntimeEvent(), "selectionEvent", null, 0, 1, Button.class,IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

posted @ 2011-07-21 21:33  vwpolo  阅读(726)  评论(0编辑  收藏  举报