Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Exception while calling extension point
Exception while calling extension point [message #526076] Thu, 08 April 2010 16:01
lehmia  is currently offline lehmia Friend
Messages: 29
Registered: February 2010
Junior Member
I want to call the extension point org.eclipse.ltk.core.refactoring.moveParticipants that is defined in plugin.xml
//////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// /
<extension point="org.eclipse.ltk.core.refactoring.moveParticipants">
<moveParticipant id="moreunit.moveMethodParticipant"
name="MoreUnitMethodMethodParticipant"
class="org.moreunit.refactoring.MoveMethodParticipant">
<enablement>
<with variable="affectedNatures">
<iterate operator="or">
<equals value="org.eclipse.jdt.core.javanature"/>
</iterate>
</with>
<with variable="element">
<instanceof value="org.eclipse.jdt.core.IMethod"/>
</with>
</enablement>
</moveParticipant>
</extension>
//////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////
i have written following code to call extension point
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////
private void runGreeterExtension() {
try {
System.out.println("run Greeter ");

IExtensionRegistry reg = Platform.getExtensionRegistry();

//IConfigurationElement[] extensions = reg.getConfigurationElementsFor(myPlugin);


// IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint(myPlugin);
// getExtension(myPlugin);
//System.out.println( extension.getUniqueIdentifier());

IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor( myPlugin);

// IExtension[] extensions = extension.getExtensions();
// System.out.println("extension length"+extensions.length);
// for(int i=0;i<extensions.length;i++)
// {
// System.out.println("name of extensions "+extensions[i].getUniqueIdentifier());
//}

for (IConfigurationElement e : config) {


final Object o = e.createExecutableExtension("class");

if (o instanceof MoveMethodParticipant) {
ISafeRunnable runnable = new ISafeRunnable() {
public void handleException(Throwable exception) {
System.out.println("Exception in client");
}

public void run() throws Exception {
((MoveMethodParticipant) o).getName();
}
};
SafeRunner.run(runnable);
}
}
}
catch (Exception ex) {
System.out.println(ex.getMessage());
}
}

//////////////////////////////////////////////////////////// ///////////////////////////////////////////////////
Following exception is thrown when the
" final Object o = e.createExecutableExtension("class");" is called .
Exception:
"Plug-in org.eclipse.jdt.debug.ui was unable to load class org.eclipse.jdt.internal.debug.core.refactoring.LaunchConfig urationITypeMoveParticipant. "

Need urgent help.
Previous Topic:LIsten For File Save Event?
Next Topic:Exception while calling extension point
Goto Forum:
  


Current Time: Tue Mar 19 06:15:08 GMT 2024

Powered by FUDForum. Page generated in 0.02950 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top