Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[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.setActiveTool(ToolManager.java:508)
	at
net.refractions.udig.project.ui.internal.tool.display.ToolManager.setCurrentEditor(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








Back to the top