2010-08-13 5 views
1

Il est possible d'implémenter le refactoring en utilisant la bibliothèque Eclipse (JDT, LTK) sans impliquer les assistants. Je voudrais profiter de la fonctionnalité de refactoring d'eclipse mais je ne veux pas fournir d'entrée pour le refactoring par d'autres moyens (qui ne sont pas entrés dans l'assistant) tels que la lecture à partir du fichier, etcBibliothèque de refactoring d'eclipse

Si possible, S'il vous plaît suggérer moi comment

Répondre

0

Vous pouvez trouver un échantillon dans le SurroundWithTryCatchAction de JDT (éludant beaucoup de détails):

SurroundWithTryCatchRefactoring refactoring= SurroundWithTryCatchRefactoring.create(cu, selection); 
Change change= refactoring.createChange(new NullProgressMonitor()); 
PerformChangeOperation op= new PerformChangeOperation(change); 
WorkbenchRunnableAdapter adapter= new WorkbenchRunnableAdapter(op); 
PlatformUI.getWorkbench().getProgressService().runInUI(
    new BusyIndicatorRunnableContext(), adapter, adapter.getSchedulingRule()); 

le refactoring est mis en place entièrement non interactive à travers le create -helper.