Skip to content

Implement Cut action for resources in Project Explorer#3789

Draft
vogella wants to merge 3 commits intoeclipse-platform:masterfrom
vogella:navigator-cut-action
Draft

Implement Cut action for resources in Project Explorer#3789
vogella wants to merge 3 commits intoeclipse-platform:masterfrom
vogella:navigator-cut-action

Conversation

@vogella
Copy link
Contributor

@vogella vogella commented Mar 17, 2026

This PR implements the 'Cut' action for resources in the Common Navigator-based Project Explorer.

Previously, only Copy, Paste, and Delete were supported. This implementation adds the ability to cut resources to the clipboard and move them to a target location upon pasting.

Key Changes:

  • CutAction.java: New package-private action that handles clipboard 'Cut' operations and tracks the 'cut' state.
  • PasteAction.java: Updated to perform a move (using ) if a cut is pending, otherwise continuing with a copy.
  • EditActionGroup.java: Wired the new action into the context menu and global action bars.
  • Localization: Added necessary strings to .
  • Tests: Expanded with 14 test cases covering enablement, clipboard state, and move verification.

Verification:

Ran the full with to ensure workspace changes were used. All 146 tests passed (including the 14 in ).

vogella and others added 3 commits March 17, 2026 14:27
Implemented a new test class covering copy and paste functionality for
resources in the Common Navigator-based Project Explorer.

Key tests include:
- Verify Copy/Paste/Delete actions exist in context menu for resources
- Copy enablement for single resource selection
- Copy-to-clipboard verification using ResourceTransfer and TextTransfer
- Paste enablement based on clipboard contents and target selection
- End-to-end copy-paste round-trip between different projects

These tests ensure EditActionGroup and its constituent CopyAction and
PasteAction are correctly wired and functional.
Added a new CutAction and integrated it into the Common Navigator's
EditActionGroup. Modified PasteAction to support moves when a cut
operation is pending.

Key changes:
- Created CutAction.java to handle clipboard 'Cut' operations.
- Updated PasteAction.java to use MoveFilesAndFoldersOperation when
  CutAction.isCut is true.
- Wired CutAction into EditActionGroup's context menu and action bars.
- Added localized strings for the Cut action.
- Expanded CopyPasteActionTest.java with comprehensive tests for Cut
  enablement, clipboard contents, and move behavior.

The tests use a dedicated TEST_VIEWER to ensure navigator actions are
tested without interference from JDT's action provider overrides.
@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.resources/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 3d53ff3e2507c1678f9ca147f3eac9d59a986acf Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Tue, 17 Mar 2026 13:46:17 +0000
Subject: [PATCH] Version bump(s) for 4.40 stream


diff --git a/bundles/org.eclipse.ui.navigator.resources/META-INF/MANIFEST.MF b/bundles/org.eclipse.ui.navigator.resources/META-INF/MANIFEST.MF
index 3d9d65dfd1..a26be904ac 100644
--- a/bundles/org.eclipse.ui.navigator.resources/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.ui.navigator.resources/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.resources; singleton:=true
-Bundle-Version: 3.10.0.qualifier
+Bundle-Version: 3.10.100.qualifier
 Bundle-Activator: org.eclipse.ui.internal.navigator.resources.plugin.WorkbenchNavigatorPlugin
 Bundle-Vendor: %Plugin.providerName
 Bundle-Localization: plugin
-- 
2.53.0

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

@github-actions
Copy link
Contributor

Test Results

   852 files  ± 0     852 suites  ±0   54m 28s ⏱️ + 2m 10s
 7 862 tests +14   7 619 ✅ +14  243 💤 ±0  0 ❌ ±0 
20 112 runs  +42  19 456 ✅ +42  656 💤 ±0  0 ❌ ±0 

Results for commit 3c417a5. ± Comparison against base commit ec2a668.

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.

2 participants