Custom Label Parser: call orders [message #468401] |
Wed, 05 August 2009 08:39  |
Eclipse User |
|
|
|
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
|
|
|
|
|
Re: Custom Label Parser: call orders [message #478739 is a reply to message #478608] |
Thu, 06 August 2009 11:38  |
Eclipse User |
|
|
|
> - 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.
Ok, this was my fault: The parser changed the original object in a not
allowed way such that it was accidently removed from the model. Sorry
for bothering.
Hauke
|
|
|
Powered by
FUDForum. Page generated in 0.05489 seconds