@Override void submitItem(Property item) { if (!App.employee.hasPermission(Permission.CLIENT_SETTINGS)) { App.notify.showAndWait(Permission.CLIENT_SETTINGS); } else { App.confirm.showAndWait( "Are you sure you want to make these changes?", () -> { App.properties.add(item.getKey(), item.getValue()); App.properties.save(new File(System.getProperty("user.dir") + "/app.properties")); }); } }
@Override void bindItem(Property newItem) { tfKey.textProperty().bindBidirectional(newItem.keyProperty()); if (newItem.getValue().matches("#[0-9a-fA-F]{6}")) { cpColor.setVisible(true); tfValue.setVisible(false); cpColor.setValue(Color.web(newItem.getValue())); newItem.valueProperty().bindBidirectional(cpColor.valueProperty(), colorConverter); } else { cpColor.setVisible(false); tfValue.setVisible(true); tfValue.textProperty().bindBidirectional(newItem.valueProperty()); } }
@Override void unbindItem(Property currentItem) { tfKey.textProperty().unbindBidirectional(currentItem.keyProperty()); tfValue.textProperty().unbindBidirectional(currentItem.valueProperty()); currentItem.valueProperty().unbindBidirectional(cpColor.valueProperty()); }