Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "User talk:Longth.hotmail.com"
(New page: My talk) |
(→Editor生命周期: new section) |
||
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的标题栏会加上*标志。 |
Revision as of 02:50, 28 September 2008
My talk
Editor生命周期
editor被修改
平台调用Editor的isDirty方法获取editor的修改状态,当返回值为true,该editor被置为已修改.
创建boolean类型的实例变量dirty。 覆盖isDirty方法,如下:
在触发修改的时候调用以下代码:
dirty = true; // 修改editor的状态为已修改 firePropertyChange(PROP_DIRTY); // 通知平台编辑器dirty属性被修改
完成以上步骤,当对editor进行修改后,editor的标题栏会加上*标志。