Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Sprotty » Sprotty from Graphical Change to Text (xtext theia sprotty dsl)
Sprotty from Graphical Change to Text [message #1832337] Wed, 16 September 2020 14:46 Go to next message
Cagdas Yetim is currently offline Cagdas YetimFriend
Messages: 1
Registered: September 2020
Junior Member
I created a simple dsl, and connected it with theia and Sprotty Server.(sprotty in Theia) What I did not understand is, trace of Attribute.

Change from text to graphic works good, but if I change text of a label (which is a STRING in DSL) it doesn't affect to text.

sprotty version is 0.8.0

dsl -->
	'point' name=ID
		('description:' description=STRING)?
		'abbreviation:' abbreviation=STRING

theia -->
export class RuleLabel extends SLabel implements EditableLabel {
    hasFeature(feature: symbol): boolean {
        return feature === editLabelFeature || super.hasFeature(feature);

export class RuleLabelView implements SLabelView {
    render(label: Readonly<RuleLabel>, context: RenderingContext): VNode {
        const vnode = 
            <text class-sprotty-label={true}>
        const subType = getSubType(label);
        if (subType)
            setAttr(vnode, 'class', subType);
        return vnode;

register in theia
configureModelElement(context, 'label:rule', RuleLabel, RuleLabelView);

Sprotty graphic generator -->
def SModelElement createPoint(Point point, extension Context context){
		val theId = idCache.uniqueId('point_' +
		(new SNode[
			id = theId
			children = #[
				(new SLabel[
					id= theId + '.description'
					type = 'label:rule'
					text = point.description
					layoutOptions = new LayoutOptions [
						VGap = 1.0
				]).trace(point, RulePackage.Literals.POINT__DESCRIPTION, -1)
			layout = 'vbox'
			layoutOptions = new LayoutOptions [
				paddingTop = 10.0
				paddingBottom = 10.0
				paddingLeft = 10.0
				paddingRight = 10.0

Can somebody help to me please ? what am I doing wrong ?

[Updated on: Thu, 17 September 2020 13:30]

Report message to a moderator

Re: Sprotty from Graphical Change to Text [message #1832543 is a reply to message #1832337] Mon, 21 September 2020 06:17 Go to previous message
Miro Spönemann is currently offline Miro SpönemannFriend
Messages: 76
Registered: March 2015
Location: Kiel, Germany

That's hard to say, you should investigate with a debugger. The build listener added by DiagramUpdater should be triggered by the text change:

You should check what happens there after you edit a label.
Previous Topic:Integrating Sprotty-server into existing Spring application?
Next Topic:Sprotty Server: Tracing Attributes only knowing their name
Goto Forum:

Current Time: Sun Oct 01 03:38:36 GMT 2023

Powered by FUDForum. Page generated in 0.02189 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top