use of org.eclipse.linuxtools.internal.docker.ui.wizards.ContainerDataVolumeDialog in project linuxtools by eclipse.
the class RunImageVolumesTab method onAddDataVolume.
private SelectionListener onAddDataVolume(final CheckboxTableViewer dataVolumesTableViewer) {
return SelectionListener.widgetSelectedAdapter(e -> {
final ContainerDataVolumeDialog dialog = new ContainerDataVolumeDialog(getShell(), model.getConnection());
dialog.create();
if (dialog.open() == IDialogConstants.OK_ID) {
model.getDataVolumes().add(dialog.getDataVolume());
model.getSelectedDataVolumes().add(dialog.getDataVolume());
dialog.getDataVolume().setSelected(true);
dataVolumesTableViewer.setChecked(dialog.getDataVolume(), true);
updateLaunchConfigurationDialog();
}
});
}
use of org.eclipse.linuxtools.internal.docker.ui.wizards.ContainerDataVolumeDialog in project linuxtools by eclipse.
the class RunImageVolumesTab method onEditDataVolume.
private SelectionListener onEditDataVolume(final CheckboxTableViewer dataVolumesTableViewer) {
return SelectionListener.widgetSelectedAdapter(e -> {
final IStructuredSelection selection = (IStructuredSelection) dataVolumesTableViewer.getSelection();
if (selection.isEmpty()) {
return;
}
final DataVolumeModel selectedDataVolume = (DataVolumeModel) selection.getFirstElement();
final ContainerDataVolumeDialog dialog = new ContainerDataVolumeDialog(getShell(), model.getConnection(), selectedDataVolume);
dialog.create();
if (dialog.open() == IDialogConstants.OK_ID) {
final DataVolumeModel dialogDataVolume = dialog.getDataVolume();
selectedDataVolume.setContainerMount(dialogDataVolume.getContainerMount());
selectedDataVolume.setMountType(dialogDataVolume.getMountType());
selectedDataVolume.setHostPathMount(dialogDataVolume.getHostPathMount());
selectedDataVolume.setContainerMount(dialogDataVolume.getContainerMount());
selectedDataVolume.setReadOnly(dialogDataVolume.isReadOnly());
model.getSelectedDataVolumes().add(selectedDataVolume);
dataVolumesTableViewer.setChecked(selectedDataVolume, true);
updateLaunchConfigurationDialog();
}
});
}
Aggregations