diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 13:23:09 +0200 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 13:24:09 +0200 |
commit | c7da892cb23d50d4d85746c9a0b6b14bf570989d (patch) | |
tree | e7136073f386d6156f51766c498c52c30c8df85f /plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/wizards/bsp/BSPProgressDialog.java | |
download | eclipse-poky-kepler-c7da892cb23d50d4d85746c9a0b6b14bf570989d.tar.gz |
initial commit for Enea Linux 4.0daisy
Migrated from the internal git server on the daisy-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/wizards/bsp/BSPProgressDialog.java')
-rw-r--r-- | plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/wizards/bsp/BSPProgressDialog.java | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/wizards/bsp/BSPProgressDialog.java b/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/wizards/bsp/BSPProgressDialog.java new file mode 100644 index 0000000..8d5864c --- /dev/null +++ b/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/wizards/bsp/BSPProgressDialog.java | |||
@@ -0,0 +1,47 @@ | |||
1 | package org.yocto.sdk.remotetools.wizards.bsp; | ||
2 | |||
3 | import org.eclipse.core.runtime.IProgressMonitor; | ||
4 | import org.eclipse.jface.dialogs.ProgressMonitorDialog; | ||
5 | import org.eclipse.jface.operation.IRunnableWithProgress; | ||
6 | import org.eclipse.swt.widgets.Shell; | ||
7 | |||
8 | /** | ||
9 | * Creates a progress monitor dialog that will run in the background a BSPThread and display a custom message | ||
10 | * @author ioana.grigoropol | ||
11 | * | ||
12 | */ | ||
13 | public class BSPProgressDialog extends ProgressMonitorDialog{ | ||
14 | String displayMessage; | ||
15 | BSPThread getterThread; | ||
16 | Shell shell; | ||
17 | |||
18 | |||
19 | public BSPProgressDialog(Shell parent, BSPThread getterThread, String displayMessage) { | ||
20 | super(parent); | ||
21 | this.shell = parent; | ||
22 | this.getterThread = getterThread; | ||
23 | this.displayMessage = displayMessage; | ||
24 | } | ||
25 | |||
26 | public void run(boolean showProgressDialog){ | ||
27 | try { | ||
28 | if (showProgressDialog) | ||
29 | super.run(true, true, new IRunnableWithProgress(){ | ||
30 | @Override | ||
31 | public void run(IProgressMonitor monitor) { | ||
32 | monitor.beginTask(displayMessage + " ...", 100); | ||
33 | getterThread.run(); | ||
34 | monitor.done(); | ||
35 | } | ||
36 | }); | ||
37 | else | ||
38 | getterThread.run(); | ||
39 | } catch (Exception e) { | ||
40 | getterThread.getBspAction().setMessage(e.getMessage()); | ||
41 | } | ||
42 | } | ||
43 | |||
44 | public BSPAction getBspAction() { | ||
45 | return getterThread.getBspAction(); | ||
46 | } | ||
47 | } | ||