use of com.archimatetool.editor.diagram.commands.ConnectionRouterTypeCommand in project archi by archimatetool.
the class DiagramModelConnectionSection method createRouterTypeControl.
private void createRouterTypeControl(Composite parent) {
// Label
createLabel(parent, Messages.DiagramModelConnectionSection_0, ITabbedLayoutConstants.BIG_LABEL_WIDTH, SWT.CENTER);
// Combo
fComboRouterType = new Combo(parent, SWT.READ_ONLY);
fComboRouterType.setItems(comboItems);
fComboRouterType.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
CompoundCommand result = new CompoundCommand();
for (EObject dm : getEObjects()) {
if (isAlive(dm)) {
Command cmd = new ConnectionRouterTypeCommand((IDiagramModel) dm, ConnectionRouterAction.CONNECTION_ROUTER_TYPES.get(fComboRouterType.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;
fComboRouterType.setLayoutData(gd);
}
use of com.archimatetool.editor.diagram.commands.ConnectionRouterTypeCommand in project archi by archimatetool.
the class ConnectionRouterAction method run.
@Override
public void run() {
if (isChecked()) {
CommandStack stack = part.getAdapter(CommandStack.class);
stack.execute(new ConnectionRouterTypeCommand(diagramModel, getType()));
}
}
Aggregations