1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| // méthode appelé lorsque l'on clique droit sur une méthode
//iMethod est de Type IMethod, c'est la méthode en question
public void run(IAction action)
{
int nbParam = iMethod.getNumberOfParameters();
String stringParam = "";
try {
stringParam = iMethod.getSignature();
} catch (JavaModelException e1) {
e1.printStackTrace();
}
if( iMethod != null)
{
System.out.println("iMethod :"+iMethod);
if( iMethod.getParent() instanceof IType)
{
// classDef : la classe de definition de la méthode
IType classDef = (IType) iMethod.getParent();
System.out.println("classDef :"+classDef);
classDef
try {
// Attentio, je tente de récupé la super méthode :
IType superClass = classDef.getType(classDef.getSuperclassName());
System.out.println("superClass" +superClass);
LinkedList<IMethod> list = new LinkedList<IMethod>();
// ERREUR ! , superClass doesnt' Exists .....
IMethod[] lesFils = superClass.getMethods(); // POurquoi? |
Partager