< prev index next >
functional/ControlsTests/src/javafx/scene/control/test/utils/ptables/PropertyValueListener.java
Print this page
*** 26,42 ****
import java.lang.reflect.Method;
import javafx.beans.property.ReadOnlyProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
! import javafx.scene.control.LabelBuilder;
import javafx.scene.control.TextField;
- import javafx.scene.control.TextFieldBuilder;
import javafx.scene.control.Tooltip;
- import javafx.scene.control.TreeTableColumn;
- import javafx.scene.layout.HBox;
import static javafx.scene.control.test.utils.ptables.StaticLogger.*;
/**
* @author Alexander Kirov
*
* How to use it: Use contructor to give this class owningObject (this is
--- 26,40 ----
import java.lang.reflect.Method;
import javafx.beans.property.ReadOnlyProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
! import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.control.Tooltip;
import static javafx.scene.control.test.utils.ptables.StaticLogger.*;
+ import javafx.scene.layout.HBox;
/**
* @author Alexander Kirov
*
* How to use it: Use contructor to give this class owningObject (this is
*** 55,65 ****
public class PropertyValueListener<ValueType> extends HBox implements AbstractPropertyValueListener<ValueType> {
public final static String LISTENER_SUFFIX = "_LISTENER_ID";
private ReadOnlyProperty listenedProperty;
private Object owningObject;
! private TextField receivedValueTF = TextFieldBuilder.create().minWidth(50).maxWidth(110).build();
private boolean someStateWasRemembered = false;
private ValueType rememberedState = null;
private int rememberedChangeCountValue = -1;
private AbstractPropertyValueChangeCounter counter;
--- 53,63 ----
public class PropertyValueListener<ValueType> extends HBox implements AbstractPropertyValueListener<ValueType> {
public final static String LISTENER_SUFFIX = "_LISTENER_ID";
private ReadOnlyProperty listenedProperty;
private Object owningObject;
! private TextField receivedValueTF = new TextField();
private boolean someStateWasRemembered = false;
private ValueType rememberedState = null;
private int rememberedChangeCountValue = -1;
private AbstractPropertyValueChangeCounter counter;
*** 75,93 ****
this(labelDescription, listenedProperty, textFieldId, owningObject, true);
}
public <ValueType> PropertyValueListener(String labelDescription, ReadOnlyProperty listenedProperty, String textFieldId, Object owningObject, Boolean showCounters) {
this.owningObject = owningObject;
receivedValueTF.setId(textFieldId);
receivedValueTF.setTooltip(new Tooltip());
if (listenedProperty.getName().contains("BOUNDS")) {
//Make text field width, because bounds - big.
receivedValueTF.setMinWidth(500);
}
this.listenedProperty = listenedProperty;
counter = new PropertyValueCounter(listenedProperty);
! getChildren().add(LabelBuilder.create().text(labelDescription).prefWidth(100).build());
if (showCounters) {
getChildren().add(counter.getVisualRepresentation());
}
getChildren().add(receivedValueTF);
--- 73,95 ----
this(labelDescription, listenedProperty, textFieldId, owningObject, true);
}
public <ValueType> PropertyValueListener(String labelDescription, ReadOnlyProperty listenedProperty, String textFieldId, Object owningObject, Boolean showCounters) {
this.owningObject = owningObject;
+ receivedValueTF.setMinWidth(50);
+ receivedValueTF.setMaxWidth(110);
receivedValueTF.setId(textFieldId);
receivedValueTF.setTooltip(new Tooltip());
if (listenedProperty.getName().contains("BOUNDS")) {
//Make text field width, because bounds - big.
receivedValueTF.setMinWidth(500);
}
this.listenedProperty = listenedProperty;
counter = new PropertyValueCounter(listenedProperty);
! Label temp = new Label(labelDescription);
! temp.setPrefWidth(100);
! getChildren().add(temp);
if (showCounters) {
getChildren().add(counter.getVisualRepresentation());
}
getChildren().add(receivedValueTF);
< prev index next >