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.PushDownRefactoring; 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 36 40 public class PushDownRefactoringUI implements RefactoringUI { 41 private final PushDownRefactoring refactoring; 43 private final Set initialMembers; 45 private PushDownPanel panel; 47 48 51 public PushDownRefactoringUI(TreePathHandle[] selectedElements, CompilationInfo info) { 52 initialMembers = new HashSet (); 53 56 TreePathHandle sourceType=null; 59 refactoring = new PushDownRefactoring(Lookups.singleton(sourceType)); 61 } 62 63 65 public boolean isQuery() { 66 return false; 67 } 68 69 public CustomRefactoringPanel getPanel(ChangeListener parent) { 70 if (panel == null) { 71 panel = new PushDownPanel(refactoring, initialMembers); 72 } 73 return panel; 74 } 75 76 public Problem setParameters() { 77 captureParameters(); 78 return refactoring.checkParameters(); 79 } 80 81 public Problem checkParameters() { 82 captureParameters(); 83 return refactoring.fastCheckParameters(); 84 } 85 86 public AbstractRefactoring getRefactoring() { 87 return refactoring; 88 } 89 90 public String getDescription() { 91 return NbBundle.getMessage(PushDownRefactoringUI.class, "DSC_PushDown", "TODO"); } 93 94 public String getName() { 95 return NbBundle.getMessage(PushDownRefactoringUI.class, "LBL_PushDown"); } 97 98 public boolean hasParameters() { 99 return true; 100 } 101 102 public HelpCtx getHelpCtx() { 103 return new HelpCtx(PushDownRefactoringUI.class.getName()); 104 } 105 106 108 111 private void captureParameters() { 112 } 115 116 } | Popular Tags |