From 2c9ef4ca2251c8957a9937bd276a9fb1ba478fb5 Mon Sep 17 00:00:00 2001 From: "shahzaib.ibrahim" Date: Fri, 26 Apr 2024 12:44:22 +0200 Subject: [PATCH] Add Filter Mechanism for Target in Move Refactoring #1337 Text Search added to search withing the tree while moving (refactoring) the file to different package https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/1337 --- .../internal/ui/refactoring/reorg/ReorgUserInputPage.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/ReorgUserInputPage.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/ReorgUserInputPage.java index 7530fbbadd9..409321a90ee 100644 --- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/ReorgUserInputPage.java +++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/ReorgUserInputPage.java @@ -34,6 +34,9 @@ import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.ui.dialogs.FilteredTree; +import org.eclipse.ui.dialogs.PatternFilter; + import org.eclipse.ltk.core.refactoring.RefactoringStatus; import org.eclipse.ltk.ui.refactoring.UserInputWizardPage; @@ -41,6 +44,7 @@ import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.corext.refactoring.reorg.IReorgDestinationValidator; import org.eclipse.jdt.internal.corext.util.Messages; @@ -49,7 +53,6 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; abstract class ReorgUserInputPage extends UserInputWizardPage{ @@ -143,7 +146,8 @@ private final void verifyDestination(Object selected, boolean initialVerificatio } private TreeViewer createViewer(Composite parent) { - TreeViewer treeViewer= new TreeViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); + FilteredTree filteredTree = new FilteredTree(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.BORDER, new PatternFilter(), true, true, 500); + TreeViewer treeViewer = filteredTree.getViewer(); GridData gd= new GridData(GridData.FILL_BOTH); gd.widthHint= convertWidthInCharsToPixels(40); gd.heightHint= convertHeightInCharsToPixels(15);