Table of Contents

Class NodeDescriptor<T>

Namespace
NMF.Glsp.Language
Assembly
NMF.Glsp.dll

Denotes the basic type to describe the appearance of elements as nodes

public abstract class NodeDescriptor<T> : ElementDescriptor<T>

Type Parameters

T

The semantic element type

Inheritance
NodeDescriptor<T>
Derived
Inherited Members

Constructors

NodeDescriptor()

Creates a new instance

protected NodeDescriptor()

Properties

IsDeletable

Denotes whether this node can be deleted

protected virtual bool IsDeletable { get; }

Property Value

bool

IsResizable

Denotes whether this node can be resized

protected virtual bool IsResizable { get; }

Property Value

bool

Methods

CalculateTypeHints()

Calculates type hints for this rule

protected override IEnumerable<TypeHint> CalculateTypeHints()

Returns

IEnumerable<TypeHint>

A collection of type hints

Compartment(string, LayoutStrategy, Expression<Func<T, bool>>)

Creates a new compartment for the nodes represented by this semantic element

protected IDisposable Compartment(string type = "comp", LayoutStrategy layoutStrategy = null, Expression<Func<T, bool>> guard = null)

Parameters

type string

The GElement type for the compartment

layoutStrategy LayoutStrategy

The layout strategy for the compartment or Vbox, if nothing is specified

guard Expression<Func<T, bool>>

A predicate expression to control the creation of this compartment

Returns

IDisposable

A disposable that can be disposed to return to the parent element

Remarks

This method is intended to be used to create a using block inside of DefineLayout()

Edges<TTransition>(EdgeDescriptor<TTransition>, Func<T, ICollectionExpression<TTransition>>)

Specifies that the nodes should contain edges

protected IChildSyntax Edges<TTransition>(EdgeDescriptor<TTransition> edgeDescriptor, Func<T, ICollectionExpression<TTransition>> selector)

Parameters

edgeDescriptor EdgeDescriptor<TTransition>

A descriptor for the edges

selector Func<T, ICollectionExpression<TTransition>>

A function to calculate a collection of edges to create

Returns

IChildSyntax

Type Parameters

TTransition

The semantic type of edges

Remarks

This method is intended to be used inside of DefineLayout()

Edges<TSource, TTarget>(EdgeDescriptor<TSource, TTarget>, Func<T, ICollectionExpression<(TSource, TTarget)>>)

Specifies that the nodes should contain edges

protected IChildSyntax Edges<TSource, TTarget>(EdgeDescriptor<TSource, TTarget> edgeDescriptor, Func<T, ICollectionExpression<(TSource, TTarget)>> selector)

Parameters

edgeDescriptor EdgeDescriptor<TSource, TTarget>

A descriptor of edges from sources to the target

selector Func<T, ICollectionExpression<(TSource, TTarget)>>

A function to calculate pairs of source and target node

Returns

IChildSyntax

Type Parameters

TSource

The semantic type of source nodes

TTarget

The semantic type of target nodes

Remarks

This method is intended to be used inside of DefineLayout()

Edges<TSource, TTarget>(NodeDescriptor<TSource>, NodeDescriptor<TTarget>, Func<T, ICollectionExpression<(TSource, TTarget)>>)

Specifies that the nodes should contain edges

protected IAdhocEdgeSyntax Edges<TSource, TTarget>(NodeDescriptor<TSource> sourceDescriptor, NodeDescriptor<TTarget> targetDescriptor, Func<T, ICollectionExpression<(TSource, TTarget)>> selector)

Parameters

sourceDescriptor NodeDescriptor<TSource>

The descriptor for the source nodes

targetDescriptor NodeDescriptor<TTarget>

The descriptor for the target nodes

selector Func<T, ICollectionExpression<(TSource, TTarget)>>

A function to calculate pairs of source and target node

Returns

IAdhocEdgeSyntax

Type Parameters

TSource

The semantic type of source nodes

TTarget

The semantic type of target nodes

