|
1 /* |
|
2 * Copyright (c) 2008 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 * Callback for select component dialog |
|
17 * |
|
18 */ |
|
19 package com.nokia.tracebuilder.engine.propertydialog; |
|
20 |
|
21 import java.util.Iterator; |
|
22 |
|
23 import com.nokia.tracebuilder.engine.SoftwareComponent; |
|
24 import com.nokia.tracebuilder.engine.TraceBuilderGlobals; |
|
25 import com.nokia.tracebuilder.engine.TraceObjectPropertyDialog; |
|
26 import com.nokia.tracebuilder.model.TraceBuilderException; |
|
27 import com.nokia.tracebuilder.model.TraceModel; |
|
28 |
|
29 /** |
|
30 * Callback for select component dialog |
|
31 * |
|
32 */ |
|
33 final class SelectComponentCallback extends PropertyDialogCallback { |
|
34 |
|
35 /** |
|
36 * Constructor |
|
37 * |
|
38 * @param model |
|
39 * the trace model |
|
40 */ |
|
41 SelectComponentCallback(TraceModel model) { |
|
42 super(model); |
|
43 } |
|
44 |
|
45 /* |
|
46 * (non-Javadoc) |
|
47 * |
|
48 * @see com.nokia.tracebuilder.engine.PropertyDialogManagerCallback# |
|
49 * okSelected(com.nokia.tracebuilder.engine.TraceObjectPropertyDialog) |
|
50 */ |
|
51 public void okSelected(TraceObjectPropertyDialog dialog) |
|
52 throws TraceBuilderException { |
|
53 int index = 0; |
|
54 String componentName = dialog.getTarget(); |
|
55 Iterator<SoftwareComponent> components = TraceBuilderGlobals.getSoftwareComponents(); |
|
56 while (components.hasNext()) { |
|
57 SoftwareComponent component = components.next(); |
|
58 if (component.getName().equals(componentName)) { |
|
59 TraceBuilderGlobals.setCurrentSoftwareComponentIndex(index); |
|
60 break; |
|
61 } |
|
62 index++; |
|
63 } |
|
64 } |
|
65 |
|
66 } |