|
Re: Overriding Display Name for Sequence Flow [message #1407945 is a reply to message #1407907] |
Wed, 13 August 2014 21:37 |
|
Updating of Sequence Flow labels (and in fact, labels for all shapes and connections) is handled by the UpdateLabelFeature class. This is one of several Update Features that are invoked during Sequence Flow updating, and is constructed in SequenceFlowFeatureContainer. See the getUpdateFeature() method. You can override the text string like so:
@Override
public IUpdateFeature getUpdateFeature(IFeatureProvider fp) {
MultiUpdateFeature multiUpdate = new MultiUpdateFeature(fp);
multiUpdate.addFeature(new UpdateDefaultSequenceFlowFeature(fp));
multiUpdate.addFeature(new UpdateConditionalSequenceFlowFeature(fp));
multiUpdate.addFeature(new UpdateLabelFeature(fp) {
@Override
protected String getLabelString(BaseElement element) {
return "This is a Sequence Flow";
}
});
return multiUpdate;
}
BTW, just curious: are you writing an extension plugin for the editor, or just hacking the code directly for your own purposes? Reason I ask is because there is a way to do this "legally" in an extension plugin.
Cheers,
Bob
|
|
|
|
Powered by
FUDForum. Page generated in 0.02091 seconds