ボタンはエディターとは直接関係ありません。
そこで説明されているように、あなたはしなければなりません):
:
protected void makeActions(final IWorkbenchWindow window) {
// Creates the actions and registers them.
// Registering is needed to ensure that key bindings work.
// The corresponding commands keybindings are defined in the plugin.xml
// file.
// Registering also provides automatic disposal of the actions when
// the window is closed.
saveAction = ActionFactory.SAVE.create(window);
register(saveAction);
}
- 一部ダーティフラグを追加し、メソッド、メソッド
Editor
を実装。isDirty()
setDirty()
clean()
2013 年 2 月、ユーザー sdから更新:
注: Indigo R2 (3.7.2) に基づく RCP では、 に を追加するsaveAction
必要ActionBarContributor
がなくなりました。を追加し、エディタのメソッドに追加し、次のようにオーバーライド
するだけで十分です。menuContribution
getCommandStack().markSaveLocation()
doSave()
commandStackChanged()
public void commandStackChanged(EventObject event) {
firePropertyChange(PROP_DIRTY);
super.commandStackChanged(event);
}