public class CommandMenuVP extends MenuButtonVP
StyledElementViewPart.Role
menuAtLeft, role, selectElement, view
BOTTOM, disabledIcon, icon, iconHeight, iconWidth, LEFT, RIGHT, state, toolTip, TOP
DEFAULT_STYLE, style
Constructor and Description |
---|
CommandMenuVP(Style style,
StyledElementView view,
StyledElementViewPart.Role role,
StyleValue labels,
StyleValue values) |
Modifier and Type | Method and Description |
---|---|
CommandResult |
executeCommand(Gadget self,
String parameter,
int x,
int y)
Actually executes this command with specified parameter and in
specified context.
|
CommandMenu |
getMenu() |
static String[] |
getMenuItems(StyleValue labels,
StyleValue values,
String cmdParam,
Element element) |
void |
setCommand(Command command) |
void |
setCommandParameter(String commandParameter) |
createMenu, getCommand, getCommandParameter, hasCommand, hasMenu, prepareCommand, setMenu
detachingViewFromModel, getCommand, getElementView, getMenuAtLeft, getRole, getStyledElementView, getView, grabsMouseButton, handleMouseEvent, isElementSelected, reportCommandError, selectElement, selectElement, setElementSelected, setMenuAtLeft
doAction, getFirstBaseLine, getIcon, getIconGap, getIconPosition, getLastBaseLine, getToolTip, hasIcon, hasText, isEnabled, isPressed, layoutContent, paintContent, setEnabled, setIcon, setIconGap, setIconPosition, setPressed, setToolTip
doLayoutContent, doPaintContent, getText, setText
refresh
drawBorder, drawBox, drawEmptyContent, drawEmptyTextContent, getContentSizeConstraints, getEmptyContentSize, getEmptyContentSize, getMarginBottom, getMarginTop, getStyle, hasDynamicVerticalMargins, layout, paint, setStyle
focusGained, focusLost, gadgetToPanel, gadgetToRoot, getAncestors, getBounds, getBounds, getCursor, getEventDispatcher, getFontMetrics, getGadgetPanel, getGraphics, getLocation, getLocation, getNonBreakableVerticalRanges, getRoot, getSize, getSize, getToolkit, handleAppEvent, handleKeyEvent, hasFocus, isAppEventHandler, layout, makeRectangleVisible, makeRectangleVisible, panelToGadget, print, relayout, relayout, repaint, repaint, requestFocus
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMarginBottom, getMarginTop, getStyle, hasDynamicVerticalMargins
public CommandMenuVP(Style style, StyledElementView view, StyledElementViewPart.Role role, StyleValue labels, StyleValue values)
public void setCommand(Command command)
setCommand
in class MenuButtonVP
public void setCommandParameter(String commandParameter)
setCommandParameter
in class MenuButtonVP
public CommandMenu getMenu()
getMenu
in class ButtonBaseVP
public static final String[] getMenuItems(StyleValue labels, StyleValue values, String cmdParam, Element element)
public CommandResult executeCommand(Gadget self, String parameter, int x, int y)
Command
This method assumes that Command.prepareCommand(com.xmlmind.xmledit.gadget.Gadget, java.lang.String, int, int)
has been
successfully invoked immediately before its own invocation.
self
- the target of this commandparameter
- parameterizes the command (that is, modifies the
behavior of the command in a command specific way)x
- X position relative to gadget of the mouse event
having triggered this command; -1 if this command was triggered by a
keyboard inputy
- Y position relative to gadget of the mouse event
having triggered this command; -1 if this command was triggered by a
keyboard inputnull