Remarks

This method is intended to be used inside of DefineLayout()

Embed(NodeDescriptor<T>, Expression<Func<T, bool>>)

Embeds another rule into the current node descriptor

protected void Embed(NodeDescriptor<T> innerDescriptor, Expression<Func<T, bool>> guard = null)

Parameters

innerDescriptor NodeDescriptor<T>

The inner description

guard Expression<Func<T, bool>>

A predicate expression to control the creation of this compartment

Remarks

This method is intended to be used to create a using block inside of DefineLayout()

Label(Expression<Func<T, string>>, string, bool, Expression<Func<T, bool>>)

Specifies that a GLabel element should be created under the current node

protected INodeLabelSyntax<T> Label(Expression<Func<T, string>> labelSelector, string type = "label", bool canEdit = true, Expression<Func<T, bool>> guard = null)

Parameters

labelSelector Expression<Func<T, string>>

An expression calculating the text of the label

type string

The GElement type of the label

canEdit bool

True, if the label can be added, otherwise False

guard Expression<Func<T, bool>>

An expression to guard the visibility of the label, or null

Returns

INodeLabelSyntax<T>

Remarks

This method is intended to be used inside of DefineLayout()

Label(string, string, Expression<Func<T, bool>>)

Specifies that a GLabel element should be created under the current node with a static text

protected void Label(string text, string type = "label:static", Expression<Func<T, bool>> guard = null)

Parameters

text string

The text to display

type string

The GElement type of the label

guard Expression<Func<T, bool>>

An expression to guard the visibility of the label, or null

Remarks

This method is intended to be used inside of DefineLayout()

Labels<TOther>(LabelDescriptor<TOther>, Func<T, ICollectionExpression<TOther>>, bool)

Specifies that labels should be created as subnodes of the given descriptor

protected IChildSyntax Labels<TOther>(LabelDescriptor<TOther> targetDescriptor, Func<T, ICollectionExpression<TOther>> selector, bool includeInSelection = true)

Parameters

targetDescriptor LabelDescriptor<TOther>

The node descriptor describing the sub-elements

selector Func<T, ICollectionExpression<TOther>>

A function to obtain a collection of semantic elements

includeInSelection bool

True, if the label elements should also be included in the selection, otherwise false

Returns

IChildSyntax

Type Parameters

TOther

The semantic type of the dependent elements

Remarks

This method is intended to be used inside of DefineLayout()

Layout(LayoutStrategy)

Sets the layout of this node

protected void Layout(LayoutStrategy layout)

Parameters

layout LayoutStrategy

Remarks

This method is intended to be used to create a using block inside of DefineLayout()

LayoutOptions(LayoutOptions)

Sets the layout options for this node

protected void LayoutOptions(LayoutOptions layoutOptions)

Parameters

layoutOptions LayoutOptions

layout options

Nodes<TOther>(NodeDescriptor<TOther>, Func<T, ICollectionExpression<TOther>>)

Specifies that nodes should be created as subnodes of the given descriptor

protected IChildSyntax Nodes<TOther>(NodeDescriptor<TOther> targetDescriptor, Func<T, ICollectionExpression<TOther>> selector)

Parameters

targetDescriptor NodeDescriptor<TOther>

The node descriptor describing the sub-elements

selector Func<T, ICollectionExpression<TOther>>

A function to obtain a collection of semantic elements

Returns

IChildSyntax

Type Parameters

TOther

The semantic type of the dependent elements

Remarks

This method is intended to be used inside of DefineLayout()

RoundCorners(RoundedCornerOptions)

Sets options for rounded corners

protected void RoundCorners(RoundedCornerOptions roundedCornerOptions)

Parameters

roundedCornerOptions RoundedCornerOptions

Options for rounded corners

Size(double, double)

Sets the initial size of the node

protected void Size(double width, double height)

Parameters

width double

The width of the node in pixel

height double

The height of the node in pixel

Remarks

This method is intended to be used to create a using block inside of DefineLayout()