Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314335 - Open/Close project option from file menu is incorrect
Summary: Open/Close project option from file menu is incorrect
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Paul Slauenwhite CLA
QA Contact: Kathy Chan CLA
URL:
Whiteboard:
Keywords:
Depends on: 243953
Blocks:
  Show dependency tree
 
Reported: 2010-05-25 15:13 EDT by Ben Chen CLA
Modified: 2016-05-05 11:09 EDT (History)
3 users (show)

See Also:
paulslau: pmc_approved? (oec)
paulslau: pmc_approved? (ernest)
kathy: pmc_approved+
paulslau: pmc_approved? (paulslau)
ewchan: pmc_approved+
paulslau: pmc_approved? (jgwest)
jerome.bozier: review+


Attachments
Patch. (9.61 KB, patch)
2010-05-26 13:52 EDT, Paul Slauenwhite CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Chen CLA 2010-05-25 15:13:00 EDT
Build Identifier: TPTP-4.7.0-201005222133

no messages in error log
note: this symptom only occurs under test prospective

Reproducible: Always

Steps to Reproduce:
1.Create a java project
2.Right click/select "Project" from file menu, --> Close Project
3.Right click/select "Project" from file menu, --> Open Project
4.Select "Project" from file menu and note that even though the project is already open, the option "Open Project" is available and "Close Project" is unavailable
Comment 1 Paul Slauenwhite CLA 2010-05-25 15:21:50 EDT
See /org.eclipse.hyades.test.ui.navigator.tests/manual/Test.UI.TestNavigator_bugzilla_249587.testsuite.
Comment 2 Paul Slauenwhite CLA 2010-05-26 07:46:50 EDT
Updated /org.eclipse.hyades.test.ui.navigator.tests/manual/Test.UI.TestNavigator_bugzilla_249587.testsuite to include tests for both the Resource and Logical views of the Test Navigator.
Comment 3 Paul Slauenwhite CLA 2010-05-26 13:52:14 EDT
Created attachment 170060 [details]
Patch.
Comment 4 Paul Slauenwhite CLA 2010-05-26 13:57:47 EDT
This defect is composed of two symptoms:

1) Menu enablement: This is caused by not registering the org.eclipse.ui.actions.OpenResourceAction and org.eclipse.ui.actions.CloseResourceAction as workspace resource change listeners to be notified when the selected resource changes (e.g. opens or closes).

2) The Properties view is not updated after the selected project is opened: This is caused by the Properties view only updating when the selection changes and not when the selected project is updated (e.g. opened or closed).  This is a limitation of the Properties view (org.eclipse.ui.views.properties.PropertySheet).  Note, the current work-around of reselecting the same selection in the Test Navigator by notifying the registered selection listeners has no affect since the Properties view (see PropertySheet#selectionChanged(IWorkbenchPart, ISelection)) shortcuts the same selection, for performance reasons.  That said, I am not sure how the tests for this function passed in previous test passes.  The work-around is to de-select and reselect the selection in the Test Navigator, after the project is opened, to force an update of the Properties view.

Covered by an existing test suite.

Jerome, please review the attached patch.
Comment 5 Bozier jerome CLA 2010-05-27 06:58:35 EDT
reviewed and approved
Comment 6 Paul Slauenwhite CLA 2010-05-27 10:13:38 EDT
Requesting PMC approval for TPTP 4.7.0: 

  1.   Explain why you believe this is a stop-ship defect. How does the defect manifest itself, and how will users of TPTP / consuming products be affected if the defect is not fixed?

When opening/closing a project in the Test Navigator, the Close Project/Open Project file menus are not disabled/enabled correctly and the properties view is not updated.

   2. Is there a work-around? If so, why do you believe the work-around is insufficient?

Yes (select another project and reselect the original project).  Not user friendly. 

   3. Is this a regression or API breakage? Explain.

Regression (see defect 243953).

   4. Does this require new API?

No.

   5. Who performed the code review?

Jerome Bozier

   6. Is there a test case attached to the bugzilla record?

Covered by existing test case(s).

   7. What is the nature of the fix? What is the scope of the fix? What is the risk associated with this fix?

Registering the
org.eclipse.ui.actions.OpenResourceAction and
org.eclipse.ui.actions.CloseResourceAction as workspace resource change
listeners to be notified when the selected resource changes (e.g. opens or
closes) and de-select
and reselect the selection in the Test Navigator, after the project is opened,
to force an update of the Properties view.

   8. Is this fix related to any standards that TPTP adheres to? If so, who has validated that the fix continues to adhere to the standard?

No.
Comment 7 Paul Slauenwhite CLA 2010-05-27 10:22:06 EDT
The attached patch is checked in to CVS (HEAD).
Comment 8 Ben Chen CLA 2010-06-01 15:23:56 EDT
verified in TPTP-4.7.0-201006011014
Comment 9 Ben Chen CLA 2010-06-01 15:24:13 EDT
(In reply to comment #8)
> verified in TPTP-4.7.0-201006011014

Closing