Created
April 6, 2015 13:35
-
-
Save emorgado/d8a49ecb5d5bef07fdc4 to your computer and use it in GitHub Desktop.
ProcessamentoController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clItemBetonadaSobrepeso.setCellFactory(new Callback<TableColumn<ItemBetonada, Boolean>, TableCell<ItemBetonada, Boolean>>() { | |
public TableCell<ItemBetonada, Boolean> call(TableColumn<ItemBetonada, Boolean> param) { | |
return new TableCell<ItemBetonada, Boolean>() { | |
Label label; | |
{ | |
label = new Label(""); | |
label.getStyleClass().add("mixcontroller-icon"); | |
setGraphic(label); | |
} | |
@Override | |
public void updateItem(Boolean item, boolean empty) { | |
super.updateItem(item, empty); | |
TableRow<ItemBetonada> row = getTableRow(); | |
if (row != null) { | |
row.getStyleClass().removeAll("greenRow","redRow"); | |
} | |
ItemBetonada itemBetonada = row.getItem(); | |
if (itemBetonada != null && itemBetonada.getQuantidadeMedida() > 0) { | |
label.getStyleClass().removeAll("text-color-red", "text-color-green", "text-color-blue"); | |
if (itemBetonada.getSobrePeso() == true) { | |
label.setText("g"); | |
label.getStyleClass().add("text-color-red"); | |
row.getStyleClass().add("redRow"); | |
} else { | |
label.setText("i"); | |
label.getStyleClass().add("text-color-green"); | |
} | |
} | |
} | |
}; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment