Skip to content

Conversation

@deepika-u
Copy link
Contributor

@deepika-u deepika-u commented Nov 11, 2025

Fixes #2739

Description:
In the Project Explorer, the "Edit > Select All" menu item and Ctrl+A shortcut did not work reliably when a single project was selected. Specifically, pressing Ctrl+A after selecting a project for the first time had no effect. Only after clicking another project did Ctrl+A begin to work as expected.

Details of the fix:

  • Added a KeyListener to the Tree widget to handle Ctrl+A directly, ensuring selection works even without command activation.
  • Registered a IPartListener2 to activate the EDIT_SELECT_ALL command handler when the Project Explorer view becomes active, enabling the menu item.
  • Deactivated the handler when the view is no longer active to avoid stale references.

Note : No-ops - These methods are required by the IPartListener2 interface though unused but must be implemented. Yeah - i just tried even if removed it works(not sure if it added some warnings).

Open eclipse freshly, open Project Explorer view. Select a project and ctrl+A to select all the projects.
Before fix(unable to select, next click on 2nd project then ctrl+A will be enabled)
image

After fix(able to select)
image

@github-actions
Copy link
Contributor

github-actions bot commented Nov 11, 2025

Test Results

 3 018 files  ±0   3 018 suites  ±0   2h 15m 4s ⏱️ -21s
 8 236 tests ±0   7 986 ✅ ±0  249 💤 ±0  1 ❌ ±0 
23 628 runs  ±0  22 833 ✅ ±0  794 💤 ±0  1 ❌ ±0 

For more details on these failures, see this check.

Results for commit 5d468be. ± Comparison against base commit 2d4334f.

♻️ This comment has been updated with latest results.

}

// no-ops for the other methods:
@Override
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the methods have default implementations so these stubs are just useless noise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As suggested, removed them.

// Immediate fallback: handle Ctrl+A at the Tree level
commonViewer.getTree().addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow it seems like a hack to handle this one key directly, especially given the key binding appears to be configurable:

Image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, CommonViewer is a base class in CNF and can be extended. Adding key and part listeners that consumes key or register handlers here directly might affect others code. So please carefully change the code here, it is not only about Project Explorer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow it seems like a hack to handle this one key directly, especially given the key binding appears to be configurable:

Let me check on it.

@deepika-u deepika-u force-pushed the 2739_edit_selectall branch 2 times, most recently from a3fe77d to a49db52 Compare November 12, 2025 14:11
reliably irrespective of first or subsequent selections.
@deepika-u deepika-u force-pushed the 2739_edit_selectall branch from a49db52 to 835fc39 Compare December 2, 2025 11:21
@eclipse-platform-bot
Copy link
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

bundles/org.eclipse.ui.navigator/META-INF/MANIFEST.MF

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From 00affcbceaaa0f1547e02667148b1a209e31433a Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Tue, 2 Dec 2025 11:27:07 +0000
Subject: [PATCH] Version bump(s) for 4.39 stream


diff --git a/bundles/org.eclipse.ui.navigator/META-INF/MANIFEST.MF b/bundles/org.eclipse.ui.navigator/META-INF/MANIFEST.MF
index e2e4391692..3a92eee523 100644
--- a/bundles/org.eclipse.ui.navigator/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.ui.navigator/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Plugin.name
 Bundle-SymbolicName: org.eclipse.ui.navigator; singleton:=true
-Bundle-Version: 3.13.300.qualifier
+Bundle-Version: 3.13.400.qualifier
 Bundle-Activator: org.eclipse.ui.internal.navigator.NavigatorPlugin
 Bundle-Vendor: %Plugin.providerName
 Bundle-Localization: plugin
-- 
2.51.2

Further information are available in Common Build Issues - Missing version increments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Edit/"Select All" Menu item disabled with single project selected in Project Explorer

4 participants