Search in sources :

Example 11 with ExposedPortModel

use of org.eclipse.linuxtools.internal.docker.ui.wizards.ImageRunSelectionModel.ExposedPortModel in project linuxtools by eclipse.

the class ImageRunSelectionPage method onEditPort.

private SelectionListener onEditPort(final CheckboxTableViewer exposedPortsTableViewer) {
    return SelectionListener.widgetSelectedAdapter(e -> {
        final IStructuredSelection selection = exposedPortsTableViewer.getStructuredSelection();
        final ExposedPortModel selectedContainerPort = (ExposedPortModel) selection.getFirstElement();
        final ContainerPortDialog dialog = new ContainerPortDialog(getShell(), selectedContainerPort);
        dialog.create();
        if (dialog.open() == IDialogConstants.OK_ID) {
            final ExposedPortModel configuredPort = dialog.getPort();
            selectedContainerPort.setContainerPort(configuredPort.getContainerPort());
            selectedContainerPort.setHostAddress(configuredPort.getHostAddress());
            selectedContainerPort.setHostPort(configuredPort.getHostPort());
            exposedPortsTableViewer.refresh();
        }
    });
}
Also used : ExposedPortModel(org.eclipse.linuxtools.internal.docker.ui.wizards.ImageRunSelectionModel.ExposedPortModel) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Aggregations

ExposedPortModel (org.eclipse.linuxtools.internal.docker.ui.wizards.ImageRunSelectionModel.ExposedPortModel)11 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)4 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 CoreException (org.eclipse.core.runtime.CoreException)2 IDockerImageInfo (org.eclipse.linuxtools.docker.core.IDockerImageInfo)2 Builder (org.eclipse.linuxtools.internal.docker.core.DockerContainerConfig.Builder)2 ContainerPortDialog (org.eclipse.linuxtools.internal.docker.ui.wizards.ContainerPortDialog)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 List (java.util.List)1 ProgressMonitorDialog (org.eclipse.jface.dialogs.ProgressMonitorDialog)1 IDockerHostConfig (org.eclipse.linuxtools.docker.core.IDockerHostConfig)1 IDockerImage (org.eclipse.linuxtools.docker.core.IDockerImage)1 IDockerPortBinding (org.eclipse.linuxtools.docker.core.IDockerPortBinding)1 DockerContainerConfig (org.eclipse.linuxtools.internal.docker.core.DockerContainerConfig)1 DockerHostConfig (org.eclipse.linuxtools.internal.docker.core.DockerHostConfig)1 DockerPortBinding (org.eclipse.linuxtools.internal.docker.core.DockerPortBinding)1 ImageRunSelectionModel (org.eclipse.linuxtools.internal.docker.ui.wizards.ImageRunSelectionModel)1 ContainerLinkModel (org.eclipse.linuxtools.internal.docker.ui.wizards.ImageRunSelectionModel.ContainerLinkModel)1