public abstract class MenuButtonVP extends ButtonBaseVP implements Command
StyledElementViewPart.Role
menuAtLeft, role, selectElement, view
BOTTOM, disabledIcon, icon, iconHeight, iconWidth, LEFT, RIGHT, state, toolTip, TOP
DEFAULT_STYLE, style
Constructor and Description |
---|
MenuButtonVP(Style style,
StyledElementView view,
StyledElementViewPart.Role role) |
Modifier and Type | Method and Description |
---|---|
protected CommandMenu |
createMenu(String[] menuItems) |
Command |
getCommand() |
String |
getCommandParameter() |
boolean |
hasCommand() |
boolean |
hasMenu() |
boolean |
prepareCommand(Gadget self,
String parameter,
int x,
int y)
Tests whether this command can be executed with specified parameter
and in specified context.
|
void |
setCommand(Command command) |
void |
setCommandParameter(String commandParameter) |
void |
setMenu(CommandMenu menu) |
detachingViewFromModel, getCommand, getElementView, getMenu, 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
copy, executeCommand
getMarginBottom, getMarginTop, getStyle, hasDynamicVerticalMargins
public MenuButtonVP(Style style, StyledElementView view, StyledElementViewPart.Role role)
public boolean hasCommand()
hasCommand
in class ButtonBaseVP
public void setCommand(Command command)
setCommand
in class ButtonBaseVP
public Command getCommand()
getCommand
in class ButtonBaseVP
public void setCommandParameter(String commandParameter)
setCommandParameter
in class ButtonBaseVP
public String getCommandParameter()
getCommandParameter
in class ButtonBaseVP
public boolean hasMenu()
hasMenu
in class ButtonBaseVP
public void setMenu(CommandMenu menu)
setMenu
in class ButtonBaseVP
protected final CommandMenu createMenu(String[] menuItems)
public boolean prepareCommand(Gadget self, String parameter, int x, int y)
Command
If the command can be executed, this method returns
true
after having configured its internal state for
consumption by method Command.executeCommand(com.xmlmind.xmledit.gadget.Gadget, java.lang.String, int, int)
which should be invoked
immediately after this one.
Returns false
if this command cannot be executed with
specified parameter and in specified context.
prepareCommand
in interface Command
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 input