classpathVariableInitializer doesn't seem to work under Eclipse 2.01 [message #76168] |
Tue, 17 June 2003 07:05 |
Eclipse User |
|
|
|
Originally posted by: frank.weber.gmx.at
I try to set a classpath variable with the extension point
org.eclipse.jdt.core.classpathVariableInitializer. The whole thing works
fine with Eclipse 2.1, but it doesn't work under 2.01 (200208291828). The
initialize method will not be called.
I am using a simple "Hello World Plugin" and add a simple
classpathVariableInitializer to the Project.
This is my plugin.xml:
<?xml version="1.0" encoding="UTF-8"?>
<plugin
id="hallo"
name="hallo Plug-in"
version="1.0.0"
provider-name=""
class="hallo.halloPlugin">
<runtime>
<library name="hallo.jar"/>
</runtime>
<requires>
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.jdt.core"/>
</requires>
<extension
point="org.eclipse.ui.actionSets">
<actionSet
label="Sample Action Set"
visible="true"
id="hallo.actionSet">
<menu
label="Sample &Menu"
id="sampleMenu">
<separator
name="sampleGroup">
</separator>
</menu>
<action
label="&Sample Action"
icon="icons/sample.gif"
class="hallo.actions.SampleAction"
tooltip="Hello, Eclipse world"
menubarPath="sampleMenu/sampleGroup"
toolbarPath="sampleGroup"
id="hallo.actions.SampleAction">
</action>
</actionSet>
</extension>
<extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension
targetID="org.eclipse.ui.resourcePerspective">
<actionSet
id="hallo.actionSet">
</actionSet>
</perspectiveExtension>
</extension>
<extension
point="org.eclipse.jdt.core.classpathVariableInitializer">
<classpathVariableInitializer
variable="HALLO"
class="hallo.Hallo"/>
</extension>
</plugin>
The class hallo.Hallo exists and looks like this:
package hallo;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.ClasspathVariableInitializer;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
public class Hallo extends ClasspathVariableInitializer {
public Hallo() {
super();
}
public void initialize(String var) {
IPath p = new Path("/home/frank/test.jar");
try {
JavaCore.setClasspathVariable(var, p, null);
} catch (JavaModelException e) {
e.printStackTrace();
}
}
}
Does anybody know what is wrong with the code?
|
|
|
Powered by
FUDForum. Page generated in 0.03462 seconds