deep

a Cross Development Platform for Java

User Tools

Site Tools


dev:eclipse_integration

Eclipse Integration

The project deep contains an integration into eclipse as plugin. Though the compiler and linker are not dependent on eclipse and can run standalone, see Launcher. All configuration details are given in the configuration files (see Configuration). These files must be parsed for the various eclipse wizards and dialogues and changes must be stored back to those files. It is possible to work without eclipse at all.
All plugin related components are packed in org.deepjava.eclipse. There, they are split into launcher, nature and ui. The only exception to this is the necessary MANIFEST.MF, plugin.xml and build.properties. They must be placed in the root directory.
To test the plugin itself, the project can be run as eclipse application as described in Launcher.

Metafiles for Plugin

Metafiles describe the features of the plugin, give entry points and dependecies.

DeepPlugin.java

DeepPlugin.java is the the entry point for eclipse. When loading the plugin the constructor of this class is called where the console is initialized. Constants are defined here, which are used by various other classes. Methods for handling of files and pictures are also contained in this class.

Launcher

DeepLaunchDelegate.java

When you start a run configuration of type deep-LaunchType (defined in the manifest file) by the run button, the method

launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor);

of this class is called. This method starts building the project. Finally a terminate event is sent to the environment by the aid of DummyDebugTarget. This causes the environment to refresh.

DeepLaunchShortcut.java

So called Launch Shortcuts are defined. They help that one does not have to create a new run configuration for each project by hand. With the shortcut you can create a run configuration by right clicking the deep project file and selecting Run-As. DeepLaunchShortcut searches first if a suitable run configuration already exists. If this is not the case a new configuration is created with default settings.

DummyDebugTarget.java

The DummyDebugTarget can be used for the debugger. But it is also used to signal that running the compiler has terminated. If this does not happen, running the compiler would never end in the debug perspective of eclipse.

DeepNature

The deep nature extends the regular java nature. It enables specific deep actions.

UI

Actions

Actions are defined here, which can be started through the eclipse toolbar. They must be added as actionSets to the manifest file as well.

Perspective

The class DeepPerspective contains default settings for the deep perspective.

Preferences

The class DeepPreferencePage extends FieldEditorPreferencePage and defines the fields which show on the deep preference page. These fields get initialized with the values contained in the PreferenceStore.
The method initializeDefaultPreferences() of the class DeepPreferenceInitializer is called when a new workspace is created. Then a new PreferenceStore is initialized with the values from PreferenceConstants.

Wizard

The main class is DeepProjectWizard. It calls several dialogue pages and creates the project folder together with the classpath file and the deep configuration file.

Properties

DeepProjectPage defines the layout of the project properties dialogue, which can be called by Project → Properties.

Tabs

DeepTabGroup defines the tabs of the run configuration. They are all standard java tabs except DeepMainTab. DeepMainTab is necessary because the regular java entry point is a main method.

View + Model

Simple views are discussed in many tutorials. Therefore, we only discuss ConsoleDisplayMgr. ConsoleDisplayMgr adds a deep console to the eclipse standard console and offers methods to print into this console. It's possible to use print directly. Alternatively, you can direct a stream onto this console. Through the type of the message the colour can be chosen. If system colours should be used you have to make sure that ConsoleDisplayMgr runs in an UI-thread. This is currently not the case.

dev/eclipse_integration.txt · Last modified: 2022/12/20 15:54 by ursgraf