I am working under Eclipse plug-in development. I have implemented two view parts to view and change some objects. Each view part implements ISaveablePart
to save modified objects and enable save button on toolbar.
The problem is: when I select my objects in Project Explorer, Save button isn't enabled, only Save All is enabled.
So I'd like to know is there any ability to enable Save butto开发者_如何学Cn in this case?
You must first implement ISaveablePart
, as you have mentioned above.
You have to fire an event (see IWorkbenchPartConstants.PROP_DIRTY
), which will in turn ask your editor whether it's dirty (ISaveablePart#isDirty()
). If the answer is true
, then the save button will be enabled.
See FormEditor#editorDirtyStateChanged()
for an example.
精彩评论