Search in sources :

Example 1 with ImageRemoveTag

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

the class RemoveTagCommandHandler method execute.

@Override
public Object execute(final ExecutionEvent event) {
    final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
    final List<IDockerImage> selectedImages = CommandUtils.getSelectedImages(activePart);
    final IDockerConnection connection = CommandUtils.getCurrentConnection(activePart);
    if (selectedImages.size() != 1 || connection == null) {
        Activator.log(new DockerException(CommandMessages.getString(// $NON-NLS-1$
        "Command.missing.selection.failure")));
        return null;
    }
    final IDockerImage image = selectedImages.get(0);
    final ImageRemoveTag wizard = new ImageRemoveTag(image);
    final boolean removeTag = CommandUtils.openWizard(wizard, HandlerUtil.getActiveShell(event));
    if (removeTag) {
        performRemoveTagImage(connection, wizard.getTag());
    }
    return null;
}
Also used : DockerException(org.eclipse.linuxtools.docker.core.DockerException) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) IDockerConnection(org.eclipse.linuxtools.docker.core.IDockerConnection) IDockerImage(org.eclipse.linuxtools.docker.core.IDockerImage) ImageRemoveTag(org.eclipse.linuxtools.internal.docker.ui.wizards.ImageRemoveTag)

Aggregations

DockerException (org.eclipse.linuxtools.docker.core.DockerException)1 IDockerConnection (org.eclipse.linuxtools.docker.core.IDockerConnection)1 IDockerImage (org.eclipse.linuxtools.docker.core.IDockerImage)1 ImageRemoveTag (org.eclipse.linuxtools.internal.docker.ui.wizards.ImageRemoveTag)1 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)1