public class DropdownAction
extends org.eclipse.jface.action.Action
implements org.eclipse.jface.action.IMenuCreator
Action with a dropdown button and a simple capability for adding child actions
Constructor and Description |
---|
DropdownAction(java.lang.String text)
Creates a dropdown action with a text label
|
DropdownAction(java.lang.String text,
java.lang.String imageFilename)
Creates a dropdown action with an icon label
|
Modifier and Type | Method and Description |
---|---|
void |
addAction(org.eclipse.jface.action.Action action)
Appends an Action to the bottom of the current menu
|
void |
dispose()
Cleans up and disposes internal Menu instance
|
org.eclipse.jface.resource.ImageDescriptor |
getImageDescriptor() |
org.eclipse.swt.widgets.Menu |
getMenu(org.eclipse.swt.widgets.Control parent)
Returns the Menu generated by this DropdownAction
|
org.eclipse.swt.widgets.Menu |
getMenu(org.eclipse.swt.widgets.Menu parent)
Returns null in this implementation
|
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, run, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
public DropdownAction(java.lang.String text)
Creates a dropdown action with a text label
text
- The label text to appear on the action button
public DropdownAction(java.lang.String text, java.lang.String imageFilename)
Creates a dropdown action with an icon label
text
- The tooltip text
imageFilename
- The filename of the icon image, relative to the OSGi bundle location
public org.eclipse.jface.resource.ImageDescriptor getImageDescriptor()
getImageDescriptor
in interface org.eclipse.jface.action.IAction
getImageDescriptor
in class org.eclipse.jface.action.Action
public void dispose()
Cleans up and disposes internal Menu instance
dispose
in interface org.eclipse.jface.action.IMenuCreator
public org.eclipse.swt.widgets.Menu getMenu(org.eclipse.swt.widgets.Menu parent)
Returns null in this implementation
getMenu
in interface org.eclipse.jface.action.IMenuCreator
parent
- The parent Menu
The generated menu
public org.eclipse.swt.widgets.Menu getMenu(org.eclipse.swt.widgets.Control parent)
Returns the Menu generated by this DropdownAction
getMenu
in interface org.eclipse.jface.action.IMenuCreator
parent
- The parent Control instance
The menu generated by this DropdownAction
public void addAction(org.eclipse.jface.action.Action action)
Appends an Action to the bottom of the current menu
action
- The Action to append