码迷,mamicode.com
首页 > 其他好文 > 详细

JDI 架构研究21 - JDI的Debugger的UI部分

时间:2014-12-11 16:07:06      阅读:225      评论:0      收藏:0      [点我收藏+]

标签:jdwp   jpda   jvmti   

引入:

前面揭示了JDI的Debugger如何建立连接,发送和处理请求,这里我们专注于人机交互部分,Debugger的UI,它主要负责如何把人发出的操作转为请求,以及把请求操作反映在调试器的界面上。


分析:

这个插件主要都定义在org.eclipse.jdt.debug.ui_<Version>.jar中的plugin.xml中,它提供了各种人机交互的插件功能。打的比方,我们看编辑器功能:

<extension
         point="org.eclipse.ui.editorActions">
      <editorContribution
            targetID="org.eclipse.jdt.ui.CompilationUnitEditor"
            id="org.eclipse.jdt.debug.CompilationUnitEditor.BreakpointRulerActions">
         <action
               label="%AddBreakpoint.label"
               class="org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate"
               actionID="RulerDoubleClick"
               id="org.eclipse.jdt.debug.ui.actions.ManageBreakpointRulerAction">
         </action>
      </editorContribution>
      <editorContribution
            targetID="org.eclipse.jdt.ui.ClassFileEditor"
            id="org.eclipse.jdt.debug.ClassFileEditor.BreakpointRulerActions">
         <action
               label="%AddBreakpoint.label"
               class="org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate"
               actionID="RulerDoubleClick"
               id="org.eclipse.jdt.debug.ui.actions.ManageBreakpointRulerAction">
         </action>
      </editorContribution>
      <editorContribution
            targetID="org.eclipse.jdt.debug.ui.SnippetEditor"
            id="org.eclipse.jdt.debug.ui.JavaSnippetToolbarActions">
         <action
               toolbarPath="evaluationGroup"
               id="org.eclipse.jdt.debug.ui.SnippetExecute"
               hoverIcon="$nl$/icons/full/etool16/run_sbook.gif"
               class="org.eclipse.jdt.internal.debug.ui.actions.ExecuteAction"
               disabledIcon="$nl$/icons/full/dtool16/run_sbook.gif"
               enablesFor="+"
               icon="$nl$/icons/full/etool16/run_sbook.gif"
               helpContextId="execute_action_context"
               label="%Execute.label"
               tooltip="%Execute.tooltip">
            <selection
                  class="org.eclipse.jface.text.ITextSelection">
            </selection>
         </action>
         <action
               toolbarPath="evaluationGroup"
               id="org.eclipse.jdt.debug.ui.SnippetDisplay"
               hoverIcon="$nl$/icons/full/etool16/disp_sbook.gif"
               class="org.eclipse.jdt.internal.debug.ui.actions.PopupDisplayAction"
               disabledIcon="$nl$/icons/full/dtool16/disp_sbook.gif"
               enablesFor="+"
               icon="$nl$/icons/full/etool16/disp_sbook.gif"
               helpContextId="display_action_context"
               label="%Display.label"
               tooltip="%Display.tooltip">
            <selection
                  class="org.eclipse.jface.text.ITextSelection">
            </selection>
         </action>
         <action
               toolbarPath="evaluationGroup"
               id="org.eclipse.jdt.debug.ui.SnippetInspect"
               hoverIcon="$nl$/icons/full/etool16/insp_sbook.gif"
               class="org.eclipse.jdt.internal.debug.ui.actions.PopupInspectAction"
               disabledIcon="$nl$/icons/full/dtool16/insp_sbook.gif"
               enablesFor="+"
               icon="$nl$/icons/full/etool16/insp_sbook.gif"
               helpContextId="inspect_action_context"
               label="%Inspect.label"
               tooltip="%Inspect.tooltip">
            <selection
                  class="org.eclipse.jface.text.ITextSelection">
            </selection>
         </action>
      </editorContribution>
   </extension>

从这里看出,它支持好几个操作:如CompilationUnitEditor的打断点 ,ClassFileEditor的打断点等。


每个操作都有用到的图标,用到的action响应类等,有兴趣的可以看下。

本文出自 “平行线的凝聚” 博客,请务必保留此出处http://supercharles888.blog.51cto.com/609344/1588681

JDI 架构研究21 - JDI的Debugger的UI部分

标签:jdwp   jpda   jvmti   

原文地址:http://supercharles888.blog.51cto.com/609344/1588681

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!