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 015 files  ±0   3 015 suites  ±0   2h 15m 3s ⏱️ - 10m 8s
 8 264 tests ±0   8 013 ✅  - 3  248 💤 ±0  3 ❌ +3 
23 616 runs  ±0  22 820 ✅  - 5  791 💤 ±0  5 ❌ +5 

For more details on these failures, see this check.

Results for commit dd70538. ± Comparison against base commit 8a64d23.

♻️ 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
@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.

@deepika-u deepika-u force-pushed the 2739_edit_selectall branch 2 times, most recently from 8849f93 to a9f91c5 Compare January 9, 2026 11:58
@vogella vogella requested a review from merks January 12, 2026 09:40
@Override
public void keyPressed(KeyEvent e) {
// MOD1 = Ctrl on Win/Linux, Command on macOS
if ((e.stateMask & SWT.MOD1) != 0 && (e.keyCode == 'a' || e.keyCode == 'A')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This continues to hard code a key binding that is configurable doesn't it?

Copy link
Contributor

@merks merks left a comment

Choose a reason for hiding this comment

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

It continues to feel like we are treating a symptom and not fixing an underlying problem.

@deepika-u deepika-u force-pushed the 2739_edit_selectall branch 3 times, most recently from 08db76d to 876fada Compare January 12, 2026 10:08
@deepika-u
Copy link
Contributor Author

@merks
Sorry for the delayed reply on your comments.
I have revised the fix as per your suggestion. When you get some time, can you take a look at this please?
Thanks alot.

@deepika-u deepika-u force-pushed the 2739_edit_selectall branch from 876fada to 124b217 Compare January 12, 2026 11:12
@deepika-u deepika-u force-pushed the 2739_edit_selectall branch from 124b217 to dd70538 Compare January 13, 2026 07:03
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