Custom Label Parser: call orders [message #468401] |
Wed, 05 August 2009 12:39 |
Hauke Fuhrmann Messages: 333 Registered: July 2009 |
Senior Member |
|
|
Dear GMF folks,
I try to implement a custom label parser, implementing an IParser,
respectively an ISemanticParser.
I don't quite understand, for what purpose the methods there are
intended as they behave different from what I expect.
I'm a bit confused about a few things:
- getPrintString is only called *before* getParseCommand and before the
command is executed. Hence the visible String after editing and parsing
the String is not updated afterwards to display the current value.
- isValidEditString is called every character the user enters. However,
my parser is quite heavy and I don't want to check every single
character again, but only at the end, when the user hits enter.
- getParseCommand is only called when the feature is edited via the
diagram label. It is not called when I edit it via the properties view.
I tried to implement ISemanticParser instead, whose Javadoc indicated
something about getting notified when the semantic element has changed.
But I did not yet figure it out.
My view about the methods is:
getEditString
returns the String displayed in the edit field
getPrintString
returns the String displayed when not editing
getParseCommand
gives the command that performs the actual parsing and update of the
semantic model
isAffectingEvent
checks if the parser is applicable for the feature
isValidEditString
checks if the entered String is valid or not
Could anyone clarifiy these issues for me?
Cheers,
Hauke
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06412 seconds