use of org.eclipse.linuxtools.internal.docker.ui.PopulateContainerFilesOperation in project linuxtools by eclipse.
the class ContainerCopyFrom method addPages.
@Override
public void addPages() {
ProgressMonitorDialog pd = new ProgressMonitorDialog(Activator.getActiveWorkbenchShell());
ContainerFileSystemProvider provider = new ContainerFileSystemProvider(connection, container.id());
PopulateContainerFilesOperation sfo = new PopulateContainerFilesOperation(// $NON-NLS-1$ //$NON-NLS-2$
new ContainerFileProxy("", "", true), null, provider);
try {
pd.run(true, true, sfo);
} catch (InvocationTargetException | InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
boolean isRunning = EnumDockerStatus.fromStatusMessage(container.status()) == EnumDockerStatus.RUNNING;
// we only want to browse a Container's file system if
// it is running and it has specified to use a tty
boolean usingTTY = false;
if (isRunning) {
IDockerContainerInfo info = connection.getContainerInfo(container.id());
if (info != null) {
usingTTY = info.config().tty();
}
}
mainPage = new ContainerCopyFromPage(sfo.getResult(), provider, container.name(), isRunning && usingTTY);
addPage(mainPage);
}
use of org.eclipse.linuxtools.internal.docker.ui.PopulateContainerFilesOperation in project linuxtools by eclipse.
the class ContainerCopyTo method addPages.
@Override
public void addPages() {
ProgressMonitorDialog pd = new ProgressMonitorDialog(Activator.getActiveWorkbenchShell());
ContainerFileSystemProvider provider = new ContainerFileSystemProvider(connection, container.id());
PopulateContainerFilesOperation sfo = new PopulateContainerFilesOperation(// $NON-NLS-1$ //$NON-NLS-2$
new ContainerFileProxy("", "", true), null, provider);
try {
pd.run(true, true, sfo);
} catch (InvocationTargetException | InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
boolean isRunning = EnumDockerStatus.fromStatusMessage(container.status()) == EnumDockerStatus.RUNNING;
// we only want to browse a Container's file system if
// it is running and it has specified to use a tty
boolean usingTTY = false;
if (isRunning) {
IDockerContainerInfo info = connection.getContainerInfo(container.id());
if (info != null) {
usingTTY = info.config().tty();
}
}
mainPage = new ContainerCopyToPage(sfo.getResult(), provider, container.name(), isRunning && usingTTY);
addPage(mainPage);
}
Aggregations