use of com.archimatetool.editor.model.commands.EObjectFeatureCommand in project archi by archimatetool.
the class ImageChooserSection method doImagePathCommand.
protected void doImagePathCommand(String path) {
CompoundCommand result = new CompoundCommand();
for (EObject dmo : getEObjects()) {
if (isAlive(dmo)) {
Command cmd = new EObjectFeatureCommand(path == null ? Messages.DiagramModelImageSection_4 : Messages.DiagramModelImageSection_7, dmo, IArchimatePackage.Literals.DIAGRAM_MODEL_IMAGE_PROVIDER__IMAGE_PATH, path);
if (cmd.canExecute()) {
result.add(cmd);
}
}
}
executeCommand(result.unwrap());
}
use of com.archimatetool.editor.model.commands.EObjectFeatureCommand in project archi by archimatetool.
the class SketchModelBackgroundSection method createBackgroundControl.
private void createBackgroundControl(Composite parent) {
// Label
createLabel(parent, Messages.SketchModelBackgroundSection_0, ITabbedLayoutConstants.BIG_LABEL_WIDTH, SWT.CENTER);
// Combo
fComboBackground = new Combo(parent, SWT.READ_ONLY);
fComboBackground.setItems(ISketchEditor.BACKGROUNDS);
getWidgetFactory().adapt(fComboBackground, true, true);
fComboBackground.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
CompoundCommand result = new CompoundCommand();
for (EObject sketchModel : getEObjects()) {
if (isAlive(sketchModel)) {
Command cmd = new EObjectFeatureCommand(Messages.SketchModelBackgroundSection_1, sketchModel, IArchimatePackage.Literals.SKETCH_MODEL__BACKGROUND, fComboBackground.getSelectionIndex());
if (cmd.canExecute()) {
result.add(cmd);
}
}
}
executeCommand(result.unwrap());
}
});
GridData gd = new GridData(SWT.NONE, SWT.NONE, true, false);
gd.minimumWidth = ITabbedLayoutConstants.COMBO_WIDTH;
fComboBackground.setLayoutData(gd);
}
Aggregations