Skip to content

Commit

Permalink
remove FurnaceHelper.createStartFurnaceJob()
Browse files Browse the repository at this point in the history
  • Loading branch information
koentsje committed May 6, 2014
1 parent f44ea02 commit 7b94f9b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public Object execute(ExecutionEvent event) {
final IWorkbenchWindow window = HandlerUtil
.getActiveWorkbenchWindowChecked(event);
if (!ForgeRuntimeState.RUNNING.equals(FurnaceRuntime.INSTANCE.getState())) {
Job job = FurnaceHelper.createStartFurnaceJob();
Job job = FurnaceHelper.createStartRuntimeJob(FurnaceRuntime.INSTANCE);
job.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(IJobChangeEvent event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,10 @@
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
import org.jboss.tools.forge.core.furnace.FurnaceRuntime;
import org.jboss.tools.forge.core.runtime.ForgeRuntime;

public class FurnaceHelper {

public static Job createStartFurnaceJob() {
final FurnaceRuntime runtime = FurnaceRuntime.INSTANCE;
final String version = runtime.getVersion();
WorkspaceJob job = new WorkspaceJob("Starting JBoss Forge " + version) {
@Override
public IStatus runInWorkspace(IProgressMonitor monitor)
throws CoreException {
String taskName = "Please wait while JBoss Forge " + version + " is started.";
monitor.beginTask(taskName, IProgressMonitor.UNKNOWN);
runtime.start(monitor);
if (runtime.getErrorMessage() != null) {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
MessageDialog.openError(
null,
"JBoss Forge Startup Error",
runtime.getErrorMessage());
}
});
}
return Status.OK_STATUS;
}
};
job.setUser(true);
return job;
}

public static Job createStartRuntimeJob(final ForgeRuntime runtime) {
final String version = runtime.getVersion();
WorkspaceJob job = new WorkspaceJob("Starting JBoss Forge " + version) {
Expand Down

0 comments on commit 7b94f9b

Please sign in to comment.