use of org.eclipse.linuxtools.internal.docker.ui.wizards.ContainerCopyFrom in project linuxtools by eclipse.
the class CopyFromContainerCommandHandler method execute.
@Override
public Object execute(final ExecutionEvent event) {
final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
final IDockerConnection connection = CommandUtils.getCurrentConnection(activePart);
final List<IDockerContainer> selectedContainers = CommandUtils.getSelectedContainers(activePart);
if (selectedContainers.size() != 1) {
return null;
}
final IDockerContainer container = selectedContainers.get(0);
if (connection == null) {
MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), CommandMessages.getString(MISSING_CONNECTION), CommandMessages.getString(ERROR_COPYING_FROM_CONTAINER_NO_CONNECTION));
} else {
final ContainerCopyFrom wizard = new ContainerCopyFrom(connection, container);
final boolean copyFromContainer = CommandUtils.openWizard(wizard, HandlerUtil.getActiveShell(event));
if (copyFromContainer) {
performCopyFromContainer(connection, container, wizard.getTarget(), wizard.getSources());
}
}
return null;
}
Aggregations