N
- the native typeM
- the model typepublic abstract class WWidgetImpl<N,M extends org.eclipse.e4.ui.model.application.ui.MUIElement> extends java.lang.Object implements WWidget<M>
WWidget.WidgetState
Modifier and Type | Field and Description |
---|---|
protected @NonNull WWidget.WidgetState |
state
The current widget state
|
Constructor and Description |
---|
WWidgetImpl() |
Modifier and Type | Method and Description |
---|---|
void |
activate()
activate the control tree
|
protected void |
bindProperties(N widget)
Setup property bindings
|
protected void |
bindProperty(@NonNull java.lang.String propertyName,
@NonNull javafx.beans.value.ObservableValue<? extends java.lang.Object> value)
Bind a property and fire change events
|
protected abstract N |
createWidget() |
void |
deactivate()
deactivate the control tree
|
protected void |
doCleanup()
Cleanup code to run
|
protected void |
fireChange(@NonNull java.lang.String propertyName,
@Nullable java.lang.Object newValue)
Fire a change event
|
M |
getDomElement() |
N |
getWidget() |
WWidget.WidgetState |
getWidgetState() |
protected void |
init()
Initialize the widget (called by DI)
|
boolean |
isActive() |
void |
registerActivationCallback(WCallback<java.lang.Boolean,java.lang.Void> callback)
Register a callback to get informed when this widget gets activated
|
void |
setDomElement(M domElement)
Set the associated application model element
|
void |
setPropertyChangeHandler(WPropertyChangeHandler<? extends WWidget<M>> propertyChangeHandler)
Set a handler informed about a property change
|
protected abstract void |
setUserData(WWidgetImpl<N,M> widget)
Associate user data with the widget
|
void |
setWidgetState(WWidget.WidgetState state)
Updating the widget state
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addStyleClasses, addStyleClasses, removeStyleClasses, removeStyleClasses, setStyleId
protected @NonNull WWidget.WidgetState state
protected abstract N createWidget()
public void setWidgetState(WWidget.WidgetState state)
WWidget
setWidgetState
in interface WWidget<M extends org.eclipse.e4.ui.model.application.ui.MUIElement>
state
- the new statepublic WWidget.WidgetState getWidgetState()
getWidgetState
in interface WWidget<M extends org.eclipse.e4.ui.model.application.ui.MUIElement>
public void activate()
WWidget
public void deactivate()
WWidget
deactivate
in interface WWidget<M extends org.eclipse.e4.ui.model.application.ui.MUIElement>
public boolean isActive()
public void registerActivationCallback(WCallback<java.lang.Boolean,java.lang.Void> callback)
WWidget
registerActivationCallback
in interface WWidget<M extends org.eclipse.e4.ui.model.application.ui.MUIElement>
callback
- the callback@PostConstruct protected void init()
protected void doCleanup()
public final void setDomElement(M domElement)
WWidget
setDomElement
in interface WWidget<M extends org.eclipse.e4.ui.model.application.ui.MUIElement>
domElement
- the dom elementpublic M getDomElement()
getDomElement
in interface WWidget<M extends org.eclipse.e4.ui.model.application.ui.MUIElement>
public N getWidget()
protected void bindProperties(N widget)
widget
- the widgetprotected void bindProperty(@NonNull java.lang.String propertyName, @NonNull javafx.beans.value.ObservableValue<? extends java.lang.Object> value)
propertyName
- the property to bound tovalue
- the property to attach a listenerprotected abstract void setUserData(WWidgetImpl<N,M> widget)
widget
- the widgetpublic void setPropertyChangeHandler(WPropertyChangeHandler<? extends WWidget<M>> propertyChangeHandler)
WWidget
setPropertyChangeHandler
in interface WWidget<M extends org.eclipse.e4.ui.model.application.ui.MUIElement>
propertyChangeHandler
- the handlerprotected final void fireChange(@NonNull java.lang.String propertyName, @Nullable java.lang.Object newValue)
propertyName
- the property modifiednewValue
- the new value