Thanks Vitali, I already checked the processtools method, and if activeModalToolProxy is null, the defaultModalToolProxy is assigned. The problem is, that also defaultModalToolProxy is null, when the method is called. I have no idea where the defaultModalToolProxy comes from. In the ToolManager class it is apparently never instantiated and it also doesn't come from a superclass, since there is only an interface implementation.
Any idea where I could look? I'm sure it is my tool to break the thing, but I have no idea about how. What about the categoryID or menupath that has to be set in the extention? Could that be the problem? I also tried to create a category from its extention point, but no luck. The problem stays. Andrea Vitali Diatchkov probaly wrote: > > Hello! > Regarding to activeModalToolProxy - it should not be a null because there is > always one modal tool being active. During initialization of tools the > default tool (which is ZOOM) is set to the activeModalToolProxy member of > ToolManager. So your exception means that something went wrong during > initialization of tools inside of ToolProxy constructor. > > Do you have another exceptions earlier in the log file? > > Take a look into the method ToolManager.processTools(). This method > initializes tools and if YOUR tool (action tool as I understand) was not > initialized properly - all other tools are not initialized because the > exception (NPE probably) is thrown outside of this method. > > So I am pretty sure that wrong configuration of your tool corrupts > initialization of other tools. Please check this! > > Vitali Diatchkov. > >> -----Original Message----- >> From: [EMAIL PROTECTED] [mailto:udig-devel- >> [EMAIL PROTECTED] On Behalf Of Andrea Antonello >> Sent: Thursday, April 19, 2007 3:02 PM >> To: User-friendly Desktop Internet GIS >> Subject: [udig-devel] menubuilder and actions >> >> I am trying to create an Action to be added to a menu created through >> the menubuilder extention. >> >> Mainly I want to create a button that launches a dialog, then the user >> chooses some layer and the action does something. >> >> That said, I first tried to create an ActionTool from the udig >> extention, which is rather easy and seemed to fit my needs. >> >> However when I started udig, i got a nice exception: >> java.lang.NullPointerException >> at >> net.refractions.udig.project.ui.internal.tool.display.ToolManager.setActiv >> eTool(ToolManager.java:508) >> at >> net.refractions.udig.project.ui.internal.tool.display.ToolManager.setCurre >> ntEditor(ToolManager.java:407) >> at >> [ and so on ] >> >> which nicely made appear my tool in the toolbar, but broke every other >> button on the bar, i.e. only my button populated the toolbar. Rather >> aggressive... :) >> >> Since I couldn't figure out why activeModalToolProxy was null at the >> point all this occured, I decided to step over to the menuBuilder and >> create a "normal" Action. >> >> Now I notice that the menubuilder misses the >> protected void makeActions( IWorkbenchWindow window ) >> method, which is mandatory to activate and register the actions to the >> workbench. >> Which is the proper way to add my Action, that extends Action and >> implements IAction? >> >> Ciao >> Andrea >> >> >> >> >> >> >> _______________________________________________ >> User-friendly Desktop Internet GIS (uDig) >> http://udig.refractions.net >> http://lists.refractions.net/mailman/listinfo/udig-devel > > _______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel
