Summary: | [PropertiesView] Properties view should delegate Save back to source part | ||
---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Nick Edgar <n.a.edgar> |
Component: | UI | Assignee: | Nick Edgar <n.a.edgar> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | major | ||
Priority: | P2 | CC: | dmisic, douglas.pollock, emoffatt |
Version: | 3.2 | Keywords: | usability |
Target Milestone: | 3.2 M5 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
See Also: | https://bugs.eclipse.org/bugs/show_bug.cgi?id=495567 | ||
Whiteboard: |
Description
Nick Edgar
2006-01-26 15:55:11 EST
Since the SaveAction looks for ISaveablePart using both direct instanceof checks on the active part, and getAdapter(ISaveablePart.class), I can address this problem by having the Properties view provide an ISaveablePart adapter that delegates back to the source part (actually, it can answer the source part directly). PageBookView.getAdapter already delegates to the active page, then to the platform adapter manager. It now also calls getViewAdapter in between, which can be overridden it subclasses. PropertySheet overrides getViewAdapter and calls getSaveablePart() for the ISaveablePart.class case, which returns the source part (getCurrentContributingPart()). For the default property sheet page, however, getCurrentContributingPart() returns null, so we need to handle this specially in PropertySheetPage. PropertySheetPage now remembers the source part, and has logic to clean this reference up when the source part is closed (previously it would continue showing properties from the closed part). This bug is part of an effort to address broader save/close lifecycle concerns in 3.2. See bug 112225 comment 11 for an overview of the general problem. I would recommend renaming IDocument to something else. The concept being represented has no direct connection to a document, and may not be textual at all. It might be better to use the word "Model" in some form or another. Perhaps one of the following: + IModel + ISavableModel + IModelWithHandlers + IEditorModel + IEditableModel See bug 112225 comment 22. I've gone with ISaveableModel and ISaveableModelSource. Note that these APIs are not involved in the fix for this bug. Closing as fixed. Verified in I20060213-1200 using Saveable Mock View from tests as source view. Also added a test for this: PropertySheetAuto.testSaveableRetargeting() |