O'Reilly logo

ExtGWT Rich Internet Application Cookbook by Odili Charles Opute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Augmenting trees with ContextMenu

Context menus are used to provide context-specific menu options on GXT Component objects, and since TreePanel is derived from BoxComponent, which is of course a descendant of Component, we can leverage the Component API to provide context menus for TreePanel, allowing users to right-click on a tree node to see what more they can do with that node, apart from just staring at it.

Augmenting trees with ContextMenu

How to do it...

Simply create a Menu object and add MenuItem objects to the Menu object; then, set the Menu object as a context menu on the TreePanel instance by using its setContextMenu() method.

// set up the store and tree final TreeStore<FileModel> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required