See org.gjt.sp.jedit.EditPlugin for properties you need to define to have your plugin provide a dynamic menu.