76 lines
2.3 KiB
Java
76 lines
2.3 KiB
Java
package de.opcua.app.model;
|
|
|
|
import javafx.beans.property.*;
|
|
|
|
public class NodeRow {
|
|
|
|
private final BooleanProperty selected = new SimpleBooleanProperty(false);
|
|
private final StringProperty displayName = new SimpleStringProperty("");
|
|
private final StringProperty nodeType = new SimpleStringProperty("");
|
|
private final StringProperty nodeId = new SimpleStringProperty("");
|
|
private final StringProperty namespaceIndex = new SimpleStringProperty("");
|
|
private final StringProperty identifierType = new SimpleStringProperty("");
|
|
private final StringProperty value = new SimpleStringProperty("");
|
|
|
|
public NodeRow() {}
|
|
|
|
public NodeRow(
|
|
boolean selected,
|
|
String displayName,
|
|
String nodeType,
|
|
String nodeId,
|
|
String namespaceIndex,
|
|
String identifierType,
|
|
String value
|
|
) {
|
|
this.selected.set(selected);
|
|
this.displayName.set(displayName);
|
|
this.nodeType.set(nodeType);
|
|
this.nodeId.set(nodeId);
|
|
this.namespaceIndex.set(namespaceIndex);
|
|
this.identifierType.set(identifierType);
|
|
this.value.set(value);
|
|
}
|
|
|
|
// --- Properties ------------------------------------------------
|
|
|
|
public BooleanProperty selectedProperty() { return selected; }
|
|
public StringProperty displayNameProperty() { return displayName; }
|
|
public StringProperty nodeTypeProperty() { return nodeType; }
|
|
public StringProperty nodeIdProperty() { return nodeId; }
|
|
public StringProperty namespaceIndexProperty() { return namespaceIndex; }
|
|
public StringProperty identifierTypeProperty() { return identifierType; }
|
|
public StringProperty valueProperty() { return value; }
|
|
|
|
// --- Convenience ----------------------------------------------
|
|
|
|
public boolean isSelected() {
|
|
return selected.get();
|
|
}
|
|
|
|
public void setSelected(boolean v) {
|
|
selected.set(v);
|
|
}
|
|
|
|
public String getNodeId() {
|
|
return nodeId.get();
|
|
}
|
|
|
|
public String getDisplayName() {
|
|
return displayName.get();
|
|
}
|
|
|
|
public String getValue() {
|
|
return value.get();
|
|
}
|
|
|
|
public void setValue(String v) {
|
|
value.set(v);
|
|
}
|
|
|
|
/** 🔥 DAS IST DER FIX FÜR <err> */
|
|
public boolean isReadable() {
|
|
return "Variable".equalsIgnoreCase(nodeType.get());
|
|
}
|
|
}
|