This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | projectOpened/projectClosed methods should be called on all instances of ProjectOpenedHook | ||
---|---|---|---|
Product: | projects | Reporter: | Andrei Badea <abadea> |
Component: | Generic Projects UI | Assignee: | apireviews <apireviews> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | jglick, jlahoda |
Priority: | P3 | Keywords: | API, API_REVIEW_FAST |
Version: | 4.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 51880 | ||
Attachments: |
Proposed change.
Improved patch with corrected api changes. |
Description
Andrei Badea
2005-03-25 18:40:37 UTC
May be too late to push such an API change thru DevRev, I don't know. We are long after feature freeze. I agree, I don't want to push it for 4.1. Promo-F should be enough. Actually we can't make those methods public since existing subclasses overriding as protected would be broken. (In sources, not I think in binaries.) Would need some new helper methods or something. Maybe we could add public static void notifyProjectOpened(POH poh); public static void notifyProjectClosed(POH poh); to ProjectOpenedHook? Not very nice, but would probably suffice? Another idea: what if the ant/freeform defined a new interface/abstract class FreeformProjectOpenedHook, which would be implemented by the natures in place of ProjectOpenedHook? The freeform project would then define the ProjectOpenHook and do callbacks into FreeformProjectOpenedHook(s). While your solution would work and would solve this concrete problem (in the freeform), it would be just a not very nice workaround around a bug in project/uiapi. I think the bug should be solved, otherwise sometimes in the future we will face it again. OTOH this solution allows the freeform nature to be notified when the project is opened or closed, which is exactly what I need. From this point of view I'm perfectly happy with it. Currently, there is only one known client of the notifyOpened, notifyClosed API, so it seems to me like a bit overkill to introduce such API. Jesse, what do you think about it? No strong opinion; either way could work. We need to add an API *somehow* anyway, since even to add to the freeform SPI is an API change (though not as central). There is another option: the projectOpened and projectClosed callbacks can be called on all ProjectOpenedHook(s) found in the project's lookup, not only on the first one. Although this is an incompatible change, I think it is the best way to solve this problem. I am attaching diff that makes this change. If there are no objects, I will pass it to api review. Created attachment 21978 [details]
Proposed change.
Probably OK; send to apireviews. One note in apichanges: <compatibility> should contain nested text explaining what the incompatibility is, when you would be affected, and what you can do instead. Created attachment 21979 [details]
Improved patch with corrected api changes.
I would like to ask for API review of the following change: Currently, if a project is being opened/closed, method projectOpened/projectClosed is called on the first instance of org.netbeans.spi.project.ui.ProjectOpenedHook found in the project's lookup. I propose to call this method on all instances of org.netbeans.spi.project.ui.ProjectOpenedHook found in the project's lookup. The patch for this change is attached. Adjusting summary. If there are no objections, I will commit the change tomorrow. Implemented: Checking in projectui/src/org/netbeans/modules/project/ui/OpenProjectList.java; /cvs/projects/projectui/src/org/netbeans/modules/project/ui/OpenProjectList.java,v <-- OpenProjectList.java new revision: 1.32; previous revision: 1.31 done Checking in projectui/test/unit/src/org/netbeans/modules/project/ui/OpenProjectListTest.java; /cvs/projects/projectui/test/unit/src/org/netbeans/modules/project/ui/OpenProjectListTest.java,v <-- OpenProjectListTest.java new revision: 1.4; previous revision: 1.3 done Checking in projectuiapi/apichanges.xml; /cvs/projects/projectuiapi/apichanges.xml,v <-- apichanges.xml new revision: 1.8; previous revision: 1.7 done Checking in projectuiapi/src/org/netbeans/spi/project/ui/ProjectOpenedHook.java; /cvs/projects/projectuiapi/src/org/netbeans/spi/project/ui/ProjectOpenedHook.java,v <-- ProjectOpenedHook.java new revision: 1.5; previous revision: 1.4 done |