use of org.palladiosimulator.editors.commons.dialogs.parameters.ParametersDialog in project Palladio-Editors-Sirius by PalladioSimulator.
the class InfrastructureSignaturesEditorSection 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'
InfrastructureSignatureDeleteCellValueListener cellValueListener = new InfrastructureSignatureDeleteCellValueListener(viewer);
viewer.addSelectionChangedListener(cellValueListener);
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.editors.commons.dialogs.parameters.ParametersDialog 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;
}
Aggregations