Search in sources :

Example 1 with ContainerCommit

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

the class CommitContainerCommandHandler method execute.

@Override
public Object execute(final ExecutionEvent event) {
    final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
    List<IDockerContainer> selectedContainers = CommandUtils.getSelectedContainers(activePart);
    final IDockerConnection connection = CommandUtils.getCurrentConnection(activePart);
    if (selectedContainers.size() != 1 || connection == null)
        return null;
    final IDockerContainer container = selectedContainers.get(0);
    final ContainerCommit wizard = new ContainerCommit(container.id());
    final boolean commitContainer = CommandUtils.openWizard(wizard, HandlerUtil.getActiveShell(event));
    if (commitContainer) {
        performCommitContainer(wizard, connection, container);
    }
    return null;
}
Also used : IDockerContainer(org.eclipse.linuxtools.docker.core.IDockerContainer) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) IDockerConnection(org.eclipse.linuxtools.docker.core.IDockerConnection) ContainerCommit(org.eclipse.linuxtools.internal.docker.ui.wizards.ContainerCommit)

Aggregations

IDockerConnection (org.eclipse.linuxtools.docker.core.IDockerConnection)1 IDockerContainer (org.eclipse.linuxtools.docker.core.IDockerContainer)1 ContainerCommit (org.eclipse.linuxtools.internal.docker.ui.wizards.ContainerCommit)1 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)1