Beispiel #1
0
Datei: bool.go Projekt: kego/ke
func NewBoolEditorView(ctx context.Context, node *node.Node, format editable.Format) *BoolEditorView {
	v := &BoolEditorView{}
	v.View = views.New(ctx, v)
	v.model = v.App.Editors.Get(node)
	v.node = v.App.Nodes.Get(node)
	v.format = format
	v.Watch(v.model.Node,
		stores.NodeFocus,
		stores.NodeValueChanged,
		stores.NodeErrorsChanged)
	return v
}
Beispiel #2
0
Datei: editor.go Projekt: kego/ke
func NewIconEditorView(ctx context.Context, node *node.Node, format editable.Format) *IconEditorView {
	v := &IconEditorView{}
	v.View = views.New(ctx, v)
	v.model = v.App.Editors.Get(node)
	v.icon = v.model.Node.Value.(*Icon)
	v.Watch(v.model.Node,
		stores.NodeValueChanged,
		stores.NodeDescendantChanged,
		stores.NodeFocus,
	)
	return v
}
Beispiel #3
0
Datei: object.go Projekt: kego/ke
func NewObjectEditorView(ctx context.Context, node *node.Node) *ObjectEditorView {
	v := &ObjectEditorView{}
	v.View = views.New(ctx, v)
	v.model = v.App.Editors.Get(node)
	v.node = v.App.Nodes.Get(node)
	v.branch = v.App.Branches.Get(node)
	v.object = node.Value.(system.ObjectInterface).GetObject(v.Ctx)
	v.Watch(v.model.Node,
		stores.NodeValueChanged,
		stores.NodeErrorsChanged,
		stores.InfoStateChange,
		stores.NodeSystemControls,
	)
	v.Watch(v.model.Node.Map["description"],
		stores.NodeValueChanged,
		stores.NodeDeleted,
		stores.NodeInitialised,
	)
	return v
}