Directory

← Back

dMenu Widget

Menu UI Component

Author

Rating

Popularity

<100

dMenu is a Vaadin UI component and is a set of toolbars which are placed on tabs in a tab bar. With dMenu you can use tabs to expose different sets of controls, eliminating the need for many parallel toolbars.

Sample code

MenuItem menuItem1 = new MenuItem( "Menu 1" );
menuItem1.addMenuElement( new MenuItemElement( "Menu element 1", new Button( "Button 1" ) ) );
menuItem1.addMenuElement( new MenuItemElement( "Menu element 2", new Button( "Button 2" ) ) );

MenuItem menuItem2 = new MenuItem( "Menu 2" );
menuItem2.addMenuElement( new MenuItemElement( "Menu element 1", new Button( "Button 1" ) ) );
menuItem2.addMenuElement( new MenuItemElement( "Menu element 2",
                                               new VerticalLayout( new Button( "Button 2" ),
                                                                   new Button( "Button 3" ),
                                                                   new Button( "Button 4" ) ) ) );

ComboBox comboBox = new ComboBox( "Select something here" );
comboBox.addItem( "Mercury" );
comboBox.addItem( "Venus" );
comboBox.addItem( "Earth" );
comboBox.addItem( "Mars" );
comboBox.addItem( "Jupiter" );
comboBox.addItem( "Saturn" );
comboBox.setValue( "Mercury" );
comboBox.setNewItemsAllowed( false );
menuItem2.addMenuElement( new MenuItemElement( "Menu element 3",
                                               new VerticalLayout( comboBox, new Button( "Button 5" ) ) ) );

ListSelect select = new ListSelect();
select.addItem( "Mercury" );
select.addItem( "Venus" );
select.addItem( "Earth" );
select.addItem( "Mars" );
select.addItem( "Jupiter" );
select.addItem( "Saturn" );
select.setRows( 5 );
select.setNullSelectionAllowed( false );
menuItem2.addMenuElement( new MenuItemElement( "Menu element 4", select ) );

OptionGroup group = new OptionGroup( "Group element" );
group.addItem( "One" );
group.addItem( "Two" );
group.addItem( "Three" );
group.setItemEnabled( "Two", false );
menuItem2.addMenuElement( new MenuItemElement( "Menu element 5", group ) );

MenuItem menuItem3 = new MenuItem( "Menu 3" );
TextArea area = new TextArea();
area.setWordwrap( true );
area.setValue( "A quick brown fox jumps over the lazy dog" );
area.setColumns( 40 );
area.setRows( 4 );
menuItem3.addMenuElement( new MenuItemElement( "Menu element 1", area ) );

DMenu menu = new DMenu();
menu.setCenteredTabs( true );
menu.addMenuItems( menuItem1, menuItem2, menuItem3 );

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Complete rewritten code. Removed GwtQuery library dependency.

Released
2016-02-22
Maturity
EXPERIMENTAL
License
Apache License 2.0

Compatibility

Framework
Vaadin 7.6+
Vaadin 7.0+ in 0.5.0
Browser
Firefox
Opera
Safari
Google Chrome
Internet Explorer
iOS Browser
Android Browser
Internet Explorer
Internet Explorer

Vaadin Add-on Directory

Find open-source widgets, add-ons, themes, and integrations for your Vaadin application. Vaadin Add-on Directory
The channel for finding, promoting, and distributing Vaadin add-ons.
Online