Search in sources :

Example 1 with ImagePull

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

the class PullImageCommandHandler method execute.

@Override
public Object execute(final ExecutionEvent event) {
    final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
    final IDockerConnection connection = CommandUtils.getCurrentConnection(activePart);
    if (connection == null) {
        MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), CommandMessages.getString(MISSING_CONNECTION), CommandMessages.getString(ERROR_PULLING_IMAGE_NO_CONNECTION));
    } else {
        final ImagePull wizard = new ImagePull(connection);
        final boolean pullImage = CommandUtils.openWizard(wizard, HandlerUtil.getActiveShell(event));
        if (pullImage) {
            performPullImage(connection, wizard.getSelectedImageName(), // part of the IRegistry interface
            (AbstractRegistry) wizard.getSelectedRegistryAccount());
        }
    }
    return null;
}
Also used : IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) IDockerConnection(org.eclipse.linuxtools.docker.core.IDockerConnection) ImagePull(org.eclipse.linuxtools.internal.docker.ui.wizards.ImagePull)

Aggregations

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