public class ButtonImage extends Image implements GenericListener
Image
EMPTY_ELEMENT_ARRAY
Constructor and Description |
---|
ButtonImage()
Creates a button image without source.
|
ButtonImage(ej.microui.display.Image source)
Creates a button image with the source to display.
|
ButtonImage(java.lang.String source)
Creates a button image with the path to the source to display.
|
Modifier and Type | Method and Description |
---|---|
void |
addOnClickListener(OnClickListener listener)
Adds a listener on the click events of the button.
|
boolean |
handleEvent(int event) |
boolean |
isInState(State state)
Gets whether or not the element is in the given state.
|
void |
performClick()
Performs the actions associated to a click.
|
void |
removeOnClickListener(OnClickListener listener)
Removes a listener on the click events of the button.
|
void |
update()
Something has changed.
|
getSource, renderContent, setSource, setSource, updateSource, updateSource, validateContent
addClassSelector, contains, gainFocus, getAttribute, getChild, getChildrenCount, getChildrenElements, getContentBounds, getParentElement, getStyle, hasClassSelector, isTransparent, lostFocus, mergeStyle, removeAllClassSelectors, removeClassSelector, removeInstanceStyle, render, setClassSelectors, setEnabled, updateStyle, updateStyleOnly, validate
getAbsoluteX, getAbsoluteX, getAbsoluteY, getAbsoluteY, getEventHandler, getHeight, getPanel, getParent, getPreferredHeight, getPreferredWidth, getRelativeX, getRelativeY, getWidgetAt, getWidth, getX, getY, hasFocus, hideNotify, invalidate, isEnabled, isShown, isValid, isVisible, repaint, repaint, requestFocus, requestFocus, revalidate, revalidateSubTree, setBounds, setEventHandler, setLocation, setPreferredSize, setSize, setVisible, showNotify
public ButtonImage()
public ButtonImage(java.lang.String source)
source
- the path to the source to display.java.lang.NullPointerException
- if the given source is null
.public ButtonImage(@Nullable ej.microui.display.Image source)
source
- the source to display.public void update()
GenericListener
update
in interface GenericListener
public void performClick()
public void addOnClickListener(OnClickListener listener)
listener
- the listener to add.java.lang.NullPointerException
- if the given listener is null
.public void removeOnClickListener(OnClickListener listener)
listener
- the listener to remove.public boolean isInState(State state)
Element
isInState
in interface Element
isInState
in class StyledWidget
state
- the state to check.true
if the element is in the given state, false
otherwise.public boolean handleEvent(int event)
handleEvent
in interface ej.mwt.Renderable
handleEvent
in class ej.mwt.Widget