ktmprabhu / spray

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

text fields are not editable #276

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Text fields currently aren’t editable directly in the editor. However, it is 
possible to edit the text in the properties view of eclipse.

Original issue reported on code.google.com by dicheri...@googlemail.com on 22 Jun 2013 at 2:58

GoogleCodeExporter commented 8 years ago
textfield in the compartment cannot be directly edited. 

Original comment by ferr...@gmail.com on 22 Jun 2013 at 5:19

GoogleCodeExporter commented 8 years ago

Original comment by fabio.filippelli on 8 Jul 2013 at 4:13

GoogleCodeExporter commented 8 years ago
There is no direct problem with DirectEdit... The problem is in the definition 
of the Shapes.
For example the ChenEntityShape was defined as follows:

shape ChenEntityShape {
    rectangle {
        size(width=150, height=80)
    }
    text {
        size(width=110,height=20)
        position(x=10,y=25)
        id=EntityText
    }
}

Therefore if you click on the text the DirectEditFeature thinks you clicked on 
the rectangle. Because the text is on the same layer, but logically after the 
rectangle on this position. 

The best solution is to make the text a nested part of the rectangle. Then if 
you click on the text the DirectEdit Feature works as defined. 

See:
shape ChenEntityShape {
    rectangle {
        size(width=150, height=80)
        text {
            size(width=110,height=20)
            position(x=10,y=25)
            id=EntityText
        }
    }
}

Another workaround could be to define the text before the Rectangle, but this 
solution is not a good one. 

Original comment by fabio.filippelli on 11 Jul 2013 at 10:00