引入:
前面揭示了JDI的Debugger如何建立连接,发送和处理请求,这里我们专注于人机交互部分,Debugger的UI,它主要负责如何把人发出的操作转为请求,以及把请求操作反映在调试器的界面上。
分析:
这个插件主要都定义在org.eclipse.jdt.debug.ui_<Version>.jar中的plugin.xml中,它提供了各种人机交互的插件功能。打的比方,我们看编辑器功能:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
< 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响应类等,有兴趣的可以看下。
本文转自 charles_wang888 51CTO博客,原文链接:http://blog.51cto.com/supercharles888/1588681,如需转载请自行联系原作者