Skip to content

Commit

Permalink
Add Filter Mechanism for Target in Move Refactoring #1337
Browse files Browse the repository at this point in the history
Text Search added to search withing the tree while moving (refactoring) the file to different package

#1337
  • Loading branch information
ShahzaibIbrahim committed Apr 26, 2024
1 parent c183806 commit 5085596
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,17 @@
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;

import org.eclipse.jdt.core.IJavaElement;
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;

Expand All @@ -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{
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5085596

Please sign in to comment.