330 likes | 425 Views
My First OSGi Bundle. New Project (1). New Project (2). New Project (3). New Project (4). Activator.java file. MANIFEST.MF File. Run configure(1). Run configure(2). run. run. run. My First OSGi Service Bundle. New project(1). New project(2). New project(3). New project(4).
E N D
Bundle with SWT • package testbundle; • import org.osgi.framework.BundleActivator; • import org.osgi.framework.BundleContext; • import org.eclipse.swt.widgets.Display; • import org.eclipse.swt.widgets.Shell; • public class Activator implements BundleActivator { • Display display = new Display(); • public void start(BundleContext context) throws Exception { • System.out.println("Hello World!!"); • Shell shell = new Shell(display); • shell.setText("Hello world!"); • shell.open(); • //while (!shell.isDisposed()) { • //if (!display.readAndDispatch()) display.sleep(); • //} • //display.dispose(); • } • public void stop(BundleContext context) throws Exception { • System.out.println("Goodbye World!!"); • display.dispose(); • } • }