public class CodeManipulator
extends java.lang.Object
Constructor and Description |
---|
CodeManipulator()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAction(java.lang.String action,
java.lang.String name,
int value)
This method adds action in java code (interface type + field + method + switch case)
|
void |
addActionParameter(java.lang.String action,
java.lang.String actionName,
java.lang.String parameterName)
This method adds action parameter in java code (field)
(SAMPLE_ACTION_, TIMER_ACTION_, TEST_ACTION_, CONTROL_ACTION_)
|
org.eclipse.jdt.core.ICompilationUnit |
getCompilationUnit()
Applies all modifications and returns compilation unit.
|
boolean |
isDataProvider() |
void |
load(org.eclipse.jdt.core.ICompilationUnit arg0,
java.lang.String arg1,
org.eclipse.swt.widgets.Shell arg2)
This method loads information and contructs a AST Tree.
|
void |
removeAction(java.lang.String action,
java.lang.String name,
java.lang.String[] params)
This method removes action in java code if user does not use the field.
|
void |
removeActionParameter(java.lang.String action,
java.lang.String actionName,
java.lang.String parameterName)
This method removes action parameter in java code (field)
(SAMPLE_ACTION_, TIMER_ACTION_, TEST_ACTION_, CONTROL_ACTION_)
|
void |
reset()
This method resets memory.
|
void |
setCompilationUnit(org.eclipse.jdt.core.ICompilationUnit cu) |
void |
setDataProvider(boolean provider)
This method adds or removes informations about DataProvider interface.
|
void |
updateAction(java.lang.String action,
java.lang.String oldName,
java.lang.String newName,
java.lang.String[] params)
This method updates action and action parameters in project by doing a rename refactoring.
|
void |
updateActionParameter(java.lang.String action,
java.lang.String actionName,
java.lang.String oldParameterName,
java.lang.String newParameterName)
This method updates action parameter in java code by doing rename refactoring
|
void |
updateClassName(java.lang.String className)
This method updates class name by doing a rename refactoring.
|
void |
updatePackage(java.lang.String packageName)
This method updates package name declaration.
|
void |
updatePluginName(java.lang.String arg0)
This method updates plugin name in class (Javadoc, exception, ...).
|
public void load(org.eclipse.jdt.core.ICompilationUnit arg0, java.lang.String arg1, org.eclipse.swt.widgets.Shell arg2) throws java.lang.Exception
arg0
- ICompilationUnit representing java classarg1
- String representing plugin namearg2
- Shell representing the parent shelljava.lang.Exception
public void reset()
public void updatePluginName(java.lang.String arg0) throws java.lang.Exception
arg0
- String representing new plugin namejava.lang.Exception
public void updatePackage(java.lang.String packageName) throws java.lang.Exception
packageName
- String representing new package name declarationjava.lang.Exception
public void updateClassName(java.lang.String className) throws java.lang.Exception
className
- String representing new class namejava.lang.Exception
public void setDataProvider(boolean provider) throws java.lang.Exception
provider
- true if class must implements DataProvider interfacejava.lang.Exception
public void addAction(java.lang.String action, java.lang.String name, int value) throws java.lang.Exception
action
- String representing action (sample, timer, test, control, provider)name
- String representing action namevalue
- int representing action valuejava.lang.Exception
public void removeAction(java.lang.String action, java.lang.String name, java.lang.String[] params) throws java.lang.Exception
action
- String representing action (sample, timer, test, control)name
- String representing action nameparams
- String [] representing all action parameters namejava.lang.Exception
public void updateAction(java.lang.String action, java.lang.String oldName, java.lang.String newName, java.lang.String[] params) throws java.lang.Exception
action
- String representing action (sample, timer, test, control)oldName
- String representing old action namenewName
- String representing new action nameparams
- String [] representing all action parameters namejava.lang.Exception
public void addActionParameter(java.lang.String action, java.lang.String actionName, java.lang.String parameterName)
action
- String representing action (sample, timer, test, control, object)actionName
- String representing action nameparameterName
- String representing parameter namepublic void removeActionParameter(java.lang.String action, java.lang.String actionName, java.lang.String parameterName) throws java.lang.Exception
action
- String representing action (sample, timer, test, control, provider)actionName
- String representing action nameparameterName
- String representing parameter namejava.lang.Exception
public void updateActionParameter(java.lang.String action, java.lang.String actionName, java.lang.String oldParameterName, java.lang.String newParameterName) throws java.lang.Exception
action
- String representing action (sample, timer, test, control, object)actionName
- String representing action nameoldParameterName
- String representing old parameter namenewParameterName
- String representing new parameter namejava.lang.Exception
public boolean isDataProvider()
public org.eclipse.jdt.core.ICompilationUnit getCompilationUnit() throws java.lang.Exception
java.lang.Exception
public void setCompilationUnit(org.eclipse.jdt.core.ICompilationUnit cu)
cu
- the CompilationUnit to set