1 /** |
|
2 * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "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 * Symbian Foundation - initial contribution. |
|
11 * Contributors: |
|
12 * Description: |
|
13 * Overview: |
|
14 * Details: |
|
15 * Platforms/Drives/Compatibility: |
|
16 * Assumptions/Requirement/Pre-requisites: |
|
17 * Failures and causes: |
|
18 */ |
|
19 package org.symbian.tools.wrttools.core.deploy; |
|
20 |
|
21 import org.eclipse.core.resources.IProject; |
|
22 import org.eclipse.core.runtime.IProgressMonitor; |
|
23 import org.eclipse.core.runtime.IStatus; |
|
24 import org.eclipse.core.runtime.MultiStatus; |
|
25 import org.eclipse.core.runtime.Status; |
|
26 import org.symbian.tools.wrttools.Activator; |
|
27 import org.symbian.tools.wrttools.core.status.IWRTStatusListener; |
|
28 import org.symbian.tools.wrttools.core.status.WRTStatus; |
|
29 import org.symbian.tools.wrttools.util.ProjectUtils; |
|
30 |
|
31 public class ProgressMonitorAndLogger implements IWRTStatusListener { |
|
32 private final IProgressMonitor monitor; |
|
33 private final MultiStatus status; |
|
34 |
|
35 public ProgressMonitorAndLogger(IProgressMonitor monitor, MultiStatus status) { |
|
36 this.monitor = monitor; |
|
37 this.status = status; |
|
38 } |
|
39 |
|
40 public void emitStatus(WRTStatus status) { |
|
41 monitor.setTaskName(status.getStatusDescription().toString()); |
|
42 this.status.add(new Status(IStatus.INFO, Activator.PLUGIN_ID, status.getStatusDescription().toString())); |
|
43 } |
|
44 |
|
45 public boolean isStatusHandled(WRTStatus status) { |
|
46 return true; |
|
47 } |
|
48 |
|
49 public void close() { |
|
50 // Do nothing |
|
51 } |
|
52 |
|
53 public boolean canPackageWithErrors(IProject project) { |
|
54 return ProjectUtils.canPackageWithErrors(project); |
|
55 } |
|
56 } |
|