Changeset 647

Show
Ignore:
Timestamp:
04/17/08 09:50:49 (8 months ago)
Author:
markd
Message:
 
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • org.cfeclipse.cfml/trunk/src/org/cfeclipse/cfml/editors/actions/AutoCommentAction.java

    r2 r647  
    3434import org.eclipse.ui.IEditorActionDelegate; 
    3535import org.eclipse.ui.IEditorPart; 
     36import org.eclipse.ui.IWorkbenchWindow; 
     37import org.eclipse.ui.IWorkbenchWindowActionDelegate; 
    3638import org.eclipse.ui.texteditor.ITextEditor; 
    3739 
     
    4446 * or cf comments in a cfblock. 
    4547 */ 
    46 public class AutoCommentAction extends Encloser implements IEditorActionDelegate { 
     48public class AutoCommentAction extends Encloser implements IWorkbenchWindowActionDelegate,IEditorActionDelegate { 
    4749         
    4850        ITextEditor editor = null; 
     
    115117        } 
    116118 
    117         public void selectionChanged(IAction action, ISelection selection) {;}   
     119        public void selectionChanged(IAction action, ISelection selection){ 
     120                if(editor != null){ 
     121                        setActiveEditor(null,  editor.getSite().getPage().getActiveEditor()); 
     122                } 
     123        } 
     124 
     125 
     126        public void dispose() { 
     127                // TODO Auto-generated method stub 
     128                 
     129        } 
     130 
     131        public void init(IWorkbenchWindow window) { 
     132                IEditorPart activeEditor = window.getActivePage().getActiveEditor(); 
     133                if(activeEditor instanceof ITextEditor){ 
     134                        editor = (ITextEditor)activeEditor; 
     135                } 
     136                 
     137        } 
     138 
    118139}