Package com.iizix.swt
Class DropdownSelectionListener
java.lang.Object
com.iizix.swt.DropdownSelectionListener
- All Implemented Interfaces:
- Listener
Class used as helper for toolbar drop-down items.
- Author:
- Christopher Mindus
- Constructor SummaryConstructorsConstructorDescription- DropdownSelectionListener- (ToolItem dropdown) Creates a drop-down handler for a drop-down toolbar item.- DropdownSelectionListener- (ToolItem dropdown, boolean lastDefault) Creates a drop-down handler for a drop-down toolbar item.
- Method SummaryModifier and TypeMethodDescriptionAdds a menu item with a selection listener to the drop-down menu.Adds a menu item with a selection listener to the drop-down menu.Adds a menu item with a selection listener to the drop-down menu.Adds a menu item with a selection listener to the drop-down menu.Adds a menu item with a selection listener to the drop-down menu.Adds a menu item with a selection listener to the drop-down menu.Adds a menu item with a selection listener to the drop-down menu.Adds a menu item with a selection listener to the drop-down menu.Adds an action that has a text and image.- void- addInitializer- (IDropdownMenuInitializer init, int keepMenuItemCount) Adds a menu initializer.- void- addMenuListener- (Runnable listener) Adds a menu listener when the menu becomes visible.- voidAdds a separator line.- voidRemoves all menu items.- void- clearMenu- (int keepMenuItemCount) Removes menu items from the bottom, keeping "count" menu items.- getMenu()Gets the menu.- void- handleEvent- (Event event) Process selection.- voidSets the default item.- void- setDefaultSelected- (IzMenuItem mi, boolean forceLastDefault) Sets the default item.- void- showMenu()Shows the drop-down menu.
- Constructor Details- DropdownSelectionListenerCreates a drop-down handler for a drop-down toolbar item.- Parameters:
- dropdown- The drop-down toolbar item.
 
- DropdownSelectionListenerCreates a drop-down handler for a drop-down toolbar item.- Parameters:
- dropdown- The drop-down toolbar item.
- lastDefault- Last item becomes the default one.
 
 
- Method Details- getMenuGets the menu.
- addMenuListenerAdds a menu listener when the menu becomes visible.- Parameters:
- listener- The menu listener.
 
- addAdds a menu item with a selection listener to the drop-down menu.- Parameters:
- item- The text for the item.
- select- The selection listener.
- Returns:
- The added menu item.
 
- addAdds a menu item with a selection listener to the drop-down menu.- Parameters:
- item- The text for the item.
- image- The image or null for none.
- select- The selection listener.
- Returns:
- The added menu item.
 
- addAdds a menu item with a selection listener to the drop-down menu.- Parameters:
- item- The text for the item.
- style- The style, a combination of SWT flags, default SWT.NONE.
- select- The selection listener.
- Returns:
- The added menu item.
 
- addAdds a menu item with a selection listener to the drop-down menu.- Parameters:
- item- The text for the item.
- image- The image or null for none.
- style- The style, a combination of SWT flags, default SWT.NONE.
- select- The selection listener.
- Returns:
- The added menu item.
 
- addAdds a menu item with a selection listener to the drop-down menu.- Parameters:
- item- The text for the item.
- select- The selection listener.
- isDefault- Flag for default selection in the pull-down menu.
- Returns:
- The added menu item.
 
- addAdds a menu item with a selection listener to the drop-down menu.- Parameters:
- item- The text for the item.
- image- The image or null for none.
- select- The selection listener.
- isDefault- Flag for default selection in the pull-down menu.
- Returns:
- The added menu item.
 
- addAdds a menu item with a selection listener to the drop-down menu.- Parameters:
- item- The text for the item.
- style- The style, a combination of SWT flags, default SWT.NONE.
- select- The selection listener.
- isDefault- Flag for default selection in the pull-down menu.
- Returns:
- The added menu item.
 
- addAdds a menu item with a selection listener to the drop-down menu.- Parameters:
- item- The text for the item.
- image- The image or null for none.
- style- The style, a combination of SWT flags, default SWT.NONE.
- select- The selection listener.
- isDefault- Flag for default selection in the pull-down menu.
- Returns:
- The added menu item.
 
- addSeparatorpublic void addSeparator()Adds a separator line.
- addAdds an action that has a text and image. The action is wrapped with an ActionContributionItem that creates the menu item.- Parameters:
- action- The action to add.
- Returns:
- The menu item created.
 
- setDefaultSelectedSets the default item.
- setDefaultSelectedSets the default item.
- handleEventProcess selection.- Specified by:
- handleEventin interface- Listener
 
- clearMenupublic void clearMenu()Removes all menu items.
- clearMenupublic void clearMenu- (int keepMenuItemCount) Removes menu items from the bottom, keeping "count" menu items.
- addInitializerAdds a menu initializer.- Parameters:
- init- The menu initializer.
- keepMenuItemCount- Item count to keep in the menu (-1 for all).
 
- showMenupublic void showMenu()Shows the drop-down menu.