public class CommandMenu extends CommandButton
Constructor and Description |
---|
CommandMenu() |
Modifier and Type | Method and Description |
---|---|
protected ButtonBaseVP |
createButton(Style style,
StyledElementView view,
StyledElementViewPart.Role role) |
Gadget |
createGadget(StyledElementView view,
StyledElementViewPart.Role role,
Style style,
StyleValue[] parameters,
StyledViewFactory viewFactory)
Creates a Gadget which is to be used the CSS content generated for
specified element.
|
getCommand
public Gadget createGadget(StyledElementView view, StyledElementViewPart.Role role, Style style, StyleValue[] parameters, StyledViewFactory viewFactory)
GadgetFactory
StyledElementViewPart
.createGadget
in interface GadgetFactory
createGadget
in class CommandButton
view
- the returned gadget will be a part of this viewrole
- the role of the Gadget: content generated before the view
of the element, after the view of the element, replacing the normal
view of the element, etcstyle
- style of the custom view. For example: style.font,
style.color, etc, may be used to set the font, foreground, etc, of the
created Gadgetparameters
- arguments passed to the component pseudo-functions.
Example:
div[class=c1] > *:first-child:before { content: gadget("com.xmlmind.xmledit.cssext.Collapser", collapsed-icon, icon(pop-right), expanded-icon, icon(pop-down)) " "; color: olive; }
For the above example, parameters contains 4 StyleValues: first one with .type=IDENTIFIER and .string="collapsed-icon", second one with .type=FUNCTION, .string="icon", etc.
viewFactory
- StyledViewFactory which will create the custom viewnull
if, for any reason,
the gadget cannot be createdprotected ButtonBaseVP createButton(Style style, StyledElementView view, StyledElementViewPart.Role role)
createButton
in class CommandButton