java.lang.Object | +--com.ibm.lab.soln.jdt.AddTraceStatementsEditorActionDelegate
The purpose of AddTraceStatementsEditorAction
is to demonstrate how to
add simple code modifications ("refactoring") to the Java editor. This action
adds System.out.println
statements for each method, including
all parameters, to the beginning of each method.
IBuffer
,
IWorkingCopy
,
JavaCore
,
IWorkingCopyManager
,
ICompilationUnit
Constructor Summary | |
AddTraceStatementsEditorActionDelegate()
|
Method Summary | |
void |
run(org.eclipse.jface.action.IAction action)
Traverse all the ICompilationUnit 's methods using an AST,
calculating the position of each, and adding System.out.println
for each method parameter. |
void |
selectionChanged(org.eclipse.jface.action.IAction action,
org.eclipse.jface.viewers.ISelection selection)
|
void |
setActiveEditor(org.eclipse.jface.action.IAction action,
org.eclipse.ui.IEditorPart targetEditor)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AddTraceStatementsEditorActionDelegate()
Method Detail |
public void run(org.eclipse.jface.action.IAction action)
ICompilationUnit
's methods using an AST,
calculating the position of each, and adding System.out.println
for each method parameter.
run
in interface org.eclipse.ui.IActionDelegate
IActionDelegate.run(org.eclipse.jface.action.IAction)
public void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection)
selectionChanged
in interface org.eclipse.ui.IActionDelegate
public void setActiveEditor(org.eclipse.jface.action.IAction action, org.eclipse.ui.IEditorPart targetEditor)
setActiveEditor
in interface org.eclipse.ui.IEditorActionDelegate