level 1
我滴小呆呆
楼主
小弟这两天在写一个插件,需要获取当前选中的代码块,就照网上写了下边的代码
ISelectionService selectionService =Workbench.getInstance().getActiveWorkbenchWindow().getSelectionService();
ISelection selection = selectionService.getSelection();
TextSelection text = (TextSelection) selection;
可是运行就会报类型转换错误
org.eclipse.jface.text.TextSelection cannot be cast to org.eclipse.jface.text.TextSelection
这是什么原因,求大神帮我分析下
2018年02月08日 02点02分
1
ISelectionService selectionService =Workbench.getInstance().getActiveWorkbenchWindow().getSelectionService();
ISelection selection = selectionService.getSelection();
TextSelection text = (TextSelection) selection;
可是运行就会报类型转换错误
org.eclipse.jface.text.TextSelection cannot be cast to org.eclipse.jface.text.TextSelection
这是什么原因,求大神帮我分析下