use of com.archimatetool.editor.model.commands.FeatureCommand in project archi by archimatetool.
the class DiagramConnectionSection method createDisplayNameControl.
private void createDisplayNameControl(Composite parent) {
// $NON-NLS-1$
createLabel(parent, Messages.DiagramConnectionSection_8 + ":", ITabbedLayoutConstants.STANDARD_LABEL_WIDTH, SWT.CENTER);
fButtonDisplayName = getWidgetFactory().createButton(parent, null, SWT.CHECK);
fButtonDisplayName.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
CompoundCommand result = new CompoundCommand();
for (EObject connection : getEObjects()) {
if (isAlive(connection)) {
Command cmd = new FeatureCommand(Messages.DiagramConnectionSection_8, (IFeatures) connection, IDiagramModelConnection.FEATURE_NAME_VISIBLE, fButtonDisplayName.getSelection(), IDiagramModelConnection.FEATURE_NAME_VISIBLE_DEFAULT);
if (cmd.canExecute()) {
result.add(cmd);
}
}
}
executeCommand(result.unwrap());
}
});
}
use of com.archimatetool.editor.model.commands.FeatureCommand in project archi by archimatetool.
the class GradientSection method createGradientControl.
private void createGradientControl(Composite parent) {
createLabel(parent, Messages.GradientSection_0, ITabbedLayoutConstants.STANDARD_LABEL_WIDTH, SWT.CENTER);
fGradientCombo = new Combo(parent, SWT.READ_ONLY);
getWidgetFactory().adapt(fGradientCombo, true, true);
fGradientCombo.setItems(GRADIENT_STYLES);
fGradientCombo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
CompoundCommand result = new CompoundCommand();
for (EObject object : getEObjects()) {
if (isAlive(object)) {
Command cmd = new FeatureCommand(Messages.GradientSection_1, (IFeatures) object, IDiagramModelObject.FEATURE_GRADIENT, fGradientCombo.getSelectionIndex() - 1, IDiagramModelObject.FEATURE_GRADIENT_DEFAULT);
if (cmd.canExecute()) {
result.add(cmd);
}
}
}
executeCommand(result.unwrap());
}
});
}
Aggregations