Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "User talk:Longth.hotmail.com"

(New page: My talk)
 
(esfsfsfsfs: new section)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
My talk
 
My talk
 +
 +
== Editor生命周期 ==
 +
 +
editor被修改
 +
 +
----
 +
 +
平台调用Editor的isDirty方法获取editor的修改状态,当返回值为true,该editor被置为已修改.
 +
 +
创建boolean类型的实例变量dirty。
 +
覆盖isDirty方法,如下:
 +
 +
 +
在触发修改的时候调用以下代码:
 +
<source lang="java">
 +
dirty = true; // 修改editor的状态为已修改
 +
firePropertyChange(PROP_DIRTY);      // 通知平台编辑器dirty属性被修改
 +
</source>
 +
 +
完成以上步骤,当对editor进行修改后,editor的标题栏会加上*标志。
 +
 +
== Eclipse Command Framework 简介 ==
 +
 +
'''前言'''
 +
 +
从Eclipse 3.3开始,平台正式引入了Command Framework来让开发者实现用户交互UI组件(菜单、工具栏、状态栏等等)的扩展。
 +
 +
在版本3.3以前,用户通过以下几个扩展点来扩展菜单等交互UI组件:
 +
 +
org.eclipse.ui.ActionSets
 +
org.eclipse.ui.EditorActions
 +
org.eclipse.ui.popupMenus (including 'objectContributions')
 +
org.eclipse.ui.viewAction
 +
Command Framework由以下几个扩展点组成:
 +
 +
org.eclipse.ui.commands
 +
org.eclipse.ui.handlers
 +
org.eclipse.ui.menus
 +
org.eclipse.ui.bindings
 +
org.eclipse.ui.contexts
 +
 +
----
 +
 +
'''Command'''
 +
 +
从词面的意思command是代表一个执令,基本上与设计模式中Command模式相同,只是Eclipse中的command本身不执行具体的功能,而是把功能的执行由handler来处理,这样的设计更加灵活,每个command都可以关联多个handler,在随后的介绍中会介绍如何将handler与command关联起来。
 +
 +
平台中的Command由ICommandService来维护,ICommandService提供了非常多的接口来操作command,具体请参照Api文档。
 +
 +
添加新的command通过扩展org.eclipse.ui.commands来实现
 +
 +
== fffff ==
 +
 +
ssss
 +
 +
== esfsfsfsfs ==
 +
 +
sesfsef

Latest revision as of 03:08, 28 September 2008

My talk

Editor生命周期

editor被修改


平台调用Editor的isDirty方法获取editor的修改状态,当返回值为true,该editor被置为已修改.

创建boolean类型的实例变量dirty。 覆盖isDirty方法,如下:


在触发修改的时候调用以下代码:

dirty = true;		// 修改editor的状态为已修改
firePropertyChange(PROP_DIRTY);      // 通知平台编辑器dirty属性被修改

完成以上步骤,当对editor进行修改后,editor的标题栏会加上*标志。

Eclipse Command Framework 简介

前言

从Eclipse 3.3开始,平台正式引入了Command Framework来让开发者实现用户交互UI组件(菜单、工具栏、状态栏等等)的扩展。

在版本3.3以前,用户通过以下几个扩展点来扩展菜单等交互UI组件:

org.eclipse.ui.ActionSets org.eclipse.ui.EditorActions org.eclipse.ui.popupMenus (including 'objectContributions') org.eclipse.ui.viewAction Command Framework由以下几个扩展点组成:

org.eclipse.ui.commands org.eclipse.ui.handlers org.eclipse.ui.menus org.eclipse.ui.bindings org.eclipse.ui.contexts


Command

从词面的意思command是代表一个执令,基本上与设计模式中Command模式相同,只是Eclipse中的command本身不执行具体的功能,而是把功能的执行由handler来处理,这样的设计更加灵活,每个command都可以关联多个handler,在随后的介绍中会介绍如何将handler与command关联起来。

平台中的Command由ICommandService来维护,ICommandService提供了非常多的接口来操作command,具体请参照Api文档。

添加新的command通过扩展org.eclipse.ui.commands来实现

fffff

ssss

esfsfsfsfs

sesfsef

Back to the top