Changeset 366

Show
Ignore:
Timestamp:
09/16/08 17:48:55 (2 months ago)
Author:
sergey.kol..@gmail.com
Message:

Sergey Kolos:

  • Fixed bug: When trying to run "Find Definition" action, eclipse complained that the command is not available.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • jasko.tim.lisp/src/jasko/tim/lisp/editors/actions/FindDefinitionAction.java

    r327 r366  
    77import java.util.*; 
    88 
     9import org.eclipse.jface.action.IAction; 
    910import org.eclipse.jface.dialogs.Dialog; 
    1011import org.eclipse.swt.SWT; 
    1112import org.eclipse.swt.widgets.MessageBox; 
    1213import org.eclipse.swt.widgets.Shell; 
     14import org.eclipse.ui.IEditorPart; 
    1315import org.eclipse.ui.PlatformUI; 
    1416 
     
    1618         
    1719        private Shell shell; 
     20         
     21        public FindDefinitionAction(){} 
    1822         
    1923        public FindDefinitionAction(ILispEditor editor) { 
     
    3034                 
    3135        } 
     36 
     37    public void setActiveEditor(IAction action, IEditorPart targetEditor) { 
     38        editor = (ILispEditor)targetEditor; 
     39                shell = null; 
     40                if( editor == null ){ 
     41                        shell = editor.getTextWidget().getShell(); 
     42                } else { 
     43                        shell = PlatformUI.getWorkbench().getDisplay().getActiveShell(); 
     44                } 
     45    } 
     46     
    3247         
    3348        private class OpenDefinitionRunnable extends SwankRunnable { 
     
    3853                } 
    3954                public void run() { 
    40                         shell = null; 
    41                         if( editor == null ){ 
    42                                 shell = editor.getTextWidget().getShell(); 
    43                         } else { 
    44                                 shell = PlatformUI.getWorkbench().getDisplay().getActiveShell(); 
    45                         } 
    4655                        LispNode guts = result.getf(":return").getf(":ok"); 
    4756                        ArrayList<String> names = new ArrayList<String>(guts.params.size());