use of org.eclipse.linuxtools.internal.docker.ui.wizards.ImageTag in project linuxtools by eclipse.
the class TagImageCommandHandler 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);
// TODO: remove the cast to DockerImage once the 'shortId' method has
// been added in the API
final ImageTag wizard = new ImageTag(((DockerImage) image).shortId());
final boolean tagImage = CommandUtils.openWizard(wizard, HandlerUtil.getActiveShell(event));
if (tagImage) {
performTagImage(connection, image, wizard.getTag());
}
return null;
}
Aggregations