T
- type of the observable propertypublic abstract class JFXPropertyChangeHandler<T> extends Object implements com.vektorsoft.demux.core.mva.DMXEventRegistrationHandler<javafx.beans.value.ChangeListener<T>>, javafx.beans.value.ChangeListener<T>
Base class for registering property change listeners for Java FX GUI components. Subclasses must specify which property type they want to listen to and what is the method for getting property values.
Simple implementation of this class could look like the following:
class MyClass extends JFXPropertyChangeListener < BooleanProperty > {
public MyClass(DMXAdapter adapter){
super(adapter, "selectedProperty");
addComponentId("someId");
}
}
In this sample, listener will handle BooleanProperty
, and the method for getting the value of this
property is selectedProperty
, as specified in constructor. This method is invoked using reflection.
Modifier and Type | Field and Description |
---|---|
protected com.vektorsoft.demux.core.mva.DMXAdapter |
adapter
Adapter instance.
|
protected String |
property
Name of the method for getting property value.
|
Modifier | Constructor and Description |
---|---|
protected |
JFXPropertyChangeHandler(com.vektorsoft.demux.core.mva.DMXAdapter adapter,
String property)
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addComponentId(String id)
Add component ID to the list.
|
String[] |
getComponentIds() |
javafx.beans.value.ChangeListener<T> |
getEventHandler() |
String |
getProperty()
Returns the name of the property getter method.
|
void |
setComponentIds(String... ids)
Set component IDs to the list.
|
protected com.vektorsoft.demux.core.mva.DMXAdapter adapter
protected String property
protected JFXPropertyChangeHandler(com.vektorsoft.demux.core.mva.DMXAdapter adapter, String property)
adapter
- adapter instanceproperty
- name of the method for getting property valuepublic void addComponentId(String id)
id
- component IDpublic void setComponentIds(String... ids)
ids
- component IDspublic String[] getComponentIds()
getComponentIds
in interface com.vektorsoft.demux.core.mva.DMXEventRegistrationHandler<javafx.beans.value.ChangeListener<T>>
public javafx.beans.value.ChangeListener<T> getEventHandler()
getEventHandler
in interface com.vektorsoft.demux.core.mva.DMXEventRegistrationHandler<javafx.beans.value.ChangeListener<T>>
public String getProperty()
Copyright © 2012-2014 Vektor Software. All Rights Reserved.