|
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 */ |
|
17 |
|
18 package com.nokia.s60tools.crashanalyser.ui.views; |
|
19 |
|
20 import org.eclipse.jface.viewers.IStructuredContentProvider; |
|
21 import org.eclipse.jface.viewers.Viewer; |
|
22 import com.nokia.s60tools.crashanalyser.data.*; |
|
23 import com.nokia.s60tools.crashanalyser.interfaces.INewCrashFilesObserver; |
|
24 import com.nokia.s60tools.crashanalyser.model.CrashFileManager; |
|
25 |
|
26 /** |
|
27 * This class provides all rows to MainView's table. This class |
|
28 * contains CrashFileManager which is responsible for handling |
|
29 * Crash files on hard drive. This class just gets all files from |
|
30 * CrashFileManager and provides them to MainView's table in correct |
|
31 * format. |
|
32 * |
|
33 */ |
|
34 public class MainViewContentProvider implements IStructuredContentProvider { |
|
35 |
|
36 private final CrashFileManager crashFileManager; |
|
37 private ErrorLibrary errorLibrary = null; |
|
38 |
|
39 public MainViewContentProvider(INewCrashFilesObserver observer) { |
|
40 crashFileManager = new CrashFileManager(observer); |
|
41 } |
|
42 |
|
43 public void refresh() { |
|
44 crashFileManager.refresh(); |
|
45 } |
|
46 |
|
47 public void setErrorLibrary(ErrorLibrary library) { |
|
48 errorLibrary = library; |
|
49 } |
|
50 |
|
51 public Object[] getElements(Object arg0) { |
|
52 return crashFileManager.getCrashFiles(errorLibrary); |
|
53 } |
|
54 |
|
55 public void dispose() { |
|
56 // No implementation needed |
|
57 } |
|
58 |
|
59 public void inputChanged(Viewer arg0, Object arg1, Object arg2) { |
|
60 // No implementation needed |
|
61 } |
|
62 } |