Search in sources :

Example 1 with ContainerDataVolumeDialog

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();
        }
    });
}
Also used : ContainerDataVolumeDialog(org.eclipse.linuxtools.internal.docker.ui.wizards.ContainerDataVolumeDialog)

Example 2 with ContainerDataVolumeDialog

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();
        }
    });
}
Also used : ContainerDataVolumeDialog(org.eclipse.linuxtools.internal.docker.ui.wizards.ContainerDataVolumeDialog) DataVolumeModel(org.eclipse.linuxtools.internal.docker.ui.wizards.DataVolumeModel) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Aggregations

ContainerDataVolumeDialog (org.eclipse.linuxtools.internal.docker.ui.wizards.ContainerDataVolumeDialog)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 DataVolumeModel (org.eclipse.linuxtools.internal.docker.ui.wizards.DataVolumeModel)1