[go: up one dir, main page]

Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Menu Handler class not found
icon9.gif  Menu Handler class not found [message #545499] Thu, 08 July 2010 05:22
Alex is currently offline AlexFriend
Messages: 114
Registered: June 2010
Senior Member
Hi,

for my Plugin I'd like to have a menu entry when right clicking into an editor. So I added extensions to org.eclipse.ui.menus, org.eclipse.ui.commands and org.eclipse.ui.handlers:
   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            locationURI="popup:#TextEditorContext?before=group.edit">
         <command
               commandId="menuentries.formattable"
               icon="icons/formattable.PNG"
               label="Format Table"
               style="push"
         </command>
      </menuContribution>
   </extension>
   <extension
         point="org.eclipse.ui.commands">
      <command
            defaultHandler="myPackage.TableFormatter"
            id="menuentries.formattable"
            name="FormatTable">
      </command>
   </extension>
   <extension
         point="org.eclipse.ui.handlers">
      <handler
            class="myPackage.TableFormatter"
            commandId="menuentries.formattable">
      </handler>
   </extension>


When launching an Eclipse Application the menu entry appears in the editor's contextmenu as I wanted and when I press the entry, the execute-method of TableFormatter is invoked. So everything seems to fit, BUT

if I debug as an Eclipse Application Eclipse will pause when right-clicking into the editor and following stack trace appears:
org.eclipse.equinox.launcher.Main at localhost:1581	
	Thread [main] (Class load: TableFormatter)	
Class<T>.getDeclaredConstructors0(boolean) line: not available [native method]	
Class<T>.privateGetDeclaredConstructors(boolean) line: not available	
Class<T>.getConstructor0(Class[], int) line: not available	
Class<T>.newInstance0() line: not available	
Class<T>.newInstance() line: not available	
EquinoxRegistryStrategy(RegistryStrategyOSGI).createExecutableExtension(RegistryContributor, String, String) line: 184	


This happens when the EquinoxRegistryStrategy's createExecutableExtension for the className (second argument) "myPackage.TableFormatter" is invoked.
When I press Continue, everything works fine (execute-method is invoked and works properly).

Did I forget something?

What has also to be mentioned: When exporting my plugin as an Eclipse Product, the menu entry is visible but nothing happens when the entry is clicked on... So there MUST be something that I've done wrong, but I don't hit on it.... Sad


my handler:
public class TableFormatter extends AbstractHandler {

public TableFormatter() {
		super();
	}

@Override
	public Object execute(ExecutionEvent event) throws ExecutionException {
		return null;
	}
}
Previous Topic:Export Plugin as Eclipse Product
Next Topic:Menu Handler class not found
Goto Forum:
  


Current Time: Thu Dec 12 18:53:03 GMT 2024

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

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

Back to the top