|
Re: How to change model in properties sheet without having an update command on the undo-stack? [message #778768 is a reply to message #778711] |
Fri, 13 January 2012 19:47 |
Nicolas Buezas Messages: 5 Registered: January 2012 |
Junior Member |
|
|
Hi,
I'm not expert, and it may not be what you want, but when I have to change model in properties sheet I do it with listeners, for example:
...
Text callFromText = factory.createText(composite, "");
callFromText.addModifyListener(getCallFromListener());
...
private ModifyListener getCallFromListener(){
return new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
String txtCallFromText = callFromText.getText();
if (txtCallFromText == null) {
txtCallFromText = "";
}
final String txtNewCallFromText = txtCallFromText;
IFeature feature = new AbstractFeature(getDiagramTypeProvider().getFeatureProvider()){
@Override
public void execute(IContext context) {
// transitions contains the bo asociate to pe selected
TransitionType transicionCall = (TransitionType) transition;
// I can change the model here
transicionCall.setFrom(txtNewCallFromText);
}
@Override
public boolean canExecute(IContext context) {
return true;
}
};
CustomContext context = new CustomContext();
execute(feature, context);
}
};
}
I hope it helps you.
Regards.
Nicolás.
[Updated on: Fri, 13 January 2012 21:41] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03290 seconds