Quantcast

Help navigate to a method implementation by code

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Help navigate to a method implementation by code

Andres Fernando Wilches Riano
Hello

I am developing a plugin.

I need your help. I have a Table with methods' names . I need go to the method's' implementation in the editor when I click on the method name. The table has the path of the file where method is implemented and the method's header.

I will thank you if you could help me with code so as to do it.

By now I have the code to open a file. But I need to open the method's implementantion in a file.

File fileToOpen = new File(file);
if (fileToOpen.exists() && fileToOpen.isFile()) {
IFileStore fileStore = EFS.getLocalFileSystem().getStore(fileToOpen.toURI());
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
try {
IEditorPart editor =IDE.openEditorOnFileStore(page, fileStore);
 
} catch (PartInitException exf) {
// Put your exception handler here if you wish to
}
}

Regards


Atentamente,


Andrés Fernando Wilches Riaño
Ingeniero de Sistemas y Computación
Estudiante de Maestría en Ingeniería de Sistemas y Computación
Universidad Nacional de Colombia

_______________________________________________
pde-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/pde-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help navigate to a method implementation by code

Jonah Graham
Hi Andres,

Thanks for reaching out for help on your question. Unfortunately this mailing list is not the right place as it is for discussing the development of PDE itself, as opposed to using it.

Can I recommend the forum https://www.eclipse.org/forums/index.php/i/1/ or stack overflow.

To get the best results, consider having an mcve: http://stackoverflow.com/help/mcve and make sure you mention what language you are analysing as the API for C, Java, Python etc are different.

Jonah

On Wed, 16 Nov 2016 at 05:18, Andres Fernando Wilches Riano <[hidden email]> wrote:
Hello

I am developing a plugin.

I need your help. I have a Table with methods' names . I need go to the method's' implementation in the editor when I click on the method name. The table has the path of the file where method is implemented and the method's header.

I will thank you if you could help me with code so as to do it.

By now I have the code to open a file. But I need to open the method's implementantion in a file.

File fileToOpen = new File(file);
if (fileToOpen.exists() && fileToOpen.isFile()) {
IFileStore fileStore = EFS.getLocalFileSystem().getStore(fileToOpen.toURI());
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
try {
IEditorPart editor =IDE.openEditorOnFileStore(page, fileStore);
 
} catch (PartInitException exf) {
// Put your exception handler here if you wish to
}
}

Regards


Atentamente,


Andrés Fernando Wilches Riaño
Ingeniero de Sistemas y Computación
Estudiante de Maestría en Ingeniería de Sistemas y Computación
Universidad Nacional de Colombia
_______________________________________________
pde-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/pde-dev

_______________________________________________
pde-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/pde-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help navigate to a method implementation by code

Andres Fernando Wilches Riano
I can't register in eclipse community. So I haven't been able to ask my question in the forum what I would do?

thanks.

2016-11-16 2:56 GMT-05:00 Jonah Graham <[hidden email]>:
Hi Andres,

Thanks for reaching out for help on your question. Unfortunately this mailing list is not the right place as it is for discussing the development of PDE itself, as opposed to using it.

Can I recommend the forum https://www.eclipse.org/forums/index.php/i/1/ or stack overflow.

To get the best results, consider having an mcve: http://stackoverflow.com/help/mcve and make sure you mention what language you are analysing as the API for C, Java, Python etc are different.

Jonah

On Wed, 16 Nov 2016 at 05:18, Andres Fernando Wilches Riano <[hidden email]> wrote:
Hello

I am developing a plugin.

I need your help. I have a Table with methods' names . I need go to the method's' implementation in the editor when I click on the method name. The table has the path of the file where method is implemented and the method's header.

I will thank you if you could help me with code so as to do it.

By now I have the code to open a file. But I need to open the method's implementantion in a file.

File fileToOpen = new File(file);
if (fileToOpen.exists() && fileToOpen.isFile()) {
IFileStore fileStore = EFS.getLocalFileSystem().getStore(fileToOpen.toURI());
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
try {
IEditorPart editor =IDE.openEditorOnFileStore(page, fileStore);
 
} catch (PartInitException exf) {
// Put your exception handler here if you wish to
}
}

Regards


Atentamente,


Andrés Fernando Wilches Riaño
Ingeniero de Sistemas y Computación
Estudiante de Maestría en Ingeniería de Sistemas y Computación
Universidad Nacional de Colombia
_______________________________________________
pde-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/pde-dev

_______________________________________________
pde-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/pde-dev



--
Atentamente,


Andrés Fernando Wilches Riaño
Ingeniero de Sistemas y Computación
Estudiante de Maestría en Ingeniería de Sistemas y Computación
Universidad Nacional de Colombia

_______________________________________________
pde-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/pde-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help navigate to a method implementation by code

Brian de Alwis-3
If you want to open an editor on an element, see JDT's JavaUI#openInEditor(IJavaElement) and its variants.

Brian.

On 16-Nov-2016, at 11:10 AM, Andres Fernando Wilches Riano <[hidden email]> wrote:

I can't register in eclipse community. So I haven't been able to ask my question in the forum what I would do?

thanks.

2016-11-16 2:56 GMT-05:00 Jonah Graham <[hidden email]>:
Hi Andres,

Thanks for reaching out for help on your question. Unfortunately this mailing list is not the right place as it is for discussing the development of PDE itself, as opposed to using it.

Can I recommend the forum https://www.eclipse.org/forums/index.php/i/1/ or stack overflow.

To get the best results, consider having an mcve: http://stackoverflow.com/help/mcve and make sure you mention what language you are analysing as the API for C, Java, Python etc are different.

Jonah

On Wed, 16 Nov 2016 at 05:18, Andres Fernando Wilches Riano <[hidden email]> wrote:
Hello

I am developing a plugin.

I need your help. I have a Table with methods' names . I need go to the method's' implementation in the editor when I click on the method name. The table has the path of the file where method is implemented and the method's header.

I will thank you if you could help me with code so as to do it.

By now I have the code to open a file. But I need to open the method's implementantion in a file.

File fileToOpen = new File(file);
if (fileToOpen.exists() && fileToOpen.isFile()) {
IFileStore fileStore = EFS.getLocalFileSystem().getStore(fileToOpen.toURI());
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
try {
IEditorPart editor =IDE.openEditorOnFileStore(page, fileStore);
 
} catch (PartInitException exf) {
// Put your exception handler here if you wish to
}
}

Regards


Atentamente,


Andrés Fernando Wilches Riaño
Ingeniero de Sistemas y Computación
Estudiante de Maestría en Ingeniería de Sistemas y Computación
Universidad Nacional de Colombia
_______________________________________________
pde-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/pde-dev

_______________________________________________
pde-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/pde-dev



--
Atentamente,


Andrés Fernando Wilches Riaño
Ingeniero de Sistemas y Computación
Estudiante de Maestría en Ingeniería de Sistemas y Computación
Universidad Nacional de Colombia
_______________________________________________
pde-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/pde-dev


_______________________________________________
pde-dev mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/pde-dev
Loading...