public static VisualElement BuildStringWrapperEditor(this IConstantEditorBuilder builder, IStringWrapperConstantModel icm) { var enumEditor = new Button { text = icm.ObjectValue.ToString() }; // TODO use a bindable element enumEditor.clickable.clickedWithEventInfo += e => { List <string> allInputNames = icm.GetAllInputNames(); SearcherService.ShowValues("Pick a value", allInputNames, e.originalMousePosition, (v, pickedIndex) => { var oldValue = new InputName { name = icm.StringValue }; var newValue = oldValue; newValue.name = v; enumEditor.text = v; builder.TriggerOnValueChanged(oldValue, newValue); }); }; enumEditor.SetEnabled(!icm.IsLocked); return(enumEditor); }
public static IGraphElement CreateToken(this ElementBuilder elementBuilder, IStore store, IStringWrapperConstantModel model) { return(CreateConstantToken(elementBuilder, store, model)); }
public static GraphElement CreateToken(this INodeBuilder builder, Store store, IStringWrapperConstantModel model) { return(CreateConstantToken(builder, store, model)); }