use of com.thecoderscorner.menu.editorui.project.MenuIdChooserImpl in project tcMenu by davetcc.
the class RomLayoutController method init.
public void init(MenuTree menuTree) {
menuIdChooser = new MenuIdChooserImpl(menuTree);
menuIdChooser.getItemsSortedById().forEach((item) -> {
Label lbl = new Label(item.getId() + " - " + item.getName());
lbl.getStyleClass().add("idRomEntry");
idContainer.getChildren().add(lbl);
});
List<MenuItem> sortedByEeprom = menuIdChooser.getItemsSortedByEeprom();
sortedByEeprom.stream().filter((it) -> it.getEepromAddress() != -1).forEach((item) -> {
int address = item.getEepromAddress();
int addrSize = MenuItemHelper.eepromSizeForItem(item);
int addrEnd = address + addrSize - 1;
Label l = new Label(address + "-" + addrEnd + ": " + item.getName());
Optional<String> maybeOverlap = overlapDetails(item, sortedByEeprom);
if (maybeOverlap.isPresent()) {
l.getStyleClass().add("brokenEeprom");
l.setTooltip(new Tooltip(maybeOverlap.get()));
} else {
l.getStyleClass().add("eepromEntry");
}
l.setPrefWidth(eepromContainer.getPrefWidth());
eepromContainer.getChildren().add(l);
});
}
Aggregations