1 19 package org.netbeans.modules.refactoring.java.ui; 20 21 import java.util.HashSet ; 22 import java.util.Set ; 23 import javax.swing.event.ChangeListener ; 24 import org.netbeans.api.java.source.CompilationInfo; 25 import org.netbeans.api.java.source.TreePathHandle; 26 import org.netbeans.modules.refactoring.api.AbstractRefactoring; 27 import org.netbeans.modules.refactoring.api.Problem; 28 import org.netbeans.modules.refactoring.java.api.PullUpRefactoring; 29 import org.netbeans.modules.refactoring.spi.ui.CustomRefactoringPanel; 30 import org.netbeans.modules.refactoring.spi.ui.RefactoringUI; 31 import org.openide.util.HelpCtx; 32 import org.openide.util.NbBundle; 33 import org.openide.util.lookup.Lookups; 34 35 39 public class PullUpRefactoringUI implements RefactoringUI { 40 private final PullUpRefactoring refactoring; 42 private final Set initialMembers; 44 private PullUpPanel panel; 46 47 50 public PullUpRefactoringUI(TreePathHandle[] selectedElements, CompilationInfo info) { 51 initialMembers = new HashSet (); 52 TreePathHandle sourceType = null; 57 refactoring = new PullUpRefactoring(Lookups.singleton(sourceType)); 59 } 60 61 63 public boolean isQuery() { 64 return false; 65 } 66 67 public CustomRefactoringPanel getPanel(ChangeListener parent) { 68 if (panel == null) { 69 panel = new PullUpPanel(refactoring, initialMembers, parent); 70 } 71 return panel; 72 } 73 74 public Problem setParameters() { 75 captureParameters(); 76 return refactoring.checkParameters(); 77 } 78 79 public Problem checkParameters() { 80 captureParameters(); 81 return refactoring.fastCheckParameters(); 82 } 83 84 public AbstractRefactoring getRefactoring() { 85 return refactoring; 86 } 87 88 public String getDescription() { 89 return NbBundle.getMessage(PullUpAction.class, "DSC_PullUp", "TODO"); } 91 92 public String getName() { 93 return NbBundle.getMessage(PullUpAction.class, "LBL_PullUp"); } 95 96 public boolean hasParameters() { 97 return true; 98 } 99 100 public HelpCtx getHelpCtx() { 101 return new HelpCtx(PullUpRefactoringUI.class.getName()); 102 } 103 104 106 109 private void captureParameters() { 110 } 114 115 228 } | Popular Tags |