use of org.palladiosimulator.pcm.repository.DataType in project Palladio-Editors-Sirius by PalladioSimulator.
the class OperationsEditorSection method createViewerCellEditors.
/* (non-Javadoc)
* @see org.palladiosimulator.editors.commons.tabs.generic.EditorSection#createViewerCellEditors(org.eclipse.swt.widgets.Table)
*/
@Override
protected CellEditor[] createViewerCellEditors(Table table) {
CellEditor[] editors = new CellEditor[columnNames.length];
editors[SIGNATURENAME_COLUMN_INDEX] = new TextCellEditor(table);
// create 'DeleteCellValueListener' and as SelectionListener to the 'TableVewer'
OperationDeleteCellValueListener cellValueListener = new OperationDeleteCellValueListener(viewer);
viewer.addSelectionChangedListener(cellValueListener);
editors[RETURNTYPE_COLUMN_INDEX] = new TypeDialogCellEditor(table, cellValueListener) {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.DialogCellEditor#openDialogBox(org.eclipse.swt.widgets.Control)
*/
@Override
protected Object openDialogBox(Control cellEditorWindow) {
TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(getSelectedSignature());
ArrayList<Object> filterList = new ArrayList<Object>();
filterList.add(DataType.class);
filterList.add(Repository.class);
ArrayList<EReference> additionalReferences = new ArrayList<EReference>();
CallDataTypeDialog dialog = new CallDataTypeDialog(cellEditorWindow.getShell(), filterList, additionalReferences, editingDomain.getResourceSet());
dialog.setProvidedService(DataType.class);
dialog.open();
if (!(dialog.getResult() instanceof DataType))
return null;
return dialog.getResult();
}
};
editors[PARAMETER_COLUMN_INDEX] = new DialogCellEditor(table) {
@Override
protected Object openDialogBox(Control cellEditorWindow) {
ParametersDialog dialog = new ParametersDialog(cellEditorWindow.getShell(), getSelectedSignature());
if (dialog.open() == Dialog.OK)
viewer.refresh();
return null;
}
};
return editors;
}
use of org.palladiosimulator.pcm.repository.DataType in project Palladio-Editors-Sirius by PalladioSimulator.
the class Services method printParameters.
public String printParameters(Signature sig) {
String result = "";
EList<Parameter> parameters = null;
if (sig instanceof OperationSignature)
parameters = ((OperationSignature) sig).getParameters__OperationSignature();
else if (sig instanceof InfrastructureSignature) {
parameters = ((InfrastructureSignature) sig).getParameters__InfrastructureSignature();
}
if (// invalid list
parameters == null)
return "";
for (Parameter p : parameters) {
DataType parameterType = p.getDataType__Parameter();
String type = getDataTypeName(parameterType);
result += type + " " + p.getParameterName() + ", ";
}
if (result.endsWith(", "))
result = result.substring(0, result.length() - 2);
return result;
}
Aggregations