Search in sources :

Example 1 with ContainerLinkDialog

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

the class RunImageLinksTab method onAddLink.

private SelectionListener onAddLink() {
    return SelectionListener.widgetSelectedAdapter(e -> {
        final ContainerLinkDialog dialog = new ContainerLinkDialog(getShell(), model.getSelectedConnection());
        dialog.create();
        if (dialog.open() == IDialogConstants.OK_ID) {
            model.addLink(dialog.getContainerName(), dialog.getContainerAlias());
        }
        updateLaunchConfigurationDialog();
    });
}
Also used : ContainerLinkDialog(org.eclipse.linuxtools.internal.docker.ui.wizards.ContainerLinkDialog)

Example 2 with ContainerLinkDialog

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

the class RunImageLinksTab method onEditLink.

private SelectionListener onEditLink(final TableViewer linksTableViewer) {
    return SelectionListener.widgetSelectedAdapter(e -> {
        final IStructuredSelection selection = linksTableViewer.getStructuredSelection();
        final ContainerLinkModel selectedContainerLink = (ContainerLinkModel) selection.getFirstElement();
        final ContainerLinkDialog dialog = new ContainerLinkDialog(getShell(), model.getSelectedConnection(), selectedContainerLink);
        dialog.create();
        if (dialog.open() == IDialogConstants.OK_ID) {
            selectedContainerLink.setContainerName(dialog.getContainerName());
            selectedContainerLink.setContainerAlias(dialog.getContainerAlias());
            linksTableViewer.refresh();
            updateLaunchConfigurationDialog();
        }
    });
}
Also used : ContainerLinkModel(org.eclipse.linuxtools.internal.docker.ui.wizards.ImageRunSelectionModel.ContainerLinkModel) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ContainerLinkDialog(org.eclipse.linuxtools.internal.docker.ui.wizards.ContainerLinkDialog)

Aggregations

ContainerLinkDialog (org.eclipse.linuxtools.internal.docker.ui.wizards.ContainerLinkDialog)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 ContainerLinkModel (org.eclipse.linuxtools.internal.docker.ui.wizards.ImageRunSelectionModel.ContainerLinkModel)1