1 19 package org.netbeans.modules.refactoring.java.ui; 20 21 import java.util.Iterator ; 22 import javax.swing.event.ChangeListener ; 23 import org.netbeans.api.java.source.CompilationInfo; 24 import org.netbeans.api.java.source.TreePathHandle; 25 import org.netbeans.modules.refactoring.api.AbstractRefactoring; 26 import org.netbeans.modules.refactoring.api.Problem; 27 import org.netbeans.modules.refactoring.java.api.ExtractInterfaceRefactoring; 28 import org.netbeans.modules.refactoring.java.ui.ExtractInterfaceAction; 29 import org.netbeans.modules.refactoring.java.ui.ExtractInterfacePanel; 30 import org.netbeans.modules.refactoring.spi.ui.CustomRefactoringPanel; 31 import org.netbeans.modules.refactoring.spi.ui.RefactoringUI; 32 import org.openide.util.HelpCtx; 33 import org.openide.util.NbBundle; 34 35 39 public class ExtractInterfaceRefactoringUI implements RefactoringUI { 40 private final ExtractInterfaceRefactoring refactoring; 42 private final TreePathHandle sourceType; 44 private ExtractInterfacePanel panel; 46 47 50 public ExtractInterfaceRefactoringUI(TreePathHandle selectedElement, CompilationInfo info) { 51 sourceType = selectedElement; 54 refactoring = new ExtractInterfaceRefactoring(sourceType); 56 } 57 58 60 public boolean isQuery() { 61 return false; 62 } 63 64 public CustomRefactoringPanel getPanel(ChangeListener parent) { 65 if (panel == null) { 66 panel = new ExtractInterfacePanel(refactoring, parent); 67 } 68 return panel; 69 } 70 71 public Problem setParameters() { 72 return refactoring.checkParameters(); 75 } 76 77 public Problem checkParameters() { 78 return refactoring.fastCheckParameters(); 81 } 82 83 public AbstractRefactoring getRefactoring() { 84 return refactoring; 85 } 86 87 public String getDescription() { 88 return NbBundle.getMessage(ExtractInterfaceAction.class, "DSC_ExtractInterface", "TODO: getName()"); } 90 91 public String getName() { 92 return NbBundle.getMessage(ExtractInterfaceAction.class, "LBL_ExtractInterface"); } 94 95 public boolean hasParameters() { 96 return true; 97 } 98 99 public HelpCtx getHelpCtx() { 100 return new HelpCtx(ExtractInterfaceRefactoringUI.class.getName()); 101 } 102 103 105 } | Popular Tags |