Search in sources :

Example 1 with PopulateContainerFilesOperation

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);
}
Also used : ContainerFileProxy(org.eclipse.linuxtools.internal.docker.core.ContainerFileProxy) ContainerFileSystemProvider(org.eclipse.linuxtools.internal.docker.ui.ContainerFileSystemProvider) ProgressMonitorDialog(org.eclipse.jface.dialogs.ProgressMonitorDialog) IDockerContainerInfo(org.eclipse.linuxtools.docker.core.IDockerContainerInfo) InvocationTargetException(java.lang.reflect.InvocationTargetException) PopulateContainerFilesOperation(org.eclipse.linuxtools.internal.docker.ui.PopulateContainerFilesOperation)

Example 2 with PopulateContainerFilesOperation

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);
}
Also used : ContainerFileProxy(org.eclipse.linuxtools.internal.docker.core.ContainerFileProxy) ContainerFileSystemProvider(org.eclipse.linuxtools.internal.docker.ui.ContainerFileSystemProvider) ProgressMonitorDialog(org.eclipse.jface.dialogs.ProgressMonitorDialog) IDockerContainerInfo(org.eclipse.linuxtools.docker.core.IDockerContainerInfo) InvocationTargetException(java.lang.reflect.InvocationTargetException) PopulateContainerFilesOperation(org.eclipse.linuxtools.internal.docker.ui.PopulateContainerFilesOperation)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)2 ProgressMonitorDialog (org.eclipse.jface.dialogs.ProgressMonitorDialog)2 IDockerContainerInfo (org.eclipse.linuxtools.docker.core.IDockerContainerInfo)2 ContainerFileProxy (org.eclipse.linuxtools.internal.docker.core.ContainerFileProxy)2 ContainerFileSystemProvider (org.eclipse.linuxtools.internal.docker.ui.ContainerFileSystemProvider)2 PopulateContainerFilesOperation (org.eclipse.linuxtools.internal.docker.ui.PopulateContainerFilesOperation)2