15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 package com.nokia.s60tools.crashanalyser.ui.views; |
18 package com.nokia.s60tools.crashanalyser.ui.views; |
19 |
19 |
20 import org.eclipse.jface.viewers.IStructuredContentProvider; |
20 import org.eclipse.jface.viewers.ITreeContentProvider; |
21 import org.eclipse.jface.viewers.Viewer; |
21 import org.eclipse.jface.viewers.Viewer; |
22 import com.nokia.s60tools.crashanalyser.data.*; |
22 import com.nokia.s60tools.crashanalyser.data.*; |
23 import com.nokia.s60tools.crashanalyser.interfaces.INewCrashFilesObserver; |
23 import com.nokia.s60tools.crashanalyser.interfaces.INewCrashFilesObserver; |
|
24 import com.nokia.s60tools.crashanalyser.model.CrashFileBundle; |
24 import com.nokia.s60tools.crashanalyser.model.CrashFileManager; |
25 import com.nokia.s60tools.crashanalyser.model.CrashFileManager; |
25 |
26 |
26 /** |
27 /** |
27 * This class provides all rows to MainView's table. This class |
28 * This class provides all rows to MainView's table. This class |
28 * contains CrashFileManager which is responsible for handling |
29 * contains CrashFileManager which is responsible for handling |
29 * Crash files on hard drive. This class just gets all files from |
30 * Crash files on hard drive. This class just gets all files from |
30 * CrashFileManager and provides them to MainView's table in correct |
31 * CrashFileManager and provides them to MainView's table in correct |
31 * format. |
32 * format. |
32 * |
33 * |
33 */ |
34 */ |
34 public class MainViewContentProvider implements IStructuredContentProvider { |
35 public class MainViewContentProvider implements ITreeContentProvider { // IStructuredContentProvider { |
35 |
36 |
36 private final CrashFileManager crashFileManager; |
37 private final CrashFileManager crashFileManager; |
37 private ErrorLibrary errorLibrary = null; |
38 private ErrorLibrary errorLibrary = null; |
38 |
39 |
39 public MainViewContentProvider(INewCrashFilesObserver observer) { |
40 public MainViewContentProvider(INewCrashFilesObserver observer) { |
57 } |
58 } |
58 |
59 |
59 public void inputChanged(Viewer arg0, Object arg1, Object arg2) { |
60 public void inputChanged(Viewer arg0, Object arg1, Object arg2) { |
60 // No implementation needed |
61 // No implementation needed |
61 } |
62 } |
|
63 |
|
64 public Object[] getChildren(Object crashFile) { |
|
65 return crashFileManager.getThreads((CrashFileBundle) crashFile); |
|
66 } |
|
67 |
|
68 public Object getParent(Object arg0) { |
|
69 return null; |
|
70 } |
|
71 |
|
72 public boolean hasChildren(Object arg0) { |
|
73 if (crashFileManager.getTotalThreadCount((CrashFileBundle) arg0) > 1) |
|
74 return true; |
|
75 return false; |
|
76 } |
62 } |
77 } |