de.rpgframework.jfx.cells.RecommendingDataItemTableCell Maven / Gradle / Ivy
package de.rpgframework.jfx.cells;
import de.rpgframework.genericrpg.chargen.RecommendationState;
import de.rpgframework.genericrpg.data.DataItem;
import javafx.scene.control.Label;
import javafx.scene.control.TableCell;
/**
* @author prelle
*
*/
public class RecommendingDataItemTableCell extends TableCell {
//-------------------------------------------------------------------
/**
* @see javafx.scene.control.Cell#updateItem(java.lang.Object, boolean)
*/
@Override
public void updateItem(RecommendationState item, boolean empty) {
super.updateItem(item, empty);
if (empty) {
setGraphic(null);
setText(null);
} else {
if (item==null || item==RecommendationState.NEUTRAL) {
setGraphic(null);
} else if (item==RecommendationState.RECOMMENDED) {
setGraphic(new Label("*"));
} else if (item==RecommendationState.UNRECOMMENDED) {
setGraphic(new Label("!"));
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy