Commit 5caf21cc authored by Johannes Roith's avatar Johannes Roith

Move messagebox to new utility package.

parent 9888270c
......@@ -5,7 +5,7 @@ import org.eclipse.ui.IEditorRegistry;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import org.eclipse.swt.widgets.*;
import utils.*;
/**
* The activator class controls the plug-in life cycle
......@@ -35,9 +35,7 @@ public class Activator extends AbstractUIPlugin {
IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry();
registry.setDefaultEditor("*.minijava", "minijavaplugin.MiniJavaEditor");
MessageBox mb = new MessageBox(PlatformUI.getWorkbench().getDisplay().getActiveShell());
mb.setMessage("hello from minijava!");
mb.open();
Utility.showMessage("hello from minijava!");
}
/*
......
package utils;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.ui.PlatformUI;
public final class Utility {
public static void showMessage(String message) {
MessageBox mb = new MessageBox(PlatformUI.getWorkbench().getDisplay().getActiveShell());
mb.setMessage(message);
mb.open();
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment