|
1 /* |
|
2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 * Template for function entry-exit traces |
|
17 * |
|
18 */ |
|
19 package com.nokia.tracebuilder.engine.rules; |
|
20 |
|
21 import java.util.List; |
|
22 |
|
23 import com.nokia.tracebuilder.engine.TraceBuilderGlobals; |
|
24 import com.nokia.tracebuilder.model.TraceModelExtension; |
|
25 import com.nokia.tracebuilder.project.GroupNameHandlerBase; |
|
26 |
|
27 /** |
|
28 * Template for function entry-exit traces |
|
29 * |
|
30 */ |
|
31 final class EntryExitTraceTemplate extends ContextTemplateBase implements |
|
32 ExitTracePropertyBuilder { |
|
33 |
|
34 /* |
|
35 * (non-Javadoc) |
|
36 * |
|
37 * @see com.nokia.tracebuilder.engine.TraceObjectPropertyDialogTemplate#getTitle() |
|
38 */ |
|
39 public String getTitle() { |
|
40 return RuleUtils.getEntryTemplateTitle(RuleUtils.TYPE_ENTRY_EXIT); |
|
41 } |
|
42 |
|
43 /* |
|
44 * (non-Javadoc) |
|
45 * |
|
46 * @see com.nokia.tracebuilder.engine.rules.ContextTemplateBase#getTraceNameFormat() |
|
47 */ |
|
48 @Override |
|
49 protected String getTraceNameFormat() { |
|
50 return RuleUtils.createEntryTraceNameFormat(RuleUtils.TYPE_ENTRY_EXIT); |
|
51 } |
|
52 |
|
53 /* |
|
54 * (non-Javadoc) |
|
55 * |
|
56 * @see com.nokia.tracebuilder.engine.rules.ContextTemplateBase#getTraceTextFormat() |
|
57 */ |
|
58 @Override |
|
59 protected String getTraceTextFormat() { |
|
60 return RuleUtils.TEXT_FORMAT_BASE; |
|
61 } |
|
62 |
|
63 /* |
|
64 * (non-Javadoc) |
|
65 * |
|
66 * @see com.nokia.tracebuilder.engine.TraceObjectPropertyDialogTemplate# |
|
67 * createExtensions(java.util.List) |
|
68 */ |
|
69 public void createExtensions(List<TraceModelExtension> list) { |
|
70 list.add(new StartOfFunctionLocationRule()); |
|
71 list.add(new EntryTraceRule()); |
|
72 } |
|
73 |
|
74 /* |
|
75 * (non-Javadoc) |
|
76 * |
|
77 * @see com.nokia.tracebuilder.engine.rules.ExitTracePropertyBuilder# |
|
78 * createExitName(java.lang.String) |
|
79 */ |
|
80 public String createExitName(String entryName) { |
|
81 return RuleUtils.createExitName(entryName, RuleUtils.TYPE_ENTRY_EXIT); |
|
82 } |
|
83 |
|
84 /* |
|
85 * (non-Javadoc) |
|
86 * |
|
87 * @see com.nokia.tracebuilder.engine.rules.ExitTracePropertyBuilder# |
|
88 * createExitText(java.lang.String) |
|
89 */ |
|
90 public String createExitText(String entryText) { |
|
91 return entryText; |
|
92 } |
|
93 |
|
94 /* |
|
95 * (non-Javadoc) |
|
96 * |
|
97 * @see com.nokia.tracebuilder.engine.TracePropertyDialogTemplate#getGroupName() |
|
98 */ |
|
99 public String getGroupName() { |
|
100 GroupNameHandlerBase groupNameHandler = TraceBuilderGlobals.getGroupNameHandler(); |
|
101 return groupNameHandler.getDefaultGroups()[groupNameHandler.getFlowGroupIdIndex()]; |
|
102 } |
|
103 |
|
104 /* |
|
105 * (non-Javadoc) |
|
106 * |
|
107 * @see com.nokia.tracebuilder.engine.rules.ContextTemplateBase#isValueEnabled() |
|
108 */ |
|
109 @Override |
|
110 public boolean isValueEnabled() { |
|
111 return false; |
|
112 } |
|
113 |
|
114 /* |
|
115 * (non-Javadoc) |
|
116 * |
|
117 * @see com.nokia.tracebuilder.engine.rules.ContextTemplateBase#isTargetEnabled() |
|
118 */ |
|
119 @Override |
|
120 public boolean isTargetEnabled() { |
|
121 return false; |
|
122 } |
|
123 } |