ktmprabhu / spray

Automatically exported from code.google.com/p/spray
0 stars 0 forks source link

Allow to pass constant values to referenced shape #233

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Currently it is only possible to pass values to a referenced shape in by 
referencing a feature of the domain model:

class ActionBlock alias Action {
    shape ActionBlockShape {
        actionName into action
    }
    behavior {
        create palette "Elements"
    }    
}

shape ActionBlockShape {
    stretching(horizontal=true,vertical=true)
    rectangle {
        position(x=0,y=0)
        size(width=100,height=100)
        text {
            position(x=5,y=5)
            size(width=90,height=90)
            id = action
        }
    }
}

So in the example actionName must be a feature of ActionBlock.

class ActionBlock alias Action {
    shape ActionBlockShape {
        actionName into action
    }

As workaround you can write:

class ActionBlock alias Action {
    shape ActionBlockShape {
        actionName into action ("Constant text")
    }

But you still need an existing feature of the domain model element.

What you actually want to write is:

class ActionBlock alias Action {
    shape ActionBlockShape {
        "Constant text" into action
    }

Or even more constant direct in shape:

shape ActionBlockShape {
    stretching(horizontal=true,vertical=true)
    rectangle {
        position(x=0,y=0)
        size(width=100,height=100)
        text {
            position(x=5,y=5)
            size(width=90,height=90)
            id = "Constant text"
        }
    }
}

(The last version is actually a separate issue).

Original issue reported on code.google.com by de.abg.r...@gmail.com on 25 Dec 2012 at 9:59

GoogleCodeExporter commented 8 years ago
before:

    shape UniqueRuleShape {
        name into uniqueRuleName ( "Rule: " + name )
        reference properties into properties
    }

Now it is additional possible to write 

    shape UniqueRuleShape {
        constant "Rule" + name into uniqueRuleName
        reference properties into properties
    }

And with the last syntax you can leave out the feature:

    shape UniqueRuleShape {
        constant "Rule" into uniqueRuleName
        reference properties into properties
    }

We should consider to deprecate the bracket syntax so we can leave out the 
keyword 'constant': 

    shape UniqueRuleShape {
        "Rule" + name into uniqueRuleName
        reference properties into properties
    }

Original comment by de.abg.r...@gmail.com on 27 Dec 2012 at 7:47

GoogleCodeExporter commented 8 years ago
The constant syntax does not work as described here: 
http://groups.google.com/group/spray-users/msg/3c2c7c962bbd5951

Reason is, that the EMF feature was used for generating the 
DirectEditingFeature. That does not work anymore when with 'constant "Rule" 
into uniqueRuleName' no feature is set. So as workaround constant name into 
uniqueRuleName ( "Rule" ) is currently only possible.

Original comment by de.abg.r...@gmail.com on 9 Jan 2013 at 8:29

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 3c9730f3a086.

Original comment by de.abg.r...@gmail.com on 17 May 2013 at 2:24

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 3c9730f3a086.

Original comment by karsten....@googlemail.com on 5 Jun 2013 at 8:23