Application¶
Everything in eclipse is handled through the plug-in extension mechanism, and defining an application is no different. The org.eclipse.core.runtime plug-in defines the concept of what it means to be an Application.
Switch to the Extensions tab.
Press the Add button, and select the org.eclipse.core.runtime.applications extension point.
Press the Finish button.
Hint
You can check what xml is being generated at any point by looking at the plugin.xml tab.
Right click on the (application) element and select New ‣ Run
In the class text field enter: net.refractions.udig.tutorials.customapp.CustomApp
Save your work, and then press the class link.
Eclipse will open up a wizard for creating a New Java Class. Enter the following:
Superclass: net.refractions.udig.internal.ui.UDIGApplication
Press the Finish Button
In the newly created file add the following method:
@Override protected WorkbenchAdvisor createWorkbenchAdvisor() { return new UDIGWorkbenchAdvisor() { @Override public String getInitialWindowPerspectiveId() { return "net.refractions.udig.tutorials.customapp.perspective"; } }; }
If you just cut and paste the above code you will be left with several problems (as UDIGWorkbenchAdvisor is not imported yet).
Here are two ways to fix this:
Type CTRL + SHIFT + o
This keyboard short cut will try and fix as many import statements as it can. Save the file after this change and the correct import statements should be there.
Or you can just type them in at the top of the file:
import net.refractions.udig.internal.ui.UDIGWorkbenchAdvisor;
Save your work and lets move on.