|
1 /* |
|
2 * Copyright (c) 2007 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 * Wrapper for a list of trace groups |
|
17 * |
|
18 */ |
|
19 package com.nokia.tracebuilder.view; |
|
20 |
|
21 import com.nokia.tracebuilder.model.TraceGroup; |
|
22 import com.nokia.tracebuilder.model.TraceModel; |
|
23 |
|
24 /** |
|
25 * Wrapper for a list of trace groups |
|
26 * |
|
27 */ |
|
28 final class TraceGroupListWrapper extends TraceObjectListWrapper { |
|
29 |
|
30 /** |
|
31 * Creates a new wrapper |
|
32 * |
|
33 * @param model |
|
34 * trace model |
|
35 * @param parent |
|
36 * parent wrapper |
|
37 * @param updater |
|
38 * the update notifier |
|
39 */ |
|
40 TraceGroupListWrapper(TraceModel model, WrapperBase parent, |
|
41 WrapperUpdater updater) { |
|
42 super(parent, updater); |
|
43 for (TraceGroup group : model) { |
|
44 addGroup(group); |
|
45 } |
|
46 } |
|
47 |
|
48 /** |
|
49 * Adds a new trace group |
|
50 * |
|
51 * @param group |
|
52 * the group to be added |
|
53 * @return the wrapper which needs to be refreshed |
|
54 */ |
|
55 WrapperBase addGroup(TraceGroup group) { |
|
56 add(new TraceGroupWrapper(group, this, getUpdater())); |
|
57 return this; |
|
58 } |
|
59 |
|
60 /** |
|
61 * Removes a trace group |
|
62 * |
|
63 * @param group |
|
64 * the group to be removed |
|
65 * @return the wrapper which needs to be refreshed |
|
66 */ |
|
67 WrapperBase removeGroup(TraceGroup group) { |
|
68 remove(group.getExtension(TraceGroupWrapper.class)); |
|
69 return this; |
|
70 } |
|
71 } |