|
1 /* |
|
2 * Copyright (c) 2009 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 * Creates a plug-in formatter when setData is called |
|
17 */ |
|
18 package com.nokia.tracebuilder.engine.rules; |
|
19 |
|
20 import com.nokia.tracebuilder.model.TraceModelPersistentExtension; |
|
21 import com.nokia.tracebuilder.model.TraceObject; |
|
22 |
|
23 /** |
|
24 * Creates a plug-in formatter when setData is called |
|
25 * |
|
26 */ |
|
27 final class PluginTraceFormatRuleDelegate implements |
|
28 TraceModelPersistentExtension { |
|
29 |
|
30 /** |
|
31 * |
|
32 */ |
|
33 private final RulesEngine engine; |
|
34 |
|
35 /** |
|
36 * @param engine |
|
37 */ |
|
38 PluginTraceFormatRuleDelegate(RulesEngine engine) { |
|
39 this.engine = engine; |
|
40 } |
|
41 |
|
42 /** |
|
43 * Owning trace object |
|
44 */ |
|
45 private TraceObject owner; |
|
46 |
|
47 /* |
|
48 * (non-Javadoc) |
|
49 * |
|
50 * @see com.nokia.tracebuilder.model.TraceModelPersistentExtension#getData() |
|
51 */ |
|
52 public String getData() { |
|
53 return null; |
|
54 } |
|
55 |
|
56 /* |
|
57 * (non-Javadoc) |
|
58 * |
|
59 * @see com.nokia.tracebuilder.model.TraceModelPersistentExtension#getStorageName() |
|
60 */ |
|
61 public String getStorageName() { |
|
62 return null; |
|
63 } |
|
64 |
|
65 /* |
|
66 * (non-Javadoc) |
|
67 * |
|
68 * @see com.nokia.tracebuilder.model.TraceModelPersistentExtension#setData(java.lang.String) |
|
69 */ |
|
70 public boolean setData(String data) { |
|
71 this.engine.changeTraceAPI(data); |
|
72 // This extension is not added to model |
|
73 return false; |
|
74 } |
|
75 |
|
76 /* |
|
77 * (non-Javadoc) |
|
78 * |
|
79 * @see com.nokia.tracebuilder.model.TraceModelExtension#getOwner() |
|
80 */ |
|
81 public TraceObject getOwner() { |
|
82 return owner; |
|
83 } |
|
84 |
|
85 /* |
|
86 * (non-Javadoc) |
|
87 * |
|
88 * @see com.nokia.tracebuilder.model.TraceModelExtension# |
|
89 * setOwner(com.nokia.tracebuilder.model.TraceObject) |
|
90 */ |
|
91 public void setOwner(TraceObject owner) { |
|
92 this.owner = owner; |
|
93 } |
|
94 |
|
95 } |