From 5f80c0bf143c429940962129e2c8148a4ce5d9e0 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Tue, 8 Aug 2017 10:50:30 -0700 Subject: [PATCH] Add a documentation class. --- .../nwapw/abacus/fx/DocumentationCell.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/main/java/org/nwapw/abacus/fx/DocumentationCell.java diff --git a/src/main/java/org/nwapw/abacus/fx/DocumentationCell.java b/src/main/java/org/nwapw/abacus/fx/DocumentationCell.java new file mode 100644 index 0000000..73bdbd7 --- /dev/null +++ b/src/main/java/org/nwapw/abacus/fx/DocumentationCell.java @@ -0,0 +1,36 @@ +package org.nwapw.abacus.fx; + +import javafx.scene.control.Label; +import javafx.scene.control.ListCell; +import org.nwapw.abacus.function.Documentation; + +public class DocumentationCell extends ListCell { + + private Label codeNameLabel; + private Label nameLabel; + private Label description; + private Label longDescription; + + public DocumentationCell(){ + codeNameLabel = new Label(); + nameLabel = new Label(); + description = new Label(); + longDescription = new Label(); + } + + @Override + protected void updateItem(Documentation item, boolean empty) { + super.updateItem(item, empty); + if(empty){ + codeNameLabel.setText(""); + nameLabel.setText(""); + description.setText(""); + longDescription.setText(""); + } else { + codeNameLabel.setText(item.getCodeName()); + nameLabel.setText(item.getName()); + description.setText(item.getDescription()); + longDescription.setText(item.getLongDescription()); + } + } +}