Creating a New Project
Layout algorithms are developed as Eclipse Plug-in Projects. There’s a few things to setup to get your project ready, which is what we will work through here.
If you have nothing better to do…
This ticket is all about adding an ELK Project Wizard to the ELK SDK that will help people create new layout algorithm projects that are already perfectly setup. If you want to make people’s lifes better but don’t know how, here’s your chance!
Creating a New Plug-in
Follow these steps to create a new plug-in:
- From the File menu, select New - Project….
- From the Plug-in Development category, select Plug-in Project and click Next.
- Configure your project’s basic settings, in particular its name, and click Next.
- Configure your project’s content. The Properties should be somewhat sensible, but don’t really matter all that much. In the Options section, uncheck everything. Layout algorithm projects normally don’t need an activator class, and don’t normally make contributions to the UI. Also, don’t create a rich client application. Click Finish.
The Package Explorer now shows a new project for your plug-in which we will configure in the next section.
Setting Up Your Plug-in
Your plug-in needs to declare dependencies to ELK’s most important plug-ins: org.eclipse.elk.graph
(which contains the graph model that will be the input to your layout algorithm) and org.eclipse.elk.core
(which contains the core ELK code). Follow these steps to add the dependencies:
- Open the
MANIFEST.MF
file, located in your plug-in’sMETA_INF
folder. The Plug-in Manifest Editor will open up, which is divided into several pages that you can switch between using the controls at the bottom of the editor. - Open the editor’s Dependencies tab.
- Click the left Add… button to add a dependency. In the dialog that pops up, search for the
org.eclipse.elk.graph
plug-in and click OK. - Repeat for ELK’s core plug-in,
org.eclipse.elk.core
.