summaryrefslogtreecommitdiffstats
path: root/plugins/org.yocto.remote.utils/src/org/yocto/remote/utils/DialogRunnable.java
blob: 5fbab7615170cef5c038e3f99708a4028051e39d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package org.yocto.remote.utils;

import org.eclipse.jface.dialogs.MessageDialog;

public 	class DialogRunnable implements Runnable{
	int type = 0;
	boolean result;
	public static final int QUESTION = 1;
	public static final int ERROR = 2;
	String title;
	String message;

	DialogRunnable(String title, String message, int type){
		this.title = title;
		this.message = message;
		this.type = type;
	}
	@Override
	public void run() {
		if (type == QUESTION) {
			result = MessageDialog.openQuestion(null, title, message);
		} else if (type == ERROR) {
			MessageDialog.openError(null, title, message);
		}
	}
}