package de.prob2.ui.preferences;

import javafx.beans.property.*;

public class PrefTreeItem {
	private final StringProperty name;
	private final StringProperty changed;
	private final StringProperty value;
	private final ObjectProperty<ProBPreferenceType> valueType;
	private final StringProperty defaultValue;
	private final StringProperty description;
	
	protected PrefTreeItem(
		final String name,
		final String changed,
		final String value,
		final ProBPreferenceType valueType,
		final String defaultValue,
		final String description
	) {
		super();
		this.name = new SimpleStringProperty(this, "name", name);
		this.changed = new SimpleStringProperty(this, "changed", changed);
		this.value = new SimpleStringProperty(this, "value", value);
		this.valueType = new SimpleObjectProperty<>(this, "valueType", valueType);
		this.defaultValue = new SimpleStringProperty(this, "defaultValue", defaultValue);
		this.description = new SimpleStringProperty(this, "description", description);
	}
	
	public ReadOnlyStringProperty nameProperty() {
		return this.name;
	}
	
	public String getName() {
		return this.name.get();
	}
	
	public ReadOnlyStringProperty changedProperty() {
		return this.changed;
	}
	
	public String getChanged() {
		return this.changed.get();
	}
	
	public ReadOnlyStringProperty valueProperty() {
		return this.value;
	}
	
	public String getValue() {
		return this.value.get();
	}
	
	public ReadOnlyObjectProperty<ProBPreferenceType> valueTypeProperty() {
		return this.valueType;
	}
	
	public ProBPreferenceType getValueType() {
		return this.valueType.get();
	}

	public ReadOnlyStringProperty defaultValueProperty() {
		return this.defaultValue;
	}
	
	public String getDefaultValue() {
		return this.defaultValue.get();
	}

	public ReadOnlyStringProperty descriptionProperty() {
		return this.description;
	}
	
	public String getDescription() {
		return this.description.get();
	}
}

@@ -38,31 +38,341 @@
 ort 
-javafx.beans.property.*
+com.google.common.base.MoreObjects;%0A%0Aimport javafx.beans.property.ObjectProperty;%0Aimport javafx.beans.property.ReadOnlyObjectProperty;%0Aimport javafx.beans.property.ReadOnlyStringProperty;%0Aimport javafx.beans.property.SimpleObjectProperty;%0Aimport javafx.beans.property.SimpleStringProperty;%0Aimport javafx.beans.property.StringProperty
 ;%0A%0Ap
@@ -2211,10 +2211,352 @@
 t();%0A%09%7D%0A
+%09%0A%09@Override%0A%09public String toString() %7B%0A%09%09return MoreObjects.toStringHelper(this)%0A%09%09%09.add(%22name%22, this.getName())%0A%09%09%09.add(%22changed%22, this.getChanged())%0A%09%09%09.add(%22value%22, this.getValue())%0A%09%09%09.add(%22valueType%22, this.getValueType())%0A%09%09%09.add(%22defaultValue%22, this.getDefaultValue())%0A%09%09%09.add(%22description%22, this.getDescription())%0A%09%09%09.toString();%0A%09%7D%0A
 %7D%0A

Add custom PrefTreeItem.toString for debugging