...
- Rickt-click the
package and select New > File.de.cau.cs.kieler.simplelayout
- Create a file simple.elkm and double click it to open it.
- When asked whether you want to add the Xtext nature, select yes.
The file is used to specify meta information for your layout algorithm. For this, copy the following code snippet into your editor:
Code Block language java package de.cau.cs.kieler.simplelayout bundle { label "Simple Layout Algoritms" class SimpleOptions } algorithm simple(SimpleLayoutProvider) { label "Simple Test Layouter" supports org.eclipse.elk.spacing.border supports org.eclipse.elk.spacing.node }
- You still have to register the file with Eclipse. Open the
META-INF/MANIFEST.MF
file again and switch to the Extensions tab. - Add an extension for
org.eclipse.elk.core.layoutProviders
. - Right-click the extension and click New > provider.
- Set the name to
Simple Test Layouter
and the class to your layout provider class name (use the browse button and enterSimpleLayoutProvider
).SimpleOptions
). Note thatSimpleOptions
is automatically generated from the .elkm file you created. Its name is specified by theclass
keyword in thebundle
section. - Right-click the new layoutAlgorithm and click New > knownOption. Set option to
de.cau.cs.kieler.spacing
. - Add another knownOption for
de.cau.cs.kieler.borderSpacing
. - Save the editor
- Your workspace should look similar to this
We will now have to add a new run configuration that will start an Eclipse instance with your layout code loaded into the application, ready to be used.
- Click Run > Debug Configurations...
- Right-click Eclipse Application and click New. Set the configuration's name to
Layout Test
. - In the Arguments tab, make sure the the program arguments include
-debug
and-consoleLog
. - On the Plug-ins tab, set Launch with to plug-ins selected below only.
- Click Deselect All.
- Check the Workspace item in the tree.
- Check the
de.cau.cs.kieler.core.kgraph.text.ui,
de.cau.cs.kieler.klighd.xtext
andorg.eclipse.ui.ide.application
plugins under Target Platform - Click Add Required Plug-ins. Press it twice (just to be sure!).
- Click Apply to save your changes and then Debug to start an Eclipse instance to test with.
...