use of com.thecoderscorner.menu.domain.RuntimeListMenuItem in project tcMenu by davetcc.
the class ListEditorComponent method createComponent.
public Node createComponent() {
if (item instanceof RuntimeListMenuItem) {
listView = new ListView<>();
ConditionalColoring condColor = getDrawingSettings().getColors();
var bgPaint = asFxColor(condColor.backgroundFor(RenderingStatus.NORMAL, ConditionalColoring.ColorComponentType.BUTTON));
listView.setBackground(new Background(new BackgroundFill(bgPaint, new CornerRadii(0), new Insets(0))));
listView.setItems(actualData);
if (!item.isReadOnly()) {
listView.setOnMouseClicked((MouseEvent evt) -> {
var selIdx = listView.getSelectionModel().getSelectedIndex();
if (selIdx >= 0 && selIdx < actualData.size()) {
var selMode = evt.getClickCount() == 2 ? INVOKE_ITEM : SELECT_ITEM;
componentControl.editorUpdatedItem(item, new ListResponse(selIdx, selMode));
}
});
}
return listView;
} else {
return new Label("item not a list");
}
}
use of com.thecoderscorner.menu.domain.RuntimeListMenuItem in project tcMenu by davetcc.
the class UIRuntimeListMenuItem method getChangedMenuItem.
@Override
protected Optional<RuntimeListMenuItem> getChangedMenuItem() {
RuntimeListMenuItemBuilder builder = RuntimeListMenuItemBuilder.aRuntimeListMenuItemBuilder().withExisting(getMenuItem());
List<FieldError> errors = new ArrayList<>();
getChangedDefaults(builder, errors);
RuntimeListMenuItem item = builder.menuItem();
functionNameTextField.setText(item.getFunctionName());
return getItemOrReportError(item, errors);
}
Aggregations