Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] how to get CProject in a function "EditorActionDelegate1 implements IEditorActionDelegate"

Hi all,
      I added a derived class to IEditorActionDelegate for getting the selected text in C Editor. I want to know, how can I get in which file the text has been selected? In which project the file is located? 

     public class EditorActionDelegate1 implements IEditorActionDelegate {
private String textSelected;
public void setActiveEditor(IAction action, IEditorPart targetEditor) {


public void run(IAction action) {
System.out.println("Dans la fonction run dans EditorActionDelegate");
public String getTextSelected(){
return this.textSelected;
public void selectionChanged(IAction action, ISelection sel) {
System.out.println("Dans la fonction selectionChanged");
if(sel instanceof TextSelection){
System.out.println("text selection");

Thanks in advance,

Back to the top