1 19 27 28 package org.netbeans.modules.xml.refactoring.actions; 29 30 import java.text.MessageFormat ; 31 import org.netbeans.modules.xml.refactoring.RefactoringManager; 32 import org.netbeans.modules.xml.refactoring.impl.UndoRedoProgress; 33 import org.openide.nodes.Node; 34 import org.openide.util.HelpCtx; 35 import org.openide.util.NbBundle; 36 import org.openide.util.RequestProcessor; 37 import org.openide.util.actions.CallableSystemAction; 38 39 43 public class RefactoringRedoAction extends CallableSystemAction { 44 45 private static final long serialVersionUID = 1L; 46 47 56 public void performAction() { 57 UndoRedoProgress progress = new UndoRedoProgress(); 58 progress.start(); 59 try { 60 RefactoringManager.getInstance().redo(); 61 } finally { 62 progress.stop(); 63 } 64 } 65 66 74 public boolean isEnabled() { 75 return RefactoringManager.getInstance().canRedo(); 76 } 77 78 87 public String getName() { 88 String redoType = ""; if (RefactoringManager.getInstance().canRedo()) { 90 redoType = 91 RefactoringManager.getInstance().getLastRefactorRequest().getDescription(); 92 93 return MessageFormat.format(NbBundle.getMessage(RefactoringRedoAction.class, 94 "LBL_Redo"), 95 new Object []{redoType}); 96 } 97 return NbBundle.getMessage(RefactoringUndoAction.class, 98 "LBL_Redo_Disabled"); 99 } 100 101 106 public HelpCtx getHelpCtx() { 107 return HelpCtx.DEFAULT_HELP; 108 } 109 110 129 protected boolean asynchronous() { 130 return true; 131 } 132 133 } 134 | Popular Tags |