use of org.eclipse.linuxtools.internal.docker.ui.wizards.ContainerPortDialog in project linuxtools by eclipse.
the class RunImagePortsTab method onAddPort.
private SelectionListener onAddPort(final CheckboxTableViewer exposedPortsTableViewer) {
return SelectionListener.widgetSelectedAdapter(e -> {
final ContainerPortDialog dialog = new ContainerPortDialog(getShell());
dialog.create();
if (dialog.open() == IDialogConstants.OK_ID) {
final ExposedPortModel port = dialog.getPort();
model.addAvailablePort(port);
model.getSelectedPorts().add(port);
port.setSelected(true);
exposedPortsTableViewer.setChecked(port, true);
updateLaunchConfigurationDialog();
}
});
}
use of org.eclipse.linuxtools.internal.docker.ui.wizards.ContainerPortDialog in project linuxtools by eclipse.
the class RunImagePortsTab 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());
}
updateLaunchConfigurationDialog();
});
}
Aggregations