author | Matti Laitinen <matti.t.laitinen@nokia.com> |
Thu, 11 Feb 2010 15:22:14 +0200 | |
changeset 1 | 1050670c6980 |
child 6 | f65f740e69f9 |
permissions | -rw-r--r-- |
1
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
1 |
/* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
8 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
11 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
13 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
14 |
* Description: Definitions for the class ResourceVisitor |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
15 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
17 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
18 |
package com.nokia.s60tools.analyzetool.ui; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
19 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
20 |
import org.eclipse.core.resources.IResource; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
21 |
import org.eclipse.core.resources.IResourceVisitor; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
22 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
23 |
import com.nokia.s60tools.analyzetool.internal.ui.graph.AnalyzeToolGraph; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
24 |
import com.nokia.s60tools.analyzetool.ui.statistic.StatisticView; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
25 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
26 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
27 |
* Class to visit resources in the project. |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
28 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
29 |
* @author araj modified kihe |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
30 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
31 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
32 |
public class ResourceVisitor implements IResourceVisitor { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
33 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
34 |
/** Parent class reference. */ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
35 |
private final Object arg0; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
36 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
37 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
38 |
* Constructor. |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
39 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
40 |
* @param parentClass Parent class reference |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
41 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
42 |
public ResourceVisitor(final Object parentClass) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
43 |
this.arg0 = parentClass; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
44 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
45 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
46 |
/** |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
47 |
* Visit every resource of project. |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
48 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
49 |
* @see org.eclipse.core.resources.IResourceVisitor#visit(org.eclipse.core.resources.IResource) |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
50 |
* |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
51 |
* @param resource |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
52 |
* One resource of the project |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
53 |
*/ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
54 |
public boolean visit(IResource resource) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
55 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
56 |
// if visit request came from main view |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
57 |
if (arg0 instanceof MainView) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
58 |
MainView mainView = (MainView) arg0; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
59 |
mainView.loadFileInfo(resource); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
60 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
61 |
else if( arg0 instanceof StatisticView ) |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
62 |
{ |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
63 |
StatisticView stats = (StatisticView)arg0; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
64 |
stats.loadFileInfo(resource); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
65 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
66 |
else if(arg0 instanceof AnalyzeToolGraph) { |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
67 |
AnalyzeToolGraph chart = (AnalyzeToolGraph)arg0; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
68 |
chart.loadFileInfo(resource); |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
69 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
70 |
return true; |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
71 |
} |
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
72 |
|
1050670c6980
Initial version of AnalyzeTool under EPL
Matti Laitinen <matti.t.laitinen@nokia.com>
parents:
diff
changeset
|
73 |
} |