Reputation: 21
I'm developing an Eclipse Plug-in. I have Activator class and my own classes. I need an Hashtable that must be initiated when the IDE is loaded and must be kept and accessible (used through several classes) until the IDE is closed.
Upvotes: 2
Views: 1125
Reputation: 819
Create a separate plugin to hold the Hashtable, and have it extend org.eclipse.ui.startup,
A simple example:
plugin.xml:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.startup">
<startup
class="org.markus.startup.EarlyGreeter">
</startup>
</extension>
</plugin>
EarlyGreeter.java:
package org.markus.startup;
import org.eclipse.ui.IStartup;
public class EarlyGreeter implements IStartup {
@Override
public void earlyStartup() {
System.out.println("This is EarlyGreeter saying Hello during workbench startup.");
}
}
Upvotes: 3
Reputation: 44515
You can use the extension point org.eclipse.ui.startup to start your plugin automatically with the application.
Upvotes: 4