Lines 200-209
Link Here
|
200 |
/** |
200 |
/** |
201 |
* The <code>CloseResourceAction</code> implementation of this |
201 |
* The <code>CloseResourceAction</code> implementation of this |
202 |
* <code>SelectionListenerAction</code> method ensures that this action is |
202 |
* <code>SelectionListenerAction</code> method ensures that this action is |
203 |
* enabled only if all of the selected resources are projects. |
203 |
* enabled only if one of the selections is a closed project. |
204 |
*/ |
204 |
*/ |
205 |
protected boolean updateSelection(IStructuredSelection s) { |
205 |
protected boolean updateSelection(IStructuredSelection s) { |
206 |
return super.updateSelection(s) && selectionIsOfType(IProject.PROJECT); |
206 |
// don't call super since we want to enable if open project is selected. |
|
|
207 |
if (!selectionIsOfType(IResource.PROJECT)) |
208 |
return false; |
209 |
|
210 |
Iterator resources = getSelectedResources().iterator(); |
211 |
while (resources.hasNext()) { |
212 |
IProject currentResource = (IProject) resources.next(); |
213 |
if (currentResource.isOpen()) { |
214 |
return true; |
215 |
} |
216 |
} |
217 |
return false; |
207 |
} |
218 |
} |
208 |
|
219 |
|
209 |
/** |
220 |
/** |