Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2015-05-05 16:00:33 -0400
committerJeff Johnston2015-05-05 16:43:53 -0400
commitab85496121aa4aa0803bc7cd813fcb1b9b9b3ba5 (patch)
tree13f57da4828eeecf64c4c08d896ac9ff8dbf4198
parent80e6e18df68399c974315495121248e8640ed282 (diff)
downloadorg.eclipse.linuxtools-ab85496121aa4aa0803bc7cd813fcb1b9b9b3ba5.tar.gz
org.eclipse.linuxtools-ab85496121aa4aa0803bc7cd813fcb1b9b9b3ba5.tar.xz
org.eclipse.linuxtools-ab85496121aa4aa0803bc7cd813fcb1b9b9b3ba5.zip
Add support for Docker into Linux Tools.
Change-Id: I4497bdc930f70075d2cded4c4d9eada9acfc692b Reviewed-on: https://git.eclipse.org/r/47214 Tested-by: Hudson CI Reviewed-by: Jeff Johnston <jjohnstn@redhat.com> Tested-by: Jeff Johnston <jjohnstn@redhat.com>
-rw-r--r--containers/org.eclipse.linuxtools.docker-feature/.project17
-rw-r--r--containers/org.eclipse.linuxtools.docker-feature/build.properties8
-rw-r--r--containers/org.eclipse.linuxtools.docker-feature/feature.properties10
-rw-r--r--containers/org.eclipse.linuxtools.docker-feature/feature.xml40
-rw-r--r--containers/org.eclipse.linuxtools.docker-feature/p2.inf3
-rw-r--r--containers/org.eclipse.linuxtools.docker-feature/pom.xml57
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/.classpath53
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/.project34
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.jdt.core.prefs291
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.jdt.ui.prefs62
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.m2e.core.prefs4
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/META-INF/MANIFEST.MF66
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/build.properties40
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/pom.xml63
-rwxr-xr-xcontainers/org.eclipse.linuxtools.docker.core/resources/script.sh2
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/Activator.java83
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerConnectionManager.java240
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerContainerNotFoundException.java24
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerException.java32
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerImageBuildFailedException.java47
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerImageNotFoundException.java52
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerImagePullFailedException.java47
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerImagePushFailedException.java47
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/EnumDockerConnectionSettings.java23
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/EnumDockerLoggingStatus.java15
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/EnumDockerStatus.java42
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConfParameter.java19
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConnection.java189
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConnectionInfo.java132
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConnectionManagerListener.java21
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainer.java49
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerConfig.java64
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerExit.java17
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerInfo.java63
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerListener.java27
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerState.java31
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerHostConfig.java40
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerImage.java53
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerImageInfo.java41
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerImageListener.java19
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerNetworkSettings.java35
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerPortBinding.java19
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerPortMapping.java28
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerProgressDetail.java21
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerProgressHandler.java18
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerProgressMessage.java26
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IFieldMatcher.java17
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/ILogger.java25
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/Messages.java43
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/Messages.properties27
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/AbstractKillableThread.java60
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConfParameter.java63
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java1539
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnectionInfo.java211
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainer.java142
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerConfig.java490
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerExit.java28
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerInfo.java164
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerRefreshManager.java137
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerState.java74
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerHostConfig.java293
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerImage.java170
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerImageInfo.java114
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerNetworkSettings.java108
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerPortBinding.java48
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerPortMapping.java106
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerProgressDetail.java42
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerProgressHandler.java46
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerProgressMessage.java75
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerTCPConnection.java20
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/FieldMatcher.java57
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/HttpHijackWorkaround.java127
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/.classpath7
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/.project34
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/.settings/org.eclipse.jdt.core.prefs291
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/.settings/org.eclipse.jdt.ui.prefs62
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/.settings/org.eclipse.m2e.core.prefs4
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/META-INF/MANIFEST.MF24
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/build.properties7
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/README2
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/banner-repository-context.gifbin0 -> 2866 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/banner-repository.gifbin0 -> 2749 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/build_exec.pngbin0 -> 3539 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/collapseall.gifbin0 -> 157 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/commit.gifbin0 -> 599 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/commitd.gifbin0 -> 409 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/connection.gifbin0 -> 918 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/container.pngbin0 -> 1715 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/context-attach.gifbin0 -> 355 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/createcontainer.gifbin0 -> 213 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/createcontainer_d.gifbin0 -> 229 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/db_obj.gifbin0 -> 213 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/dbgroup_obj.gifbin0 -> 360 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/delete.gifbin0 -> 372 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/delete_d.gifbin0 -> 367 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/docker_large.pngbin0 -> 1192 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/docker_small.gifbin0 -> 223 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/filter_ps.gifbin0 -> 240 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/folder.gifbin0 -> 216 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/image.gifbin0 -> 609 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/image.pngbin0 -> 1560 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/images.pngbin0 -> 1539 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/instance.gifbin0 -> 582 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/kill.gifbin0 -> 339 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/killd.gifbin0 -> 959 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/list_UDDI_service_enabled.gifbin0 -> 564 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/list_wsdl_highlighted.gifbin0 -> 587 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/mock-repository.gifbin0 -> 224 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/new_wsdl_wiz.pngbin0 -> 5955 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/pull.gifbin0 -> 323 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/push.gifbin0 -> 362 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/pushd.gifbin0 -> 373 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/reboot.gifbin0 -> 949 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/rebootd.gifbin0 -> 948 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/refresh_tab.gifbin0 -> 213 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/repos.gifbin0 -> 588 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/repositories-blue.gifbin0 -> 367 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/repositories.gifbin0 -> 587 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/repository-middle.gifbin0 -> 325 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/repository-new.gifbin0 -> 342 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/repository-synchronize-attributes.pngbin0 -> 514 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/resource_obj.gifbin0 -> 588 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/restart.gifbin0 -> 590 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/resume.gifbin0 -> 337 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/resumed.gifbin0 -> 251 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/running.gifbin0 -> 527 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/runningd.gifbin0 -> 939 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/sample.gifbin0 -> 983 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/stopped.gifbin0 -> 219 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/stoppedd.gifbin0 -> 238 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/suspend.gifbin0 -> 359 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/suspendd.gifbin0 -> 253 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/systemprocess.gifbin0 -> 245 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/tag.gifbin0 -> 123 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/tag_d.gifbin0 -> 144 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/task-repository-new.gifbin0 -> 339 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/icons/task-retrieve.gifbin0 -> 343 bytes
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/plugin.properties91
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/plugin.xml923
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/pom.xml12
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/Activator.java105
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/IDockerConnectionPreferenceConstants.java18
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/actions/package-info.java16
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/ContainerLauncher.java425
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/IContainerLaunchListener.java21
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/IRunConsoleListener.java23
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/Messages.java38
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/Messages.properties13
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/ColoredTableViewer.java38
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/ConsoleOutputStream.java81
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/DockerPerspective.java23
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/ProgressJob.java83
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/RunConsole.java314
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/SWTImagesFactory.java175
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/AddConnectionCommandHandler.java53
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/BaseContainersCommandHandler.java93
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/BaseImagesCommandHandler.java94
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/BuildImageCommandHandler.java105
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/CommandUtils.java201
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/CommitContainerCommandHandler.java97
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/CreateContainerCommandHandler.java141
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/DisplayContainerLogCommandHandler.java108
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/KillContainersCommandHandler.java54
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/PauseContainersCommandHandler.java53
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/PullImageCommandHandler.java100
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/PushImageCommandHandler.java99
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RefreshConnectionsCommandHandler.java40
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RefreshContainersCommandHandler.java57
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RefreshImagesCommandHandler.java56
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveConnectionCommandHandler.java51
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveContainerLogCommandHandler.java50
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveContainersCommandHandler.java102
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveImagesCommandHandler.java122
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveTagCommandHandler.java113
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/ShowAllContainersCommandHandler.java39
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/ShowAllImagesCommandHandler.java39
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/StartContainersCommandHandler.java64
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/StopContainersCommandHandler.java53
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/TagImageCommandHandler.java112
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/UnpauseContainersCommandHandler.java64
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/DockerPreferencePage.java295
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/LoggingPreferencePage.java58
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/Messages.java38
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/Messages.properties15
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/PreferenceConstants.java25
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/PreferenceInitializer.java71
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/propertytesters/ContainerPropertyTester.java65
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/propertytesters/ImagePropertyTester.java44
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/propertytesters/package-info.java16
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/utils/UIUtils.java257
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/BasePropertySection.java77
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ConnectionInfoContentProvider.java71
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ConnectionInfoPropertySection.java87
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInfoContentProvider.java120
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInfoPropertySection.java52
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInspectContentProvider.java161
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInspectPropertySection.java102
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DVMessages.java38
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DVMessages.properties167
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DanglingImagesViewerFilter.java45
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerContainersComparator.java80
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerContainersContentProvider.java92
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerContainersView.java413
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerExplorerContentProvider.java234
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerExplorerLabelProvider.java137
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerExplorerView.java233
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImagesComparator.java90
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImagesContentProvider.java96
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/DockerImagesView.java432
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/HideStoppedContainersViewerFilter.java42
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ImageBuildProgressHandler.java105
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ImageComparator.java65
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ImageInfoContentProvider.java90
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ImageInfoPropertySection.java53
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ImageInspectContentProvider.java135
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ImageInspectPropertySection.java106
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ImagePullProgressHandler.java108
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ImagePushProgressHandler.java99
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ImageViewLabelAndContentProvider.java172
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/IntermediateImagesViewerFilter.java45
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/LabelUtils.java136
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/SearchFilter.java32
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/SpecialColumnLabelProvider.java21
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/TopLevelImagesViewerFilter.java43
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ContainerCommit.java69
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ContainerCommitPage.java187
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ContainerCreate.java133
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ContainerCreatePage.java939
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/DockerfileEditDialog.java136
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImageBuild.java94
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImageBuildPage.java251
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImagePull.java47
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImagePullPage.java129
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImagePush.java54
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImagePushPage.java150
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImageRemove.java49
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImageRemovePage.java142
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImageRemoveTag.java50
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImageRemoveTagPage.java95
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImageTag.java49
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImageTagPage.java114
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/NewDockerConnection.java62
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/NewDockerConnectionPage.java454
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/WizardMessages.java39
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/WizardMessages.properties146
-rw-r--r--gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTest.java2
246 files changed, 19783 insertions, 1 deletions
diff --git a/containers/org.eclipse.linuxtools.docker-feature/.project b/containers/org.eclipse.linuxtools.docker-feature/.project
new file mode 100644
index 0000000000..e85a8ddfbe
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker-feature/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.docker-feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/containers/org.eclipse.linuxtools.docker-feature/build.properties b/containers/org.eclipse.linuxtools.docker-feature/build.properties
new file mode 100644
index 0000000000..155886c3eb
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker-feature/build.properties
@@ -0,0 +1,8 @@
+bin.includes = feature.xml,\
+ feature.properties,\
+ p2.inf
+src.includes = feature.xml,\
+ feature.properties,\
+ build.properties,\
+ .classpath,\
+ .project
diff --git a/containers/org.eclipse.linuxtools.docker-feature/feature.properties b/containers/org.eclipse.linuxtools.docker-feature/feature.properties
new file mode 100644
index 0000000000..8cb60e961b
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker-feature/feature.properties
@@ -0,0 +1,10 @@
+# features.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+featureProvider=Eclipse Linux Tools
+featureName=Docker Tooling
+featureDescription=The Docker Tooling feature provides the ability to manage Docker Images and Containers from within Eclipse.
+copyright=Copyright 2014, 2015 Red Hat, Inc.
diff --git a/containers/org.eclipse.linuxtools.docker-feature/feature.xml b/containers/org.eclipse.linuxtools.docker-feature/feature.xml
new file mode 100644
index 0000000000..092fc66619
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker-feature/feature.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.linuxtools.docker.feature"
+ label="%featureName"
+ version="1.0.0.qualifier"
+ provider-name="%featureProvider"
+ license-feature="org.eclipse.license"
+ license-feature-version="0.0.0">
+
+ <description url="http://www.eclipse.org/linuxtools">
+ %featureDescription
+ </description>
+
+ <copyright url="http://www.redhat.com">
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <url>
+ <update label="Linux Tools Docker Update Site" url="http://download.eclipse.org/linuxtools/update-docker"/>
+ </url>
+
+ <plugin
+ id="org.eclipse.linuxtools.docker.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.docker.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/containers/org.eclipse.linuxtools.docker-feature/p2.inf b/containers/org.eclipse.linuxtools.docker-feature/p2.inf
new file mode 100644
index 0000000000..7bc97f020b
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker-feature/p2.inf
@@ -0,0 +1,3 @@
+instructions.configure=\
+org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/linuxtools/updates-docker-nightly,type:0,name:Linux Tools Docker Tooling,enabled:false); \
+org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(location:http${#58}//download.eclipse.org/linuxtools/updates-docker-nightly,type:1,name:Linux Tools Docker Tooling,enabled:false);
diff --git a/containers/org.eclipse.linuxtools.docker-feature/pom.xml b/containers/org.eclipse.linuxtools.docker-feature/pom.xml
new file mode 100644
index 0000000000..6112006470
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker-feature/pom.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2014, 2015, Red Hat, Inc.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.linuxtools</groupId>
+ <artifactId>org.eclipse.linuxtools.docker</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.linuxtools.docker.feature</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-feature</packaging>
+
+ <name>Linux Tools Docker Tooling Feature</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho.extras</groupId>
+ <artifactId>tycho-source-feature-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>source-feature</id>
+ <phase>package</phase>
+ <goals>
+ <goal>source-feature</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-plugin</artifactId>
+ <version>${tychoVersion}</version>
+ <executions>
+ <execution>
+ <id>attached-p2-metadata</id>
+ <phase>package</phase>
+ <goals>
+ <goal>p2-metadata</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/containers/org.eclipse.linuxtools.docker.core/.classpath b/containers/org.eclipse.linuxtools.docker.core/.classpath
new file mode 100644
index 0000000000..9ca34165f0
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/.classpath
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src/"/>
+ <classpathentry exported="true" kind="lib" path="lib/bcpkix-jdk15on-1.51.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/bcprov-jdk15on-1.51.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-codec-1.6.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-compress-1.8.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.1.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/guava-17.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/httpclient-4.3.5.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/httpcore-4.3.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.7.6.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/docker-client-2.7.18.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jnr-unixsocket-0.4.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jnr-enxio-0.5.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jersey-client-2.13.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/javax.ws.rs-api-2.0.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hk2-api-2.3.0-b10.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jackson-databind-2.2.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jackson-annotations-2.2.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jackson-core-2.2.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jackson-jaxrs-base-2.2.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jackson-jaxrs-json-provider-2.2.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jackson-module-jaxb-annotations-2.2.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jackson-datatype-guava-2.2.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jersey-apache-connector-2.13.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jersey-common-2.13.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jersey-guava-2.13.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jersey-media-json-jackson-2.13.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/aopalliance-repackaged-2.3.0-b10.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/asm-4.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/asm-analysis-4.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/asm-commons-4.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/asm-tree-4.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/asm-util-4.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-lang-2.6.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hk2-locator-2.3.0-b10.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hk2-utils-2.3.0-b10.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jackson-dataformat-yaml-2.2.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/javassist-3.18.1-GA.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/javax.annotation-api-1.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/javax.inject-2.3.0-b10.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jffi-1.2.7.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jffi-1.2.7-native.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jnr-constants-0.8.6.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jnr-ffi-2.0.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jnr-posix-3.0.8.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jnr-x86asm-1.0.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/osgi-resource-locator-1.0.1.jar"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/containers/org.eclipse.linuxtools.docker.core/.project b/containers/org.eclipse.linuxtools.docker.core/.project
new file mode 100644
index 0000000000..4618174f99
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.docker.core</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.jdt.core.prefs b/containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..267d23cb7d
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,291 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=80
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.jdt.ui.prefs b/containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000000..32fe9378ab
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,62 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile
+formatter_settings_version=12
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=true
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=false
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=true
+sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=true
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_type_arguments=false
diff --git a/containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.m2e.core.prefs b/containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000000..f897a7f1cb
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/containers/org.eclipse.linuxtools.docker.core/META-INF/MANIFEST.MF b/containers/org.eclipse.linuxtools.docker.core/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..62139c6231
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/META-INF/MANIFEST.MF
@@ -0,0 +1,66 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Docker Core Plugin
+Bundle-SymbolicName: org.eclipse.linuxtools.docker.core
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.docker.core.Activator
+Bundle-Vendor: Eclipse Linux Tools
+Require-Bundle: org.eclipse.core.runtime;bundle-version="3.10.0",
+ org.eclipse.core.resources;bundle-version="3.9.0",
+ com.google.guava;bundle-version="15.0.0",
+ org.eclipse.equinox.registry;bundle-version="0.0.0",
+ org.eclipse.equinox.security,
+ org.eclipse.osgi
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-ActivationPolicy: lazy
+Export-Package: com.spotify.docker.client,
+ org.eclipse.linuxtools.docker.core,
+ org.eclipse.linuxtools.internal.docker.core;x-friends:="org.eclipse.linuxtools.docker.ui"
+Import-Package: org.eclipse.jface.preference
+Bundle-ClassPath: .,
+ lib/bcpkix-jdk15on-1.51.jar,
+ lib/bcprov-jdk15on-1.51.jar,
+ lib/com.google.guava-15.0.0.v201403281430.jar,
+ lib/commons-codec-1.6.jar,
+ lib/commons-compress-1.8.1.jar,
+ lib/commons-logging-1.1.3.jar,
+ lib/guava-17.0.jar,
+ lib/httpclient-4.3.5.jar,
+ lib/httpcore-4.3.2.jar,
+ lib/slf4j-api-1.7.6.jar,
+ lib/docker-client-2.7.18.jar,
+ lib/jnr-unixsocket-0.4.jar,
+ lib/jnr-enxio-0.5.jar,
+ lib/jersey-client-2.13.jar,
+ lib/javax.ws.rs-api-2.0.1.jar,
+ lib/hk2-api-2.3.0-b10.jar,
+ lib/jackson-databind-2.2.3.jar,
+ lib/jackson-annotations-2.2.3.jar,
+ lib/jackson-core-2.2.3.jar,
+ lib/jackson-jaxrs-base-2.2.3.jar,
+ lib/jackson-jaxrs-json-provider-2.2.3.jar,
+ lib/jackson-module-jaxb-annotations-2.2.3.jar,
+ lib/jackson-datatype-guava-2.2.3.jar,
+ lib/jersey-apache-connector-2.13.jar,
+ lib/jersey-common-2.13.jar,
+ lib/jersey-guava-2.13.jar,
+ lib/jersey-media-json-jackson-2.13.jar,
+ lib/aopalliance-repackaged-2.3.0-b10.jar,
+ lib/asm-4.0.jar,
+ lib/asm-analysis-4.0.jar,
+ lib/asm-commons-4.0.jar,
+ lib/asm-tree-4.0.jar,
+ lib/asm-util-4.0.jar,
+ lib/hk2-locator-2.3.0-b10.jar,
+ lib/hk2-utils-2.3.0-b10.jar,
+ lib/jackson-dataformat-yaml-2.2.3.jar,
+ lib/javassist-3.18.1-GA.jar,
+ lib/javax.annotation-api-1.2.jar,
+ lib/javax.inject-2.3.0-b10.jar,
+ lib/jffi-1.2.7.jar,
+ lib/jffi-1.2.7-native.jar,
+ lib/jnr-constants-0.8.6.jar,
+ lib/jnr-ffi-2.0.0.jar,
+ lib/jnr-posix-3.0.8.jar,
+ lib/jnr-x86asm-1.0.2.jar,
+ lib/osgi-resource-locator-1.0.1.jar
diff --git a/containers/org.eclipse.linuxtools.docker.core/build.properties b/containers/org.eclipse.linuxtools.docker.core/build.properties
new file mode 100644
index 0000000000..d84e9a2521
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/build.properties
@@ -0,0 +1,40 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ lib/docker-client-2.7.18.jar,\
+ lib/jnr-unixsocket-0.4.jar,\
+ lib/jnr-enxio-0.5.jar,\
+ lib/jersey-client-2.13.jar,\
+ lib/javax.ws.rs-api-2.0.1.jar,\
+ lib/hk2-api-2.3.0-b10.jar,\
+ lib/jackson-databind-2.2.3.jar,\
+ lib/jackson-annotations-2.2.3.jar,\
+ lib/jackson-core-2.2.3.jar,\
+ lib/jackson-jaxrs-base-2.2.3.jar,\
+ lib/jackson-jaxrs-json-provider-2.2.3.jar,\
+ lib/jackson-module-jaxb-annotations-2.2.3.jar,\
+ lib/jackson-datatype-guava-2.2.3.jar,\
+ lib/jersey-apache-connector-2.13.jar,\
+ lib/jersey-common-2.13.jar,\
+ lib/jersey-guava-2.13.jar,\
+ lib/jersey-media-json-jackson-2.13.jar,\
+ lib/aopalliance-repackaged-2.3.0-b10.jar,\
+ lib/asm-4.0.jar,\
+ lib/asm-analysis-4.0.jar,\
+ lib/asm-commons-4.0.jar,\
+ lib/asm-tree-4.0.jar,\
+ lib/asm-util-4.0.jar,\
+ lib/commons-lang-2.6.jar,\
+ lib/hk2-locator-2.3.0-b10.jar,\
+ lib/hk2-utils-2.3.0-b10.jar,\
+ lib/jackson-dataformat-yaml-2.2.3.jar,\
+ lib/javassist-3.18.1-GA.jar,\
+ lib/javax.annotation-api-1.2.jar,\
+ lib/javax.inject-2.3.0-b10.jar,\
+ lib/jffi-1.2.7.jar,\
+ lib/jnr-constants-0.8.6.jar,\
+ lib/jnr-ffi-2.0.0.jar,\
+ lib/jnr-posix-3.0.8.jar,\
+ lib/jnr-x86asm-1.0.2.jar,\
+ lib/osgi-resource-locator-1.0.1.jar
diff --git a/containers/org.eclipse.linuxtools.docker.core/pom.xml b/containers/org.eclipse.linuxtools.docker.core/pom.xml
new file mode 100644
index 0000000000..876f8ed74c
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/pom.xml
@@ -0,0 +1,63 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.linuxtools</groupId>
+ <artifactId>org.eclipse.linuxtools.docker</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.linuxtools.docker.core</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.10</version>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>lib</outputDirectory>
+ <overWriteReleases>false</overWriteReleases>
+ <overWriteSnapshots>false</overWriteSnapshots>
+ <overWriteIfNewer>true</overWriteIfNewer>
+ <excludeGroupIds>p2.eclipse-plugin,org.eclipse.linuxtools</excludeGroupIds>
+ <includeTypes>jar</includeTypes>
+ <includeScope>runtime</includeScope>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>lib</directory>
+ <includes>
+ <include>**/*.jar</include>
+ </includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.spotify</groupId>
+ <artifactId>docker-client</artifactId>
+ <version>2.7.18</version>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/containers/org.eclipse.linuxtools.docker.core/resources/script.sh b/containers/org.eclipse.linuxtools.docker.core/resources/script.sh
new file mode 100755
index 0000000000..a6043d7a94
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/resources/script.sh
@@ -0,0 +1,2 @@
+#!/usr/bin/env sh
+$SHELL -i -c "env | grep DOCKER" \ No newline at end of file
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/Activator.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/Activator.java
new file mode 100644
index 0000000000..8f80a470bb
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/Activator.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+import org.osgi.framework.BundleContext;
+
+public class Activator extends Plugin {
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.linuxtools.docker.core"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext
+ * )
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ super.start(bundleContext);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ plugin = null;
+ super.stop(bundleContext);
+ }
+
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ public static void log(IStatus status) {
+ Activator.getDefault().getLog().log(status);
+ }
+
+ public static void logErrorMessage(String message) {
+ log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, message, null));
+ }
+
+ public static void log(Throwable e) {
+ if (e instanceof InvocationTargetException)
+ e = ((InvocationTargetException) e).getTargetException();
+ IStatus status = null;
+ if (e instanceof CoreException) {
+ status = ((CoreException) e).getStatus();
+ } else {
+ status = new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK,
+ e.getMessage(), e);
+ }
+ log(status);
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerConnectionManager.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerConnectionManager.java
new file mode 100644
index 0000000000..6732c7b835
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerConnectionManager.java
@@ -0,0 +1,240 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.equinox.security.storage.ISecurePreferences;
+import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
+import org.eclipse.equinox.security.storage.StorageException;
+import org.eclipse.linuxtools.internal.docker.core.DockerConnection;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+public class DockerConnectionManager {
+
+ public final static String CONNECTIONS_FILE_NAME = "dockerconnections.xml"; //$NON-NLS-1$
+
+ private static DockerConnectionManager instance;
+
+ private ArrayList<IDockerConnection> connections;
+ private ListenerList connectionManagerListeners;
+
+ private DockerConnectionManager() {
+ connections = new ArrayList<IDockerConnection>();
+ loadConnections();
+ }
+
+ static public DockerConnectionManager getInstance() {
+ if (instance == null)
+ instance = new DockerConnectionManager();
+
+ return instance;
+ }
+
+ private void loadConnections() {
+ IPath stateLocation = Activator.getDefault().getStateLocation();
+ File connectionFile = stateLocation.append(CONNECTIONS_FILE_NAME)
+ .toFile();
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ try {
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ if (connectionFile.exists()) {
+ Document d = db.parse(connectionFile);
+ Element e = d.getDocumentElement();
+ // Get the stored configuration data
+ NodeList connectionNodes = e.getElementsByTagName("connection"); // $NON-NLS-1$
+ for (int x = 0; x < connectionNodes.getLength(); ++x) {
+ Node n = connectionNodes.item(x);
+ NamedNodeMap attrs = n.getAttributes();
+ Node nameNode = attrs.getNamedItem("name"); //$NON-NLS-1$
+ Node uriNode = attrs.getNamedItem("uri"); //$NON-NLS-1$
+ Node usernameNode = attrs.getNamedItem("username"); //$NON-NLS-1$
+ Node certNode = attrs.getNamedItem("cert"); //$NON-NLS-1$
+ if (uriNode != null) {
+ String uri = uriNode.getNodeValue();
+ String name = nameNode.getNodeValue();
+
+ if (usernameNode != null) {
+ String username = usernameNode.getNodeValue();
+ String key = DockerConnection.getPreferencesKey(
+ uri, username);
+ ISecurePreferences root = SecurePreferencesFactory
+ .getDefault();
+ ISecurePreferences node = root.node(key);
+ @SuppressWarnings("unused")
+ String password;
+ try {
+ password = node.get("password", null); //$NON-NLS-1$
+ } catch (StorageException e1) {
+ e1.printStackTrace();
+ }
+ }
+
+ DockerConnection.Builder builder = new DockerConnection.Builder()
+ .name(name);
+ if (uri.startsWith("unix:")) { //$NON-NLS-1$
+ builder = builder.unixSocket(uri);
+ } else {
+ builder = builder.tcpHost(uri);
+ if (certNode != null) {
+ String cert = certNode.getNodeValue();
+ builder = builder.tcpCertPath(cert);
+ }
+ }
+ try {
+ DockerConnection connection = builder.build();
+ addConnection(connection);
+ } catch (DockerException e1) {
+ Activator.log(e1);
+ }
+ }
+ }
+ }
+ } catch (ParserConfigurationException e) {
+ Activator.log(e);
+ } catch (SAXException e) {
+ Activator.log(e);
+ } catch (IOException e) {
+ Activator.log(e);
+ }
+
+ /*if (connections.size() == 0) {
+ // create a new connection from the UI preferences
+ final IEclipsePreferences preferences = InstanceScope.INSTANCE
+ .getNode("org.eclipse.linuxtools.docker.ui"); //$NON-NLS-1$
+ final int bindingMode = preferences.getInt(BINDING_MODE, UNIX_SOCKET);
+ try {
+ if(bindingMode == UNIX_SOCKET) {
+ final String unixSocketPath = preferences.get(UNIX_SOCKET_PATH, DEFAULT_UNIX_SOCKET_PATH);
+ connections.add(new DockerConnection.Builder().unixSocket(unixSocketPath).build());
+ } else {
+ final String tcpHost = preferences.get(TCP_HOST, null);
+ final String tcpCertPath = preferences.get(TCP_CERT_PATH, null);
+ connections.add(new DockerConnection.Builder().tcpHost(tcpHost).tcpCertPath(tcpCertPath).build()); //$NON-NLS-1$
+ }
+ } catch (DockerCertificateException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } //$NON-NLS-1$
+ }*/
+ }
+
+ public void saveConnections() {
+ try {
+ IPath stateLocation = Activator.getDefault().getStateLocation();
+ File ConnectionFile = stateLocation.append(CONNECTIONS_FILE_NAME)
+ .toFile();
+ if (!ConnectionFile.exists())
+ ConnectionFile.createNewFile();
+ if (ConnectionFile.exists()) {
+ PrintWriter p = new PrintWriter(new BufferedWriter(
+ new FileWriter(ConnectionFile)));
+ p.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$
+ p.println("<connections>"); // $NON-NLS-1$
+ for (IDockerConnection d : connections) {
+ p.print("<connection name=\"" + d.getName() + //$NON-NLS-1$
+ "\" uri=\"" + d.getUri()); //$NON-NLS-1$
+ if (d.getUsername() != null) {
+ p.print("\" username=\"" + d.getUsername()); //$NON-NLS-1$
+ }
+ if (d.getTcpCertPath() != null) {
+ p.print("\" cert=\"" + d.getTcpCertPath()); //$NON-NLS-1$
+ }
+ p.println("\"/>");
+ }
+ p.println("</connections>"); //$NON-NLS-1$
+ p.close();
+ }
+ } catch (Exception e) {
+ Activator.log(e);
+ }
+ }
+
+ public IDockerConnection[] getConnections() {
+ return connections.toArray(new IDockerConnection[connections.size()]);
+ }
+
+ public IDockerConnection findConnection(String name) {
+ for (IDockerConnection connection : connections) {
+ if (connection.getName().equals(name))
+ return connection;
+ }
+ return null;
+ }
+
+ public void addConnection(final IDockerConnection dockerConnection) throws DockerException {
+ if(!dockerConnection.isOpen()) {
+ dockerConnection.open(true);
+ }
+ connections.add(dockerConnection);
+ saveConnections();
+ notifyListeners(IDockerConnectionManagerListener.ADD_EVENT);
+ }
+
+ public void removeConnection(IDockerConnection d) {
+ connections.remove(d);
+ String uri = d.getUri();
+ String name = d.getName();
+ for (IDockerConnection connection : connections) {
+ if (connection.getUri().equals(uri)
+ && connection.getName().equals(name)) {
+ break;
+ }
+ }
+ saveConnections();
+ notifyListeners(IDockerConnectionManagerListener.REMOVE_EVENT);
+ }
+
+ public void notifyConnectionRename() {
+ saveConnections();
+ notifyListeners(IDockerConnectionManagerListener.RENAME_EVENT);
+ }
+
+ public void addConnectionManagerListener(
+ IDockerConnectionManagerListener listener) {
+ if (connectionManagerListeners == null)
+ connectionManagerListeners = new ListenerList(ListenerList.IDENTITY);
+ connectionManagerListeners.add(listener);
+ }
+
+ public void removeConnectionManagerListener(
+ IDockerConnectionManagerListener listener) {
+ if (connectionManagerListeners != null)
+ connectionManagerListeners.remove(listener);
+ }
+
+ public void notifyListeners(int type) {
+ if (connectionManagerListeners != null) {
+ Object[] listeners = connectionManagerListeners.getListeners();
+ for (int i = 0; i < listeners.length; ++i) {
+ ((IDockerConnectionManagerListener) listeners[i])
+ .changeEvent(type);
+ }
+ }
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerContainerNotFoundException.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerContainerNotFoundException.java
new file mode 100644
index 0000000000..13c9c7510a
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerContainerNotFoundException.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+public class DockerContainerNotFoundException extends DockerException {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ public DockerContainerNotFoundException(Exception e) {
+ super(e.getMessage(), e.getCause());
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerException.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerException.java
new file mode 100644
index 0000000000..34d00c9258
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerException.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+public class DockerException extends Exception {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ public DockerException(final String message) {
+ super(message);
+ }
+
+ public DockerException(final String message, final Throwable cause) {
+ super(message, cause);
+ }
+
+ public DockerException(final Throwable cause) {
+ super(cause);
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerImageBuildFailedException.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerImageBuildFailedException.java
new file mode 100644
index 0000000000..377c34d0e1
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerImageBuildFailedException.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2014 Spotify AB.
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Class copied from ImagePullFailedException and modified
+
+package org.eclipse.linuxtools.docker.core;
+
+public class DockerImageBuildFailedException extends DockerException {
+
+ private static final long serialVersionUID = 1L;
+
+ private final String image;
+
+ public DockerImageBuildFailedException(final String image,
+ final Throwable cause) {
+ super(Messages.Image_Build_Failed_Header + image, cause);
+ this.image = image;
+ }
+
+ public DockerImageBuildFailedException(final String image,
+ final String message) {
+ super(Messages.Image_Build_Failed_Header + image + ": " + message);
+ this.image = image;
+ }
+
+ public String getImage() {
+ return image;
+ }
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerImageNotFoundException.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerImageNotFoundException.java
new file mode 100644
index 0000000000..37dc3bad40
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerImageNotFoundException.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014 Spotify AB.
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+// Class copied from ImageNotFoundException and modified
+
+package org.eclipse.linuxtools.docker.core;
+
+public class DockerImageNotFoundException extends DockerException {
+
+ private static final long serialVersionUID = 1L;
+
+ private final String image;
+
+ public DockerImageNotFoundException(final String image,
+ final Throwable cause) {
+ super(Messages.Image_Not_Found_Header + image, cause);
+ this.image = image;
+ }
+
+ public DockerImageNotFoundException(final String image, final String message) {
+ super(Messages.Image_Not_Found_Header + image + ": " + message);
+ this.image = image;
+ }
+
+ public DockerImageNotFoundException(final String image) {
+ super(Messages.Image_Not_Found_Header + image);
+ this.image = image;
+ }
+
+ public String getImage() {
+ return image;
+ }
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerImagePullFailedException.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerImagePullFailedException.java
new file mode 100644
index 0000000000..817b3be6ed
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerImagePullFailedException.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2014 Spotify AB.
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Class copied from ImagePullFailedException and modified
+
+package org.eclipse.linuxtools.docker.core;
+
+public class DockerImagePullFailedException extends DockerException {
+
+ private static final long serialVersionUID = 1L;
+
+ private final String image;
+
+ public DockerImagePullFailedException(final String image,
+ final Throwable cause) {
+ super(Messages.Image_Pull_Failed_Header + image, cause);
+ this.image = image;
+ }
+
+ public DockerImagePullFailedException(final String image,
+ final String message) {
+ super(Messages.Image_Pull_Failed_Header + image + ": " + message);
+ this.image = image;
+ }
+
+ public String getImage() {
+ return image;
+ }
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerImagePushFailedException.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerImagePushFailedException.java
new file mode 100644
index 0000000000..0c6ad7f8bd
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/DockerImagePushFailedException.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2014 Spotify AB.
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Class copied from ImagePullFailedException and modified
+
+package org.eclipse.linuxtools.docker.core;
+
+public class DockerImagePushFailedException extends DockerException {
+
+ private static final long serialVersionUID = 1L;
+
+ private final String image;
+
+ public DockerImagePushFailedException(final String image,
+ final Throwable cause) {
+ super(Messages.Image_Push_Failed_Header + image, cause);
+ this.image = image;
+ }
+
+ public DockerImagePushFailedException(final String image,
+ final String message) {
+ super(Messages.Image_Push_Failed_Header + image + ": " + message);
+ this.image = image;
+ }
+
+ public String getImage() {
+ return image;
+ }
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/EnumDockerConnectionSettings.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/EnumDockerConnectionSettings.java
new file mode 100644
index 0000000000..44becaf6dd
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/EnumDockerConnectionSettings.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.docker.core;
+
+/**
+ * Constants to store/retrieve connection settings
+ *
+ * @author xcoulon
+ *
+ */
+public enum EnumDockerConnectionSettings {
+
+ BINDING_MODE, UNIX_SOCKET, TCP_CONNECTION, UNIX_SOCKET_PATH, TCP_HOST, TCP_TLS_VERIFY, TCP_CERT_PATH;
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/EnumDockerLoggingStatus.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/EnumDockerLoggingStatus.java
new file mode 100644
index 0000000000..f13bcf8143
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/EnumDockerLoggingStatus.java
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+public enum EnumDockerLoggingStatus {
+ LOGGING_NONE, LOGGING_ACTIVE, LOGGING_COMPLETE
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/EnumDockerStatus.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/EnumDockerStatus.java
new file mode 100644
index 0000000000..9d136d6b1a
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/EnumDockerStatus.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+/**
+ * The {@link IDockerStatus} implementation
+ * @author xcoulon
+ *
+ */
+public enum EnumDockerStatus {
+
+ STOPPED, RUNNING, PAUSED, EXITED, UNKNOWN;
+
+ /**
+ * Finds the {@link EnumDockerStatus} from the given status message
+ * @param statusMessage the {@link IDockerContainer#status()} message
+ * @return the corresponding {@link EnumDockerStatus}
+ */
+ public static EnumDockerStatus fromStatusMessage(final String statusMessage) {
+ if (statusMessage.startsWith("Exited") || statusMessage.startsWith("Stopped")) {//$NON-NLS-1$
+ return STOPPED;
+ } else if (statusMessage.startsWith("Running") && statusMessage.endsWith("(Paused)")) { //$NON-NLS-1$ //$NON-NLS-2$
+ return PAUSED;
+ } else if (statusMessage.startsWith("Running")) { //$NON-NLS-1$ //$NON-NLS-2$
+ return RUNNING;
+ } else if (statusMessage.startsWith("Up") && statusMessage.endsWith("(Paused)")) { //$NON-NLS-1$ //$NON-NLS-2$
+ return PAUSED;
+ } else if (statusMessage.startsWith("Up")) { //$NON-NLS-1$ //$NON-NLS-2$
+ return RUNNING;
+ }
+ return UNKNOWN;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConfParameter.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConfParameter.java
new file mode 100644
index 0000000000..901835358e
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConfParameter.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+public interface IDockerConfParameter {
+
+ public String key();
+
+ public String value();
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConnection.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConnection.java
new file mode 100644
index 0000000000..78fe8a1567
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConnection.java
@@ -0,0 +1,189 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.linuxtools.internal.docker.core.DockerContainerRefreshManager;
+
+import com.spotify.docker.client.DockerCertificateException;
+
+public interface IDockerConnection {
+
+ public void addContainerListener(IDockerContainerListener listener);
+
+ public void removeContainerListener(IDockerContainerListener listener);
+
+ /**
+ * Get the list of {@link IDockerContainer} of the remote Docker daemon.
+ *
+ * @return an unmodifiable list of {@link IDockerContainer} or
+ * {@link Collections#emptyList()} if no container exists yet.
+ * @see {@link IDockerConnection#getContainers(boolean)}
+ */
+ public List<IDockerContainer> getContainers();
+
+ /**
+ * Get the list of {@link IDockerContainer} of the remote Docker daemon.
+ *
+ * @param force
+ * {@code true} to force a new retrieval of the list of
+ * {@link IDockerContainer}, {@code false} to use the cached
+ * list.
+ * @return an unmodifiable list of {@link IDockerContainer} or
+ * {@link Collections#emptyList()} if no container exists yet.
+ */
+ public List<IDockerContainer> getContainers(final boolean force);
+
+ /**
+ * @return Boolean flag to indicate if the list of {@link IDockerContainer}
+ * has already been loaded ({@code true}) or not ({@code false}).
+ */
+ public boolean isContainersLoaded();
+
+ /**
+ * @return the {@link IDockerContainer} identified by the given {@code id} or <code>null</code> if none was found.
+ * @param id the {@link IDockerContainer} id
+ */
+ public IDockerContainer getContainer(final String id);
+
+ /**
+ * @return the {@link IDockerContainerInfo} for the {@link IDockerContainer} identified by the given {@code id} or <code>null</code> if none was found.
+ * @param id the {@link IDockerContainer} id
+ */
+ public IDockerContainerInfo getContainerInfo(final String id);
+
+ /**
+ * @return the {@link IDockerImageInfo} for the {@link IDockerImage}
+ * identified by the given {@code id} or <code>null</code> if none
+ * was found.
+ * @param id
+ * the {@link IDockerImage} id
+ */
+ public IDockerImageInfo getImageInfo(final String id);
+
+ public void addImageListener(IDockerImageListener listener);
+
+ public void removeImageListener(IDockerImageListener listener);
+
+ /**
+ * Get the list of {@link IDockerImage} of the remote Docker daemon.
+ *
+ * @return an unmodifiable list of {@link IDockerImage} or
+ * {@link Collections#emptyList()} if no container exists yet.
+ * @see IDockerConnection#getImages(boolean)
+ */
+ public List<IDockerImage> getImages();
+
+ /**
+ * Get the list of {@link IDockerImage} of the remote Docker daemon.
+ *
+ * @param force
+ * {@code true} to force a new retrieval of the list of
+ * {@link IDockerImage}, {@code false} to use the cached
+ * list.
+ * @return an unmodifiable list of {@link IDockerImage} or
+ * {@link Collections#emptyList()} if no container exists yet.
+ */
+ public List<IDockerImage> getImages(final boolean force);
+
+ /**
+ * @return Boolean flag to indicate if the list of {@link IDockerImage}
+ * has already been loaded ({@code true}) or not ({@code false}).
+ */
+ public boolean isImagesLoaded();
+
+ public String getName();
+
+ public String getUri();
+
+ public String getUsername();
+
+ public String getTcpCertPath();
+
+ /**
+ * Checks if the connection is open
+ * @return {@code true} if connection is open, {@code false} otherwise.
+ */
+ public boolean isOpen();
+
+ /**
+ * Opens the connection to the Docker daemon.
+ * @param registerContainerRefreshManager {@code true} if the {@link DockerContainerRefreshManager} should be qssociated with the Docker client to auto-refresh the list of containers, {@code false} otherwise (eg: wheh the connection should just be tested with a call to {@link IDockerConnection#ping()}
+ * @throws DockerCertificateException
+ */
+ public void open(boolean registerContainerRefreshManager) throws DockerException;
+
+ /**
+ * Send a ping message to the Docker daemon to check if the connection works.
+ * @throws InterruptedException
+ * @throws IOException
+ * @throws DockerException
+ * @throws DockerCertificateException
+ * @throws DockerException
+ */
+ public void ping() throws DockerException;
+
+ /**
+ * Closes the connection.
+ */
+ public void close();
+
+ /**
+ * @return the {@link IDockerConnectionInfo} associated with this {@link IDockerConnection}
+ * @throws DockerException if info retrieval failed
+ */
+ public IDockerConnectionInfo getInfo() throws DockerException;
+
+ void pullImage(String id, IDockerProgressHandler handler) throws DockerException, InterruptedException;
+
+ void pushImage(String name, IDockerProgressHandler handler) throws DockerException, InterruptedException;
+
+ void tagImage(String name, String newTag) throws DockerException, InterruptedException;
+
+ String buildImage(IPath path, String name, IDockerProgressHandler handler)
+ throws DockerException, InterruptedException;
+
+ String createContainer(IDockerContainerConfig c) throws DockerException, InterruptedException;
+
+ void stopContainer(String id) throws DockerException, InterruptedException;
+
+ void killContainer(String id) throws DockerException, InterruptedException;
+
+ void pauseContainer(String id) throws DockerException, InterruptedException;
+
+ void unpauseContainer(String id, OutputStream stream) throws DockerException, InterruptedException;
+
+ void removeContainer(String id) throws DockerException, InterruptedException;
+
+ void startContainer(String id, OutputStream stream) throws DockerException, InterruptedException;
+
+ void startContainer(String id, IDockerHostConfig config, OutputStream stream)
+ throws DockerException, InterruptedException;
+
+ void startContainer(String id, String loggingId, IDockerHostConfig config, OutputStream stream)
+ throws DockerException, InterruptedException;
+
+ void commitContainer(String id, String repo, String tag, String comment, String author) throws DockerException;
+
+ void stopLoggingThread(String id);
+
+ void logContainer(String id, OutputStream stream) throws DockerException, InterruptedException;
+
+ void removeImage(String name) throws DockerException, InterruptedException;
+
+ void removeTag(String tag) throws DockerException, InterruptedException;
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConnectionInfo.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConnectionInfo.java
new file mode 100644
index 0000000000..006fa66820
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConnectionInfo.java
@@ -0,0 +1,132 @@
+package org.eclipse.linuxtools.docker.core;
+
+import java.util.List;
+
+public interface IDockerConnectionInfo {
+
+ /**
+ * @return the memoryLimit
+ */
+ boolean isMemoryLimit();
+
+ /**
+ * @return the containers
+ */
+ int getContainers();
+
+ /**
+ * @return the debug
+ */
+ boolean isDebug();
+
+ /**
+ * @return the Driver status
+ */
+ List<List<String>> getDriverStatus();
+
+ /**
+ * @return the DockerRootDir
+ */
+ String getDockerRootDir();
+
+ /**
+ * @return the executionDriver
+ */
+ String getExecutionDriver();
+
+ /**
+ * @return the fileDescriptors
+ */
+ int getFileDescriptors();
+
+ /**
+ * @return the goroutines
+ */
+ int getGoroutines();
+
+ /**
+ * @return the images
+ */
+ int getImages();
+
+ /**
+ * @return the initPath
+ */
+ String getInitPath();
+
+ /**
+ * @return the initSha1
+ */
+ String getInitSha1();
+
+ /**
+ * @return the IndexServerAddress
+ */
+ String getIndexServerAddress();
+
+ /**
+ * @return the IPv4Forwarding flag
+ */
+ boolean isIPv4Forwarding();
+
+ /**
+ * @return the kernelVersion
+ */
+ String getKernelVersion();
+
+ /**
+ * @return the Labels
+ */
+ List<String> getLabels();
+
+ /**
+ * @return number of CPUs
+ */
+ int getCPUNumber();
+
+ /**
+ * @return total memory
+ */
+ long getTotalMemory();
+
+ /**
+ * @return VM name
+ */
+ String getName();
+
+ /**
+ * @return VM ID
+ */
+ String getId();
+
+ /**
+ * @return the storageDriver
+ */
+ String getStorageDriver();
+
+ /**
+ * @return the swapLimit
+ */
+ boolean isSwapLimit();
+
+ /**
+ * @return the apiVersion
+ */
+ String getApiVersion();
+
+ /**
+ * @return the gitCommit
+ */
+ String getGitCommit();
+
+ /**
+ * @return the os
+ */
+ String getOs();
+
+ /**
+ * @return the version
+ */
+ String getVersion();
+
+} \ No newline at end of file
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConnectionManagerListener.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConnectionManagerListener.java
new file mode 100644
index 0000000000..d445491cee
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerConnectionManagerListener.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+public interface IDockerConnectionManagerListener {
+
+ int ADD_EVENT = 0;
+ int REMOVE_EVENT = 1;
+ int RENAME_EVENT = 2;
+
+ public void changeEvent(int type);
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainer.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainer.java
new file mode 100644
index 0000000000..917eb5aff8
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainer.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+import java.util.List;
+
+public interface IDockerContainer {
+
+ public String id();
+
+ public String image();
+
+ public String command();
+
+ public Long created();
+
+ public String status();
+
+ public List<IDockerPortMapping> ports();
+
+ /**
+ * @return The first name of the container
+ */
+ public String name();
+
+ /**
+ * @return All the names of the container
+ */
+ public List<String> names();
+
+ public Long sizeRw();
+
+ public Long sizeRootFs();
+
+ /**
+ * @return the {@link IDockerConnection} associated with (or used to retrieve) this {@link IDockerContainer}
+ */
+ public IDockerConnection getConnection();
+
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerConfig.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerConfig.java
new file mode 100644
index 0000000000..e72a074e82
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerConfig.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+import java.util.List;
+import java.util.Set;
+
+public interface IDockerContainerConfig {
+
+ public String hostname();
+
+ public String domainname();
+
+ public String user();
+
+ public Long memory();
+
+ public Long memorySwap();
+
+ public Long cpuShares();
+
+ public String cpuset();
+
+ public Boolean attachStdin();
+
+ public Boolean attachStdout();
+
+ public Boolean attachStderr();
+
+ public List<String> portSpecs();
+
+ public Set<String> exposedPorts();
+
+ public Boolean tty();
+
+ public Boolean openStdin();
+
+ public Boolean stdinOnce();
+
+ public List<String> env();
+
+ public List<String> cmd();
+
+ public String image();
+
+ public Set<String> volumes();
+
+ public String workingDir();
+
+ public List<String> entrypoint();
+
+ public Boolean networkDisabled();
+
+ public List<String> onBuild();
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerExit.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerExit.java
new file mode 100644
index 0000000000..678868638b
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerExit.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+public interface IDockerContainerExit {
+
+ public Integer statusCode();
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerInfo.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerInfo.java
new file mode 100644
index 0000000000..7ff45624a7
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerInfo.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+public interface IDockerContainerInfo {
+
+ public String id();
+
+ public Date created();
+
+ public String path();
+
+ public List<String> args();
+
+ public IDockerContainerConfig config();
+
+ public IDockerHostConfig hostConfig();
+
+ public IDockerContainerState state();
+
+ public String image();
+
+ public IDockerNetworkSettings networkSettings();
+
+ public String resolvConfPath();
+
+ public String hostnamePath();
+
+ public String hostsPath();
+
+ public String name();
+
+ public String driver();
+
+ public String execDriver();
+
+ public String processLabel();
+
+ public String mountLabel();
+
+ public Map<String, String> volumes();
+
+ public Map<String, Boolean> volumesRW();
+
+ public boolean equals(Object o);
+
+ public int hashCode();
+
+ public String toString();
+
+} \ No newline at end of file
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerListener.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerListener.java
new file mode 100644
index 0000000000..85924a1524
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerListener.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+import java.util.List;
+
+public interface IDockerContainerListener {
+
+ /**
+ * Listener notification method
+ *
+ * @param connection
+ * - Docker connection
+ * @param list
+ * - new list of IDockerContainers
+ */
+ void listChanged(IDockerConnection connection, List<IDockerContainer> list);
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerState.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerState.java
new file mode 100644
index 0000000000..42b4f44d34
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerContainerState.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+import java.util.Date;
+
+public interface IDockerContainerState {
+
+ public Boolean running();
+
+ public Integer pid();
+
+ public Integer exitCode();
+
+ public Date startDate();
+
+ public Date finishDate();
+
+ Boolean restarting();
+
+ Boolean paused();
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerHostConfig.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerHostConfig.java
new file mode 100644
index 0000000000..5a976b95b8
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerHostConfig.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+import java.util.List;
+import java.util.Map;
+
+public interface IDockerHostConfig {
+
+ public List<String> binds();
+
+ public String containerIDFile();
+
+ public List<IDockerConfParameter> lxcConf();
+
+ public Boolean privileged();
+
+ public Map<String, List<IDockerPortBinding>> portBindings();
+
+ public List<String> links();
+
+ public Boolean publishAllPorts();
+
+ public List<String> dns();
+
+ public List<String> dnsSearch();
+
+ public List<String> volumesFrom();
+
+ public String networkMode();
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerImage.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerImage.java
new file mode 100644
index 0000000000..066fea7e5a
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerImage.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+import java.util.List;
+
+public interface IDockerImage {
+
+ public String created();
+
+ public String createdDate();
+
+ public String id();
+
+ public String parentId();
+
+ public List<String> repoTags();
+
+ public String repo();
+
+ public List<String> tags();
+
+ public Long size();
+
+ public Long virtualSize();
+
+ /**
+ * @return {@code true} is this is an intermediate image, i.e., it is the
+ * parent of another image and it is not tagged (no repo/tag).
+ */
+ public boolean isIntermediateImage();
+
+ /**
+ * @return {@code true} is this is a top-level image, i.e., it is not the
+ * parent of another image, but it has no repo/tag (they were
+ * removed when another image was built).
+ */
+ public boolean isDangling();
+
+ /**
+ * @return the {@link IDockerConnection} associated with (or used to retrieve) this {@link IDockerImage}
+ */
+ public IDockerConnection getConnection();
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerImageInfo.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerImageInfo.java
new file mode 100644
index 0000000000..8baeed0de3
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerImageInfo.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+import java.util.Date;
+
+public interface IDockerImageInfo {
+
+ public String id();
+
+ public String parent();
+
+ public String comment();
+
+ public Date created();
+
+ public String container();
+
+ public IDockerContainerConfig containerConfig();
+
+ public String dockerVersion();
+
+ public String author();
+
+ public IDockerContainerConfig config();
+
+ public String architecture();
+
+ public String os();
+
+ public Long size();
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerImageListener.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerImageListener.java
new file mode 100644
index 0000000000..d1195a3b5b
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerImageListener.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+import java.util.List;
+
+public interface IDockerImageListener {
+
+ void listChanged(IDockerConnection manager, List<IDockerImage> list);
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerNetworkSettings.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerNetworkSettings.java
new file mode 100644
index 0000000000..4c994f2c0e
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerNetworkSettings.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.docker.core;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author xcoulon
+ *
+ */
+public interface IDockerNetworkSettings {
+
+ String bridge();
+
+ String gateway();
+
+ String ipAddress();
+
+ Integer ipPrefixLen();
+
+ Map<String, Map<String, String>> portMapping();
+
+ Map<String, List<IDockerPortBinding>> ports();
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerPortBinding.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerPortBinding.java
new file mode 100644
index 0000000000..eaec3e9cbe
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerPortBinding.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+public interface IDockerPortBinding {
+
+ public String hostIp();
+
+ public String hostPort();
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerPortMapping.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerPortMapping.java
new file mode 100644
index 0000000000..eb7919f9b9
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerPortMapping.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.docker.core;
+
+/**
+ * Port mapping for {@link IDockerContainer}
+ *
+ */
+public interface IDockerPortMapping {
+
+ public int getPrivatePort();
+
+ public int getPublicPort();
+
+ public String getType();
+
+ public String getIp();
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerProgressDetail.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerProgressDetail.java
new file mode 100644
index 0000000000..a84e14f2dc
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerProgressDetail.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+public interface IDockerProgressDetail {
+
+ public long current();
+
+ public long start();
+
+ public long total();
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerProgressHandler.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerProgressHandler.java
new file mode 100644
index 0000000000..c6741d4ddb
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerProgressHandler.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+public interface IDockerProgressHandler {
+
+ public void processMessage(IDockerProgressMessage message)
+ throws DockerException;
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerProgressMessage.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerProgressMessage.java
new file mode 100644
index 0000000000..d66a9c788b
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IDockerProgressMessage.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+public interface IDockerProgressMessage {
+ public String id();
+
+ public String status();
+
+ public String stream();
+
+ public String error();
+
+ public String progress();
+
+ public IDockerProgressDetail progressDetail();
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IFieldMatcher.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IFieldMatcher.java
new file mode 100644
index 0000000000..40eda3ae9f
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/IFieldMatcher.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+public interface IFieldMatcher {
+
+ public boolean matches(String input);
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/ILogger.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/ILogger.java
new file mode 100644
index 0000000000..89129a671a
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/ILogger.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+import java.io.OutputStream;
+
+public interface ILogger {
+
+ /**
+ * Set the output stream for the logger to use.
+ *
+ * @param stream
+ * - output stream
+ */
+ public void setOutputStream(OutputStream stream);
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/Messages.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/Messages.java
new file mode 100644
index 0000000000..3412796595
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/Messages.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.core;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+
+ public static String Default_Name;
+ public static String Image_Not_Found_Header;
+ public static String Image_Pull_Failed_Header;
+ public static String Image_Push_Failed_Header;
+ public static String Image_Build_Failed_Header;
+ public static String Up_specifier;
+ public static String Exited_specifier;
+ public static String Running_specifier;
+ public static String Paused_specifier;
+ public static String Missing_Default_Settings;
+ public static String Missing_Settings;
+ public static String Retrieve_Default_Settings_Failure;
+ public static String Open_Connection_Failure;
+ public static String Docker_Daemon_Ping_Failure;
+ public static String Retrieve_Docker_Certificates_Failure;
+ public static String List_Docker_Containers_Failure;
+ public static String Docker_General_Info_Failure;
+
+ static {
+ // Initialize resource bundle.
+ NLS.initializeMessages(Messages.class.getName(), Messages.class);
+ }
+
+ private Messages() {
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/Messages.properties b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/Messages.properties
new file mode 100644
index 0000000000..72323a1aa6
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/docker/core/Messages.properties
@@ -0,0 +1,27 @@
+#################################################################################
+# Copyright (c) 2014, 2015 Red Hat.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat - Initial Contribution
+#################################################################################
+Default_Name=Default Local
+Image_Not_Found_Header=Image not found:
+Image_Pull_Failed_Header=Image pull failed:
+Image_Push_Failed_Header=Image push failed:
+Image_Build_Failed_Header=Image build failed:
+Exited_specifier=Exited
+Up_specifier=Up
+Paused_specifier=Paused
+Running_specifier=Running
+Missing_Default_Settings=Could not find default settings to connect to a local Docker daemon
+Missing_Settings=Unable to open a new client to the Docker daemon: missing configuration
+Retrieve_Default_Settings_Failure=Failed to retrieve default connection settings
+Open_Connection_Failure=Failed to open a connection
+Docker_Daemon_Ping_Failure=Failed to ping the Docker daemon
+Retrieve_Docker_Certificates_Failure=Unable to retrieve certificates to connect to the Docker daemon
+List_Docker_Containers_Failure=Failed to load list of Docker containers from {0}
+Docker_General_Info_Failure=Failed to get Docker connection info \ No newline at end of file
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/AbstractKillableThread.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/AbstractKillableThread.java
new file mode 100644
index 0000000000..0ba60b8eb3
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/AbstractKillableThread.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.core;
+
+import java.io.IOException;
+
+public abstract class AbstractKillableThread extends Thread {
+ protected boolean kill;
+ protected boolean stop;
+ protected boolean mayInterrupt;
+
+ /**
+ * Kill this thread.
+ */
+ public void kill() {
+ kill = true;
+ // System.out.println("killing logging thread");
+ this.interrupt();
+ }
+
+ public void requestStop() {
+ stop = true;
+ }
+
+ /**
+ * Local routine to run. It will be run again on interruption if mayInterupt
+ * is TRUE.
+ *
+ * @throws InterruptedException
+ * @throws IOException
+ */
+ public abstract void execute() throws InterruptedException, IOException;
+
+ @Override
+ public void run() {
+ boolean finished = false;
+ while (!finished) {
+ try {
+ execute();
+ finished = true;
+ } catch (InterruptedException e) {
+ if (kill || !mayInterrupt)
+ finished = true;
+ // otherwise..continue
+ } catch (IOException e) {
+ finished = true;
+ // failed to close output stream..just ignore
+ }
+ }
+ // System.out.println("thread complete");
+ }
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConfParameter.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConfParameter.java
new file mode 100644
index 0000000000..df27ddef2d
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConfParameter.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.core;
+
+import org.eclipse.linuxtools.docker.core.IDockerConfParameter;
+
+import com.spotify.docker.client.messages.HostConfig.LxcConfParameter;
+
+public class DockerConfParameter implements IDockerConfParameter {
+
+ private final String key;
+ private final String value;
+
+ public DockerConfParameter(final LxcConfParameter confParameter) {
+ this.key = confParameter.key();
+ this.value = confParameter.value();
+ }
+
+ @Override
+ public String key() {
+ return key;
+ }
+
+ @Override
+ public String value() {
+ return value;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+
+ if (this == obj)
+ return true;
+
+ if (obj == null || this.getClass() != obj.getClass())
+ return false;
+
+ IDockerConfParameter that = (IDockerConfParameter) obj;
+
+ if (this.key != null) {
+ if (!this.key.equals(that.key()))
+ return false;
+ } else if (that.key() != null)
+ return false;
+
+ if (this.value != null) {
+ if (!this.value.equals(that.value()))
+ return false;
+ } else if (that.value() != null)
+ return false;
+
+ return true;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java
new file mode 100644
index 0000000000..31a92a9b58
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java
@@ -0,0 +1,1539 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.core;
+
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.BINDING_MODE;
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.TCP_CERT_PATH;
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.TCP_CONNECTION;
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.TCP_HOST;
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.TCP_TLS_VERIFY;
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.UNIX_SOCKET;
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.UNIX_SOCKET_PATH;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.nio.ByteBuffer;
+import java.nio.channels.WritableByteChannel;
+import java.nio.file.FileSystems;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Properties;
+import java.util.Set;
+
+import jnr.unixsocket.UnixSocketAddress;
+import jnr.unixsocket.UnixSocketChannel;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.equinox.security.storage.EncodingUtils;
+import org.eclipse.equinox.security.storage.ISecurePreferences;
+import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
+import org.eclipse.equinox.security.storage.StorageException;
+import org.eclipse.linuxtools.docker.core.Activator;
+import org.eclipse.linuxtools.docker.core.DockerConnectionManager;
+import org.eclipse.linuxtools.docker.core.DockerContainerNotFoundException;
+import org.eclipse.linuxtools.docker.core.DockerException;
+import org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings;
+import org.eclipse.linuxtools.docker.core.EnumDockerLoggingStatus;
+import org.eclipse.linuxtools.docker.core.IDockerConfParameter;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerConnectionInfo;
+import org.eclipse.linuxtools.docker.core.IDockerContainer;
+import org.eclipse.linuxtools.docker.core.IDockerContainerConfig;
+import org.eclipse.linuxtools.docker.core.IDockerContainerExit;
+import org.eclipse.linuxtools.docker.core.IDockerContainerInfo;
+import org.eclipse.linuxtools.docker.core.IDockerContainerListener;
+import org.eclipse.linuxtools.docker.core.IDockerHostConfig;
+import org.eclipse.linuxtools.docker.core.IDockerImage;
+import org.eclipse.linuxtools.docker.core.IDockerImageInfo;
+import org.eclipse.linuxtools.docker.core.IDockerImageListener;
+import org.eclipse.linuxtools.docker.core.IDockerPortBinding;
+import org.eclipse.linuxtools.docker.core.IDockerPortMapping;
+import org.eclipse.linuxtools.docker.core.IDockerProgressHandler;
+import org.eclipse.linuxtools.docker.core.ILogger;
+import org.eclipse.linuxtools.docker.core.Messages;
+
+import com.spotify.docker.client.ContainerNotFoundException;
+import com.spotify.docker.client.DefaultDockerClient;
+import com.spotify.docker.client.DockerCertificateException;
+import com.spotify.docker.client.DockerCertificates;
+import com.spotify.docker.client.DockerClient;
+import com.spotify.docker.client.DockerClient.AttachParameter;
+import com.spotify.docker.client.DockerClient.BuildParameter;
+import com.spotify.docker.client.DockerClient.LogsParameter;
+import com.spotify.docker.client.LogStream;
+import com.spotify.docker.client.messages.Container;
+import com.spotify.docker.client.messages.ContainerConfig;
+import com.spotify.docker.client.messages.ContainerCreation;
+import com.spotify.docker.client.messages.ContainerExit;
+import com.spotify.docker.client.messages.ContainerInfo;
+import com.spotify.docker.client.messages.HostConfig;
+import com.spotify.docker.client.messages.HostConfig.LxcConfParameter;
+import com.spotify.docker.client.messages.Image;
+import com.spotify.docker.client.messages.ImageInfo;
+import com.spotify.docker.client.messages.Info;
+import com.spotify.docker.client.messages.PortBinding;
+import com.spotify.docker.client.messages.Version;
+
+/**
+ * A connection to a Docker daemon. The connection may rely on Unix Socket or TCP connection (using the REST API).
+ * All low-level communication is delegated to a wrapped {@link DockerClient}.
+ *
+ *
+ */
+public class DockerConnection implements IDockerConnection {
+
+ public static class Defaults {
+
+ public static final String DEFAULT_UNIX_SOCKET_PATH = "unix:///var/run/docker.sock";
+
+ private String name = Messages.Default_Name;
+ private final Map<EnumDockerConnectionSettings, Object> settings = new HashMap<>();
+
+ public Defaults() throws DockerException {
+ // first, looking for a Unix socket at /var/run/docker.sock
+ if (defaultsWithUnixSocket() || defaultsWithSystemEnv()
+ || defaultWithShellEnv()) {
+ // attempt to connect and retrieve the 'name' from the system
+ // info
+ final DockerConnection connection = new Builder()
+ .unixSocket(getUnixSocketPath()).tcpHost(getTcpHost())
+ .tcpCertPath(getTcpCertPath()).build();
+ connection.open(false);
+ final IDockerConnectionInfo info = connection.getInfo();
+ if (info != null) {
+ this.name = info.getName();
+ }
+ return;
+ }
+ Activator.log(new Status(IStatus.WARNING, Activator.PLUGIN_ID,
+ Messages.Missing_Default_Settings));
+ }
+
+ /**
+ * Checks if there is a Unix socket available at the given location
+ *
+ * @return {@code true} if the Unix socket exists and is readable,
+ * {@code false} otherwise.
+ */
+ private boolean defaultsWithUnixSocket() {
+ final File unixSocketFile = new File("/var/run/docker.sock");
+ if (unixSocketFile.exists() && unixSocketFile.canRead()) {
+ try {
+ final UnixSocketAddress address = new UnixSocketAddress(
+ unixSocketFile);
+ final UnixSocketChannel channel = UnixSocketChannel
+ .open(address);
+ // assume socket works
+ channel.close();
+ settings.put(BINDING_MODE, UNIX_SOCKET);
+ // putting the full URI with the unix:// scheme here
+ settings.put(UNIX_SOCKET_PATH, DEFAULT_UNIX_SOCKET_PATH);
+ return true;
+ } catch (IOException e) {
+ // do nothing, just assume socket did not work.
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Checks if there are DOCKER_xxx environment variables
+ *
+ * @return {@code true} if the env variables exist and is readable,
+ * {@code false} otherwise.
+ */
+ private boolean defaultsWithSystemEnv() {
+ final String dockerHostEnv = System.getenv("DOCKER_HOST");
+ if (dockerHostEnv != null) {
+ settings.put(BINDING_MODE, TCP_CONNECTION);
+ settings.put(TCP_HOST, dockerHostEnv);
+ final String tlsVerifyEnv = System.getenv("DOCKER_TLS_VERIFY");
+ if (tlsVerifyEnv != null && tlsVerifyEnv.equals("1")) {
+ settings.put(TCP_TLS_VERIFY, Boolean.TRUE);
+ final String dockerCertPathEnv = System
+ .getenv("DOCKER_CERT_PATH");
+ if (dockerCertPathEnv != null) {
+ settings.put(TCP_CERT_PATH, dockerCertPathEnv);
+ }
+ } else {
+ settings.put(TCP_TLS_VERIFY, Boolean.FALSE);
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Checks if there are DOCKER_xxx environment variables when running a
+ * script in a shell. The expected varibles are written in a file that
+ * can be read later.
+ *
+ * @return {@code true} if the env variables exist and is readable,
+ * {@code false} otherwise.
+ * @throws DockerException
+ */
+ private boolean defaultWithShellEnv() throws DockerException {
+ try {
+ // FIXME need to verify the OS and decide which script to run
+ final URL scriptURL = FileLocator.resolve(FileLocator.find(
+ Activator.getDefault().getBundle(), new Path(
+ "resources/script.sh"), Collections.EMPTY_MAP));
+ final Process process = Runtime.getRuntime().exec(
+ scriptURL.getPath());
+ process.waitFor();
+ if (process.exitValue() == 0) {
+ final InputStream processInputStream = process
+ .getInputStream();
+ // read content from temp file
+ Properties dockerSettings = new Properties();
+ dockerSettings.load(processInputStream);
+ settings.put(BINDING_MODE, TCP_CONNECTION);
+ if (dockerSettings.containsKey("DOCKER_HOST")) {
+ settings.put(TCP_HOST, dockerSettings
+ .get("DOCKER_HOST").toString());
+ }
+ if (dockerSettings.containsKey("DOCKER_CERT_PATH")) {
+ settings.put(TCP_CERT_PATH,
+ dockerSettings.get("DOCKER_CERT_PATH")
+ .toString());
+ }
+ if (dockerSettings.containsKey("DOCKER_TLS_VERIFY")) {
+ settings.put(
+ TCP_TLS_VERIFY,
+ Boolean.valueOf(dockerSettings
+ .get("DOCKER_TLS_VERIFY").toString()
+ .equals("1")));
+ }
+ return true;
+ } else {
+ // log what happened if the process did not end as expected
+ final InputStream processErrorStream = process
+ .getErrorStream();
+ final String errorMessage = streamToString(processErrorStream);
+ Activator.log(new Status(IStatus.ERROR,
+ Activator.PLUGIN_ID, errorMessage));
+ }
+ } catch (IOException | InterruptedException e) {
+ throw new DockerException(Messages.Retrieve_Default_Settings_Failure, e);
+ }
+ return false;
+ }
+
+ private String streamToString(InputStream stream) {
+ BufferedReader buff = new BufferedReader(new InputStreamReader(
+ stream));
+ StringBuffer res = new StringBuffer();
+ String line = "";
+ try {
+ while ((line = buff.readLine()) != null) {
+ res.append(System.getProperty("line.separator"));
+ res.append(line);
+ }
+ buff.close();
+ } catch (IOException e) {
+ }
+ return res.length() > 0 ? res.substring(1) : "";
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return the default binding mode that was found, or UNIX_SOCKET if
+ * the property was not was not found.
+ */
+ public EnumDockerConnectionSettings getBindingMode() {
+ if (settings.containsKey(BINDING_MODE)) {
+ return (EnumDockerConnectionSettings) settings
+ .get(BINDING_MODE);
+ }
+ return UNIX_SOCKET;
+ }
+
+ /**
+ * @return the path to the Unix socket, or {@code null} if if the
+ * property was not was not found.
+ */
+ public String getUnixSocketPath() {
+ return (String) settings.get(UNIX_SOCKET_PATH);
+ }
+
+ /**
+ * @return the TCP host, or {@code null} if none was found.
+ */
+ public String getTcpHost() {
+ return (String) settings.get(TCP_HOST);
+ }
+
+ /**
+ * @return the TLS_VERIFY {@link Boolean} flag, or {@code false} if the
+ * property was not was not found.
+ */
+ public boolean getTcpTlsVerify() {
+ if (settings.containsKey(TCP_TLS_VERIFY)) {
+ return (Boolean) settings.get(TCP_TLS_VERIFY);
+ }
+ return false;
+ }
+
+ /**
+ * @return the path to the TCP certificates, or {@code null} if the
+ * property was not was found.
+ */
+ public String getTcpCertPath() {
+ return (String) settings.get(TCP_CERT_PATH);
+ }
+
+ }
+
+ // Builder allowing different binding modes (unix socket vs TCP connection)
+ public static class Builder {
+
+ private String unixSocketPath;
+ private String name;
+ private String tcpHost;
+ private String tcpCertPath;
+
+ public Builder name(final String name) {
+ this.name = name;
+ return this;
+
+ }
+
+ public Builder unixSocket(String unixSocketPath) {
+ try {
+ if (unixSocketPath != null
+ && new URI(unixSocketPath).getScheme() == null) {
+ unixSocketPath = "unix://" + unixSocketPath;
+ }
+ } catch (URISyntaxException e) {
+ }
+ this.unixSocketPath = unixSocketPath;
+ return this;
+ }
+
+ public Builder tcpHost(String tcpHost) {
+ try {
+ if (tcpHost != null) {
+ if (new URI(tcpHost).getScheme() == null) {
+ tcpHost = "tcp://" + tcpHost;
+ }
+ this.tcpHost = tcpHost.replace("tcp://", "http://");
+ }
+ } catch (URISyntaxException e) {
+ }
+ return this;
+ }
+
+ public Builder tcpCertPath(final String tcpCertPath) {
+ this.tcpCertPath = tcpCertPath;
+ if (tcpCertPath != null) {
+ this.tcpHost = tcpHost.replace("http://", "https://");
+ }
+ return this;
+ }
+
+ public DockerConnection build() {
+ if (unixSocketPath != null) {
+ return new DockerConnection(name, unixSocketPath, null, null);
+ } else {
+ return new DockerConnection(name, tcpHost, tcpCertPath, null,
+ null);
+
+ }
+ }
+ }
+
+ private final String name;
+ private final String socketPath;
+ private final String tcpHost;
+ private final String tcpCertPath;
+ private final String username;
+ private final Object imageLock = new Object();
+ private final Object containerLock = new Object();
+ private final Object actionLock = new Object();
+ private DefaultDockerClient client;
+
+ private Map<String, Job> actionJobs;
+
+ private Map<String, LogThread> loggingThreads = new HashMap<String, LogThread>();
+
+ // private Set<String> printIds = new HashSet<String>();
+
+ private List<IDockerContainer> containers;
+ private boolean containersLoaded = false;
+ private List<IDockerImage> images;
+ private boolean imagesLoaded = false;
+
+ ListenerList containerListeners;
+ ListenerList imageListeners;
+
+ /**
+ * Constructor for a unix socket based connection
+ */
+ private DockerConnection(final String name, final String socketPath,
+ final String username, final String password) {
+ this.name = name;
+ this.socketPath = socketPath;
+ this.username = username;
+ this.tcpHost = null;
+ this.tcpCertPath = null;
+ storePassword(socketPath, username, password);
+
+ }
+
+ /**
+ * Constructor for a REST-based connection
+ */
+ private DockerConnection(final String name, final String tcpHost,
+ final String tcpCertPath, final String username,
+ final String password) {
+ this.name = name;
+ this.socketPath = null;
+ this.username = username;
+ this.tcpHost = tcpHost;
+ this.tcpCertPath = tcpCertPath;
+ storePassword(socketPath, username, password);
+ // Add the container refresh manager to watch the containers list
+ DockerContainerRefreshManager dcrm = DockerContainerRefreshManager
+ .getInstance();
+ addContainerListener(dcrm);
+ }
+
+ private void storePassword(String uri, String username, String passwd) {
+ ISecurePreferences root = SecurePreferencesFactory.getDefault();
+ String key = DockerConnection.getPreferencesKey(uri, username);
+ ISecurePreferences node = root.node(key);
+ try {
+ if (passwd != null && !passwd.equals("")) //$NON-NLS-1$
+ node.put("password", passwd, true /* encrypt */);
+ } catch (StorageException e) {
+ Activator.log(e);
+ }
+ }
+
+ public static String getPreferencesKey(String uri, String username) {
+ String key = "/org/eclipse/linuxtools/docker/core/"; //$NON-NLS-1$
+ key += uri + "/" + username; //$NON-NLS-1$
+ return EncodingUtils.encodeSlashes(key);
+ }
+
+ @Override
+ public boolean isOpen() {
+ return this.client != null;
+ }
+
+ @Override
+ public void open(boolean registerContainerRefreshManager)
+ throws DockerException {
+ // synchronized block to avoid concurrent attempts to open a connection
+ // to the same Docker daemon
+ synchronized (this) {
+ try {
+ if (this.client == null) {
+ if (this.socketPath != null) {
+ this.client = DefaultDockerClient.builder()
+ .uri(socketPath).build();
+ } else if (this.tcpHost != null) {
+ if (this.tcpCertPath != null) {
+ this.client = DefaultDockerClient
+ .builder()
+ .uri(URI.create(tcpHost))
+ .dockerCertificates(
+ new DockerCertificates(new File(
+ tcpCertPath).toPath()))
+ .build();
+ } else {
+ this.client = DefaultDockerClient.builder()
+ .uri(URI.create(tcpHost)).build();
+ }
+ }
+ if (registerContainerRefreshManager) {
+ // Add the container refresh manager to watch the
+ // containers
+ // list
+ DockerContainerRefreshManager dcrm = DockerContainerRefreshManager
+ .getInstance();
+ addContainerListener(dcrm);
+ }
+ }
+ } catch (Exception e) {
+ throw new DockerException(Messages.Open_Connection_Failure, e);
+ }
+ }
+ }
+
+ @Override
+ public void ping() throws DockerException {
+ try {
+ client.ping();
+ } catch (com.spotify.docker.client.DockerException
+ | InterruptedException e) {
+ throw new DockerException(Messages.Docker_Daemon_Ping_Failure, e);
+ }
+ }
+
+ @Override
+ public void close() {
+ if (client != null) {
+ this.client.close();
+ this.client = null;
+ }
+
+ }
+
+ @Override
+ public IDockerConnectionInfo getInfo() throws DockerException {
+ try {
+ final Info info = client.info();
+ final Version version = client.version();
+ return new DockerConnectionInfo(info, version);
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ throw new DockerException(e.message());
+ } catch (com.spotify.docker.client.DockerException | InterruptedException e) {
+ throw new DockerException(Messages.Docker_General_Info_Failure, e);
+ }
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public String getUri() {
+ return this.socketPath != null ? this.socketPath : this.tcpHost;
+ }
+
+ @Override
+ public String getUsername() {
+ return username;
+ }
+
+ @Override
+ public void addContainerListener(IDockerContainerListener listener) {
+ if (containerListeners == null)
+ containerListeners = new ListenerList(ListenerList.IDENTITY);
+ containerListeners.add(listener);
+ }
+
+ @Override
+ public void removeContainerListener(IDockerContainerListener listener) {
+ if (containerListeners != null)
+ containerListeners.remove(listener);
+ }
+
+ /**
+ * Get a copy of the client to use in parallel threads for long-standing
+ * operations such as logging or waiting until finished. The user of the
+ * copy should close it when the operation is complete.
+ *
+ * @return copy of client
+ * @throws DockerException
+ * @throws DockerCertificateException
+ * @see DockerConnection#open(boolean)
+ */
+ private DockerClient getClientCopy() throws DockerException {
+ if (this.socketPath != null) {
+ return DefaultDockerClient.builder().uri(socketPath).build();
+ } else if (this.tcpHost != null) {
+ if (this.tcpCertPath != null) {
+ try {
+ return DefaultDockerClient
+ .builder()
+ .uri(URI.create(tcpHost))
+ .dockerCertificates(
+ new DockerCertificates(
+ new File(tcpCertPath).toPath()))
+ .build();
+ } catch (DockerCertificateException e) {
+ throw new DockerException(Messages.Retrieve_Docker_Certificates_Failure, e);
+ }
+ } else {
+ return DefaultDockerClient.builder().uri(URI.create(tcpHost))
+ .build();
+ }
+ }
+ throw new DockerException(Messages.Missing_Settings);
+
+ }
+
+ public void notifyContainerListeners(DockerConnection manager,
+ List<IDockerContainer> list) {
+ if (containerListeners != null) {
+ Object[] listeners = containerListeners.getListeners();
+ for (int i = 0; i < listeners.length; ++i) {
+ ((IDockerContainerListener) listeners[i]).listChanged(this,
+ list);
+ }
+ }
+ }
+
+ public Job getActionJob(String id) {
+ synchronized (actionLock) {
+ Job j = null;
+ if (actionJobs != null) {
+ return actionJobs.get(id);
+ }
+ return j;
+ }
+ }
+
+ public void registerActionJob(String id, Job j) {
+ synchronized (actionLock) {
+ if (actionJobs == null)
+ actionJobs = new HashMap<String, Job>();
+ actionJobs.put(id, j);
+ }
+ }
+
+ public void removeActionJob(String id, Job j) {
+ synchronized (actionLock) {
+ if (actionJobs != null && actionJobs.get(id) == j)
+ actionJobs.remove(id);
+ }
+ }
+
+ @Override
+ public List<IDockerContainer> getContainers() {
+ return getContainers(false);
+ }
+
+ @Override
+ public List<IDockerContainer> getContainers(final boolean force) {
+ List<IDockerContainer> latestContainers;
+ synchronized (containerLock) {
+ latestContainers = this.containers;
+ }
+ if (!isContainersLoaded() || force) {
+ try {
+ latestContainers = listContainers();
+ } catch (DockerException e) {
+ synchronized (containerLock) {
+ this.containers = Collections.emptyList();
+ }
+ Activator.log(e);
+ } finally {
+ this.containersLoaded = true;
+ }
+ }
+ return latestContainers;
+ }
+
+ @Override
+ public boolean isContainersLoaded() {
+ return containersLoaded;
+ }
+
+ /**
+ * Class to perform logging of a container run to a given output stream
+ * (usually a console stream).
+ *
+ */
+ private class LogThread extends AbstractKillableThread implements ILogger {
+ private String id;
+ private DockerClient copyClient;
+ private OutputStream outputStream;
+ private boolean follow;
+
+ public LogThread(String id, DockerClient copyClient, boolean follow) {
+ this.id = id;
+ this.copyClient = copyClient;
+ this.follow = follow;
+ }
+
+ @Override
+ public LogThread clone() {
+ return new LogThread(id, copyClient, follow);
+ }
+
+ public void setOutputStream(OutputStream stream) {
+ outputStream = stream;
+ }
+
+ public void execute() throws InterruptedException, IOException {
+ try {
+ // Add timestamps to log based on user preference
+ IEclipsePreferences preferences = InstanceScope.INSTANCE
+ .getNode("org.eclipse.linuxtools.docker.ui"); //$NON-NLS-1$
+
+ boolean timestamps = preferences.getBoolean(
+ "logTimestamp", true); //$NON-NLS-1$
+
+ LogStream stream = null;
+
+ if (timestamps)
+ stream = copyClient.logs(id, LogsParameter.FOLLOW,
+ LogsParameter.STDOUT, LogsParameter.STDERR,
+ LogsParameter.TIMESTAMPS);
+ else
+ stream = copyClient.logs(id, LogsParameter.FOLLOW,
+ LogsParameter.STDOUT, LogsParameter.STDERR);
+
+ // First time through, don't sleep before showing log data
+ int delayTime = 100;
+
+ do {
+ Thread.sleep(delayTime);
+ // Second time in loop and following, pause a second to
+ // allow other threads to do meaningful work
+ delayTime = 1000;
+ while (stream.hasNext()) {
+ ByteBuffer b = stream.next().content();
+ byte[] bytes = new byte[b.remaining()];
+ b.get(bytes);
+ if (outputStream != null)
+ outputStream.write(bytes);
+ }
+ } while (follow && !stop);
+ listContainers();
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ Activator.logErrorMessage(e.message());
+ throw new InterruptedException();
+ } catch (com.spotify.docker.client.DockerException | IOException e) {
+ Activator.logErrorMessage(e.getMessage());
+ throw new InterruptedException();
+ } catch (Exception e) {
+ Activator.logErrorMessage(e.getMessage());
+ } finally {
+ follow = false;
+ copyClient.close(); // we are done with copyClient..dispose
+ outputStream.close();
+ }
+ }
+ }
+
+ private List<IDockerContainer> listContainers() throws DockerException {
+ final List<IDockerContainer> dclist = new ArrayList<IDockerContainer>();
+ synchronized (containerLock) {
+ List<Container> list = null;
+ try {
+ list = client.listContainers(DockerClient.ListContainersParam
+ .allContainers());
+ } catch (com.spotify.docker.client.DockerException
+ | InterruptedException e) {
+ throw new DockerException(Messages.bind(
+ Messages.List_Docker_Containers_Failure,
+ this.getName()), e);
+ }
+
+ // We have a list of containers. Now, we translate them to our own
+ // core format in case we decide to change the underlying engine
+ // in the future.
+ for (Container c : list) {
+ final List<Container.PortMapping> ports = c.ports();
+ final List<IDockerPortMapping> portMappings = new ArrayList<>();
+ for (Container.PortMapping port : ports) {
+ final DockerPortMapping portMapping = new DockerPortMapping(port.getPrivatePort(), port.getPublicPort(), port.getType(), port.getIp());
+ portMappings.add(portMapping);
+ }
+ // For containers that have exited, make sure we aren't tracking
+ // them with a logging thread.
+ if (c.status().startsWith(Messages.Exited_specifier)) {
+ if (loggingThreads.containsKey(c.id())) {
+ loggingThreads.get(c.id()).requestStop();
+ loggingThreads.remove(c.id());
+ }
+ }
+ dclist.add(new DockerContainer(this, c.id(), c.image(), c
+ .command(), c.created(), c.status(), c.sizeRw(), c
+ .sizeRootFs(), portMappings, c.names()));
+ }
+ containers = dclist;
+ }
+ // perform notification outside of containerLock so we don't have a View
+ // causing a deadlock
+ notifyContainerListeners(this, dclist);
+ return dclist;
+ }
+
+ @Override
+ public IDockerContainer getContainer(String id) {
+ List<IDockerContainer> containers = getContainers();
+ for (IDockerContainer container : containers) {
+ if (container.id().equals(id)) {
+ return container;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public IDockerContainerInfo getContainerInfo(String id) {
+ try {
+ final ContainerInfo info = client.inspectContainer(id);
+ return new DockerContainerInfo(info);
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ Activator.logErrorMessage(e.message());
+ return null;
+ } catch (com.spotify.docker.client.DockerException
+ | InterruptedException e) {
+ Activator.log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Failed to inspect container '" + id + "'", e));
+ return null;
+ }
+ }
+
+ @Override
+ public IDockerImageInfo getImageInfo(String id) {
+ try {
+ final ImageInfo info = client.inspectImage(id);
+ return new DockerImageInfo(info);
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ Activator.logErrorMessage(e.message());
+ return null;
+ } catch (com.spotify.docker.client.DockerException
+ | InterruptedException e) {
+ Activator.log(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
+ "Failed to inspect container '" + id + "'", e));
+ return null;
+ }
+ }
+
+ @Override
+ public void addImageListener(IDockerImageListener listener) {
+ if (imageListeners == null)
+ imageListeners = new ListenerList(ListenerList.IDENTITY);
+ imageListeners.add(listener);
+ }
+
+ @Override
+ public void removeImageListener(IDockerImageListener listener) {
+ if (imageListeners != null)
+ imageListeners.remove(listener);
+ }
+
+ public void notifyImageListeners(DockerConnection manager,
+ List<IDockerImage> list) {
+ if (imageListeners != null) {
+ Object[] listeners = imageListeners.getListeners();
+ for (int i = 0; i < listeners.length; ++i) {
+ ((IDockerImageListener) listeners[i]).listChanged(this, list);
+ }
+ }
+ }
+
+ @Override
+ public List<IDockerImage> getImages() {
+ return getImages(false);
+ }
+
+ @Override
+ public List<IDockerImage> getImages(final boolean force) {
+ List<IDockerImage> latestImages;
+ synchronized (imageLock) {
+ latestImages = this.images;
+ }
+ if (!isImagesLoaded() || force) {
+ try {
+ latestImages = listImages();
+ } catch (DockerException e) {
+ synchronized (imageLock) {
+ this.images = Collections.emptyList();
+ }
+ Activator.log(e);
+ } finally {
+ this.imagesLoaded = true;
+ }
+ }
+ return latestImages;
+ }
+
+ @Override
+ public boolean isImagesLoaded() {
+ return imagesLoaded;
+ }
+
+ private List<IDockerImage> listImages() throws DockerException {
+ final List<IDockerImage> dilist = new ArrayList<IDockerImage>();
+ synchronized (imageLock) {
+ List<Image> rawImages = null;
+ try {
+ rawImages = client.listImages(DockerClient.ListImagesParam
+ .allImages());
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ throw new DockerException(e.message());
+ } catch (com.spotify.docker.client.DockerException
+ | InterruptedException e) {
+ DockerException f = new DockerException(e);
+ throw f;
+ }
+ // We have a list of images. Now, we translate them to our own
+ // core format in case we decide to change the underlying engine
+ // in the future. We also look for intermediate and dangling images.
+ final Set<String> imageParentIds = new HashSet<>();
+ for (Image rawImage : rawImages) {
+ imageParentIds.add(rawImage.parentId());
+ }
+ for (Image rawImage : rawImages) {
+ final boolean taggedImage = !(rawImage.repoTags().size() == 1 && rawImage
+ .repoTags().contains("<none>:<none>")); //$NON-NLS-1$
+ final boolean intermediateImage = !taggedImage
+ && imageParentIds.contains(rawImage.id());
+ final boolean danglingImage = !taggedImage
+ && !intermediateImage;
+ dilist.add(new DockerImage(this, (List<String>) rawImage
+ .repoTags(), rawImage.id(), rawImage.parentId(),
+ rawImage.created(), rawImage.size(), rawImage
+ .virtualSize(), intermediateImage,
+ danglingImage));
+ }
+ images = dilist;
+ }
+ // Perform notification outside of lock so that listener doesn't cause a
+ // deadlock to occur
+ notifyImageListeners(this, dilist);
+ return dilist;
+ }
+
+ @Override
+ public void pullImage(final String id, final IDockerProgressHandler handler)
+ throws DockerException, InterruptedException {
+ try {
+ DockerProgressHandler d = new DockerProgressHandler(handler);
+ client.pull(id, d);
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ throw new DockerException(e.message());
+ } catch (com.spotify.docker.client.DockerException e) {
+ DockerException f = new DockerException(e);
+ throw f;
+ }
+ }
+
+ @Override
+ public void pushImage(final String name, final IDockerProgressHandler handler)
+ throws DockerException, InterruptedException {
+ try {
+ DockerProgressHandler d = new DockerProgressHandler(handler);
+ client.push(name, d);
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ throw new DockerException(e.message());
+ } catch (com.spotify.docker.client.DockerException e) {
+ DockerException f = new DockerException(e);
+ throw f;
+ }
+ }
+
+ @Override
+ public void removeImage(final String name) throws DockerException,
+ InterruptedException {
+ try {
+ client.removeImage(name, true, false);
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ throw new DockerException(e.message());
+ } catch (com.spotify.docker.client.DockerException e) {
+ DockerException f = new DockerException(e);
+ throw f;
+ }
+ }
+
+ @Override
+ public void removeTag(final String tag) throws DockerException,
+ InterruptedException {
+ try {
+ client.removeImage(tag, false, false);
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ throw new DockerException(e.message());
+ } catch (com.spotify.docker.client.DockerException e) {
+ DockerException f = new DockerException(e);
+ throw f;
+ }
+ }
+
+ @Override
+ public void tagImage(final String name, final String newTag) throws DockerException,
+ InterruptedException {
+ try {
+ client.tag(name, newTag);
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ throw new DockerException(e.message());
+ } catch (com.spotify.docker.client.DockerException e) {
+ DockerException f = new DockerException(e);
+ throw f;
+ }
+ }
+
+ @Override
+ public String buildImage(final IPath path, final String name,
+ final IDockerProgressHandler handler) throws DockerException,
+ InterruptedException {
+ try {
+ DockerProgressHandler d = new DockerProgressHandler(handler);
+ java.nio.file.Path p = FileSystems.getDefault().getPath(
+ path.makeAbsolute().toOSString());
+ return client.build(p, name, d, BuildParameter.FORCE_RM);
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ throw new DockerException(e.message());
+ } catch (com.spotify.docker.client.DockerException | IOException e) {
+ DockerException f = new DockerException(e);
+ throw f;
+ }
+ }
+
+ public void save() {
+ // Currently we have to save all clouds instead of just this one
+ DockerConnectionManager.getInstance().saveConnections();
+ }
+
+ @Override
+ public String createContainer(final IDockerContainerConfig c)
+ throws DockerException, InterruptedException {
+ ContainerConfig.Builder builder = ContainerConfig.builder()
+ .hostname(c.hostname()).domainname(c.domainname())
+ .user(c.user()).memory(c.memory()).memorySwap(c.memorySwap())
+ .cpuShares(c.cpuShares()).cpuset(c.cpuset())
+ .attachStdin(c.attachStdin()).attachStdout(c.attachStdout())
+ .attachStderr(c.attachStderr()).tty(c.tty())
+ .openStdin(c.openStdin()).stdinOnce(c.stdinOnce()).cmd(c.cmd())
+ .image(c.image()).workingDir(c.workingDir())
+ .networkDisabled(c.networkDisabled());
+ // For those fields that are Collections and not set, they will be null.
+ // We can't use their values to set the builder's fields as they are
+ // expecting non-null Collections to copy over. In those cases, we just
+ // don't set those fields in the builder.
+ if (c.portSpecs() != null)
+ builder = builder.portSpecs(c.portSpecs());
+ if (c.exposedPorts() != null)
+ builder = builder.exposedPorts(c.exposedPorts());
+ if (c.env() != null)
+ builder = builder.env(c.env());
+ if (c.volumes() != null)
+ builder = builder.volumes(c.volumes());
+ if (c.entrypoint() != null)
+ builder = builder.entrypoint(c.entrypoint());
+ if (c.onBuild() != null)
+ builder = builder.onBuild(c.onBuild());
+
+ final ContainerConfig config = builder.build();
+
+ try {
+ // create container with default random name
+ final ContainerCreation creation = client.createContainer(config);
+ final String id = creation.id();
+ return id;
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ throw new DockerException(e.message());
+ } catch (com.spotify.docker.client.DockerException e) {
+ DockerException f = new DockerException(e);
+ throw f;
+ }
+ }
+
+ @Override
+ public void stopContainer(final String id) throws DockerException,
+ InterruptedException {
+ try {
+ // stop container or kill after 10 seconds
+ client.stopContainer(id, 10); // allow up to 10 seconds to stop
+ synchronized (loggingThreads) {
+ if (loggingThreads.containsKey(id)) {
+ loggingThreads.get(id).kill();
+ loggingThreads.remove(id);
+ }
+ }
+ // list of containers needs to be updated once the given container is stopped, to reflect it new state.
+ listContainers();
+ } catch (ContainerNotFoundException e) {
+ throw new DockerContainerNotFoundException(e);
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ throw new DockerException(e.message());
+ } catch (com.spotify.docker.client.DockerException e) {
+ throw new DockerException(e.getMessage(), e.getCause());
+ }
+ }
+
+ @Override
+ public void killContainer(final String id) throws DockerException,
+ InterruptedException {
+ try {
+ // kill container
+ client.killContainer(id);
+ synchronized (loggingThreads) {
+ if (loggingThreads.containsKey(id)) {
+ loggingThreads.get(id).kill();
+ loggingThreads.remove(id);
+ }
+ }
+ listContainers(); // update container list
+ } catch (ContainerNotFoundException e) {
+ throw new DockerContainerNotFoundException(e);
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ throw new DockerException(e.message());
+ } catch (com.spotify.docker.client.DockerException e) {
+ throw new DockerException(e.getMessage(), e.getCause());
+ }
+ }
+
+ @Override
+ public void pauseContainer(final String id) throws DockerException,
+ InterruptedException {
+ try {
+ // pause container
+ client.pauseContainer(id);
+ listContainers(); // update container list
+ } catch (ContainerNotFoundException e) {
+ throw new DockerContainerNotFoundException(e);
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ throw new DockerException(e.message());
+ } catch (com.spotify.docker.client.DockerException e) {
+ throw new DockerException(e.getMessage(), e.getCause());
+ }
+ }
+
+ @Override
+ public void unpauseContainer(final String id, final OutputStream stream)
+ throws DockerException, InterruptedException {
+ try {
+ // unpause container
+ client.unpauseContainer(id);
+ if (stream != null) {
+ synchronized (loggingThreads) {
+ LogThread t = loggingThreads.get(id);
+ if (t == null || !t.isAlive()) {
+ t = new LogThread(id, getClientCopy(), true);
+ loggingThreads.put(id, t);
+ t.setOutputStream(stream);
+ t.start();
+ } else {
+ // we aren't going to use the stream given...close it
+ try {
+ stream.close();
+ } catch (IOException e) {
+ // do nothing...we tried to close the stream
+ }
+ }
+ }
+ }
+ listContainers(); // update container list
+ } catch (ContainerNotFoundException e) {
+ throw new DockerContainerNotFoundException(e);
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ throw new DockerException(e.message());
+ } catch (com.spotify.docker.client.DockerException e) {
+ throw new DockerException(e.getMessage(), e.getCause());
+ }
+ }
+
+ @Override
+ public void removeContainer(final String id) throws DockerException,
+ InterruptedException {
+ try {
+ // kill container
+ client.removeContainer(id);
+ listContainers(); // update container list
+ } catch (ContainerNotFoundException e) {
+ throw new DockerContainerNotFoundException(e);
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ throw new DockerException(e.message());
+ } catch (com.spotify.docker.client.DockerException e) {
+ throw new DockerException(e.getMessage(), e.getCause());
+ }
+ }
+
+ @Override
+ public void startContainer(final String id, final OutputStream stream)
+ throws DockerException, InterruptedException {
+ try {
+ // start container
+ client.startContainer(id);
+ // Log the started container if a stream is provided
+ if (stream != null && !getContainerInfo(id).config().tty()) {
+ // display logs for container
+ synchronized (loggingThreads) {
+ LogThread t = loggingThreads.get(id);
+ if (t == null || !t.isAlive()) {
+ t = new LogThread(id, getClientCopy(), true);
+ loggingThreads.put(id, t);
+ t.setOutputStream(stream);
+ t.start();
+ }
+ }
+ }
+ // list of containers needs to be refreshed once the container started, to reflect it new state.
+ listContainers();
+ } catch (ContainerNotFoundException e) {
+ throw new DockerContainerNotFoundException(e);
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ throw new DockerException(e.message());
+ } catch (com.spotify.docker.client.DockerException e) {
+ throw new DockerException(e.getMessage(), e.getCause());
+ }
+ }
+
+ @Override
+ public void startContainer(final String id, final IDockerHostConfig config,
+ OutputStream stream) throws DockerException, InterruptedException {
+ startContainer(id, id, config, stream);
+ }
+
+ @Override
+ public void startContainer(String id, String loggingId,
+ IDockerHostConfig config, OutputStream stream)
+ throws DockerException, InterruptedException {
+ try {
+ HostConfig.Builder builder = HostConfig.builder()
+ .containerIDFile(config.containerIDFile())
+ .publishAllPorts(config.publishAllPorts())
+ .privileged(config.privileged())
+ .networkMode(config.networkMode());
+ if (config.binds() != null)
+ builder.binds(config.binds());
+ if (config.dns() != null)
+ builder.dns(config.dns());
+ if (config.dnsSearch() != null)
+ builder.dnsSearch(config.dnsSearch());
+ if (config.links() != null)
+ builder.links(config.links());
+ if (config.lxcConf() != null) {
+ List<IDockerConfParameter> lxcconf = config.lxcConf();
+ ArrayList<LxcConfParameter> lxcreal = new ArrayList<LxcConfParameter>();
+ for (IDockerConfParameter param : lxcconf) {
+ lxcreal.add(new LxcConfParameter(param.key(), param.value()));
+ }
+ builder.lxcConf(lxcreal);
+ }
+ if (config.portBindings() != null) {
+ Map<String, List<IDockerPortBinding>> bindings = config
+ .portBindings();
+ HashMap<String, List<PortBinding>> realBindings = new HashMap<String, List<PortBinding>>();
+
+ for (Entry<String, List<IDockerPortBinding>> entry : bindings
+ .entrySet()) {
+ String key = entry.getKey();
+ List<IDockerPortBinding> bindingList = entry.getValue();
+ ArrayList<PortBinding> newList = new ArrayList<PortBinding>();
+ for (IDockerPortBinding binding : bindingList) {
+ newList.add(PortBinding.of(binding.hostIp(),
+ binding.hostPort()));
+ }
+ realBindings.put(key, newList);
+ }
+ builder.portBindings(realBindings);
+ }
+ if (config.volumesFrom() != null)
+ builder.volumesFrom(config.volumesFrom());
+
+ // start container with host config
+ client.startContainer(id, builder.build());
+ // Log the started container based on user preference
+ IEclipsePreferences preferences = InstanceScope.INSTANCE
+ .getNode("org.eclipse.linuxtools.docker.ui"); //$NON-NLS-1$
+
+ boolean autoLog = preferences.getBoolean("autoLogOnStart", true); //$NON-NLS-1$
+
+ if (autoLog && !getContainerInfo(id).config().tty()) {
+ // display logs for container
+ synchronized (loggingThreads) {
+ LogThread t = loggingThreads.get(loggingId);
+ if (t == null || !t.isAlive()) {
+ t = new LogThread(id, getClientCopy(), true);
+ loggingThreads.put(loggingId, t);
+ t.setOutputStream(stream);
+ t.start();
+ }
+ }
+ }
+ // update container list
+ listContainers();
+ } catch (ContainerNotFoundException e) {
+ throw new DockerContainerNotFoundException(e);
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ throw new DockerException(e.message());
+ } catch (com.spotify.docker.client.DockerException e) {
+ throw new DockerException(e);
+ }
+ }
+
+ @Override
+ public void commitContainer(final String id, final String repo, final String tag,
+ final String comment, final String author) throws DockerException {
+ ContainerInfo info;
+ try {
+ info = client.inspectContainer(id);
+ client.commitContainer(id, repo, tag, info.config(), comment,
+ author);
+ // update images list
+ getImages(true);
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ throw new DockerException(e.message());
+ } catch (com.spotify.docker.client.DockerException
+ | InterruptedException e) {
+ throw new DockerException(e.getMessage(), e.getCause());
+ }
+ }
+
+ public EnumDockerLoggingStatus loggingStatus(final String id) {
+ synchronized (loggingThreads) {
+ LogThread t = loggingThreads.get(id);
+ if (t == null)
+ return EnumDockerLoggingStatus.LOGGING_NONE;
+ if (t.isAlive())
+ return EnumDockerLoggingStatus.LOGGING_ACTIVE;
+ return EnumDockerLoggingStatus.LOGGING_COMPLETE;
+ }
+ }
+
+ @Override
+ public void stopLoggingThread(final String id) {
+ synchronized (loggingThreads) {
+ LogThread t = loggingThreads.get(id);
+ if (t != null)
+ t.requestStop();
+ }
+ }
+
+ @Override
+ public void logContainer(final String id, final OutputStream stream)
+ throws DockerException, InterruptedException {
+ try {
+ // Figure out if we are logging a running container or not
+ // Pass that info to see whether the LogThread should just terminate
+ // or keep running
+ synchronized (loggingThreads) {
+ ContainerInfo info = client.inspectContainer(id);
+ LogThread t = loggingThreads.get(id);
+ if (t == null || !t.isAlive()) {
+ t = new LogThread(id, getClientCopy(), info.state()
+ .running());
+ loggingThreads.put(id, t);
+ t.setOutputStream(stream);
+ t.start();
+ } else {
+ // we aren't going to use the stream given...close it
+ try {
+ stream.close();
+ } catch (IOException e) {
+ // do nothing...we tried to close the stream
+ }
+ }
+ }
+ } catch (ContainerNotFoundException e) {
+ throw new DockerContainerNotFoundException(e);
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ throw new DockerException(e.message());
+ } catch (com.spotify.docker.client.DockerException e) {
+ throw new DockerException(e.getMessage(), e.getCause());
+ }
+ }
+
+ public IDockerContainerExit waitForContainer(final String id)
+ throws DockerException, InterruptedException {
+ try {
+ // wait for container to exit
+ DockerClient copy = getClientCopy();
+ ContainerExit x = copy.waitContainer(id);
+ DockerContainerExit exit = new DockerContainerExit(x.statusCode());
+ listContainers(); // update container list
+ copy.close(); // dispose of copy now we are finished
+ return exit;
+ } catch (ContainerNotFoundException e) {
+ throw new DockerContainerNotFoundException(e);
+ } catch (com.spotify.docker.client.DockerRequestException e) {
+ throw new DockerException(e.message());
+ } catch (com.spotify.docker.client.DockerException e) {
+ throw new DockerException(e.getMessage(), e.getCause());
+ }
+ }
+
+ public WritableByteChannel attachCommand(final String id,
+ final InputStream in, final OutputStream out)
+ throws DockerException, InterruptedException {
+
+ final byte[] prevCmd = new byte[1024];
+ try {
+ final LogStream pty_stream = client.attachContainer(id,
+ AttachParameter.STDIN, AttachParameter.STDOUT,
+ AttachParameter.STDERR, AttachParameter.STREAM);
+ final boolean isTtyEnabled = getContainerInfo(id).config().tty();
+
+ // Data from the given input stream
+ // Written to container's STDIN
+ Thread t_in = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ byte[] buff = new byte[1024];
+ int n;
+ try {
+ WritableByteChannel pty_out = HttpHijackWorkaround
+ .getOutputStream(pty_stream, getUri());
+ while ((n = in.read(buff)) != -1
+ && getContainerInfo(id).state().running()) {
+ synchronized (prevCmd) {
+ pty_out.write(ByteBuffer.wrap(buff, 0, n));
+ for (int i = 0; i < prevCmd.length; i++) {
+ prevCmd[i] = buff[i];
+ }
+ }
+ buff = new byte[1024];
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ });
+
+ t_in.start();
+ // Incoming data from container's STDOUT
+ // Written to the given output stream
+ Thread t_out = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ InputStream pty_in = HttpHijackWorkaround
+ .getInputStream(pty_stream);
+ while (getContainerInfo(id).state().running()) {
+ byte[] buff = new byte[1024];
+ int n = pty_in.read(buff);
+ if (n > 0) {
+ /*
+ * The container's STDOUT contains initial input
+ * we sent to its STDIN and the result. eg. >
+ * echo once < echo once \n $ once
+ *
+ * Try to remove this unwanted data from the
+ * stream.
+ */
+ if (isTtyEnabled) {
+ int idex = 0;
+ synchronized (prevCmd) {
+ /*
+ * Check if buff contains a prefix of
+ * prevCmd ignoring differences in
+ * carriage return (10,13). Save the
+ * prefix's ending index.
+ */
+ for (int i = 0; i < prevCmd.length; i++) {
+ if (prevCmd[i] != buff[i]
+ && (prevCmd[i] != 10 && buff[i] != 13)
+ && (prevCmd[i] != 13 && buff[i] != 10)
+ && prevCmd[i] != 0) {
+ idex = 0;
+ break;
+ } else if (prevCmd[i] != 0) {
+ idex++;
+ }
+ }
+ }
+ // A prefix exists, remove it
+ // Do not include the ending NL/CR
+ if (idex != 0) {
+ shiftLeft(buff, idex + 1);
+ }
+ n = removeTerminalCodes(buff);
+ } else {
+ /*
+ * If not in TTY mode, first 8 bytes are
+ * header data describing payload which we
+ * don't need.
+ */
+ shiftLeft(buff, 8);
+ n = n - 8;
+ }
+ out.write(buff, 0, n);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ });
+
+ /*
+ * Our handling of STDOUT for terminals is mandatory, but the
+ * logging framework can handle catching output very early so use it
+ * for now.
+ */
+ if (isTtyEnabled) {
+ t_out.start();
+ }
+
+ return HttpHijackWorkaround.getOutputStream(pty_stream, getUri());
+ } catch (Exception e) {
+ throw new DockerException(e.getMessage(), e.getCause());
+ }
+ }
+
+ /*
+ * Incoming data from container's STDOUT contains terminal codes which the
+ * Eclipse Console does not support. Either we install/use some terminal
+ * plugin that does, or we need to remove these.
+ */
+ private static int removeTerminalCodes(final byte[] buff) {
+ String tmp = new String(buff);
+ byte[] tmp_buff = tmp.replaceAll("\u001B]0;.*\u0007", "")
+ .replaceAll("\u001B\\[([0-9]{1,2}(;[0-9]{1,2})?)?[mK]", "")
+ .replaceAll("\u001B\\[\\?[0-9]{1,4}h\\[", "").getBytes();
+ for (int i = 0; i < buff.length; i++) {
+ if (i >= tmp_buff.length) {
+ buff[i] = 0;
+ } else {
+ buff[i] = tmp_buff[i];
+ }
+ }
+ return getByteLength(buff);
+ }
+
+ /*
+ * Shift contents of buff[idex] .. buff[buff.length-1] to buff[0] ..
+ * buff[(buff.length-1) - idex]
+ */
+ private static void shiftLeft(byte[] buff, int idex) {
+ for (int i = 0; i < buff.length; i++) {
+ if (idex + i < buff.length) {
+ buff[i] = buff[idex + i];
+ } else {
+ buff[i] = 0;
+ }
+ }
+ }
+
+ /*
+ * Get the number of non-zero bytes from the beginning of the byte array.
+ */
+ private static int getByteLength(byte[] buff) {
+ int n;
+ for (n = 0; n < buff.length; n++) {
+ if (buff[n] == 0) {
+ break;
+ }
+ }
+ if ((n == buff.length - 1) && buff[buff.length - 1] != 0) {
+ return buff.length;
+ }
+ return n;
+ }
+
+ @Override
+ public String getTcpCertPath() {
+ return tcpCertPath;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnectionInfo.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnectionInfo.java
new file mode 100644
index 0000000000..ea77d96251
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnectionInfo.java
@@ -0,0 +1,211 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.core;
+
+import java.util.List;
+
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerConnectionInfo;
+
+import com.spotify.docker.client.messages.Info;
+import com.spotify.docker.client.messages.Version;
+
+/**
+ * Info about a given {@link IDockerConnection}
+ * @author xcoulon
+ *
+ */
+public class DockerConnectionInfo implements IDockerConnectionInfo {
+
+ private final int containers;
+ private final boolean debug;
+ private final String executionDriver;
+ private final int fileDescriptors;
+ private final int goroutines;
+ private final int images;
+ private final String initPath;
+ private final String kernelVersion;
+ private final boolean memoryLimit;
+ private final String storageDriver;
+ private final boolean swapLimit;
+ private final String apiVersion;
+ private final String gitCommit;
+ private final String os;
+ private final String version;
+ private final List<List<String>> driverStatus;
+ private final int cpuNumber;
+ private final long totalMemory;
+ private final String name;
+ private final String id;
+ private final String initSha1;
+ private final String indexServerAddress;
+ private final boolean ipv4Forwarding;
+ private final List<String> labels;
+ private final String dockerRootDir;
+
+ public DockerConnectionInfo(final Info info, final Version version) {
+ this.containers = info.containers();
+ this.debug = info.debug();
+ this.executionDriver = info.executionDriver();
+ this.fileDescriptors = info.fileDescriptors();
+ this.goroutines = info.goroutines();
+ this.images = info.images();
+ this.initPath = info.initPath();
+ this.kernelVersion = info.kernelVersion();
+ this.memoryLimit = info.memoryLimit();
+ this.storageDriver = info.storageDriver();
+ this.swapLimit = info.swapLimit();
+ this.apiVersion = version.apiVersion();
+ this.gitCommit = version.gitCommit();
+ this.os = version.os();
+ this.version = version.version();
+ this.driverStatus = info.driverStatus();
+ this.cpuNumber = info.cpus();
+ this.totalMemory = info.memTotal();
+ this.name = info.name();
+ this.id = info.id();
+ this.initSha1 = info.initSha1();
+ this.ipv4Forwarding = info.ipv4Forwarding();
+ this.indexServerAddress = info.indexServerAddress();
+ this.labels = info.labels();
+ this.dockerRootDir = info.dockerRootDir();
+
+ }
+
+ @Override
+ public boolean isMemoryLimit() {
+ return memoryLimit;
+ }
+
+ public int getContainers() {
+ return containers;
+ }
+
+ @Override
+ public boolean isDebug() {
+ return debug;
+ }
+
+ @Override
+ public String getExecutionDriver() {
+ return executionDriver;
+ }
+
+ @Override
+ public int getFileDescriptors() {
+ return fileDescriptors;
+ }
+
+ @Override
+ public int getGoroutines() {
+ return goroutines;
+ }
+
+ @Override
+ public int getImages() {
+ return images;
+ }
+
+ @Override
+ public String getInitPath() {
+ return initPath;
+ }
+
+ @Override
+ public String getKernelVersion() {
+ return kernelVersion;
+ }
+
+ @Override
+ public String getStorageDriver() {
+ return storageDriver;
+ }
+
+ @Override
+ public boolean isSwapLimit() {
+ return swapLimit;
+ }
+
+ @Override
+ public String getApiVersion() {
+ return apiVersion;
+ }
+
+ @Override
+ public String getGitCommit() {
+ return gitCommit;
+ }
+
+ @Override
+ public String getOs() {
+ return os;
+ }
+
+ @Override
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * @return the driverStatus
+ */
+ @Override
+ public List<List<String>> getDriverStatus() {
+ return driverStatus;
+ }
+
+ @Override
+ public int getCPUNumber() {
+ return cpuNumber;
+ }
+
+ @Override
+ public long getTotalMemory() {
+ return totalMemory;
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public String getInitSha1() {
+ return initSha1;
+ }
+
+ @Override
+ public String getIndexServerAddress() {
+ return indexServerAddress;
+ }
+
+ @Override
+ public boolean isIPv4Forwarding() {
+ return ipv4Forwarding;
+ }
+
+ @Override
+ public List<String> getLabels() {
+ return labels;
+ }
+
+ @Override
+ public String getDockerRootDir() {
+ return dockerRootDir;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainer.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainer.java
new file mode 100644
index 0000000000..0befc04823
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainer.java
@@ -0,0 +1,142 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.core;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.linuxtools.docker.core.IDockerContainer;
+import org.eclipse.linuxtools.docker.core.IDockerPortMapping;
+
+public class DockerContainer implements IDockerContainer {
+
+ private DockerConnection parent;
+ private String id;
+ private List<String> names;
+ private String image;
+ private String command;
+ private Long created;
+ private String status;
+ private List<IDockerPortMapping> ports;
+ private Long sizeRw;
+ private Long sizeRootFs;
+
+ public DockerContainer(DockerConnection parent, String id, String image,
+ String command, Long created, String status, Long sizeRw,
+ Long sizeRootFs, List<IDockerPortMapping> ports, List<String> names) {
+ this.parent = parent;
+ this.id = id;
+ this.image = image;
+ this.command = command;
+ this.created = created;
+ this.status = status;
+ this.names = new ArrayList<>();
+ for(String name : names) {
+ if(name.startsWith("/")) {
+ this.names.add(name.substring(1));
+ } else {
+ this.names.add(name);
+ }
+ }
+ this.sizeRw = sizeRw;
+ this.sizeRootFs = sizeRootFs;
+ this.ports = ports;
+ }
+
+ public DockerConnection getConnection() {
+ return parent;
+ }
+
+ @Override
+ public String id() {
+ return id;
+ }
+
+ @Override
+ public String image() {
+ return image;
+ }
+
+ @Override
+ public String command() {
+ return command;
+ }
+
+ @Override
+ public Long created() {
+ return created;
+ }
+
+ @Override
+ public String status() {
+ return status;
+ }
+
+ @Override
+ public Long sizeRw() {
+ return sizeRw;
+ }
+
+ @Override
+ public Long sizeRootFs() {
+ return sizeRootFs;
+ }
+
+ @Override
+ public List<IDockerPortMapping> ports() {
+ return ports;
+ }
+
+ @Override
+ public String name() {
+ return names.get(0);
+ }
+
+ @Override
+ public List<String> names() {
+ return names;
+ }
+
+ @Override
+ public String toString() {
+ return "Container: id=" + id() + "\n" + " image=" + image() + "\n"
+ + " created=" + created() + "\n" + " command=" + command()
+ + "\n" + " status=<" + status() + ">\n" + " name="
+ + name() + "\n";
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ DockerContainer other = (DockerContainer) obj;
+ if (id == null) {
+ if (other.id != null)
+ return false;
+ } else if (!id.equals(other.id))
+ return false;
+ return true;
+ }
+
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerConfig.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerConfig.java
new file mode 100644
index 0000000000..13749dbec2
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerConfig.java
@@ -0,0 +1,490 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.core;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.eclipse.linuxtools.docker.core.IDockerContainerConfig;
+
+import com.spotify.docker.client.messages.ContainerConfig;
+
+public class DockerContainerConfig implements IDockerContainerConfig {
+
+ private final String hostname;
+ private final String domainname;
+ private final String user;
+ private final Long memory;
+ private final Long memorySwap;
+ private final Long cpuShares;
+ private final String cpuset;
+ private final Boolean attachStdin;
+ private final Boolean attachStdout;
+ private final Boolean attachStderr;
+ private final List<String> portSpecs;
+ private final Set<String> exposedPorts;
+ private final Boolean tty;
+ private final Boolean openStdin;
+ private final Boolean stdinOnce;
+ private final List<String> env;
+ private final List<String> cmd;
+ private final String image;
+ private final Set<String> volumes;
+ private final String workingDir;
+ private final List<String> entrypoint;
+ private final Boolean networkDisabled;
+ private final List<String> onBuild;
+
+ public DockerContainerConfig(final ContainerConfig containerConfig) {
+ this.hostname = containerConfig.hostname();
+ this.domainname = containerConfig.domainname();
+ this.user = containerConfig.user();
+ this.memory = containerConfig.memory();
+ this.memorySwap = containerConfig.memorySwap();
+ this.cpuShares = containerConfig.cpuShares();
+ this.cpuset = containerConfig.cpuset();
+ this.attachStdin = containerConfig.attachStdin();
+ this.attachStdout = containerConfig.attachStdout();
+ this.attachStderr = containerConfig.attachStderr();
+ this.portSpecs = containerConfig.portSpecs();
+ this.exposedPorts = containerConfig.exposedPorts();
+ this.tty = containerConfig.tty();
+ this.openStdin = containerConfig.openStdin();
+ this.stdinOnce = containerConfig.stdinOnce();
+ this.env = containerConfig.env();
+ this.cmd = containerConfig.cmd();
+ this.image = containerConfig.image();
+ this.volumes = containerConfig.volumes();
+ this.workingDir = containerConfig.workingDir();
+ this.entrypoint = containerConfig.entrypoint();
+ this.networkDisabled = containerConfig.networkDisabled();
+ this.onBuild = containerConfig.onBuild();
+ }
+
+ private DockerContainerConfig(final Builder builder) {
+ this.hostname = builder.hostname;
+ this.domainname = builder.domainname;
+ this.user = builder.user;
+ this.memory = builder.memory;
+ this.memorySwap = builder.memorySwap;
+ this.cpuShares = builder.cpuShares;
+ this.cpuset = builder.cpuset;
+ this.attachStdin = builder.attachStdin;
+ this.attachStdout = builder.attachStdout;
+ this.attachStderr = builder.attachStderr;
+ this.portSpecs = builder.portSpecs;
+ this.exposedPorts = builder.exposedPorts;
+ this.tty = builder.tty;
+ this.openStdin = builder.openStdin;
+ this.stdinOnce = builder.stdinOnce;
+ this.env = builder.env;
+ this.cmd = builder.cmd;
+ this.image = builder.image;
+ this.volumes = builder.volumes;
+ this.workingDir = builder.workingDir;
+ this.entrypoint = builder.entrypoint;
+ this.networkDisabled = builder.networkDisabled;
+ this.onBuild = builder.onBuild;
+ }
+
+ @Override
+ public String hostname() {
+ return hostname;
+ }
+
+ @Override
+ public String domainname() {
+ return domainname;
+ }
+
+ @Override
+ public String user() {
+ return user;
+ }
+
+ @Override
+ public Long memory() {
+ return memory;
+ }
+
+ @Override
+ public Long memorySwap() {
+ return memorySwap;
+ }
+
+ @Override
+ public Long cpuShares() {
+ return cpuShares;
+ }
+
+ @Override
+ public String cpuset() {
+ return cpuset;
+ }
+
+ @Override
+ public Boolean attachStdin() {
+ return attachStdin;
+ }
+
+ @Override
+ public Boolean attachStdout() {
+ return attachStdout;
+ }
+
+ @Override
+ public Boolean attachStderr() {
+ return attachStderr;
+ }
+
+ @Override
+ public List<String> portSpecs() {
+ return portSpecs;
+ }
+
+ @Override
+ public Set<String> exposedPorts() {
+ return exposedPorts;
+ }
+
+ @Override
+ public Boolean tty() {
+ return tty;
+ }
+
+ @Override
+ public Boolean openStdin() {
+ return openStdin;
+ }
+
+ @Override
+ public Boolean stdinOnce() {
+ return stdinOnce;
+ }
+
+ @Override
+ public List<String> env() {
+ return env;
+ }
+
+ @Override
+ public List<String> cmd() {
+ return cmd;
+ }
+
+ @Override
+ public String image() {
+ return image;
+ }
+
+ @Override
+ public Set<String> volumes() {
+ return volumes;
+ }
+
+ @Override
+ public String workingDir() {
+ return workingDir;
+ }
+
+ @Override
+ public List<String> entrypoint() {
+ return entrypoint;
+ }
+
+ @Override
+ public Boolean networkDisabled() {
+ return networkDisabled;
+ }
+
+ @Override
+ public List<String> onBuild() {
+ return onBuild;
+ }
+
+ public static class Builder {
+
+ private String hostname;
+ private String domainname;
+ private String user;
+ private Long memory;
+ private Long memorySwap;
+ private Long cpuShares;
+ private String cpuset;
+ private Boolean attachStdin;
+ private Boolean attachStdout;
+ private Boolean attachStderr;
+ private List<String> portSpecs;
+ private Set<String> exposedPorts;
+ private Boolean tty;
+ private Boolean openStdin;
+ private Boolean stdinOnce;
+ private List<String> env;
+ private List<String> cmd;
+ private String image;
+ private Set<String> volumes;
+ private String workingDir;
+ private List<String> entrypoint;
+ private Boolean networkDisabled;
+ private List<String> onBuild;
+
+ public Builder hostname(final String hostname) {
+ this.hostname = hostname;
+ return this;
+ }
+
+ public String hostname() {
+ return hostname;
+ }
+
+ public Builder domainname(final String domainname) {
+ this.domainname = domainname;
+ return this;
+ }
+
+ public String domainname() {
+ return domainname;
+ }
+
+ public Builder user(final String user) {
+ this.user = user;
+ return this;
+ }
+
+ public String user() {
+ return user;
+ }
+
+ public Builder memory(final Long memory) {
+ this.memory = memory;
+ return this;
+ }
+
+ public Long memory() {
+ return memory;
+ }
+
+ public Builder memorySwap(final Long memorySwap) {
+ this.memorySwap = memorySwap;
+ return this;
+ }
+
+ public Long memorySwap() {
+ return memorySwap;
+ }
+
+ public Builder cpuShares(final Long cpuShares) {
+ this.cpuShares = cpuShares;
+ return this;
+ }
+
+ public Long cpuShares() {
+ return cpuShares;
+ }
+
+ public Builder cpuset(final String cpuset) {
+ this.cpuset = cpuset;
+ return this;
+ }
+
+ public String cpuset() {
+ return cpuset;
+ }
+
+ public Builder attachStdin(final Boolean attachStdin) {
+ this.attachStdin = attachStdin;
+ return this;
+ }
+
+ public Boolean attachStdin() {
+ return attachStdin;
+ }
+
+ public Builder attachStdout(final Boolean attachStdout) {
+ this.attachStdout = attachStdout;
+ return this;
+ }
+
+ public Boolean attachStdout() {
+ return attachStdout;
+ }
+
+ public Builder attachStderr(final Boolean attachStderr) {
+ this.attachStderr = attachStderr;
+ return this;
+ }
+
+ public Boolean attachStderr() {
+ return attachStderr;
+ }
+
+ public Builder portSpecs(final List<String> portSpecs) {
+
+ this.portSpecs = new ArrayList<String>(portSpecs);
+ return this;
+ }
+
+ public Builder portSpecs(final String... portSpecs) {
+ this.portSpecs = Arrays.asList(portSpecs);
+ return this;
+ }
+
+ public List<String> portSpecs() {
+ return portSpecs;
+ }
+
+ public Builder exposedPorts(final Set<String> exposedPorts) {
+ this.exposedPorts = new TreeSet<String>(exposedPorts);
+ return this;
+ }
+
+ public Builder exposedPorts(final String... exposedPorts) {
+ this.exposedPorts = new TreeSet<String>(Arrays.asList(exposedPorts));
+ return this;
+ }
+
+ public Set<String> exposedPorts() {
+ return exposedPorts;
+ }
+
+ public Builder tty(final Boolean tty) {
+ this.tty = tty;
+ return this;
+ }
+
+ public Boolean tty() {
+ return tty;
+ }
+
+ public Builder openStdin(final Boolean openStdin) {
+ this.openStdin = openStdin;
+ return this;
+ }
+
+ public Boolean openStdin() {
+ return openStdin;
+ }
+
+ public Builder stdinOnce(final Boolean stdinOnce) {
+ this.stdinOnce = stdinOnce;
+ return this;
+ }
+
+ public Boolean stdinOnce() {
+ return stdinOnce;
+ }
+
+ public Builder env(final List<String> env) {
+ this.env = new ArrayList<String>(env);
+ return this;
+ }
+
+ public Builder env(final String... env) {
+ this.env = Arrays.asList(env);
+ return this;
+ }
+
+ public List<String> env() {
+ return env;
+ }
+
+ public Builder cmd(final List<String> cmd) {
+ this.cmd = new ArrayList<String>(cmd);
+ return this;
+ }
+
+ public Builder cmd(final String... cmd) {
+ this.cmd = Arrays.asList(cmd);
+ return this;
+ }
+
+ public List<String> cmd() {
+ return cmd;
+ }
+
+ public Builder image(final String image) {
+ this.image = image;
+ return this;
+ }
+
+ public String image() {
+ return image;
+ }
+
+ public Builder volumes(final Set<String> volumes) {
+ this.volumes = new TreeSet<String>(volumes);
+ return this;
+ }
+
+ public Builder volumes(final String... volumes) {
+ this.volumes = new TreeSet<String>(Arrays.asList(volumes));
+ return this;
+ }
+
+ public Set<String> volumes() {
+ return volumes;
+ }
+
+ public Builder workingDir(final String workingDir) {
+ this.workingDir = workingDir;
+ return this;
+ }
+
+ public String workingDir() {
+ return workingDir;
+ }
+
+ public Builder entryPoint(final List<String> entrypoint) {
+ this.entrypoint = new ArrayList<String>(entrypoint);
+ return this;
+ }
+
+ public Builder entryPoint(final String... entrypoint) {
+ this.entrypoint = Arrays.asList(entrypoint);
+ return this;
+ }
+
+ public List<String> entryPoint() {
+ return entrypoint;
+ }
+
+ public Builder networkDisabled(final Boolean networkDisabled) {
+ this.networkDisabled = networkDisabled;
+ return this;
+ }
+
+ public Boolean networkDisabled() {
+ return networkDisabled;
+ }
+
+ public Builder onBuild(final List<String> onBuild) {
+ this.onBuild = new ArrayList<String>(onBuild);
+ return this;
+ }
+
+ public Builder onBuild(final String... onBuild) {
+ this.onBuild = Arrays.asList(onBuild);
+ return this;
+ }
+
+ public List<String> onBuild() {
+ return onBuild;
+ }
+
+ public DockerContainerConfig build() {
+ return new DockerContainerConfig(this);
+ }
+
+ }
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerExit.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerExit.java
new file mode 100644
index 0000000000..3fe453c6e6
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerExit.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.core;
+
+import org.eclipse.linuxtools.docker.core.IDockerContainerExit;
+
+public class DockerContainerExit implements IDockerContainerExit {
+
+ private Integer statusCode;
+
+ public DockerContainerExit(Integer statusCode) {
+ this.statusCode = statusCode;
+ }
+
+ @Override
+ public Integer statusCode() {
+ return statusCode;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerInfo.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerInfo.java
new file mode 100644
index 0000000000..84d7db1004
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerInfo.java
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.core;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.linuxtools.docker.core.IDockerContainerConfig;
+import org.eclipse.linuxtools.docker.core.IDockerContainerInfo;
+import org.eclipse.linuxtools.docker.core.IDockerContainerState;
+import org.eclipse.linuxtools.docker.core.IDockerHostConfig;
+import org.eclipse.linuxtools.docker.core.IDockerNetworkSettings;
+
+import com.spotify.docker.client.messages.ContainerInfo;
+
+public class DockerContainerInfo implements IDockerContainerInfo {
+
+ private String id;
+ private Date created;
+ private String path;
+ private List<String> args;
+ private IDockerContainerConfig config;
+ private IDockerHostConfig hostConfig;
+ private IDockerContainerState state;
+ private String image;
+ private IDockerNetworkSettings networkSettings;
+ private String resolvConfPath;
+ private String hostnamePath;
+ private String hostsPath;
+ private String name;
+ private String driver;
+ private String execDriver;
+ private String processLabel;
+ private String mountLabel;
+ private Map<String, String> volumes;
+ private Map<String, Boolean> volumesRW;
+
+ public DockerContainerInfo (final ContainerInfo info) {
+ this.id = info.id();
+ this.created = info.created();
+ this.path = info.path();
+ this.args = info.args();
+ this.config = new DockerContainerConfig(info.config());
+ this.hostConfig = new DockerHostConfig(info.hostConfig());
+ this.state = new DockerContainerState(info.state());
+ this.image = info.image();
+ this.networkSettings = new DockerNetworkSettings(info.networkSettings());
+ this.resolvConfPath = info.resolvConfPath();
+ this.hostnamePath = info.hostnamePath();
+ this.hostsPath = info.hostsPath();
+ this.name = info.name();
+ this.driver = info.driver();
+ this.execDriver = info.execDriver();
+ this.processLabel = info.processLabel();
+ this.mountLabel = info.mountLabel();
+ this.volumes = info.volumes();
+ this.volumesRW = info.volumesRW();
+ }
+
+ @Override
+ public String id() {
+ return id;
+ }
+
+ @Override
+ public Date created() {
+ return created == null ? null : new Date(created.getTime());
+ }
+
+ @Override
+ public String path() {
+ return path;
+ }
+
+ @Override
+ public List<String> args() {
+ return args;
+ }
+
+ @Override
+ public IDockerContainerConfig config() {
+ return config;
+ }
+
+ @Override
+ public IDockerHostConfig hostConfig() {
+ return hostConfig;
+ }
+
+ @Override
+ public IDockerContainerState state() {
+ return state;
+ }
+
+ @Override
+ public String image() {
+ return image;
+ }
+
+ @Override
+ public IDockerNetworkSettings networkSettings() {
+ return networkSettings;
+ }
+
+ @Override
+ public String resolvConfPath() {
+ return resolvConfPath;
+ }
+
+ @Override
+ public String hostnamePath() {
+ return hostnamePath;
+ }
+
+ @Override
+ public String hostsPath() {
+ return hostsPath;
+ }
+
+ @Override
+ public String name() {
+ return name;
+ }
+
+ @Override
+ public String driver() {
+ return driver;
+ }
+
+ @Override
+ public String execDriver() {
+ return execDriver;
+ }
+
+ @Override
+ public String processLabel() {
+ return processLabel;
+ }
+
+ @Override
+ public String mountLabel() {
+ return mountLabel;
+ }
+
+ @Override
+ public Map<String, String> volumes() {
+ return volumes;
+ }
+
+ @Override
+ public Map<String, Boolean> volumesRW() {
+ return volumesRW;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerRefreshManager.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerRefreshManager.java
new file mode 100644
index 0000000000..bf3bae0472
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerRefreshManager.java
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.core;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerContainer;
+import org.eclipse.linuxtools.docker.core.IDockerContainerListener;
+
+public class DockerContainerRefreshManager implements IDockerContainerListener {
+
+ private static DockerContainerRefreshManager instance;
+ private final long DEFAULT_REFRESH_TIME = 15;
+
+ private Map<IDockerConnection, ContainerRefreshThread> refreshThreadMap;
+
+ private DockerContainerRefreshManager() {
+ refreshThreadMap = new HashMap<IDockerConnection, ContainerRefreshThread>();
+ }
+
+ public static DockerContainerRefreshManager getInstance() {
+ if (instance == null)
+ instance = new DockerContainerRefreshManager();
+ return instance;
+ }
+
+ @Override
+ public synchronized void listChanged(IDockerConnection connection,
+ List<IDockerContainer> dclist) {
+
+ ContainerRefreshThread rt = refreshThreadMap.get(connection);
+ if (rt == null) {
+ long refreshRateInSeconds = Platform.getPreferencesService()
+ .getLong("org.eclipse.linuxtools.docker.ui", //$NON-NLS-1$
+ "containerRefreshTime", DEFAULT_REFRESH_TIME, null); //$NON-NLS-1$
+ rt = new ContainerRefreshThread(connection,
+ TimeUnit.SECONDS.toMillis(refreshRateInSeconds));
+ rt.start();
+ refreshThreadMap.put(connection, rt);
+ }
+ }
+
+ /**
+ * Method to reset the refresh rate for updating container lists
+ *
+ * @param seconds
+ * - time to wait between refreshes
+ */
+ public void setRefreshTime(long seconds) {
+ if (seconds >= 5) {
+ long refreshRate = TimeUnit.SECONDS.toMillis(seconds);
+ for (ContainerRefreshThread t : refreshThreadMap.values()) {
+ t.setSleepTime(refreshRate);
+ }
+ }
+ }
+
+ /**
+ * ContainerRefreshThread class is used to update the container lists for a
+ * particular connection as short as needed to keep the UI updated on a
+ * regular basis.
+ *
+ */
+ private class ContainerRefreshThread extends Thread {
+
+ private IDockerConnection connection;
+ private long sleepTime;
+ private boolean kill;
+
+ public ContainerRefreshThread(IDockerConnection connection,
+ long sleepTime) {
+ this.connection = connection;
+ this.sleepTime = sleepTime;
+ }
+
+ public IDockerConnection getConnection() {
+ return connection;
+ }
+
+ public synchronized long getSleepTime() {
+ return sleepTime;
+ }
+
+ public synchronized void setSleepTime(long newTime) {
+ sleepTime = newTime;
+ this.interrupt();
+ }
+
+ public void kill() {
+ kill = true;
+ this.interrupt();
+ }
+
+ public void run() {
+ for (;;) {
+ try {
+ Thread.sleep(getSleepTime());
+ // After sleep period, update the containers list, but make
+ // sure the refreshManager isn't notified since that
+ // is what triggered this to begin with.
+ synchronized (instance) {
+ connection.removeContainerListener(instance);
+ ((DockerConnection) connection).getContainers(true);
+ connection.addContainerListener(instance);
+ }
+ } catch (InterruptedException e) {
+ if (kill)
+ break;
+ // otherwise..continue
+ }
+ }
+ }
+ }
+
+ /***
+ * Method to kill all threads at shutdown.
+ */
+ public void killAllThreads() {
+ for (ContainerRefreshThread rt : refreshThreadMap.values()) {
+ rt.kill();
+ refreshThreadMap.remove(rt.getConnection());
+ }
+ }
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerState.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerState.java
new file mode 100644
index 0000000000..096692719e
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerState.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.core;
+
+import java.util.Date;
+
+import org.eclipse.linuxtools.docker.core.IDockerContainerState;
+
+import com.spotify.docker.client.messages.ContainerState;
+
+public class DockerContainerState implements IDockerContainerState {
+
+ private final Integer pid;
+ private final Boolean running;
+ private final Boolean paused;
+ private final Boolean restarting;
+ private final Integer exitCode;
+ private final Date startDate;
+ private final Date finishDate;
+
+ public DockerContainerState(final ContainerState containerState) {
+ this.pid = containerState.pid();
+ this.running = containerState.running();
+ this.paused = containerState.paused();
+ this.restarting = containerState.restarting();
+ this.exitCode = containerState.exitCode();
+ this.startDate = containerState.startedAt();
+ this.finishDate = containerState.finishedAt();
+ }
+
+ @Override
+ public Boolean running() {
+ return running;
+ }
+
+ @Override
+ public Boolean restarting() {
+ return restarting;
+ }
+
+ @Override
+ public Boolean paused() {
+ return paused;
+ }
+
+ @Override
+ public Integer pid() {
+ return pid;
+ }
+
+ @Override
+ public Integer exitCode() {
+ return exitCode;
+ }
+
+ @Override
+ public Date startDate() {
+ return startDate;
+ }
+
+ @Override
+ public Date finishDate() {
+ return finishDate;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerHostConfig.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerHostConfig.java
new file mode 100644
index 0000000000..04e3c2f37a
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerHostConfig.java
@@ -0,0 +1,293 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.core;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.linuxtools.docker.core.IDockerConfParameter;
+import org.eclipse.linuxtools.docker.core.IDockerHostConfig;
+import org.eclipse.linuxtools.docker.core.IDockerPortBinding;
+
+import com.spotify.docker.client.messages.HostConfig;
+import com.spotify.docker.client.messages.HostConfig.LxcConfParameter;
+import com.spotify.docker.client.messages.PortBinding;
+
+public class DockerHostConfig implements IDockerHostConfig {
+
+ private final List<String> binds;
+ private final String containerIDFile;
+ private final List<IDockerConfParameter> lxcConf;
+ private final Boolean privileged;
+ private final Map<String, List<IDockerPortBinding>> portBindings;
+ private final List<String> links;
+ private final Boolean publishAllPorts;
+ private final List<String> dns;
+ private final List<String> dnsSearch;
+ private final List<String> volumesFrom;
+ private final String networkMode;
+
+ public DockerHostConfig(final HostConfig hostConfig) {
+ this.binds = hostConfig.binds();
+ this.containerIDFile = hostConfig.containerIDFile();
+ this.lxcConf = new ArrayList<>();
+ if(hostConfig.lxcConf() != null) {
+ for (LxcConfParameter lxcConfParameter : hostConfig.lxcConf()) {
+ this.lxcConf.add(new DockerConfParameter(lxcConfParameter));
+ }
+ }
+ this.privileged = hostConfig.privileged();
+ this.portBindings = new HashMap<String, List<IDockerPortBinding>>();
+ if(hostConfig != null && hostConfig.portBindings() != null) {
+ for(Entry<String, List<PortBinding>> entry : hostConfig.portBindings().entrySet()) {
+ final List<IDockerPortBinding> portBindings = new ArrayList<>();
+ for (PortBinding portBinding : entry.getValue()) {
+ portBindings.add(new DockerPortBinding(portBinding));
+ }
+ this.portBindings.put(entry.getKey(), portBindings);
+ }
+ }
+ this.links = hostConfig.links();
+ this.publishAllPorts = hostConfig.publishAllPorts();
+ this.dns = hostConfig.dns();
+ this.dnsSearch = hostConfig.dnsSearch();
+ this.volumesFrom = hostConfig.volumesFrom();
+ this.networkMode = hostConfig.networkMode();
+ }
+
+ private DockerHostConfig(final Builder builder) {
+ this.binds = builder.binds;
+ this.containerIDFile = builder.containerIDFile;
+ this.lxcConf = builder.lxcConf;
+ this.privileged = builder.privileged;
+ this.portBindings = builder.portBindings;
+ this.links = builder.links;
+ this.publishAllPorts = builder.publishAllPorts;
+ this.dns = builder.dns;
+ this.dnsSearch = builder.dnsSearch;
+ this.volumesFrom = builder.volumesFrom;
+ this.networkMode = builder.networkMode;
+ }
+
+ @Override
+ public List<String> binds() {
+ return binds;
+ }
+
+ @Override
+ public String containerIDFile() {
+ return containerIDFile;
+ }
+
+ @Override
+ public List<IDockerConfParameter> lxcConf() {
+ return lxcConf;
+ }
+
+ @Override
+ public Boolean privileged() {
+ return privileged;
+ }
+
+ @Override
+ public Map<String, List<IDockerPortBinding>> portBindings() {
+ return portBindings;
+ }
+
+ @Override
+ public List<String> links() {
+ return links;
+ }
+
+ @Override
+ public Boolean publishAllPorts() {
+ return publishAllPorts;
+ }
+
+ @Override
+ public List<String> dns() {
+ return dns;
+ }
+
+ @Override
+ public List<String> dnsSearch() {
+ return dnsSearch;
+ }
+
+ @Override
+ public List<String> volumesFrom() {
+ return volumesFrom;
+ }
+
+ @Override
+ public String networkMode() {
+ return networkMode;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder {
+
+ private List<String> binds;
+ private String containerIDFile;
+ private List<IDockerConfParameter> lxcConf;
+ private Boolean privileged;
+ private Map<String, List<IDockerPortBinding>> portBindings;
+ private List<String> links;
+ private Boolean publishAllPorts;
+ private List<String> dns;
+ private List<String> dnsSearch;
+ private List<String> volumesFrom;
+ private String networkMode;
+
+
+ public Builder binds(final List<String> binds) {
+ this.binds = new ArrayList<String>(binds);
+ return this;
+ }
+
+ public Builder binds(final String... binds) {
+ this.binds = Arrays.asList(binds);
+ return this;
+ }
+
+ public List<String> binds() {
+ return binds;
+ }
+
+ public Builder containerIDFile(final String containerIDFile) {
+ this.containerIDFile = containerIDFile;
+ return this;
+ }
+
+ public String containerIDFile() {
+ return containerIDFile;
+ }
+
+ public Builder lxcConf(final List<IDockerConfParameter> lxcConf) {
+ this.lxcConf = new ArrayList<IDockerConfParameter>(lxcConf);
+ return this;
+ }
+
+ public Builder lxcConf(final IDockerConfParameter... lxcConf) {
+ this.lxcConf = Arrays.asList(lxcConf);
+ return this;
+ }
+
+ public List<IDockerConfParameter> lxcConf() {
+ return lxcConf;
+ }
+
+ public Builder privileged(final Boolean privileged) {
+ this.privileged = privileged;
+ return this;
+ }
+
+ public Boolean privileged() {
+ return privileged;
+ }
+
+ public Builder portBindings(
+ final Map<String, List<IDockerPortBinding>> portBindings) {
+ this.portBindings = portBindings;
+ return this;
+ }
+
+ public Map<String, List<IDockerPortBinding>> portBindings() {
+ return portBindings;
+ }
+
+ public Builder links(final List<String> links) {
+ this.links = new ArrayList<String>(links);
+ return this;
+ }
+
+ public Builder links(final String... links) {
+ this.links = Arrays.asList(links);
+ return this;
+ }
+
+ public List<String> links() {
+ return links;
+ }
+
+ public Builder publishAllPorts(final Boolean publishAllPorts) {
+ this.publishAllPorts = publishAllPorts;
+ return this;
+ }
+
+ public Boolean publishAllPorts() {
+ return publishAllPorts;
+ }
+
+ public Builder dns(final List<String> dns) {
+ this.dns = new ArrayList<String>(dns);
+ return this;
+ }
+
+ public Builder dns(final String... dns) {
+ this.dns = Arrays.asList(dns);
+ return this;
+ }
+
+ public List<String> dns() {
+ return dns;
+ }
+
+ public Builder dnsSearch(final List<String> dnsSearch) {
+ this.dnsSearch = new ArrayList<String>(dnsSearch);
+ return this;
+ }
+
+ public Builder dnsSearch(final String... dnsSearch) {
+ this.dnsSearch = Arrays.asList(dnsSearch);
+ return this;
+ }
+
+ public List<String> dnsSearch() {
+ return dnsSearch;
+ }
+
+ public Builder volumesFrom(final List<String> volumesFrom) {
+ this.volumesFrom = new ArrayList<String>(volumesFrom);
+ return this;
+ }
+
+ public Builder volumesFrom(final String... volumesFrom) {
+ this.volumesFrom = Arrays.asList(volumesFrom);
+ return this;
+ }
+
+ public List<String> volumesFrom() {
+ return volumesFrom;
+ }
+
+ public Builder networkMode(final String networkMode) {
+ this.networkMode = networkMode;
+ return this;
+ }
+
+ public String networkMode() {
+ return networkMode;
+ }
+
+ public IDockerHostConfig build() {
+ return new DockerHostConfig(this);
+ }
+
+ }
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerImage.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerImage.java
new file mode 100644
index 0000000000..80cdd1e54c
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerImage.java
@@ -0,0 +1,170 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.core;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+
+import org.eclipse.linuxtools.docker.core.IDockerImage;
+
+public class DockerImage implements IDockerImage {
+
+ // SimpleDateFormat is not thread-safe, so give one to each thread
+ private static final ThreadLocal<SimpleDateFormat> formatter = new ThreadLocal<SimpleDateFormat>(){
+ @Override
+ protected SimpleDateFormat initialValue()
+ {
+ return new SimpleDateFormat("yyyy-MM-dd");
+ }
+ };
+
+ private final DockerConnection parent;
+ private final String created;
+ private final String createdDate;
+ private final String id;
+ private final String parentId;
+ private final List<String> repoTags;
+ private final String repo;
+ private final List<String> tags;
+ private final Long size;
+ private final Long virtualSize;
+
+ private final boolean intermediateImage;
+ private final boolean danglingImage;
+
+ public DockerImage(final DockerConnection parent, final List<String> repoTags,
+ final String id, final String parentId, final String created, final Long size,
+ final Long virtualSize, final boolean intermediateImage, final boolean danglingImage) {
+ this.parent = parent;
+ this.repoTags = repoTags;
+ this.repo = extractRepo(repoTags);
+ this.tags = extractTags(repoTags);
+ this.id = id;
+ this.parentId = parentId;
+ this.created = created;
+ this.createdDate = formatter.get().format(new Date(Long.valueOf(created).longValue() * 1000));
+ this.size = size;
+ this.virtualSize = virtualSize;
+ this.intermediateImage = intermediateImage;
+ this.danglingImage = danglingImage;
+ }
+
+ /**
+ * Extracts the org/repo from the list of repo tags, assuming that the given repoTags elements have the following format:
+ * <pre>org/repo:tag</pre> or <pre>repo:tag</pre>.
+ * @param repoTags the list of repo/tags to analyze
+ * @return the repo or org/repo name or {@code null} if none was found.
+ */
+ public static String extractRepo(final List<String> repoTags) {
+ if(repoTags.isEmpty()) {
+ return null;
+ }
+ final String firstRepoTag = repoTags.get(0);
+ final int indexOfColonChar = firstRepoTag.indexOf(':');
+ if(indexOfColonChar == -1) {
+ return firstRepoTag;
+ }
+ return firstRepoTag.substring(0, indexOfColonChar);
+ }
+
+ /**
+ * Extracts the list of tags in the give repo/tags, assuming that the given repoTags elements have the following format:
+ * <pre>org/repo:tag</pre> or <pre>repo:tag</pre>.
+ * @param repoTags the repo/tags list to analyze
+ * @return the list of tags or empty list if none was found.
+ */
+ public static List<String> extractTags(final List<String> repoTags) {
+ if(repoTags.isEmpty()) {
+ return Collections.emptyList();
+ }
+ final List<String> tags = new ArrayList<>();
+ for(String repoTag : repoTags) {
+ final int indexOfColonChar = repoTag.indexOf(':');
+ if(indexOfColonChar == -1) {
+ continue;
+ }
+ tags.add(repoTag.substring(indexOfColonChar+1));
+ }
+ return tags;
+ }
+
+ @Override
+ public DockerConnection getConnection() {
+ return parent;
+ }
+
+ @Override
+ public List<String> repoTags() {
+ return repoTags;
+ }
+
+ @Override
+ public String repo() {
+ return repo;
+ }
+
+ @Override
+ public List<String> tags() {
+ return tags;
+ }
+
+ @Override
+ public String id() {
+ return id;
+ }
+
+ @Override
+ public String parentId() {
+ return parentId;
+ }
+
+ @Override
+ public String created() {
+ return created;
+ }
+
+ @Override
+ public String createdDate() {
+ return createdDate;
+ }
+
+ @Override
+ public Long size() {
+ return size;
+ }
+
+ @Override
+ public Long virtualSize() {
+ return virtualSize;
+ }
+
+ @Override
+ public boolean isDangling() {
+ return danglingImage;
+ }
+
+ @Override
+ public boolean isIntermediateImage() {
+ return intermediateImage;
+ }
+
+ @Override
+ public String toString() {
+ return "Image: id=" + id() + "\n" + " parentId=" + parentId() + "\n"
+ + " created=" + created() + "\n" + " repoTags="
+ + repoTags().toString() + "\n" + " size=" + size() + "\n"
+ + " virtualSize=" + virtualSize() + "\n";
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerImageInfo.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerImageInfo.java
new file mode 100644
index 0000000000..0514885f65
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerImageInfo.java
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.core;
+
+import java.util.Date;
+
+import org.eclipse.linuxtools.docker.core.IDockerContainerConfig;
+import org.eclipse.linuxtools.docker.core.IDockerImageInfo;
+
+import com.spotify.docker.client.messages.ImageInfo;
+
+public class DockerImageInfo implements IDockerImageInfo {
+
+ private String id;
+ private String parent;
+ private String comment;
+ private Date created;
+ private String container;
+ private IDockerContainerConfig containerConfig;
+ private String dockerVersion;
+ private String author;
+ private IDockerContainerConfig config;
+ private String architecture;
+ private String os;
+ private Long size;
+
+ public DockerImageInfo(ImageInfo info) {
+ this.id = info.id();
+ this.parent = info.parent();
+ this.comment = info.comment();
+ this.created = info.created();
+ this.container = info.container();
+ this.containerConfig = new DockerContainerConfig(info.containerConfig());
+ this.dockerVersion = info.dockerVersion();
+ this.author = info.author();
+ this.config = new DockerContainerConfig(info.config());
+ this.architecture = info.architecture();
+ this.os = info.os();
+ this.size = info.size();
+ }
+
+ @Override
+ public String id() {
+ return id;
+ }
+
+ @Override
+ public String parent() {
+ return parent;
+ }
+
+ @Override
+ public String comment() {
+ return comment;
+ }
+
+ @Override
+ public Date created() {
+ return created;
+ }
+
+ @Override
+ public String container() {
+ return container;
+ }
+
+ @Override
+ public IDockerContainerConfig containerConfig() {
+ return containerConfig;
+ }
+
+ @Override
+ public String dockerVersion() {
+ return dockerVersion;
+ }
+
+ public void setDockerVersion(String dockerVersion) {
+ this.dockerVersion = dockerVersion;
+ }
+
+ @Override
+ public String author() {
+ return author;
+ }
+
+ @Override
+ public IDockerContainerConfig config() {
+ return config;
+ }
+
+ @Override
+ public String architecture() {
+ return architecture;
+ }
+
+ @Override
+ public String os() {
+ return os;
+ }
+
+ @Override
+ public Long size() {
+ return size;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerNetworkSettings.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerNetworkSettings.java
new file mode 100644
index 0000000000..7b80a3eb21
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerNetworkSettings.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.core;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.linuxtools.docker.core.IDockerNetworkSettings;
+import org.eclipse.linuxtools.docker.core.IDockerPortBinding;
+
+import com.spotify.docker.client.messages.NetworkSettings;
+import com.spotify.docker.client.messages.PortBinding;
+
+/**
+ * @author xcoulon
+ *
+ */
+public class DockerNetworkSettings implements IDockerNetworkSettings {
+
+ private final String bridge;
+ private final String gateway;
+ private final String ipAddress;
+ private final Integer ipPrefixLen;
+ private final Map<String, Map<String, String>> portMapping;
+ private final Map<String, List<IDockerPortBinding>> ports;
+
+ public DockerNetworkSettings(final NetworkSettings networkSettings) {
+ this.bridge = networkSettings.bridge();
+ this.gateway = networkSettings.gateway();
+ this.ipAddress = networkSettings.ipAddress();
+ this.ipPrefixLen = networkSettings.ipPrefixLen();
+ this.portMapping = networkSettings.portMapping();
+ this.ports = new HashMap<>();
+ if(networkSettings.ports() != null) {
+ for(Entry<String, List<PortBinding>> entry : networkSettings.ports().entrySet()) {
+ final List<IDockerPortBinding> values = new ArrayList<>();
+ if(entry.getValue() != null) {
+ for(PortBinding portBinding : entry.getValue()) {
+ values.add(new DockerPortBinding(portBinding));
+ }
+ }
+ ports.put(entry.getKey(), values);
+ }
+
+ }
+ }
+
+ /**
+ * @return the bridge
+ */
+ @Override
+ public String bridge() {
+ return bridge;
+ }
+
+ /**
+ * @return the gateway
+ */
+ @Override
+ public String gateway() {
+ return gateway;
+ }
+
+ /**
+ * @return the ipAddress
+ */
+ @Override
+ public String ipAddress() {
+ return ipAddress;
+ }
+
+ /**
+ * @return the ipPrefixLen
+ */
+ @Override
+ public Integer ipPrefixLen() {
+ return ipPrefixLen;
+ }
+
+ /**
+ * @return the portMapping
+ */
+ @Override
+ public Map<String, Map<String, String>> portMapping() {
+ return portMapping;
+ }
+
+ /**
+ * @return the ports
+ */
+ @Override
+ public Map<String, List<IDockerPortBinding>> ports() {
+ return ports;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerPortBinding.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerPortBinding.java
new file mode 100644
index 0000000000..c1cafa570d
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerPortBinding.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.core;
+
+import org.eclipse.linuxtools.docker.core.IDockerPortBinding;
+
+import com.spotify.docker.client.messages.PortBinding;
+
+public class DockerPortBinding implements IDockerPortBinding {
+
+ private final String hostIp;
+ private final String hostPort;
+
+ public DockerPortBinding(final PortBinding portBinding) {
+ this.hostIp = portBinding.hostIp();
+ this.hostPort = portBinding.hostPort();
+ }
+
+ public DockerPortBinding(final String hostIp, final String hostPort) {
+ this.hostIp = hostIp;
+ this.hostPort = hostPort;
+ }
+
+ @Override
+ public String hostIp() {
+ return hostIp;
+ }
+
+ @Override
+ public String hostPort() {
+ return hostPort;
+ }
+
+ @Override
+ public String toString() {
+ return "PortBinding: hostIp=" + hostIp() + " hostPort=" + hostPort()
+ + "\n";
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerPortMapping.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerPortMapping.java
new file mode 100644
index 0000000000..878181fd77
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerPortMapping.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.core;
+
+import org.eclipse.linuxtools.docker.core.IDockerContainer;
+import org.eclipse.linuxtools.docker.core.IDockerPortMapping;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Port mapping for {@link IDockerContainer}
+ * @author xcoulon
+ *
+ */
+public class DockerPortMapping implements IDockerPortMapping {
+
+ private final int privatePort;
+
+ private final int publicPort;
+
+ private final String type;
+
+ private final String ip;
+
+ /**
+ * Full constructor
+ * @param privatePort
+ * @param publicPort
+ * @param type
+ * @param ip
+ */
+ @JsonCreator
+ public DockerPortMapping(@JsonProperty("privatePort") int privatePort, @JsonProperty("publicPort") int publicPort, @JsonProperty("type") String type, @JsonProperty("ip") String ip) {
+ this.privatePort = privatePort;
+ this.publicPort = publicPort;
+ this.type = type;
+ this.ip = ip;
+ }
+
+ public int getPrivatePort() {
+ return privatePort;
+ }
+
+ public int getPublicPort() {
+ return publicPort;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public String getIp() {
+ return ip;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((ip == null) ? 0 : ip.hashCode());
+ result = prime * result + privatePort;
+ result = prime * result + publicPort;
+ result = prime * result + ((type == null) ? 0 : type.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ DockerPortMapping other = (DockerPortMapping) obj;
+ if (ip == null) {
+ if (other.ip != null)
+ return false;
+ } else if (!ip.equals(other.ip))
+ return false;
+ if (privatePort != other.privatePort)
+ return false;
+ if (publicPort != other.publicPort)
+ return false;
+ if (type == null) {
+ if (other.type != null)
+ return false;
+ } else if (!type.equals(other.type))
+ return false;
+ return true;
+ }
+
+
+
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerProgressDetail.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerProgressDetail.java
new file mode 100644
index 0000000000..49c9d7d4be
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerProgressDetail.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.core;
+
+import org.eclipse.linuxtools.docker.core.IDockerProgressDetail;
+
+public class DockerProgressDetail implements IDockerProgressDetail {
+
+ private long current;
+ private long start;
+ private long total;
+
+ public DockerProgressDetail(long current, long start, long total) {
+ this.current = current;
+ this.start = start;
+ this.total = total;
+ }
+
+ @Override
+ public long current() {
+ return current;
+ }
+
+ @Override
+ public long start() {
+ return start;
+ }
+
+ @Override
+ public long total() {
+ return total;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerProgressHandler.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerProgressHandler.java
new file mode 100644
index 0000000000..6676c77714
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerProgressHandler.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.core;
+
+import org.eclipse.linuxtools.docker.core.IDockerProgressHandler;
+
+import com.spotify.docker.client.DockerException;
+import com.spotify.docker.client.ProgressHandler;
+import com.spotify.docker.client.messages.ProgressDetail;
+import com.spotify.docker.client.messages.ProgressMessage;
+
+public class DockerProgressHandler implements ProgressHandler {
+
+ private IDockerProgressHandler handler;
+
+ public DockerProgressHandler(IDockerProgressHandler handler) {
+ this.handler = handler;
+ }
+
+ @Override
+ public void progress(ProgressMessage message) throws DockerException {
+
+ DockerProgressDetail detail = null;
+ ProgressDetail d = message.progressDetail();
+ if (d != null) {
+ detail = new DockerProgressDetail(d.current(), d.start(), d.total());
+ }
+ DockerProgressMessage dpmessage = new DockerProgressMessage(
+ message.id(), message.status(), message.stream(),
+ message.error(), message.progress(), detail);
+ try {
+ handler.processMessage(dpmessage);
+ } catch (org.eclipse.linuxtools.docker.core.DockerException e) {
+ throw new DockerException(e);
+ }
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerProgressMessage.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerProgressMessage.java
new file mode 100644
index 0000000000..487dbad3a9
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerProgressMessage.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.core;
+
+import org.eclipse.linuxtools.docker.core.IDockerProgressDetail;
+import org.eclipse.linuxtools.docker.core.IDockerProgressMessage;
+
+public class DockerProgressMessage implements IDockerProgressMessage {
+
+ private String id;
+ private String status;
+ private String stream;
+ private String error;
+ private String progress;
+ private IDockerProgressDetail progressDetail;
+
+ public DockerProgressMessage(String id, String status, String stream,
+ String error, String progress, IDockerProgressDetail progressDetail) {
+ this.id = id;
+ this.status = status;
+ this.stream = stream;
+ this.error = error;
+ this.progress = progress;
+ this.progressDetail = progressDetail;
+ }
+
+ @Override
+ public String id() {
+ return id;
+ }
+
+ @Override
+ public String status() {
+ return status;
+ }
+
+ @Override
+ public String stream() {
+ return stream;
+ }
+
+ @Override
+ public String error() {
+ return error;
+ }
+
+ @Override
+ public String progress() {
+ return progress;
+ }
+
+ @Override
+ public IDockerProgressDetail progressDetail() {
+ return progressDetail;
+ }
+
+ @Override
+ public String toString() {
+ return "Message: id=" + id() + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
+ "status=" + status() + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
+ "stream=" + stream() + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
+ "error=" + error() + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
+ "progress=" + progress() + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
+ "progressDetail=" + progressDetail(); //$NON-NLS-1$
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerTCPConnection.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerTCPConnection.java
new file mode 100644
index 0000000000..f99b72ba47
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerTCPConnection.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.core;
+
+/**
+ * @author xcoulon
+ *
+ */
+public class DockerTCPConnection {
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/FieldMatcher.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/FieldMatcher.java
new file mode 100644
index 0000000000..58a91c18f3
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/FieldMatcher.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.core;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
+import org.eclipse.linuxtools.docker.core.IFieldMatcher;
+
+public class FieldMatcher implements IFieldMatcher {
+
+ private String rule;
+ private Pattern pattern;
+
+ public FieldMatcher(String rule) throws PatternSyntaxException {
+ this.rule = rule;
+ String regexRule = transform(rule);
+ pattern = Pattern.compile(regexRule);
+ }
+
+ private String transform(String rule) {
+ StringBuffer buffer = new StringBuffer();
+ for (int i = 0; i < rule.length(); ++i) {
+ char ch = rule.charAt(i);
+ if (Character.isLetterOrDigit(ch))
+ buffer.append(ch);
+ else if (ch == '*') {
+ buffer.append(".*?");
+ } else {
+ buffer.append('\\');
+ buffer.append(ch);
+ }
+ }
+ return buffer.toString();
+ }
+
+ @Override
+ public boolean matches(String input) {
+ Matcher m = pattern.matcher(input);
+ return m.matches();
+ }
+
+ @Override
+ public String toString() {
+ return rule;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/HttpHijackWorkaround.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/HttpHijackWorkaround.java
new file mode 100644
index 0000000000..32957a6dd5
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/HttpHijackWorkaround.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.core;
+
+import java.io.FilterInputStream;
+import java.io.InputStream;
+import java.lang.reflect.Field;
+import java.net.Socket;
+import java.nio.channels.Channels;
+import java.nio.channels.WritableByteChannel;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.runtime.Platform;
+import org.osgi.framework.Bundle;
+
+import com.spotify.docker.client.LogReader;
+import com.spotify.docker.client.LogStream;
+
+/**
+ * This is a workaround for lack of HTTP Hijacking support in Apache
+ * HTTPClient. The assumptions made in Apache HTTPClient are that a
+ * response is an InputStream and so we have no sane way to access the
+ * underlying OutputStream (which exists at the socket level)
+ *
+ * References :
+ * https://docs.docker.com/reference/api/docker_remote_api_v1.16/#32-hijacking
+ * https://github.com/docker/docker/issues/5933
+ */
+public class HttpHijackWorkaround {
+
+ public static WritableByteChannel getOutputStream(LogStream stream, String uri) throws Exception {
+ final String[] fields = new String[] { "reader", "stream", "original",
+ "input", "in", "in", "wrappedStream", "in", "instream" };
+ final String[] declared = new String[] {
+ LogStream.class.getName(),
+ LogReader.class.getName(),
+ "org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream",
+ "org.glassfish.jersey.message.internal.EntityInputStream",
+ FilterInputStream.class.getName(),
+ FilterInputStream.class.getName(),
+ "org.apache.http.conn.EofSensorInputStream",
+ "org.apache.http.impl.io.IdentityInputStream",
+ "org.apache.http.impl.io.SessionInputBufferImpl" };
+
+ List<String[]> list = new LinkedList<>();
+ for (int i = 0; i < fields.length; i++) {
+ list.add(new String[] { declared[i], fields[i] });
+ }
+
+ if (uri.startsWith("unix:")) {
+ list.add(new String[] { "sun.nio.ch.ChannelInputStream", "ch" });
+ } else {
+ list.add(new String[] { "java.net.SocketInputStream", "socket" });
+ }
+
+ Object res = getInternalField(stream, list);
+ if (res instanceof WritableByteChannel) {
+ return (WritableByteChannel) res;
+ } else if (res instanceof Socket) {
+ return Channels.newChannel(((Socket) res).getOutputStream());
+ } else {
+ return null;
+ }
+ }
+
+ /*
+ * We could add API for this in com.spotify.docker.client since there is
+ * access to the underlying InputStream but better wait and see what
+ * happens with the HTTP Hijacking situation.
+ */
+ public static InputStream getInputStream(LogStream stream) throws Exception {
+ final String[] fields = new String[] { "reader", "stream" };
+ final String[] declared = new String[] { LogStream.class.getName(), LogReader.class.getName()};
+
+ List<String[]> list = new LinkedList<>();
+ for (int i = 0; i < fields.length; i++) {
+ list.add(new String[] { declared[i], fields[i] });
+ }
+ return (InputStream) getInternalField(stream, list);
+ }
+
+ /*
+ * Access arbitrarily nested internal fields.
+ */
+ private static Object getInternalField (Object input, List<String []> set) {
+ Object curr = input;
+ try {
+ for (String [] e : set) {
+ Field f = loadClass(e[0]).getDeclaredField(e[1]);
+ f.setAccessible(true);
+ curr = f.get(curr);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return curr;
+ }
+
+ /*
+ * Avoid explicitly depending on certain classes that are requirements
+ * of the docker-client library (com.spotify.docker.client).
+ */
+ private static Class<?> loadClass(String key) {
+ Class<?> k;
+ try {
+ k = Class.forName(key);
+ } catch (ClassNotFoundException e) {
+ Bundle b = Platform.getBundle("com.spotify.docker.client");
+ try {
+ k = b.loadClass(key);
+ } catch (ClassNotFoundException e1) {
+ k = null;
+ }
+ }
+ return k;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/.classpath b/containers/org.eclipse.linuxtools.docker.ui/.classpath
new file mode 100644
index 0000000000..46cec6ed2a
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src/"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/containers/org.eclipse.linuxtools.docker.ui/.project b/containers/org.eclipse.linuxtools.docker.ui/.project
new file mode 100644
index 0000000000..9626eef1a2
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.docker.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/containers/org.eclipse.linuxtools.docker.ui/.settings/org.eclipse.jdt.core.prefs b/containers/org.eclipse.linuxtools.docker.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..267d23cb7d
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,291 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=80
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/containers/org.eclipse.linuxtools.docker.ui/.settings/org.eclipse.jdt.ui.prefs b/containers/org.eclipse.linuxtools.docker.ui/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000000..32fe9378ab
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,62 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile
+formatter_settings_version=12
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=true
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=false
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=true
+sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=true
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_type_arguments=false
diff --git a/containers/org.eclipse.linuxtools.docker.ui/.settings/org.eclipse.m2e.core.prefs b/containers/org.eclipse.linuxtools.docker.ui/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000000..f897a7f1cb
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/containers/org.eclipse.linuxtools.docker.ui/META-INF/MANIFEST.MF b/containers/org.eclipse.linuxtools.docker.ui/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..bd27f9dc1d
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Docker UI Plug-in
+Bundle-SymbolicName: org.eclipse.linuxtools.docker.ui;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.docker.ui.Activator
+Bundle-Vendor: Eclipse Linux Tools
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.linuxtools.docker.core;bundle-version="1.0.0",
+ org.eclipse.ui.console,
+ org.eclipse.core.filesystem,
+ org.eclipse.ui.ide,
+ org.eclipse.core.resources,
+ org.eclipse.ui.forms,
+ org.eclipse.ui.navigator;bundle-version="3.5.401",
+ org.eclipse.jface,
+ org.eclipse.core.expressions;bundle-version="3.4.600",
+ org.eclipse.ui.views.properties.tabbed;bundle-version="3.6.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Export-Package: org.eclipse.linuxtools.docker.ui,
+ org.eclipse.linuxtools.docker.ui.launch
diff --git a/containers/org.eclipse.linuxtools.docker.ui/build.properties b/containers/org.eclipse.linuxtools.docker.ui/build.properties
new file mode 100644
index 0000000000..db2c688305
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = target/
+bin.includes = plugin.xml,\
+ plugin.properties,\
+ META-INF/,\
+ .,\
+ icons/
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/README b/containers/org.eclipse.linuxtools.docker.ui/icons/README
new file mode 100644
index 0000000000..5306351c10
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/README
@@ -0,0 +1,2 @@
+The icon docker-top-logo.png was taken from the official Docker github repo and is
+licensed under the Apache 2.0 license. All other icons are under the EPL 1.1 license. \ No newline at end of file
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/banner-repository-context.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/banner-repository-context.gif
new file mode 100644
index 0000000000..f916a95d30
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/banner-repository-context.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/banner-repository.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/banner-repository.gif
new file mode 100644
index 0000000000..08e472ad69
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/banner-repository.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/build_exec.png b/containers/org.eclipse.linuxtools.docker.ui/icons/build_exec.png
new file mode 100644
index 0000000000..c0272bb5d8
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/build_exec.png
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/collapseall.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/collapseall.gif
new file mode 100644
index 0000000000..a2d80a9044
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/collapseall.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/commit.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/commit.gif
new file mode 100644
index 0000000000..a694ed55d8
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/commit.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/commitd.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/commitd.gif
new file mode 100644
index 0000000000..570ea0952f
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/commitd.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/connection.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/connection.gif
new file mode 100644
index 0000000000..b5a0012761
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/connection.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/container.png b/containers/org.eclipse.linuxtools.docker.ui/icons/container.png
new file mode 100644
index 0000000000..85d1135343
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/container.png
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/context-attach.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/context-attach.gif
new file mode 100644
index 0000000000..bee8fc55fe
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/context-attach.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/createcontainer.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/createcontainer.gif
new file mode 100644
index 0000000000..0a44550655
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/createcontainer.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/createcontainer_d.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/createcontainer_d.gif
new file mode 100644
index 0000000000..9681b79ec4
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/createcontainer_d.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/db_obj.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/db_obj.gif
new file mode 100644
index 0000000000..8f2b1d5894
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/db_obj.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/dbgroup_obj.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/dbgroup_obj.gif
new file mode 100644
index 0000000000..40d011d0b7
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/dbgroup_obj.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/delete.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/delete.gif
new file mode 100644
index 0000000000..846fb00695
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/delete.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/delete_d.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/delete_d.gif
new file mode 100644
index 0000000000..157b958d24
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/delete_d.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/docker_large.png b/containers/org.eclipse.linuxtools.docker.ui/icons/docker_large.png
new file mode 100644
index 0000000000..ce7f799d3c
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/docker_large.png
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/docker_small.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/docker_small.gif
new file mode 100644
index 0000000000..b9a973da99
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/docker_small.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/filter_ps.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/filter_ps.gif
new file mode 100644
index 0000000000..06898144b4
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/filter_ps.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/folder.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/folder.gif
new file mode 100644
index 0000000000..03ee1dcb8e
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/folder.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/image.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/image.gif
new file mode 100644
index 0000000000..555182cacd
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/image.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/image.png b/containers/org.eclipse.linuxtools.docker.ui/icons/image.png
new file mode 100644
index 0000000000..f4da0ce950
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/image.png
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/images.png b/containers/org.eclipse.linuxtools.docker.ui/icons/images.png
new file mode 100644
index 0000000000..3092ea5e3a
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/images.png
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/instance.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/instance.gif
new file mode 100644
index 0000000000..bd0e1567c6
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/instance.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/kill.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/kill.gif
new file mode 100644
index 0000000000..0bc60689c6
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/kill.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/killd.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/killd.gif
new file mode 100644
index 0000000000..cb4ee9b3b4
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/killd.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/list_UDDI_service_enabled.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/list_UDDI_service_enabled.gif
new file mode 100644
index 0000000000..53e1335da1
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/list_UDDI_service_enabled.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/list_wsdl_highlighted.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/list_wsdl_highlighted.gif
new file mode 100644
index 0000000000..428c8ea5e6
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/list_wsdl_highlighted.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/mock-repository.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/mock-repository.gif
new file mode 100644
index 0000000000..1dcbaaff93
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/mock-repository.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/new_wsdl_wiz.png b/containers/org.eclipse.linuxtools.docker.ui/icons/new_wsdl_wiz.png
new file mode 100644
index 0000000000..4100110ec7
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/new_wsdl_wiz.png
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/pull.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/pull.gif
new file mode 100644
index 0000000000..166eaba903
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/pull.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/push.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/push.gif
new file mode 100644
index 0000000000..2cb69621de
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/push.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/pushd.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/pushd.gif
new file mode 100644
index 0000000000..2a348975b3
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/pushd.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/reboot.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/reboot.gif
new file mode 100644
index 0000000000..8da980dd16
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/reboot.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/rebootd.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/rebootd.gif
new file mode 100644
index 0000000000..cefe520563
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/rebootd.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/refresh_tab.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/refresh_tab.gif
new file mode 100644
index 0000000000..3ec515bda8
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/refresh_tab.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/repos.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/repos.gif
new file mode 100644
index 0000000000..c13bea1ca4
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/repos.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/repositories-blue.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/repositories-blue.gif
new file mode 100644
index 0000000000..4ecfd38534
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/repositories-blue.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/repositories.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/repositories.gif
new file mode 100644
index 0000000000..a07632446b
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/repositories.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/repository-middle.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/repository-middle.gif
new file mode 100644
index 0000000000..ae982990dc
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/repository-middle.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/repository-new.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/repository-new.gif
new file mode 100644
index 0000000000..b4832fc94e
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/repository-new.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/repository-synchronize-attributes.png b/containers/org.eclipse.linuxtools.docker.ui/icons/repository-synchronize-attributes.png
new file mode 100644
index 0000000000..195659f77c
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/repository-synchronize-attributes.png
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/resource_obj.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/resource_obj.gif
new file mode 100644
index 0000000000..442d6d10f5
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/resource_obj.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/restart.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/restart.gif
new file mode 100644
index 0000000000..afb6fa934c
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/restart.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/resume.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/resume.gif
new file mode 100644
index 0000000000..16f4e25175
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/resume.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/resumed.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/resumed.gif
new file mode 100644
index 0000000000..3e130f5467
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/resumed.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/running.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/running.gif
new file mode 100644
index 0000000000..7b3a92e090
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/running.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/runningd.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/runningd.gif
new file mode 100644
index 0000000000..29b5aaf00f
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/runningd.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/sample.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/sample.gif
new file mode 100644
index 0000000000..34fb3c9d8c
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/sample.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/stopped.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/stopped.gif
new file mode 100644
index 0000000000..1543a11590
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/stopped.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/stoppedd.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/stoppedd.gif
new file mode 100644
index 0000000000..b2daca8172
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/stoppedd.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/suspend.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/suspend.gif
new file mode 100644
index 0000000000..cd705c23d8
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/suspend.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/suspendd.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/suspendd.gif
new file mode 100644
index 0000000000..2c245695ba
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/suspendd.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/systemprocess.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/systemprocess.gif
new file mode 100644
index 0000000000..1ea6ec1f0b
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/systemprocess.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/tag.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/tag.gif
new file mode 100644
index 0000000000..34027a546c
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/tag.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/tag_d.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/tag_d.gif
new file mode 100644
index 0000000000..67f426ce98
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/tag_d.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/task-repository-new.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/task-repository-new.gif
new file mode 100644
index 0000000000..5f33961379
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/task-repository-new.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/icons/task-retrieve.gif b/containers/org.eclipse.linuxtools.docker.ui/icons/task-retrieve.gif
new file mode 100644
index 0000000000..ddfa476abe
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/icons/task-retrieve.gif
Binary files differ
diff --git a/containers/org.eclipse.linuxtools.docker.ui/plugin.properties b/containers/org.eclipse.linuxtools.docker.ui/plugin.properties
new file mode 100644
index 0000000000..db79de8f5d
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/plugin.properties
@@ -0,0 +1,91 @@
+DockerCategory.name=Docker Category
+DockerImagesView.name=Docker Images
+DockerContainersView.name=Docker Containers
+DockerContainersProvider.name=Docker Containers
+DockerExplorerView.name=Docker Explorer
+DockerExplorerContent.name=Docker daemons
+
+DockerPerspective.name=Docker Tooling
+
+TopLevelImagesViewFilter.name=Top-level images
+IntermediateImagesViewFilter.name=Intermediate images
+DanglingImagesViewFilter.name=Dangling (untagged) images
+StoppedContainerViewFilter.name=Stopped containers
+
+PreferencesPage.name=Docker
+LoggingPreferencesPage.name=Logging
+
+Info.label=Info
+Inspect.label=Inspect
+
+command.refreshimages.label=&Refresh Images
+command.refreshimages.tooltip=Refresh list of images
+command.refreshimages.name=Refresh Images
+command.refreshimages.description=Refresh the list of images
+
+command.refreshcontainers.label=&Refresh Containers
+command.refreshcontainers.tooltip=Refresh list of containers
+
+command.refreshcontainers.name=Refresh Containers
+command.refreshcontainers.description=Refresh the list of containers
+
+command.startcontainers.name=&Start Selected Containers
+command.startcontainers.description=Stop the selected containers
+
+command.pausecontainers.name=&Pause Selected Containers
+command.pausecontainers.description=Pause the selected containers
+
+command.unpausecontainers.name=&Unpause Selected Containers
+command.unpausecontainers.description=Unpause the selected containers
+
+command.stopcontainers.name=&Stop Selected Containers
+command.stopcontainers.description=Stop the selected containers
+
+command.killcontainers.name=&Kill Selected Containers
+command.killcontainers.description=Kill the selected containers
+
+command.removecontainers.name=&Remove Selected Containers
+command.removecontainers.description=Remove the selected containers
+
+command.commitcontainer.name=Commit Container
+command.commitcontainer.description=Commit the selected container into a new image
+
+command.displaycontainerlog.name=Display Log
+command.displaycontainerlog.description=Display the log for the selected container in the Console
+
+command.removecontainerlog.name=Remove Log
+command.removecontainerlog.description=Remove the console log for the selected container
+
+command.showallcontainers.name=&Show all Containers
+command.showallcontainers.description=Show all Containers, including non-running ones.
+
+command.removeimages.name=Re&move Selected Images
+command.removeimages.description=Remove the selected images
+
+command.refreshimages.name=&Refresh Images
+command.refreshimages.description=Refresh the list of images
+
+command.buildimage.name=&Build Image
+command.buildimage.description=Build Image from Dockerfile
+
+command.pullimage.name=&Pull Image
+command.pullimage.description=Pull Image from registry
+
+command.pushimage.name=P&ush Image
+command.pushimage.description=Push Image tag to registry
+
+command.createcontainer.name=&Create Container
+command.createcontainer.description=Create and run a Container based on Image
+
+command.tagimage.name=&Tag Image
+command.tagimage.description=Add a tag to an Image
+
+command.removetagimage.name=&Remove Tag
+command.removetagimage.description=Remove a tag from an Image with multiple tags
+
+command.showallimages.name=&Show all Images
+command.showallimages.description=Show all Images, including intermediate images.
+
+command.refreshexplorer.label=&Refresh
+command.removeconnection.label=&Remove connection
+command.addconnection.label=&Add connection
diff --git a/containers/org.eclipse.linuxtools.docker.ui/plugin.xml b/containers/org.eclipse.linuxtools.docker.ui/plugin.xml
new file mode 100644
index 0000000000..d0f48bc5e8
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/plugin.xml
@@ -0,0 +1,923 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ name="%PreferencesPage.name"
+ class="org.eclipse.linuxtools.internal.docker.ui.preferences.DockerPreferencePage"
+ id="org.eclipse.linuxtools.docker.ui.preferences.DockerPreferencePage">
+ </page>
+ <page
+ category="org.eclipse.linuxtools.docker.ui.preferences.DockerPreferencePage"
+ class="org.eclipse.linuxtools.internal.docker.ui.preferences.LoggingPreferencePage"
+ id="org.eclipse.linuxtools.docker.ui.preferences.LoggingPage"
+ name="%LoggingPreferencesPage.name">
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="org.eclipse.linuxtools.internal.docker.ui.preferences.PreferenceInitializer">
+ </initializer>
+ </extension>
+ <extension
+ point="org.eclipse.ui.views">
+ <category
+ name="%DockerCategory.name"
+ id="org.eclipse.linuxtools.docker.ui">
+ </category>
+ <view
+ category="org.eclipse.linuxtools.docker.ui"
+ class="org.eclipse.linuxtools.internal.docker.ui.views.DockerContainersView"
+ icon="icons/mock-repository.gif"
+ id="org.eclipse.linuxtools.docker.ui.dockerContainersView"
+ name="%DockerContainersView.name"
+ restorable="true">
+ </view>
+ <view
+ category="org.eclipse.linuxtools.docker.ui"
+ class="org.eclipse.linuxtools.internal.docker.ui.views.DockerImagesView"
+ icon="icons/dbgroup_obj.gif"
+ id="org.eclipse.linuxtools.docker.ui.dockerImagesView"
+ name="%DockerImagesView.name"
+ restorable="true">
+ </view>
+ <view
+ category="org.eclipse.linuxtools.docker.ui"
+ class="org.eclipse.linuxtools.internal.docker.ui.views.DockerExplorerView"
+ icon="icons/repositories-blue.gif"
+ id="org.eclipse.linuxtools.docker.ui.dockerExplorerView"
+ name="%DockerExplorerView.name"
+ restorable="true">
+ </view>
+
+ </extension>
+ <extension
+ point="org.eclipse.help.contexts">
+ <contexts
+ file="contexts.xml">
+ </contexts>
+ </extension>
+ <extension
+ point="org.eclipse.ui.navigator.viewer">
+ <viewer
+ viewerId="org.eclipse.linuxtools.docker.ui.dockerExplorerView">
+ <options>
+ <property
+ name="org.eclipse.ui.navigator.hideLinkWithEditorAction"
+ value="true">
+ </property>
+ </options>
+ </viewer>
+ <viewerContentBinding
+ viewerId="org.eclipse.linuxtools.docker.ui.dockerExplorerView">
+ <includes>
+ <contentExtension
+ isRoot="true"
+ pattern="org.eclipse.linuxtools.docker.ui.dockerExplorerViewContent">
+ </contentExtension>
+ <contentExtension
+ pattern="org.eclipse.linuxtools.docker.ui.topLevelImagesFilter">
+ </contentExtension>
+ <contentExtension
+ pattern="org.eclipse.linuxtools.docker.ui.intermediateImagesFilter">
+ </contentExtension>
+ <contentExtension
+ pattern="org.eclipse.linuxtools.docker.ui.danglingImagesFilter">
+ </contentExtension>
+ <contentExtension
+ pattern="org.eclipse.linuxtools.docker.ui.stoppedContainersViewerFilter">
+ </contentExtension>
+ </includes>
+ </viewerContentBinding>
+ </extension>
+ <extension
+ point="org.eclipse.ui.navigator.navigatorContent">
+ <navigatorContent
+ contentProvider="org.eclipse.linuxtools.internal.docker.ui.views.DockerExplorerContentProvider"
+ id="org.eclipse.linuxtools.docker.ui.dockerExplorerViewContent"
+ labelProvider="org.eclipse.linuxtools.internal.docker.ui.views.DockerExplorerLabelProvider"
+ name="%DockerExplorerContent.name"
+ priority="highest">
+ <triggerPoints></triggerPoints>
+ </navigatorContent>
+ <commonFilter
+ activeByDefault="false"
+ class="org.eclipse.linuxtools.internal.docker.ui.views.TopLevelImagesViewerFilter"
+ id="org.eclipse.linuxtools.docker.ui.topLevelImagesFilter"
+ name="%TopLevelImagesViewFilter.name">
+ </commonFilter>
+ <commonFilter
+ activeByDefault="true"
+ class="org.eclipse.linuxtools.internal.docker.ui.views.IntermediateImagesViewerFilter"
+ id="org.eclipse.linuxtools.docker.ui.intermediateImagesFilter"
+ name="%IntermediateImagesViewFilter.name">
+ </commonFilter>
+ <commonFilter
+ activeByDefault="true"
+ class="org.eclipse.linuxtools.internal.docker.ui.views.DanglingImagesViewerFilter"
+ id="org.eclipse.linuxtools.docker.ui.danglingImagesFilter"
+ name="%DanglingImagesViewFilter.name">
+ </commonFilter>
+ <commonFilter
+ activeByDefault="true"
+ class="org.eclipse.linuxtools.internal.docker.ui.views.HideStoppedContainersViewerFilter"
+ id="org.eclipse.linuxtools.docker.ui.stoppedContainersViewerFilter"
+ name="%StoppedContainerViewFilter.name">
+ </commonFilter>
+ </extension>
+
+ <!-- Refresh View -->
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ id="org.eclipse.linuxtools.docker.ui.commands.refreshExplorerView"
+ name="%command.refreshexplorer.label">
+ </command>
+ <command
+ id="org.eclipse.linuxtools.docker.ui.commands.addConnection"
+ name="%command.addconnection.label">
+ </command>
+ <command
+ id="org.eclipse.linuxtools.docker.ui.commands.removeConnection"
+ name="%command.removeconnection.label">
+ </command>
+ <command
+ description="%command.startcontainers.description"
+ id="org.eclipse.linuxtools.docker.ui.commands.startContainers"
+ name="%command.startcontainers.name">
+ </command>
+ <command
+ description="%command.pausecontainers.description"
+ id="org.eclipse.linuxtools.docker.ui.commands.pauseContainers"
+ name="%command.pausecontainers.name">
+ </command>
+ <command
+ description="%command.unpausecontainers.description"
+ id="org.eclipse.linuxtools.docker.ui.commands.unpauseContainers"
+ name="%command.unpausecontainers.name">
+ </command>
+ <command
+ description="%command.stopcontainers.description"
+ id="org.eclipse.linuxtools.docker.ui.commands.stopContainers"
+ name="%command.stopcontainers.name">
+ </command>
+ <command
+ description="%command.killcontainers.description"
+ id="org.eclipse.linuxtools.docker.ui.commands.killContainers"
+ name="%command.killcontainers.name">
+ </command>
+ <command
+ description="%command.removecontainers.description"
+ id="org.eclipse.linuxtools.docker.ui.commands.removeContainers"
+ name="%command.removecontainers.name">
+ </command>
+ <command
+ description="%command.refreshcontainers.description"
+ id="org.eclipse.linuxtools.docker.ui.commands.refreshContainers"
+ name="%command.refreshcontainers.name">
+ </command>
+ <command
+ description="%command.commitcontainer.description"
+ id="org.eclipse.linuxtools.docker.ui.commands.commitContainer"
+ name="%command.commitcontainer.name">
+ </command>
+ <command
+ description="%command.displaycontainerlog.description"
+ id="org.eclipse.linuxtools.docker.ui.commands.displayContainerLog"
+ name="%command.displaycontainerlog.name">
+ </command>
+ <command
+ description="%command.removecontainerlog.description"
+ id="org.eclipse.linuxtools.docker.ui.commands.removeContainerLog"
+ name="%command.removecontainerlog.name">
+ </command>
+ <command
+ description="%command.showallcontainers.description"
+ id="org.eclipse.linuxtools.docker.ui.commands.showAllContainers"
+ name="%command.showallcontainers.name">
+ <state
+ class="org.eclipse.ui.handlers.RegistryToggleState:true"
+ id="org.eclipse.ui.commands.toggleState">
+ </state>
+ </command>
+ <command
+ description="%command.pullimage.description"
+ id="org.eclipse.linuxtools.docker.ui.commands.pullImage"
+ name="%command.pullimage.name">
+ </command>
+ <command
+ description="%command.pushimage.description"
+ id="org.eclipse.linuxtools.docker.ui.commands.pushImage"
+ name="%command.pushimage.name">
+ </command>
+ <command
+ description="%command.createcontainer.description"
+ id="org.eclipse.linuxtools.docker.ui.commands.createContainer"
+ name="%command.createcontainer.name">
+ </command>
+ <command
+ description="%command.tagimage.description"
+ id="org.eclipse.linuxtools.docker.ui.commands.tagImage"
+ name="%command.tagimage.name">
+ </command>
+ <command
+ description="%command.removetagimage.description"
+ id="org.eclipse.linuxtools.docker.ui.commands.removeTag"
+ name="%command.removetagimage.name">
+ </command>
+ <command
+ description="%command.buildimage.description"
+ id="org.eclipse.linuxtools.docker.ui.commands.buildImage"
+ name="%command.buildimage.name">
+ </command>
+ <command
+ description="%command.removeimages.description"
+ id="org.eclipse.linuxtools.docker.ui.commands.removeImages"
+ name="%command.removeimages.name">
+ </command>
+ <command
+ description="%command.refreshimages.description"
+ id="org.eclipse.linuxtools.docker.ui.commands.refreshImages"
+ name="%command.refreshimages.name">
+ </command>
+ <command
+ description="%command.showallimages.description"
+ id="org.eclipse.linuxtools.docker.ui.commands.showAllImages"
+ name="%command.showallimages.name">
+ <state
+ class="org.eclipse.ui.handlers.RegistryToggleState:true"
+ id="org.eclipse.ui.commands.toggleState">
+ </state>
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.refreshExplorerView"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.RefreshConnectionsCommandHandler">
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.addConnection"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.AddConnectionCommandHandler">
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.removeConnection"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.RemoveConnectionCommandHandler">
+ <enabledWhen>
+ <with
+ variable="selection">
+ <iterate ifEmpty="false">
+ <instanceof
+ value="org.eclipse.linuxtools.docker.core.IDockerConnection">
+ </instanceof>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.startContainers"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.StartContainersCommandHandler">
+ <enabledWhen>
+ <with variable="selection">
+ <iterate ifEmpty="false">
+ <and>
+ <instanceof value="org.eclipse.linuxtools.docker.core.IDockerContainer"></instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.linuxtools.docker.propertytesters.container.isStopped" value="true"/>
+ </and>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.pauseContainers"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.PauseContainersCommandHandler">
+ <enabledWhen>
+ <with variable="selection">
+ <iterate ifEmpty="false">
+ <and>
+ <instanceof value="org.eclipse.linuxtools.docker.core.IDockerContainer"></instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.linuxtools.docker.propertytesters.container.isRunning" value="true"/>
+ </and>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.unpauseContainers"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.UnpauseContainersCommandHandler">
+ <enabledWhen>
+ <with variable="selection">
+ <iterate ifEmpty="false">
+ <and>
+ <instanceof value="org.eclipse.linuxtools.docker.core.IDockerContainer"></instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.linuxtools.docker.propertytesters.container.isPaused" value="true"/>
+ </and>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.stopContainers"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.StopContainersCommandHandler">
+ <enabledWhen>
+ <with variable="selection">
+ <iterate ifEmpty="false">
+ <and>
+ <instanceof value="org.eclipse.linuxtools.docker.core.IDockerContainer"></instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.linuxtools.docker.propertytesters.container.isStopped" value="false"/>
+ </and>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.killContainers"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.KillContainersCommandHandler">
+ <enabledWhen>
+ <with variable="selection">
+ <iterate ifEmpty="false">
+ <and>
+ <instanceof value="org.eclipse.linuxtools.docker.core.IDockerContainer"></instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.linuxtools.docker.propertytesters.container.isStopped" value="false"/>
+ </and>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.removeContainers"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.RemoveContainersCommandHandler">
+ <enabledWhen>
+ <with variable="selection">
+ <iterate ifEmpty="false">
+ <and>
+ <instanceof value="org.eclipse.linuxtools.docker.core.IDockerContainer"></instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.linuxtools.docker.propertytesters.container.isStopped" value="true"/>
+ </and>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.commitContainer"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.CommitContainerCommandHandler">
+ <enabledWhen>
+ <with variable="selection">
+ <count value="1"/>
+ <iterate ifEmpty="false">
+ <instanceof value="org.eclipse.linuxtools.docker.core.IDockerContainer"></instanceof>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.displayContainerLog"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.DisplayContainerLogCommandHandler">
+ <enabledWhen>
+ <with variable="selection">
+ <count value="1"/>
+ <iterate ifEmpty="false">
+ <instanceof value="org.eclipse.linuxtools.docker.core.IDockerContainer"></instanceof>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.removeContainerLog"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.RemoveContainerLogCommandHandler">
+ <enabledWhen>
+ <with variable="selection">
+ <count value="1"/>
+ <iterate ifEmpty="false">
+ <instanceof value="org.eclipse.linuxtools.docker.core.IDockerContainer"></instanceof>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.refreshContainers"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.RefreshContainersCommandHandler">
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.showAllContainers"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.ShowAllContainersCommandHandler">
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.pullImage"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.PullImageCommandHandler">
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.pushImage"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.PushImageCommandHandler">
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.tagImage"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.TagImageCommandHandler">
+ <enabledWhen>
+ <with variable="selection">
+ <count value="1"/>
+ <iterate ifEmpty="false">
+ <and>
+ <instanceof value="org.eclipse.linuxtools.docker.core.IDockerImage"></instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.linuxtools.docker.propertytesters.image.canBeTagged" value="true"/>
+ </and>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.removeTag"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.RemoveTagCommandHandler">
+ <enabledWhen>
+ <with variable="selection">
+ <count value="1"/>
+ <iterate ifEmpty="false">
+ <and>
+ <instanceof value="org.eclipse.linuxtools.docker.core.IDockerImage"></instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.linuxtools.docker.propertytesters.image.hasMultipleTags" value="true"/>
+ </and>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.createContainer"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.CreateContainerCommandHandler">
+ <enabledWhen>
+ <with variable="selection">
+ <count value="1"/>
+ <iterate ifEmpty="false">
+ <instanceof value="org.eclipse.linuxtools.docker.core.IDockerImage"></instanceof>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.buildImage"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.BuildImageCommandHandler">
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.removeImages"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.RemoveImagesCommandHandler">
+ <enabledWhen>
+ <with variable="selection">
+ <iterate ifEmpty="false">
+ <instanceof value="org.eclipse.linuxtools.docker.core.IDockerImage"></instanceof>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.refreshImages"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.RefreshImagesCommandHandler">
+ </handler>
+ <handler
+ commandId="org.eclipse.linuxtools.docker.ui.commands.showAllImages"
+ class="org.eclipse.linuxtools.internal.docker.ui.commands.ShowAllImagesCommandHandler">
+ </handler>
+ </extension>
+ <!-- property testers -->
+ <extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.eclipse.linuxtools.internal.docker.ui.propertytesters.ContainerPropertyTester"
+ id="org.eclipse.linuxtools.docker.containerPropertyTester"
+ namespace="org.eclipse.linuxtools.docker.propertytesters.container"
+ properties="isRunning,isStopped,isPaused"
+ type="org.eclipse.linuxtools.docker.core.IDockerContainer">
+ </propertyTester>
+ <propertyTester
+ class="org.eclipse.linuxtools.internal.docker.ui.propertytesters.ImagePropertyTester"
+ id="org.eclipse.linuxtools.docker.ui.imagePropertyTester"
+ namespace="org.eclipse.linuxtools.docker.propertytesters.image"
+ properties="canBeTagged,hasMultipleTags"
+ type="org.eclipse.linuxtools.docker.core.IDockerImage">
+ </propertyTester>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.menus">
+ <!-- explorer view toolbar: refresh view -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.linuxtools.docker.ui.dockerExplorerView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.refreshExplorerView"
+ icon="icons/refresh_tab.gif"
+ id="org.eclipse.linuxtools.docker.ui.commands.refreshExplorerView"
+ style="push"
+ mnemonic="R">
+ </command>
+ </menuContribution>
+ <!-- explorer view toolbar: add connection -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.linuxtools.docker.ui.dockerExplorerView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.addConnection"
+ icon="icons/repository-new.gif"
+ id="org.eclipse.linuxtools.docker.ui.commands.addConnection"
+ mnemonic="A"
+ style="push">
+ </command>
+ </menuContribution>
+ <!-- explorer view toolbar: remove connection -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.linuxtools.docker.ui.dockerExplorerView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.removeConnection"
+ disabledIcon="icons/delete_d.gif"
+ icon="icons/delete.gif"
+ id="org.eclipse.linuxtools.docker.ui.commands.removeConnection"
+ mnemonic="D"
+ style="push">
+ </command>
+ </menuContribution>
+ <!-- containers view toolbar: start containers -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.linuxtools.docker.ui.dockerContainersView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.startContainers"
+ disabledIcon="icons/runningd.gif"
+ icon="icons/running.gif"
+ id="org.eclipse.linuxtools.docker.ui.commands.startContainers"
+ mnemonic="R"
+ style="push">
+ </command>
+ </menuContribution>
+ <!-- containers view toolbar: pause containers -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.linuxtools.docker.ui.dockerContainersView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.pauseContainers"
+ disabledIcon="icons/suspendd.gif"
+ icon="icons/suspend.gif"
+ id="org.eclipse.linuxtools.docker.ui.commands.pauseContainers"
+ mnemonic="P"
+ style="push">
+ </command>
+ </menuContribution>
+ <!-- containers view toolbar: unpause containers -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.linuxtools.docker.ui.dockerContainersView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.unpauseContainers"
+ disabledIcon="icons/resumed.gif"
+ icon="icons/resume.gif"
+ id="org.eclipse.linuxtools.docker.ui.commands.unpauseContainers"
+ mnemonic="U"
+ style="push">
+ </command>
+ </menuContribution>
+ <!-- containers view toolbar: stop containers -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.linuxtools.docker.ui.dockerContainersView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.stopContainers"
+ disabledIcon="icons/stoppedd.gif"
+ icon="icons/stopped.gif"
+ id="org.eclipse.linuxtools.docker.ui.commands.stopContainers"
+ mnemonic="S"
+ style="push">
+ </command>
+ </menuContribution>
+ <!-- containers view toolbar: kill containers -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.linuxtools.docker.ui.dockerContainersView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.killContainers"
+ disabledIcon="icons/killd.gif"
+ icon="icons/kill.gif"
+ id="org.eclipse.linuxtools.docker.ui.commands.killContainers"
+ mnemonic="S"
+ style="push">
+ </command>
+ </menuContribution>
+ <!-- containers view toolbar: remove containers -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.linuxtools.docker.ui.dockerContainersView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.removeContainers"
+ disabledIcon="icons/delete_d.gif"
+ icon="icons/delete.gif"
+ id="org.eclipse.linuxtools.docker.ui.commands.removeContainers"
+ mnemonic="S"
+ style="push">
+ </command>
+ </menuContribution>
+ <!-- containers view context menu: commit container -->
+ <menuContribution
+ locationURI="popup:org.eclipse.linuxtools.docker.ui.dockerContainersView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.commitContainer"
+ id="org.eclipse.linuxtools.docker.ui.commands.commitContainer"
+ style="push">
+ </command>
+ </menuContribution>
+ <!-- containers view context menu: display container log -->
+ <menuContribution
+ locationURI="popup:org.eclipse.linuxtools.docker.ui.dockerContainersView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.displayContainerLog"
+ id="org.eclipse.linuxtools.docker.ui.commands.displayContainerLog"
+ style="push">
+ </command>
+ </menuContribution>
+ <!-- containers view context menu: remove container log -->
+ <menuContribution
+ locationURI="popup:org.eclipse.linuxtools.docker.ui.dockerContainersView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.removeContainerLog"
+ id="org.eclipse.linuxtools.docker.ui.commands.removeContainerLog"
+ style="push">
+ </command>
+ </menuContribution>
+ <!-- containers view toolbar: refresh view -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.linuxtools.docker.ui.dockerContainersView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.refreshContainers"
+ icon="icons/refresh_tab.gif"
+ id="org.eclipse.linuxtools.docker.ui.commands.refreshContainers"
+ style="push"
+ mnemonic="R">
+ </command>
+ </menuContribution>
+ <!-- containers view menu: show/hide stopped containers filter -->
+ <menuContribution
+ locationURI="menu:org.eclipse.linuxtools.docker.ui.dockerContainersView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.showAllContainers"
+ icon="icons/filter_ps.gif"
+ id="org.eclipse.linuxtools.docker.ui.commands.showAllContainers"
+ style="toggle"
+ mnemonic="A">
+ </command>
+ </menuContribution>
+ <!-- images view toolbar: pull image -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.linuxtools.docker.ui.dockerImagesView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.pullImage"
+ icon="icons/pull.gif"
+ id="org.eclipse.linuxtools.docker.ui.commands.pullImage"
+ mnemonic="P"
+ style="push">
+ </command>
+ </menuContribution>
+ <!-- images view toolbar: push image -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.linuxtools.docker.ui.dockerImagesView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.pushImage"
+ icon="icons/push.gif"
+ id="org.eclipse.linuxtools.docker.ui.commands.pushImage"
+ mnemonic="U"
+ style="push">
+ </command>
+ </menuContribution>
+ <!-- images view toolbar: create container -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.linuxtools.docker.ui.dockerImagesView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.createContainer"
+ icon="icons/createcontainer.gif"
+ disabledIcon="icons/createcontainer_d.gif"
+ id="org.eclipse.linuxtools.docker.ui.commands.createContainer"
+ mnemonic="C"
+ style="push">
+ </command>
+ </menuContribution>
+ <!-- images view toolbar: build image -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.linuxtools.docker.ui.dockerImagesView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.buildImage"
+ icon="icons/build_exec.png"
+ id="org.eclipse.linuxtools.docker.ui.commands.buildImage"
+ mnemonic="B"
+ style="push">
+ </command>
+ </menuContribution>
+ <!-- images view toolbar: tag image -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.linuxtools.docker.ui.dockerImagesView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.tagImage"
+ disabledIcon="icons/tag_d.gif"
+ icon="icons/tag.gif"
+ id="org.eclipse.linuxtools.docker.ui.commands.tagImage"
+ mnemonic="T"
+ style="push">
+ </command>
+ </menuContribution>
+ <!-- images view context menu: add tag -->
+ <menuContribution
+ locationURI="popup:org.eclipse.linuxtools.docker.ui.dockerImagesView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.tagImage"
+ id="org.eclipse.linuxtools.docker.ui.commands.tagImage2"
+ style="push">
+ </command>
+ </menuContribution>
+ <!-- images view context menu: remove tag -->
+ <menuContribution
+ locationURI="popup:org.eclipse.linuxtools.docker.ui.dockerImagesView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.removeTag"
+ id="org.eclipse.linuxtools.docker.ui.commands.removeTag"
+ style="push">
+ </command>
+ </menuContribution>
+ <!-- images view toolbar: remove images -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.linuxtools.docker.ui.dockerImagesView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.removeImages"
+ disabledIcon="icons/delete_d.gif"
+ icon="icons/delete.gif"
+ id="org.eclipse.linuxtools.docker.ui.commands.removeImages"
+ mnemonic="R"
+ style="push">
+ </command>
+ </menuContribution>
+ <!-- images view toolbar: refresh view -->
+ <menuContribution
+ locationURI="toolbar:org.eclipse.linuxtools.docker.ui.dockerImagesView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.refreshImages"
+ icon="icons/refresh_tab.gif"
+ id="org.eclipse.linuxtools.docker.ui.commands.refreshImages"
+ style="push"
+ mnemonic="F">
+ </command>
+ </menuContribution>
+ <!-- images view menu: show/hide untagged images filter -->
+ <menuContribution
+ locationURI="menu:org.eclipse.linuxtools.docker.ui.dockerImagesView">
+ <command
+ commandId="org.eclipse.linuxtools.docker.ui.commands.showAllImages"
+ icon="icons/filter_ps.gif"
+ id="org.eclipse.linuxtools.docker.ui.commands.showAllImages"
+ style="toggle"
+ mnemonic="A">
+ </command>
+ </menuContribution>
+
+
+ </extension>
+
+ <extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
+ <propertyContributor
+ contributorId="org.eclipse.linuxtools.docker.ui.dockerExplorerView"
+ labelProvider="org.eclipse.linuxtools.internal.docker.ui.views.DockerExplorerLabelProvider">
+ <propertyCategory category="org.eclipse.linuxtools.docker.ui.properties.connection"/>
+ <propertyCategory category="org.eclipse.linuxtools.docker.ui.properties.container"/>
+ <propertyCategory
+ category="org.eclipse.linuxtools.docker.ui.properties.image">
+ </propertyCategory>
+ </propertyContributor>
+ </extension>
+
+
+ <extension point="org.eclipse.ui.views.properties.tabbed.propertySections">
+ <propertySections contributorId="org.eclipse.linuxtools.docker.ui.dockerExplorerView">
+ <propertySection
+ class="org.eclipse.linuxtools.internal.docker.ui.views.ConnectionInfoPropertySection"
+ enablesFor="1"
+ id="org.eclipse.linuxtools.docker.ui.properties.connection.info.section"
+ tab="org.eclipse.linuxtools.docker.ui.properties.connection.info">
+ <input type="org.eclipse.linuxtools.docker.core.IDockerConnection"/>
+ </propertySection>
+ <propertySection
+ class="org.eclipse.linuxtools.internal.docker.ui.views.ContainerInspectPropertySection"
+ enablesFor="1"
+ id="org.eclipse.linuxtools.docker.ui.properties.container.inspect.section"
+ tab="org.eclipse.linuxtools.docker.ui.properties.container.inspect">
+ <input type="org.eclipse.linuxtools.docker.core.IDockerContainer"/>
+ </propertySection>
+ <propertySection
+ class="org.eclipse.linuxtools.internal.docker.ui.views.ContainerInfoPropertySection"
+ enablesFor="1"
+ id="org.eclipse.linuxtools.docker.ui.properties.container.info.section"
+ tab="org.eclipse.linuxtools.docker.ui.properties.container.info">
+ <input type="org.eclipse.linuxtools.docker.core.IDockerContainer"/>
+ </propertySection>
+ <propertySection
+ class="org.eclipse.linuxtools.internal.docker.ui.views.ImageInspectPropertySection"
+ enablesFor="1"
+ id="org.eclipse.linuxtools.docker.ui.properties.image.inspect.section"
+ tab="org.eclipse.linuxtools.docker.ui.properties.image.inspect">
+ <input type="org.eclipse.linuxtools.docker.core.IDockerImage"/>
+ </propertySection>
+ <propertySection
+ class="org.eclipse.linuxtools.internal.docker.ui.views.ImageInfoPropertySection"
+ enablesFor="1"
+ id="org.eclipse.linuxtools.docker.ui.properties.image.info.section"
+ tab="org.eclipse.linuxtools.docker.ui.properties.image.info">
+ <input type="org.eclipse.linuxtools.docker.core.IDockerImage"/>
+ </propertySection>
+ </propertySections>
+ </extension>
+ <extension
+ point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
+ <propertyTabs
+ contributorId="org.eclipse.linuxtools.docker.ui.dockerExplorerView">
+ <propertyTab
+ category="org.eclipse.linuxtools.docker.ui.properties.connection"
+ id="org.eclipse.linuxtools.docker.ui.properties.connection.info"
+ label="%Info.label">
+ </propertyTab>
+ <propertyTab
+ category="org.eclipse.linuxtools.docker.ui.properties.container"
+ id="org.eclipse.linuxtools.docker.ui.properties.container.info"
+ label="%Info.label">
+ </propertyTab>
+ <propertyTab
+ afterTab="org.eclipse.linuxtools.docker.ui.properties.container.info"
+ category="org.eclipse.linuxtools.docker.ui.properties.container"
+ id="org.eclipse.linuxtools.docker.ui.properties.container.inspect"
+ label="%Inspect.label">
+ </propertyTab>
+ <propertyTab
+ category="org.eclipse.linuxtools.docker.ui.properties.image"
+ id="org.eclipse.linuxtools.docker.ui.properties.image.info"
+ label="%Info.label">
+ </propertyTab>
+ <propertyTab
+ afterTab="org.eclipse.linuxtools.docker.ui.properties.image.info"
+ category="org.eclipse.linuxtools.docker.ui.properties.image"
+ id="org.eclipse.linuxtools.docker.ui.properties.image.inspect"
+ label="%Inspect.label">
+ </propertyTab>
+ </propertyTabs>
+ </extension>
+ <extension
+ point="org.eclipse.ui.perspectives">
+ <perspective
+ class="org.eclipse.linuxtools.internal.docker.ui.DockerPerspective"
+ icon="icons/banner-repository.gif"
+ id="org.eclipse.linuxtools.docker.ui.perspective"
+ name="%DockerPerspective.name">
+ </perspective>
+ </extension>
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.eclipse.linuxtools.docker.ui.perspective">
+ <view
+ id="org.eclipse.linuxtools.docker.ui.dockerImagesView"
+ minimized="false"
+ ratio="0.5"
+ relationship="stack"
+ relative="org.eclipse.ui.editorss">
+ </view>
+ <view
+ id="org.eclipse.linuxtools.docker.ui.dockerContainersView"
+ minimized="false"
+ ratio="0.5"
+ relationship="stack"
+ relative="org.eclipse.ui.editorss">
+ </view>
+ <view
+ id="org.eclipse.ui.console.ConsoleView"
+ minimized="false"
+ ratio="0.60"
+ relationship="bottom"
+ relative="org.eclipse.ui.editorss">
+ </view>
+ <view
+ id="org.eclipse.ui.views.PropertySheet"
+ minimized="false"
+ ratio="0.60"
+ relationship="stack"
+ relative="org.eclipse.ui.console.ConsoleView">
+ </view>
+ <view
+ id="org.eclipse.linuxtools.docker.ui.dockerExplorerView"
+ minimized="false"
+ ratio="0.25"
+ relationship="left"
+ relative="org.eclipse.ui.editorss">
+ </view>
+ </perspectiveExtension>
+ </extension>
+
+</plugin>
diff --git a/containers/org.eclipse.linuxtools.docker.ui/pom.xml b/containers/org.eclipse.linuxtools.docker.ui/pom.xml
new file mode 100644
index 0000000000..2083e6e6ab
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/pom.xml
@@ -0,0 +1,12 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.linuxtools</groupId>
+ <artifactId>org.eclipse.linuxtools.docker</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.linuxtools.docker.ui</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+</project> \ No newline at end of file
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/Activator.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/Activator.java
new file mode 100644
index 0000000000..eecc2d4b53
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/Activator.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.ui;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.linuxtools.docker.ui"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
+ * )
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
+ * )
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given plug-in
+ * relative path
+ *
+ * @param path
+ * the path
+ * @return the image descriptor
+ */
+
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+
+ public static void log(IStatus status) {
+ Activator.getDefault().getLog().log(status);
+ }
+
+ public static void logErrorMessage(String message) {
+ log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, message, null));
+ }
+
+ public static void log(Throwable e) {
+ if (e instanceof InvocationTargetException)
+ e = ((InvocationTargetException) e).getTargetException();
+ IStatus status = null;
+ if (e instanceof CoreException)
+ status = ((CoreException) e).getStatus();
+ else
+ status = new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK,
+ e.getMessage(), e);
+ log(status);
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/IDockerConnectionPreferenceConstants.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/IDockerConnectionPreferenceConstants.java
new file mode 100644
index 0000000000..bd670745e5
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/IDockerConnectionPreferenceConstants.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.ui;
+
+public interface IDockerConnectionPreferenceConstants {
+
+ public final static String LAST_CONNECTION_CONTAINER_VIEW = "last_connection_instance_view"; //$NON-NLS-1$
+ public final static String LAST_CONNECTION_IMAGE_VIEW = "last_connection_image_view"; //$NON-NLS-1$
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/actions/package-info.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/actions/package-info.java
new file mode 100644
index 0000000000..0f49031302
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/actions/package-info.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+/**
+ * @author xcoulon
+ *
+ */
+package org.eclipse.linuxtools.docker.ui.actions; \ No newline at end of file
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/ContainerLauncher.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/ContainerLauncher.java
new file mode 100644
index 0000000000..faf9f812a3
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/ContainerLauncher.java
@@ -0,0 +1,425 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.ui.launch;
+
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.linuxtools.docker.core.DockerConnectionManager;
+import org.eclipse.linuxtools.docker.core.DockerException;
+import org.eclipse.linuxtools.docker.core.EnumDockerLoggingStatus;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerContainerExit;
+import org.eclipse.linuxtools.docker.core.IDockerContainerInfo;
+import org.eclipse.linuxtools.docker.core.IDockerHostConfig;
+import org.eclipse.linuxtools.docker.core.IDockerPortBinding;
+import org.eclipse.linuxtools.internal.docker.core.DockerConnection;
+import org.eclipse.linuxtools.internal.docker.core.DockerContainerConfig;
+import org.eclipse.linuxtools.internal.docker.core.DockerHostConfig;
+import org.eclipse.linuxtools.internal.docker.core.DockerPortBinding;
+import org.eclipse.linuxtools.internal.docker.ui.ConsoleOutputStream;
+import org.eclipse.linuxtools.internal.docker.ui.RunConsole;
+import org.eclipse.linuxtools.internal.docker.ui.views.DVMessages;
+import org.eclipse.swt.widgets.Display;
+
+public class ContainerLauncher {
+
+ private static final String ERROR_CREATING_CONTAINER = "ContainerCreateError.msg"; //$NON-NLS-1$
+ private static final String ERROR_LAUNCHING_CONTAINER = "ContainerLaunchError.msg"; //$NON-NLS-1$
+ private static final String ERROR_NO_CONNECTIONS = "ContainerNoConnections.msg"; //$NON-NLS-1$
+
+ private static RunConsole console;
+
+ /**
+ * Perform a launch of a command in a container.
+ *
+ * @param id
+ * - id of caller to use to distinguish console owner
+ * @param listener
+ * - optional listener of the run console
+ * @param connectionName
+ * - the connection to try and use or default to first connection
+ * otherwise
+ * @param image
+ * - the image to use
+ * @param command
+ * - command to run
+ * @param commandDir
+ * - directory command requires or null
+ * @param workingDir
+ * - working directory or null
+ * @param additionalDirs
+ * - additional directories to mount or null
+ * @param origEnv
+ * - original environment if we are appending to our existing
+ * environment
+ * @param envMap
+ * - map of environment variable settings
+ * @param ports
+ * - ports to expose
+ * @param keep
+ * - keep container after running
+ * @param stdinSupport
+ * - true if stdin support is required, false otherwise
+ */
+ public void launch(String id, IContainerLaunchListener listener,
+ String connectionName,
+ String image, String command, String commandDir, String workingDir,
+ List<String> additionalDirs, Map<String, String> origEnv,
+ Map<String, String> envMap, List<String> ports, boolean keep,
+ boolean stdinSupport) {
+
+ final String LAUNCH_TITLE = "ContainerLaunch.title"; //$NON-NLS-1$
+ final String LAUNCH_EXITED_TITLE = "ContainerLaunchExited.title"; //$NON-NLS-1$
+
+ final List<String> env = new ArrayList<String>();
+ env.addAll(toList(origEnv));
+ env.addAll(toList(envMap));
+
+ // Add mounts for any directories we need to run the executable.
+ // When we add mount points, we need entries of the form:
+ // hostname:mountname.
+ // In our case, we want all directories mounted as-is so the executable
+ // will
+ // run as the user expects.
+ final List<String> volumes = new ArrayList<String>();
+ if (additionalDirs != null) {
+ for (String dir : additionalDirs) {
+ volumes.add(dir + ":" + dir); //$NON-NLS-1$
+ }
+ }
+ if (workingDir != null)
+ volumes.add(workingDir + ":" + workingDir); //$NON-NLS-1$
+ if (commandDir != null)
+ volumes.add(commandDir + ":" + commandDir); //$NON-NLS-1$
+
+ final List<String> cmdList = getCmdList(command);
+
+ final Set<String> exposedPorts = new HashSet<String>();
+ final Map<String, List<IDockerPortBinding>> portBindingsMap = new HashMap<String, List<IDockerPortBinding>>();
+
+ if (ports != null) {
+ for (String port : ports) {
+ port = port.trim();
+ if (port.length() > 0) {
+ String[] segments = port.split(":"); //$NON-NLS-1$
+ if (segments.length == 1) { // containerPort
+ exposedPorts.add(segments[0]);
+ portBindingsMap
+ .put(segments[0],
+ Arrays.asList((IDockerPortBinding) new DockerPortBinding(
+ "", ""))); //$NON-NLS-1$ //$NON-NLS-2$
+ } else if (segments.length == 2) { // hostPort:containerPort
+ exposedPorts.add(segments[1]);
+ portBindingsMap
+ .put(segments[1],
+ Arrays.asList((IDockerPortBinding) new DockerPortBinding(
+ "", segments[0]))); //$NON-NLS-1$ //$NON-NLS-2$
+ } else if (segments.length == 3) { // either
+ // ip:hostPort:containerPort
+ // or ip::containerPort
+ exposedPorts.add(segments[1]);
+ if (segments[1].isEmpty()) {
+ portBindingsMap
+ .put(segments[2],
+ Arrays.asList((IDockerPortBinding) new DockerPortBinding(
+ "", segments[0]))); //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ portBindingsMap
+ .put(segments[2],
+ Arrays.asList((IDockerPortBinding) new DockerPortBinding(
+ segments[0], segments[1]))); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ }
+ }
+
+ }
+
+ // Note we don't pass volumes to the config, but instead we pass them to
+ // the
+ // HostConfig binds setting
+
+ DockerContainerConfig.Builder builder = new DockerContainerConfig.Builder()
+ .openStdin(stdinSupport).env(env).cmd(cmdList).image(image)
+ .workingDir(workingDir);
+ // add any exposed ports as needed
+ if (exposedPorts.size() > 0)
+ builder = builder.exposedPorts(exposedPorts);
+ final DockerContainerConfig config = builder.build();
+
+ DockerHostConfig.Builder hostBuilder = new DockerHostConfig.Builder()
+ .binds(volumes);
+
+ // add any port bindings if specified
+ if (portBindingsMap.size() > 0)
+ hostBuilder = hostBuilder.portBindings(portBindingsMap);
+
+ final IDockerHostConfig hostConfig = hostBuilder.build();
+
+ final IDockerConnection[] connections = DockerConnectionManager
+ .getInstance().getConnections();
+ if (connections.length == 0) {
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ MessageDialog.openError(Display.getCurrent()
+ .getActiveShell(), DVMessages
+ .getString(ERROR_LAUNCHING_CONTAINER), DVMessages
+ .getString(ERROR_NO_CONNECTIONS));
+ }
+
+ });
+ return;
+ }
+
+ // Try and use the specified connection name that was used before,
+ // otherwise, default to first in list
+ int defaultIndex = 0;
+ String[] connectionNames = new String[connections.length];
+ for (int i = 0; i < connections.length; ++i) {
+ connectionNames[i] = connections[i].getName();
+ if (connectionNames[i].equals(connectionName))
+ defaultIndex = i;
+ }
+
+ final IDockerConnection connection = connections[defaultIndex];
+ final String imageName = image;
+ final boolean keepContainer = keep;
+ final String consoleId = id;
+ final IContainerLaunchListener containerListener = listener;
+
+ Thread t = new Thread(new Runnable() {
+
+ @Override
+ public void run() {
+ // create the container
+ try {
+ String containerId = ((DockerConnection) connection)
+ .createContainer(config);
+ OutputStream stream = null;
+ RunConsole oldConsole = getConsole();
+ final RunConsole rc = RunConsole.findConsole(containerId,
+ consoleId);
+ setConsole(rc);
+ rc.clearConsole();
+ if (oldConsole != null)
+ RunConsole.removeConsole(oldConsole);
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ rc.setTitle(Messages.getFormattedString(
+ LAUNCH_TITLE, new String[] {
+ cmdList.get(0), imageName }));
+ }
+
+ });
+ // if (!rc.isAttached()) {
+ rc.attachToConsole(connection, containerId);
+ // }
+ if (rc != null) {
+ stream = rc.getOutputStream();
+ if (containerListener != null) {
+ ((ConsoleOutputStream) stream)
+ .addConsoleListener(containerListener);
+ }
+ }
+ // Create a unique logging thread id which has container id
+ // and console id
+ String loggingId = containerId + "." + consoleId;
+ ((DockerConnection) connection).startContainer(containerId,
+ loggingId, hostConfig, stream);
+ if (rc != null)
+ rc.showConsole();
+ if (containerListener != null) {
+ IDockerContainerInfo info = ((DockerConnection) connection)
+ .getContainerInfo(containerId);
+ containerListener.containerInfo(info);
+ }
+
+ // Wait for the container to finish
+ final IDockerContainerExit status = ((DockerConnection) connection)
+ .waitForContainer(containerId);
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ rc.setTitle(Messages.getFormattedString(
+ LAUNCH_EXITED_TITLE, new String[] {
+ status.statusCode().toString(),
+ cmdList.get(0), imageName }));
+ rc.showConsole();
+ }
+
+ });
+
+ // Let any container listener know that the container is finished
+ if (containerListener != null)
+ containerListener.done();
+
+ if (!keepContainer) {
+ // Drain the logging thread before we remove the
+ // container (we need to use the logging id)
+ ((DockerConnection) connection)
+ .stopLoggingThread(loggingId);
+ while (((DockerConnection) connection)
+ .loggingStatus(loggingId) == EnumDockerLoggingStatus.LOGGING_ACTIVE) {
+ Thread.sleep(1000);
+ }
+ // Look for any Display Log console that the user may
+ // have opened which would be
+ // separate and make sure it is removed as well
+ RunConsole rc2 = RunConsole.findConsole(containerId);
+ if (rc2 != null)
+ RunConsole.removeConsole(rc2);
+ ((DockerConnection) connection)
+ .removeContainer(containerId);
+ }
+
+ } catch (final DockerException e) {
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ MessageDialog.openError(Display.getCurrent()
+ .getActiveShell(),
+ DVMessages
+ .getFormattedString(
+ ERROR_CREATING_CONTAINER,
+ imageName), e.getMessage());
+
+ }
+
+ });
+ } catch (InterruptedException e) {
+ // for now
+ // do nothing
+ }
+ ((DockerConnection) connection).getContainers(true);
+ }
+
+ });
+ t.start();
+ }
+
+ /**
+ * Get the reusable run console for running C/C++ executables in containers.
+ *
+ * @return
+ */
+ private RunConsole getConsole() {
+ // if (console == null) {
+ // console = RunConsole.getContainerLessConsole();
+ // }
+ return console;
+ }
+
+ private void setConsole(RunConsole cons) {
+ console = cons;
+ }
+
+ /**
+ * Take the command string and parse it into a list of strings.
+ *
+ * @param s
+ * @return list of strings
+ */
+ private List<String> getCmdList(String s) {
+ ArrayList<String> list = new ArrayList<String>();
+ int length = s.length();
+ boolean insideQuote1 = false; // single-quote
+ boolean insideQuote2 = false; // double-quote
+ boolean escaped = false;
+ StringBuffer buffer = new StringBuffer();
+ // Parse the string and break it up into chunks that are
+ // separated by white-space or are quoted. Ignore characters
+ // that have been escaped, including the escape character.
+ for (int i = 0; i < length; ++i) {
+ char c = s.charAt(i);
+ if (escaped) {
+ buffer.append(c);
+ escaped = false;
+ }
+ switch (c) {
+ case '\'':
+ if (!insideQuote2)
+ insideQuote1 = insideQuote1 ^ true;
+ else
+ buffer.append(c);
+ break;
+ case '\"':
+ if (!insideQuote1)
+ insideQuote2 = insideQuote2 ^ true;
+ else
+ buffer.append(c);
+ break;
+ case '\\':
+ escaped = true;
+ break;
+ case ' ':
+ case '\t':
+ case '\r':
+ case '\n':
+ if (insideQuote1 || insideQuote2)
+ buffer.append(c);
+ else {
+ String item = buffer.toString();
+ buffer.setLength(0);
+ if (item.length() > 0)
+ list.add(item);
+ }
+ break;
+ default:
+ buffer.append(c);
+ break;
+ }
+ }
+ // add last item of string that will be in the buffer
+ String item = buffer.toString();
+ if (item.length() > 0)
+ list.add(item);
+ return list;
+ }
+
+ /**
+ * Convert map of environment variables to a {@link List} of KEY=VALUE
+ * String
+ *
+ * @param variables
+ * the entries to manipulate
+ * @return the concatenated key/values for each given variable entry
+ */
+ private List<String> toList(final Map<String, String> variables) {
+ final List<String> result = new ArrayList<>();
+ if (variables != null) {
+ for (Entry<String, String> entry : variables.entrySet()) {
+ final String key = entry.getKey();
+ final String value = entry.getValue();
+
+ final String envEntry = key + "=" + value; //$NON-NLS-1$
+ result.add(envEntry);
+ }
+ }
+ return result;
+
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/IContainerLaunchListener.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/IContainerLaunchListener.java
new file mode 100644
index 0000000000..513e8c6034
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/IContainerLaunchListener.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.ui.launch;
+
+import org.eclipse.linuxtools.docker.core.IDockerContainerInfo;
+
+public interface IContainerLaunchListener extends IRunConsoleListener {
+
+ public void done(); // called when container finishes
+
+ public void containerInfo(IDockerContainerInfo info);
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/IRunConsoleListener.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/IRunConsoleListener.java
new file mode 100644
index 0000000000..88c2b40a46
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/IRunConsoleListener.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.ui.launch;
+
+public interface IRunConsoleListener {
+
+ /**
+ * Listener receiver method called after output is written to Run Console.
+ *
+ * @param output
+ * string written to console
+ */
+ public void newOutput(String output);
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/Messages.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/Messages.java
new file mode 100644
index 0000000000..1b38b0672d
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/Messages.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.docker.ui.launch;
+
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages {
+
+ private static final String BUNDLE_NAME = Messages.class.getName();
+
+ public static String getString(String key) {
+ try {
+ return ResourceBundle.getBundle(BUNDLE_NAME).getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ } catch (NullPointerException e) {
+ return '#' + key + '#';
+ }
+ }
+
+ public static String getFormattedString(String key, String arg) {
+ return MessageFormat.format(getString(key), new Object[] { arg });
+ }
+
+ public static String getFormattedString(String key, String[] args) {
+ return MessageFormat.format(getString(key), (Object[]) args);
+ }
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/Messages.properties b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/Messages.properties
new file mode 100644
index 0000000000..74155453b1
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/Messages.properties
@@ -0,0 +1,13 @@
+################################################################################
+# Copyright (c) 2014 Red Hat.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat - Initial Contribution
+###############################################################################
+ContainerCommitError.msg=Error committing container: <{0}>
+ContainerLaunch.title={0} running in image: {1}
+ContainerLaunchExited.title=Exited [{0}]: {1} running in image: {2} \ No newline at end of file
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/ColoredTableViewer.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/ColoredTableViewer.java
new file mode 100644
index 0000000000..057c570397
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/ColoredTableViewer.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.widgets.Composite;
+
+public class ColoredTableViewer extends TableViewer {
+
+ private List<Object> currSortedChildren;
+
+ public ColoredTableViewer(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ @Override
+ protected Object[] getSortedChildren(Object parent) {
+ Object[] sortedChildren = super.getSortedChildren(parent);
+ currSortedChildren = Arrays.asList(sortedChildren);
+ return sortedChildren;
+ }
+
+ public List<Object> getCurrSortedChildren() {
+ return currSortedChildren;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/ConsoleOutputStream.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/ConsoleOutputStream.java
new file mode 100644
index 0000000000..026da4e0e6
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/ConsoleOutputStream.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.linuxtools.docker.ui.launch.IRunConsoleListener;
+
+// Special Console OutputStream which supports listeners.
+
+public class ConsoleOutputStream extends OutputStream {
+
+ private OutputStream stream;
+
+ ListenerList consoleListeners;
+
+ public ConsoleOutputStream(OutputStream stream) {
+ this.stream = stream;
+ }
+
+ @Override
+ public void write(byte[] b) throws IOException {
+ stream.write(b);
+ notifyConsoleListeners(b, 0, b.length);
+ }
+
+ @Override
+ public void write(byte[] b, int off, int len) throws IOException {
+ stream.write(b, off, len);
+ notifyConsoleListeners(b, off, len);
+ }
+
+ @Override
+ public void write(int arg0) throws IOException {
+ byte[] b = new byte[1];
+ b[0] = (byte) arg0;
+ write(b);
+ }
+
+ @Override
+ public void close() throws IOException {
+ stream.close();
+ }
+
+ @Override
+ public void flush() throws IOException {
+ stream.flush();
+ }
+
+ public void addConsoleListener(IRunConsoleListener listener) {
+ if (consoleListeners == null)
+ consoleListeners = new ListenerList(ListenerList.IDENTITY);
+ consoleListeners.add(listener);
+ }
+
+ public void removeConsoleListener(IRunConsoleListener listener) {
+ if (consoleListeners != null)
+ consoleListeners.remove(listener);
+ }
+
+ public void notifyConsoleListeners(byte[] b, int off, int len) {
+ if (consoleListeners != null) {
+ String output = new String(b, off, len);
+ Object[] listeners = consoleListeners.getListeners();
+ for (int i = 0; i < listeners.length; ++i) {
+ ((IRunConsoleListener) listeners[i]).newOutput(output);
+ }
+ }
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/DockerPerspective.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/DockerPerspective.java
new file mode 100644
index 0000000000..d7922c6821
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/DockerPerspective.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui;
+
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+public class DockerPerspective implements IPerspectiveFactory {
+
+ @Override
+ public void createInitialLayout(IPageLayout layout) {
+ layout.getEditorArea();
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/ProgressJob.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/ProgressJob.java
new file mode 100644
index 0000000000..6d73b9090d
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/ProgressJob.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+
+public class ProgressJob extends Job {
+
+ private int percentageDone = 0;
+ private int percentageChange = 0;
+
+ private Object lockObject = new Object();
+
+ private String jobName;
+
+ public ProgressJob(String name, String jobName) {
+ super(name);
+ this.jobName = jobName;
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ monitor.beginTask(jobName, 100);
+ boolean done = false;
+
+ while (!done) {
+ if (monitor.isCanceled()) {
+ return Status.CANCEL_STATUS;
+ }
+ // if work percentage has changed...add new amount
+ int change = getPercentageChange();
+ if (change > 0) {
+ monitor.worked(change);
+ setPercentageChange(0);
+ }
+ // if we are 100% or more done, then we are done
+ if (percentageDone >= 100) {
+ done = true;
+ }
+ // otherwise, sleep and then loop again
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ done = true;
+ }
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+
+ private int getPercentageChange() {
+ synchronized (lockObject) {
+ return percentageChange;
+ }
+ }
+
+ private void setPercentageChange(int percentChange) {
+ synchronized (lockObject) {
+ this.percentageChange = percentChange;
+ }
+ }
+
+ public void setPercentageDone(int percentage) {
+ synchronized (lockObject) {
+ if (percentage > percentageDone) {
+ percentageChange = percentage - percentageDone;
+ percentageDone = percentage;
+ }
+ }
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/RunConsole.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/RunConsole.java
new file mode 100644
index 0000000000..e165bf37d6
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/RunConsole.java
@@ -0,0 +1,314 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2013, 2015 Red Hat Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alexander Kurtakov - initial API and implementation
+ * Red Hat Inc - modified to use in Docker UI
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.ByteBuffer;
+import java.nio.channels.WritableByteChannel;
+
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.internal.docker.core.DockerConnection;
+import org.eclipse.linuxtools.internal.docker.ui.views.DVMessages;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.ui.console.ConsolePlugin;
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IConsoleView;
+import org.eclipse.ui.console.IOConsole;
+import org.eclipse.ui.console.TextConsole;
+import org.eclipse.ui.internal.console.IOConsolePage;
+import org.eclipse.ui.part.IPageBookViewPage;
+
+/**
+ * RpmConsole is used to output rpm/rpmbuild output.
+ *
+ */
+@SuppressWarnings("restriction")
+public class RunConsole extends IOConsole {
+
+ /** Id of this console. */
+ public static final String ID = "containerLog"; //$NON-NLS-1$
+ public static final String CONTAINER_LOG_TITLE = "ContainerLog.title"; //$NON-NLS-1$
+ public static final String DEFAULT_ID = "__DEFAULT_ID__"; //$NON-NLS-1$
+
+ private String containerId;
+ private String id;
+ private OutputStream outputStream;
+ private boolean attached = false;
+ private final WritableByteChannel[] ptyOutRef = new WritableByteChannel[1];
+
+ /**
+ * Returns a reference to the console that is for the given container id. If
+ * such a console does not yet exist, it will be created.
+ *
+ * @param containerId
+ * The container this console will be for. Must not be
+ * <code>null</code>.
+ * @return A console instance.
+ */
+ public static RunConsole findConsole(String containerId) {
+ return findConsole(containerId, DEFAULT_ID);
+ }
+
+ /**
+ * Returns a reference to the console that is for the given container id. If
+ * such a console does not yet exist, it will be created.
+ *
+ * @param containerId
+ * The container this console will be for. Must not be
+ * <code>null</code>.
+ * @param id
+ * The secondary id used to identify consoles belonging to
+ * various owners.
+ * @return A console instance.
+ */
+ public static RunConsole findConsole(String containerId, String id) {
+ return findConsole(containerId, id, containerId.substring(0, 8));
+ }
+
+ public static RunConsole findConsole(String containerId, String id,
+ String name) {
+ RunConsole ret = null;
+ for (IConsole cons : ConsolePlugin.getDefault().getConsoleManager()
+ .getConsoles()) {
+ if (cons instanceof RunConsole
+ && ((RunConsole) cons).containerId.equals(containerId)
+ && ((RunConsole) cons).id.equals(id)) {
+ ret = (RunConsole) cons;
+ }
+ }
+ // no existing console, create new one
+ if (ret == null) {
+ ret = new RunConsole(containerId, id, name);
+ ConsolePlugin.getDefault().getConsoleManager()
+ .addConsoles(new IConsole[] { ret });
+ }
+
+ return ret;
+ }
+
+ @Override
+ public IPageBookViewPage createPage(IConsoleView view) {
+ return new RunConsolePage(this, view);
+ }
+
+ /**
+ * Set the title of the RunConsole
+ *
+ * @param name
+ */
+ public void setTitle(String name) {
+ setName(name);
+ }
+
+ /**
+ * The console will be attached to the underlying container.
+ *
+ * @param connection
+ * The connection associated with this console.
+ */
+ public void attachToConsole(final IDockerConnection connection) {
+ final InputStream in = getInputStream();
+ final OutputStream out = newOutputStream();
+ Thread t = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ DockerConnection conn = (DockerConnection) connection;
+ if (conn.getContainerInfo(containerId).config().openStdin()) {
+ while (!conn.getContainerInfo(containerId).state()
+ .running()) {
+ Thread.sleep(1000);
+ }
+ WritableByteChannel pty_out = conn.attachCommand(
+ containerId, in, out);
+ if (conn.getContainerInfo(containerId).config().tty()) {
+ ptyOutRef[0] = pty_out;
+ }
+ }
+ } catch (Exception e) {
+ }
+ }
+ });
+ t.start();
+ attached = true;
+ }
+
+ public void attachToConsole(final IDockerConnection connection,
+ String containerId) {
+ this.containerId = containerId;
+ attachToConsole(connection);
+ }
+
+ /**
+ * Indicates whether the console is attached to the container's terminal.
+ *
+ * @return true if the console is attached and false otherwise.
+ */
+ public boolean isAttached() {
+ /*
+ * TODO: This will still return true when the corresponding container is
+ * stopped but not currently a problem as we always attach to a
+ * container about to be started.
+ */
+ return attached;
+ }
+
+ /**
+ * Remove a given console from the Console view
+ *
+ * @param console
+ * the console to remove
+ */
+ public static void removeConsole(RunConsole console) {
+ console.closeOutputStream();
+ ConsolePlugin.getDefault().getConsoleManager()
+ .removeConsoles(new IConsole[] { console });
+ }
+
+ /**
+ * Show this console in the Console View.
+ */
+ public void showConsole() {
+ // Show this console
+ ConsolePlugin.getDefault().getConsoleManager().showConsoleView(this);
+ }
+
+ /**
+ * Close the last output stream opened for this console.
+ */
+ public void closeOutputStream() {
+ try {
+ if (outputStream != null)
+ outputStream.close();
+ } catch (IOException e) {
+ // do nothing...we tried
+ }
+ }
+
+ /**
+ * Get a new output stream for this console
+ *
+ * @return An output stream for writing to the console
+ */
+ public OutputStream getOutputStream() {
+ outputStream = new ConsoleOutputStream(newOutputStream());
+ // outputStream = newOutputStream();
+ return outputStream;
+ }
+
+ /**
+ * Creates the console.
+ *
+ * @param containerId
+ * The container id this console is for.
+ * @param id
+ * The id to associate with this console.
+ * @param name
+ * The name to use for the console.
+ */
+ private RunConsole(String containerId, String id, String name) {
+ super(DVMessages.getFormattedString(CONTAINER_LOG_TITLE, name), ID,
+ null, true);
+ this.containerId = containerId;
+ this.id = id;
+ }
+
+ /*
+ * Custom Page used to add our own set of actions.
+ */
+ private class RunConsolePage extends IOConsolePage {
+
+ public RunConsolePage(TextConsole console, IConsoleView view) {
+ super(console, view);
+ }
+
+ @Override
+ protected void configureToolBar(IToolBarManager mgr) {
+ super.configureToolBar(mgr);
+
+ if (getControl() != null && getControl() instanceof StyledText) {
+ StyledText styledText = (StyledText) getControl();
+ styledText.addKeyListener(new TTYKeyListener());
+ }
+ }
+
+ }
+
+ /*
+ * Listener to support sending certain key sequences
+ */
+ private class TTYKeyListener implements KeyListener {
+ private boolean isCtrlOn;
+
+ private final int CTRL_CODE = 262144;
+ private final int C_CODE = (int) 'c';
+ private final int TAB_CODE = 9;
+
+ public TTYKeyListener() {
+ this.isCtrlOn = false;
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ if (ptyOutRef[0] != null && ptyOutRef[0].isOpen()) {
+ WritableByteChannel pty_out = ptyOutRef[0];
+ try {
+ switch (e.keyCode) {
+ case CTRL_CODE:
+ isCtrlOn = false;
+ break;
+ case TAB_CODE:
+ pty_out.write(ByteBuffer
+ .wrap(new byte[] { 9, 9 }, 0, 2));
+ break;
+ }
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ }
+ }
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+ if (ptyOutRef[0] != null && ptyOutRef[0].isOpen()) {
+ WritableByteChannel pty_out = ptyOutRef[0];
+ try {
+ switch (e.keyCode) {
+ /*
+ * TODO : These values are configurable, so we should start
+ * using 'stty -a' to know what they really are.
+ */
+ case C_CODE:
+ // ETX (End Of Text) (3) is usually the interrupt
+ // signal.
+ if (isCtrlOn) {
+ pty_out.write(ByteBuffer.wrap(new byte[] { 3 }, 0,
+ 1));
+ }
+ break;
+ case CTRL_CODE:
+ isCtrlOn = true;
+ break;
+ }
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ }
+ }
+ }
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/SWTImagesFactory.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/SWTImagesFactory.java
new file mode 100644
index 0000000000..8344ed0681
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/SWTImagesFactory.java
@@ -0,0 +1,175 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.linuxtools.docker.ui.Activator;
+import org.eclipse.swt.graphics.Image;
+
+public class SWTImagesFactory {
+ // The plug-in registry
+ private static ImageRegistry imageRegistry = Activator.getDefault()
+ .getImageRegistry();
+
+ // Sub-directory (under the package containing this class) where 16 color
+ // images are
+ private static URL fgIconBaseURL;
+
+ static {
+ try {
+ fgIconBaseURL = new URL(Activator.getDefault().getBundle()
+ .getEntry("/"), "icons/"); //$NON-NLS-1$ //$NON-NLS-2$
+ } catch (MalformedURLException e) {
+ Activator.log(e);
+ }
+ }
+ private static final String NAME_PREFIX = Activator.PLUGIN_ID + '.';
+ private static final int NAME_PREFIX_LENGTH = NAME_PREFIX.length();
+ public static final String IMG_CONNECTION = NAME_PREFIX + "connection.gif"; //$NON-NLS-1$
+ public static final String IMG_CREATE_CONTAINER = NAME_PREFIX
+ + "createcontainer.gif"; //$NON-NLS-1$
+ public static final String IMG_CREATE_CONTAINERD = NAME_PREFIX
+ + "createcontainer_d.gif"; //$NON-NLS-1$
+ public static final String IMG_FOLDER = NAME_PREFIX + "folder.gif"; //$NON-NLS-1$
+ public static final String IMG_INSTANCE = NAME_PREFIX + "instance.gif"; //$NON-NLS-1$
+ public static final String IMG_IMAGE = NAME_PREFIX + "image.gif"; //$NON-NLS-1$
+ public static final String IMG_COLLAPSE_ALL = NAME_PREFIX
+ + "collapseall.gif"; //$NON-NLS-1$
+ public static final String IMG_DOCKER_LARGE = NAME_PREFIX
+ + "docker_large.png"; //$NON-NLS-1$
+ public static final String IMG_DOCKER_SMALL = NAME_PREFIX
+ + "docker_small.gif"; //$NON-NLS-1$
+ public static final String IMG_FILTER = NAME_PREFIX + "filter_ps.gif"; //$NON-NLS-1$
+ public static final String IMG_KILL = NAME_PREFIX + "kill.gif"; //$NON-NLS-1$
+ public static final String IMG_KILLD = NAME_PREFIX + "killd.gif"; //$NON-NLS-1$
+ public static final String IMG_PULL = NAME_PREFIX + "pull.gif"; //$NON-NLS-1$
+ public static final String IMG_PUSH = NAME_PREFIX + "push.gif"; //$NON-NLS-1$
+ public static final String IMG_BUILD = NAME_PREFIX + "build_exec.png"; //$NON-NLS-1$
+ public static final String IMG_PAUSE = NAME_PREFIX + "suspend.gif"; //$NON-NLS-1$
+ public static final String IMG_PAUSE_D = NAME_PREFIX + "suspendd.gif"; //$NON-NLS-1$
+ public static final String IMG_REMOVE = NAME_PREFIX + "delete.gif"; //$NON-NLS-1$
+ public static final String IMG_REMOVE_D = NAME_PREFIX + "delete_d.gif"; //$NON-NLS-1$
+ public static final String IMG_RESUME = NAME_PREFIX + "resume.gif"; //$NON-NLS-1$
+ public static final String IMG_RESUME_D = NAME_PREFIX + "resumed.gif"; //$NON-NLS-1$
+ public static final String IMG_START = NAME_PREFIX + "running.gif"; //$NON-NLS-1$
+ public static final String IMG_STARTD = NAME_PREFIX + "runningd.gif"; //$NON-NLS-1$
+ public static final String IMG_STOP = NAME_PREFIX + "stopped.gif"; //$NON-NLS-1$
+ public static final String IMG_STOPD = NAME_PREFIX + "stoppedd.gif"; //$NON-NLS-1$
+ public static final String IMG_REFRESH = NAME_PREFIX + "refresh_tab.gif"; //$NON-NLS-1$
+ public static final String IMG_REBOOT = NAME_PREFIX + "reboot.gif"; //$NON-NLS-1$
+ public static final String IMG_REBOOTD = NAME_PREFIX + "rebootd.gif"; //$NON-NLS-1$
+ public static final ImageDescriptor DESC_CONNECTION = createManaged("",
+ IMG_CONNECTION);
+ public static final ImageDescriptor DESC_CREATE_CONTAINER = createManaged(
+ "", IMG_CREATE_CONTAINER);
+ public static final ImageDescriptor DESC_FOLDER = createManaged("",
+ IMG_FOLDER);
+ public static final ImageDescriptor DESC_INSTANCE = createManaged("",
+ IMG_INSTANCE);
+ public static final ImageDescriptor DESC_IMAGE = createManaged("",
+ IMG_IMAGE);
+ public static final ImageDescriptor DESC_COLLAPSE_ALL = createManaged("",
+ IMG_COLLAPSE_ALL);
+ public static final ImageDescriptor DESC_KILL = createManaged("", IMG_KILL);
+ public static final ImageDescriptor DESC_KILLD = createManaged("",
+ IMG_KILLD);
+ public static final ImageDescriptor DESC_DOCKER_LARGE = createManaged("",
+ IMG_DOCKER_LARGE);
+ public static final ImageDescriptor DESC_DOCKER_SMALL = createManaged("",
+ IMG_DOCKER_SMALL);
+ public static final ImageDescriptor DESC_FILTER = createManaged("",
+ IMG_FILTER);
+ public static final ImageDescriptor DESC_PULL = createManaged("", IMG_PULL);
+ public static final ImageDescriptor DESC_PUSH = createManaged("", IMG_PUSH);
+ public static final ImageDescriptor DESC_BUILD = createManaged("",
+ IMG_BUILD);
+ public static final ImageDescriptor DESC_PAUSE = createManaged("",
+ IMG_PAUSE);
+ public static final ImageDescriptor DESC_PAUSE_D = createManaged("",
+ IMG_PAUSE_D);
+ public static final ImageDescriptor DESC_REMOVE = createManaged("",
+ IMG_REMOVE);
+ public static final ImageDescriptor DESC_REMOVE_D = createManaged("",
+ IMG_REMOVE_D);
+ public static final ImageDescriptor DESC_RESUME = createManaged("",
+ IMG_RESUME);
+ public static final ImageDescriptor DESC_RESUME_D = createManaged("",
+ IMG_RESUME_D);
+ public static final ImageDescriptor DESC_START = createManaged("",
+ IMG_START);
+ public static final ImageDescriptor DESC_STARTD = createManaged("",
+ IMG_STARTD);
+ public static final ImageDescriptor DESC_STOP = createManaged("", IMG_STOP);
+ public static final ImageDescriptor DESC_STOPD = createManaged("",
+ IMG_STOPD);
+ public static final ImageDescriptor DESC_REBOOT = createManaged("",
+ IMG_REBOOT);
+ public static final ImageDescriptor DESC_REFRESH = createManaged("",
+ IMG_REFRESH);
+ public static final ImageDescriptor DESC_REBOOTD = createManaged("",
+ IMG_REBOOTD);
+
+ private static ImageDescriptor createManaged(String prefix, String name) {
+ return createManaged(imageRegistry, prefix, name);
+ }
+
+ private static ImageDescriptor createManaged(ImageRegistry registry,
+ String prefix, String name) {
+ ImageDescriptor result = ImageDescriptor.createFromURL(makeIconFileURL(
+ prefix, name.substring(NAME_PREFIX_LENGTH)));
+ registry.put(name, result);
+ return result;
+ }
+
+ public static Image get(String key) {
+ return imageRegistry.get(key);
+ }
+
+ private static ImageDescriptor create(String prefix, String name) {
+ return ImageDescriptor.createFromURL(makeIconFileURL(prefix, name));
+ }
+
+ private static URL makeIconFileURL(String prefix, String name) {
+ StringBuffer buffer = new StringBuffer(prefix);
+ buffer.append(name);
+ try {
+ return new URL(fgIconBaseURL, buffer.toString());
+ } catch (MalformedURLException e) {
+ Activator.log(e);
+ return null;
+ }
+ }
+
+ /**
+ * Sets all available image descriptors for the given action.
+ */
+ public static void setImageDescriptors(IAction action, String type,
+ String relPath) {
+ if (relPath.startsWith(NAME_PREFIX))
+ relPath = relPath.substring(NAME_PREFIX_LENGTH);
+ action.setDisabledImageDescriptor(create("d" + type, relPath)); //$NON-NLS-1$
+ action.setImageDescriptor(create("e" + type, relPath)); //$NON-NLS-1$
+
+ }
+
+ /**
+ * Helper method to access the image registry from the CUIPlugin class.
+ */
+ static ImageRegistry getImageRegistry() {
+ return imageRegistry;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/AddConnectionCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/AddConnectionCommandHandler.java
new file mode 100644
index 0000000000..b4b3c1a6fd
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/AddConnectionCommandHandler.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.linuxtools.internal.docker.ui.wizards.NewDockerConnection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.navigator.CommonNavigator;
+import org.eclipse.ui.navigator.CommonViewer;
+
+/**
+ * @author xcoulon
+ *
+ */
+public class AddConnectionCommandHandler extends AbstractHandler implements IHandler {
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+ if(activePart instanceof CommonNavigator) {
+ final boolean connectionAdded = openWizard(new NewDockerConnection(), HandlerUtil.getActiveShell(event));
+ if(connectionAdded) {
+ final CommonViewer viewer = ((CommonNavigator)activePart).getCommonViewer();
+ viewer.refresh();
+ }
+ }
+ // return must be null, javadoc says.
+ return null;
+ }
+
+ public static boolean openWizard(final IWizard wizard, final Shell shell) {
+ WizardDialog wizardDialog = new WizardDialog(shell, wizard);
+ wizardDialog.create();
+ return wizardDialog.open() == Dialog.OK;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/BaseContainersCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/BaseContainersCommandHandler.java
new file mode 100644
index 0000000000..3d74cccd04
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/BaseContainersCommandHandler.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import static org.eclipse.linuxtools.internal.docker.ui.commands.CommandUtils.getCurrentConnection;
+import static org.eclipse.linuxtools.internal.docker.ui.commands.CommandUtils.getSelectedContainers;
+
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerContainer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * Command handler to kill all the selected {@link IDockerContainer}
+ *
+ * @author xcoulon
+ *
+ */
+public abstract class BaseContainersCommandHandler extends AbstractHandler implements IHandler {
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+ final List<IDockerContainer> selectedContainers = getSelectedContainers(activePart);
+ final IDockerConnection connection = getCurrentConnection(activePart);
+ if (connection == null || selectedContainers.isEmpty()) {
+ return null;
+ }
+ final Job job = new Job(getJobName(selectedContainers)) {
+ @Override
+ protected IStatus run(final IProgressMonitor monitor) {
+ if (confirmed(selectedContainers)) {
+ monitor.beginTask(getJobName(selectedContainers),
+ selectedContainers.size());
+ for (final IDockerContainer container : selectedContainers) {
+ monitor.setTaskName(getTaskName(container));
+ executeInJob(container, connection);
+ monitor.worked(1);
+ }
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ };
+ job.setPriority(Job.LONG);
+ job.setUser(true);
+ job.schedule();
+ return null;
+ }
+
+ void openError(final String errorMessage, final Exception e) {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ MessageDialog.openError(Display.getCurrent().getActiveShell(),
+ errorMessage,
+ e.getMessage());
+ }
+ });
+ }
+
+ // allow commands to add confirmation dialog
+ boolean confirmed(List<IDockerContainer> selectedContainers) {
+ return true;
+ }
+
+ abstract String getJobName(final List<IDockerContainer> selectedContainers);
+
+ abstract String getTaskName(final IDockerContainer container);
+
+ abstract void executeInJob(final IDockerContainer container, final IDockerConnection connection);
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/BaseImagesCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/BaseImagesCommandHandler.java
new file mode 100644
index 0000000000..8599de6907
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/BaseImagesCommandHandler.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import static org.eclipse.linuxtools.internal.docker.ui.commands.CommandUtils.getCurrentConnection;
+import static org.eclipse.linuxtools.internal.docker.ui.commands.CommandUtils.getSelectedImages;
+
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerImage;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * Command handler to kill all the selected {@link IDockerImage}
+ *
+ * @author jjohnstn
+ *
+ */
+public abstract class BaseImagesCommandHandler extends AbstractHandler implements IHandler {
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+ final List<IDockerImage> selectedImages = getSelectedImages(activePart);
+ final IDockerConnection connection = getCurrentConnection(activePart);
+ if (connection == null || selectedImages.isEmpty()) {
+ return null;
+ }
+ final Job job = new Job(getJobName(selectedImages)) {
+ @Override
+ protected IStatus run(final IProgressMonitor monitor) {
+ if (confirmed(selectedImages)) {
+ monitor.beginTask(getJobName(selectedImages),
+ selectedImages.size());
+ for (final IDockerImage image : selectedImages) {
+ monitor.setTaskName(getTaskName(image));
+ executeInJob(image, connection);
+ monitor.worked(1);
+ }
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ };
+ job.setPriority(Job.LONG);
+ job.setUser(true);
+ job.schedule();
+ return null;
+ }
+
+ void openError(final String errorMessage, final Exception e) {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ MessageDialog.openError(Display.getCurrent().getActiveShell(),
+ errorMessage,
+ e.getMessage());
+ }
+ });
+ }
+
+ // allow commands to add confirmation dialog
+ boolean confirmed(List<IDockerImage> selectedImages) {
+ return true;
+ }
+
+ abstract String getJobName(final List<IDockerImage> selectedImages);
+
+ abstract String getTaskName(final IDockerImage image);
+
+ abstract void executeInJob(final IDockerImage image,
+ final IDockerConnection connection);
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/BuildImageCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/BuildImageCommandHandler.java
new file mode 100644
index 0000000000..d9d38faaa9
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/BuildImageCommandHandler.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.linuxtools.docker.core.DockerException;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.internal.docker.core.DockerConnection;
+import org.eclipse.linuxtools.internal.docker.ui.views.DVMessages;
+import org.eclipse.linuxtools.internal.docker.ui.views.DockerImagesView;
+import org.eclipse.linuxtools.internal.docker.ui.views.ImageBuildProgressHandler;
+import org.eclipse.linuxtools.internal.docker.ui.wizards.ImageBuild;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class BuildImageCommandHandler extends AbstractHandler implements
+ IHandler {
+
+ private final static String BUILD_IMAGE_JOB_TITLE = "ImageBuild.msg"; //$NON-NLS-1$
+ private static final String ERROR_BUILDING_IMAGE = "ImageBuildError.msg"; //$NON-NLS-1$
+
+ private IDockerConnection connection;
+
+ @Override
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+ final ImageBuild wizard = new ImageBuild();
+ final boolean buildImage = CommandUtils.openWizard(wizard,
+ HandlerUtil.getActiveShell(event));
+ if (buildImage) {
+ if (activePart instanceof DockerImagesView) {
+ connection = ((DockerImagesView) activePart)
+ .getConnection();
+ }
+ performBuildImage(wizard);
+ }
+ return null;
+ }
+
+ private void performBuildImage(final ImageBuild wizard) {
+ final Job buildImageJob = new Job(
+ DVMessages.getString(BUILD_IMAGE_JOB_TITLE)) {
+
+ @Override
+ protected IStatus run(final IProgressMonitor monitor) {
+ final String id = wizard.getImageName();
+ final int lines = wizard.getNumberOfLines();
+ final IPath path = wizard.getDirectory();
+ monitor.beginTask(DVMessages.getString(BUILD_IMAGE_JOB_TITLE),
+ 1);
+ // build the image and let the progress
+ // handler refresh the images when done
+ try {
+ ((DockerConnection) connection)
+ .buildImage(path, id,
+ new ImageBuildProgressHandler(connection,
+ id, lines));
+ monitor.worked(1);
+ } catch (final DockerException e) {
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ MessageDialog.openError(Display.getCurrent()
+ .getActiveShell(), DVMessages
+ .getFormattedString(ERROR_BUILDING_IMAGE,
+ id), e.getMessage());
+
+ }
+
+ });
+ // for now
+ } catch (InterruptedException e) {
+ // do nothing
+ } finally {
+ monitor.done();
+ }
+ return Status.OK_STATUS;
+ }
+
+ };
+
+ buildImageJob.schedule();
+
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/CommandUtils.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/CommandUtils.java
new file mode 100644
index 0000000000..aa869a0733
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/CommandUtils.java
@@ -0,0 +1,201 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerContainer;
+import org.eclipse.linuxtools.docker.core.IDockerImage;
+import org.eclipse.linuxtools.docker.ui.Activator;
+import org.eclipse.linuxtools.internal.docker.ui.RunConsole;
+import org.eclipse.linuxtools.internal.docker.ui.preferences.PreferenceConstants;
+import org.eclipse.linuxtools.internal.docker.ui.views.DockerContainersView;
+import org.eclipse.linuxtools.internal.docker.ui.views.DockerImagesView;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * Utility class for all {@link IHandler} command handlers
+ * @author xcoulon
+ *
+ */
+public class CommandUtils {
+
+ /**
+ * Refreshes (async) the {@link TableViewer} or {@link TreeViewer} in the given {@link IWorkbenchPart}.
+ * @param activePart
+ */
+ public static void refresh(final IWorkbenchPart activePart) {
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (activePart instanceof DockerContainersView) {
+ ((DockerContainersView) activePart).getViewer().refresh();
+ } else if (activePart instanceof DockerImagesView) {
+ ((DockerImagesView) activePart).getViewer().refresh();
+ }
+ }
+ });
+ }
+
+ /**
+ * @return the current {@link IDockerConnection} associated with the given
+ * {@link IWorkbenchPart} or {@code null} if none could be found.
+ * @param activePart
+ */
+ public static IDockerConnection getCurrentConnection(final IWorkbenchPart activePart) {
+ if (activePart instanceof DockerContainersView) {
+ return ((DockerContainersView) activePart).getConnection();
+ } else if (activePart instanceof DockerImagesView) {
+ return ((DockerImagesView) activePart).getConnection();
+ }
+ return null;
+ }
+
+ /**
+ * @param activePart
+ * the active {@link IWorkbenchPart}
+ * @return the {@link List} of selected {@link IDockerContainer} in the
+ * given active part of {@link Collections#emptyList()} if none was
+ * selected
+ */
+ public static List<IDockerContainer> getSelectedContainers(final IWorkbenchPart activePart) {
+ if (activePart instanceof DockerContainersView) {
+ final ISelection selection = ((DockerContainersView) activePart).getSelection();
+ return getSelectedContainers(selection);
+ }
+ return Collections.emptyList();
+ }
+
+ /**
+ *
+ * @param selection
+ * the current selection
+ * @return the {@link List} of {@link IDockerContainer} associated with the
+ * given {@link ISelection}, or {@link Collections#emptyList()} if
+ * none was selected.
+ */
+ public static List<IDockerContainer> getSelectedContainers(final ISelection selection) {
+ if (selection instanceof IStructuredSelection) {
+ final List<IDockerContainer> selectedContainers = new ArrayList<>();
+ final IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+ for (Iterator<?> iterator = structuredSelection.iterator(); iterator.hasNext();) {
+ final Object selectedElement = iterator.next();
+ if (selectedElement instanceof IDockerContainer) {
+ selectedContainers.add((IDockerContainer) selectedElement);
+ }
+ }
+ return Collections.unmodifiableList(selectedContainers);
+ }
+ return Collections.emptyList();
+ }
+
+ /**
+ * @param activePart
+ * the active {@link IWorkbenchPart}
+ * @return the {@link List} of selected {@link IDockerImage} in the given
+ * active part of {@link Collections#emptyList()} if none was
+ * selected
+ */
+ public static List<IDockerImage> getSelectedImages(
+ final IWorkbenchPart activePart) {
+ if (activePart instanceof DockerImagesView) {
+ final ISelection selection = ((DockerImagesView) activePart)
+ .getSelection();
+ return getSelectedImages(selection);
+ }
+ return Collections.emptyList();
+ }
+
+ /**
+ *
+ * @param selection
+ * the current selection
+ * @return the {@link List} of {@link IDockerImage} associated with the
+ * given {@link ISelection}, or {@link Collections#emptyList()} if
+ * none was selected.
+ */
+ public static List<IDockerImage> getSelectedImages(
+ final ISelection selection) {
+ if (selection instanceof IStructuredSelection) {
+ final List<IDockerImage> selectedImages = new ArrayList<>();
+ final IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+ for (Iterator<?> iterator = structuredSelection.iterator(); iterator
+ .hasNext();) {
+ final Object selectedElement = iterator.next();
+ if (selectedElement instanceof IDockerImage) {
+ selectedImages.add((IDockerImage) selectedElement);
+ }
+ }
+ return Collections.unmodifiableList(selectedImages);
+ }
+ return Collections.emptyList();
+ }
+
+ /**
+ * Finds and returns a cleared {@link RunConsole} if the preference
+ * {@link PreferenceConstants#AUTOLOG_ON_START} is set to {@code true}.
+ *
+ * @param connection
+ * the current Docker connection
+ * @param container
+ * the container whose log should be sent in the
+ * {@link RunConsole}.
+ * @return the {@link RunConsole} or {@code null}
+ */
+ public static RunConsole getRunConsole(final IDockerConnection connection, final IDockerContainer container) {
+ final boolean autoLogOnStart = Activator.getDefault().getPreferenceStore()
+ .getBoolean(PreferenceConstants.AUTOLOG_ON_START);
+ // if we are auto-logging, grab the
+ // console for the container id and get
+ // its stream.
+ if (autoLogOnStart) {
+ final RunConsole console = RunConsole.findConsole(container.id(),
+ RunConsole.DEFAULT_ID, container.name());
+ console.attachToConsole(connection);
+ console.clearConsole();
+ return console;
+ }
+ return null;
+ }
+
+ /**
+ * Opens the given {@link IWizard} and returns <code>true</code> if the user
+ * finished the operation, <code>false</code> if he cancelled it.
+ *
+ * @param wizard
+ * the wizard to open
+ * @param shell
+ * the current {@link Shell}
+ * @return <code>true</code> if the wizard completed, <code>false</code>
+ * otherwise.
+ */
+ public static boolean openWizard(final IWizard wizard, final Shell shell) {
+ final WizardDialog wizardDialog = new WizardDialog(shell, wizard);
+ wizardDialog.create();
+ return wizardDialog.open() == Dialog.OK;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/CommitContainerCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/CommitContainerCommandHandler.java
new file mode 100644
index 0000000000..780ae74ed5
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/CommitContainerCommandHandler.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.linuxtools.docker.core.DockerException;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerContainer;
+import org.eclipse.linuxtools.internal.docker.core.DockerConnection;
+import org.eclipse.linuxtools.internal.docker.ui.views.DVMessages;
+import org.eclipse.linuxtools.internal.docker.ui.views.DockerContainersView;
+import org.eclipse.linuxtools.internal.docker.ui.wizards.ContainerCommit;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class CommitContainerCommandHandler extends AbstractHandler implements
+ IHandler {
+
+ private final static String COMMIT_CONTAINER_JOB_TITLE = "ContainerCommitTitle.msg"; //$NON-NLS-1$
+ private final static String COMMIT_CONTAINER_MSG = "ContainerCommit.msg"; //$NON-NLS-1$
+ private static final String ERROR_COMMITTING_CONTAINER = "ContainerCommitError.msg"; //$NON-NLS-1$
+
+ private IDockerConnection connection;
+ private IDockerContainer container;
+
+ @Override
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+ List<IDockerContainer> selectedContainers = CommandUtils
+ .getSelectedContainers(activePart);
+ if (activePart instanceof DockerContainersView) {
+ connection = ((DockerContainersView) activePart).getConnection();
+ }
+ if (selectedContainers.size() != 1 || connection == null)
+ return null;
+ container = selectedContainers.get(0);
+ final ContainerCommit wizard = new ContainerCommit(container.id());
+ final boolean commitContainer = CommandUtils.openWizard(wizard,
+ HandlerUtil.getActiveShell(event));
+ if (commitContainer) {
+ performCommitContainer(wizard);
+ }
+ return null;
+ }
+
+ private void performCommitContainer(final ContainerCommit wizard) {
+ final Job commitContainerJob = new Job(
+ DVMessages.getString(COMMIT_CONTAINER_JOB_TITLE)) {
+
+ @Override
+ protected IStatus run(final IProgressMonitor monitor) {
+ final String tag = wizard.getTag();
+ final String repo = wizard.getRepo();
+ final String author = wizard.getAuthor();
+ final String comment = wizard.getComment();
+ monitor.beginTask(DVMessages.getString(COMMIT_CONTAINER_MSG), 1);
+ // commit the Container and then update the list of Images
+ try {
+ ((DockerConnection) connection).commitContainer(
+ container.id(), repo, tag, comment, author);
+ monitor.worked(1);
+ } catch (DockerException e) {
+ MessageDialog.openError(Display.getCurrent()
+ .getActiveShell(), DVMessages.getFormattedString(
+ ERROR_COMMITTING_CONTAINER, tag), e.getMessage());
+ } finally {
+ monitor.done();
+ }
+ return Status.OK_STATUS;
+ }
+
+ };
+
+ commitContainerJob.schedule();
+
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/CreateContainerCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/CreateContainerCommandHandler.java
new file mode 100644
index 0000000000..d9d7f6ac84
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/CreateContainerCommandHandler.java
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import java.io.OutputStream;
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.linuxtools.docker.core.DockerException;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerContainerConfig;
+import org.eclipse.linuxtools.docker.core.IDockerContainerInfo;
+import org.eclipse.linuxtools.docker.core.IDockerHostConfig;
+import org.eclipse.linuxtools.docker.core.IDockerImage;
+import org.eclipse.linuxtools.internal.docker.core.DockerConnection;
+import org.eclipse.linuxtools.internal.docker.ui.RunConsole;
+import org.eclipse.linuxtools.internal.docker.ui.views.DVMessages;
+import org.eclipse.linuxtools.internal.docker.ui.views.DockerImagesView;
+import org.eclipse.linuxtools.internal.docker.ui.wizards.ContainerCreate;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class CreateContainerCommandHandler extends AbstractHandler implements
+ IHandler {
+
+ private final static String CREATE_CONTAINER_JOB_TITLE = "ContainerCreateTitle.msg"; //$NON-NLS-1$
+ private final static String CREATE_CONTAINER_MSG = "ContainerCreate.msg"; //$NON-NLS-1$
+ private static final String ERROR_CREATING_IMAGE = "ContainerCreateError.msg"; //$NON-NLS-1$
+
+ private IDockerConnection connection;
+ private IDockerImage image;
+
+ @Override
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+ List<IDockerImage> selectedImages = CommandUtils
+ .getSelectedImages(activePart);
+ if (activePart instanceof DockerImagesView) {
+ connection = ((DockerImagesView) activePart).getConnection();
+ }
+ if (selectedImages.size() != 1 || connection == null)
+ return null;
+ image = selectedImages.get(0);
+ final ContainerCreate wizard;
+ if (!image.isDangling() && !image.isIntermediateImage())
+ wizard = new ContainerCreate(connection, image.repoTags().get(0));
+ else
+ wizard = new ContainerCreate(connection, image.id()
+ .substring(0, 12));
+ final boolean tagImage = CommandUtils.openWizard(wizard,
+ HandlerUtil.getActiveShell(event));
+ if (tagImage) {
+ if (activePart instanceof DockerImagesView) {
+ connection = ((DockerImagesView) activePart)
+ .getConnection();
+ }
+ performCreateContainer(wizard);
+ }
+ return null;
+ }
+
+ private void performCreateContainer(final ContainerCreate wizard) {
+ final Job createContainerJob = new Job(
+ DVMessages.getString(CREATE_CONTAINER_JOB_TITLE)) {
+
+ @Override
+ protected IStatus run(final IProgressMonitor monitor) {
+ final IDockerContainerConfig config = wizard.getConfig();
+ final IDockerHostConfig hostConfig = wizard.getHostConfig();
+ final String image = wizard.getImageId();
+ monitor.beginTask(DVMessages.getString(CREATE_CONTAINER_MSG), 4);
+ // pull the image and let the progress
+ // handler refresh the images when done
+ try {
+ final String containerId = ((DockerConnection) connection)
+ .createContainer(config);
+ monitor.worked(1);
+ IDockerContainerInfo info = ((DockerConnection) connection)
+ .getContainerInfo(containerId);
+ String name = info.name();
+ if (name.startsWith("/")) //$NON-NLS-1$
+ name = name.replaceFirst("/", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ monitor.worked(1);
+ OutputStream stream = null;
+ RunConsole rc = RunConsole.findConsole(containerId,
+ RunConsole.DEFAULT_ID, name);
+ rc.attachToConsole(connection);
+ monitor.worked(1);
+ if (rc != null) {
+ stream = rc.getOutputStream();
+ }
+ final OutputStream logstream = stream;
+ ((DockerConnection) connection).startContainer(containerId,
+ hostConfig, logstream);
+ monitor.worked(1);
+ } catch (final DockerException e) {
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ MessageDialog.openError(Display.getCurrent()
+ .getActiveShell(), DVMessages
+ .getFormattedString(ERROR_CREATING_IMAGE,
+ image), e.getMessage());
+
+ }
+
+ });
+ // for now
+ } catch (InterruptedException e) {
+ // do nothing
+ } finally {
+ monitor.done();
+ }
+ return Status.OK_STATUS;
+ }
+
+ };
+
+ createContainerJob.schedule();
+
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/DisplayContainerLogCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/DisplayContainerLogCommandHandler.java
new file mode 100644
index 0000000000..fac3bfb637
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/DisplayContainerLogCommandHandler.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import java.io.OutputStream;
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.linuxtools.docker.core.DockerException;
+import org.eclipse.linuxtools.docker.core.EnumDockerLoggingStatus;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerContainer;
+import org.eclipse.linuxtools.internal.docker.core.DockerConnection;
+import org.eclipse.linuxtools.internal.docker.ui.RunConsole;
+import org.eclipse.linuxtools.internal.docker.ui.views.DVMessages;
+import org.eclipse.linuxtools.internal.docker.ui.views.DockerContainersView;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class DisplayContainerLogCommandHandler extends AbstractHandler implements
+ IHandler {
+
+ private static final String CONTAINER_LOG_TITLE = "ContainerLog.title"; //$NON-NLS-1$
+ private static final String ERROR_LOGGING_CONTAINER = "ContainerLoggingError.msg"; //$NON-NLS-1$
+
+ private IDockerConnection connection;
+ private IDockerContainer container;
+
+ @Override
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+ List<IDockerContainer> selectedContainers = CommandUtils
+ .getSelectedContainers(activePart);
+ if (activePart instanceof DockerContainersView) {
+ connection = ((DockerContainersView) activePart).getConnection();
+ }
+ if (selectedContainers.size() != 1 || connection == null)
+ return null;
+ container = selectedContainers.get(0);
+ final String id = container.id();
+ final String name = container.name();
+ try {
+ final RunConsole rc = RunConsole
+ .findConsole(id);
+ if (!rc.isAttached()) {
+ rc.attachToConsole(connection);
+ }
+ if (rc != null) {
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ rc.setTitle(DVMessages.getFormattedString(
+ CONTAINER_LOG_TITLE, name));
+ }
+
+ });
+ OutputStream stream = rc
+ .getOutputStream();
+ // Only bother to ask for a log if
+ // one isn't currently active
+ EnumDockerLoggingStatus status = ((DockerConnection) connection)
+ .loggingStatus(id);
+ if (status != EnumDockerLoggingStatus.LOGGING_ACTIVE
+ && !((DockerConnection) connection)
+ .getContainerInfo(id).config().tty()) {
+ rc.clearConsole();
+ ((DockerConnection) connection).logContainer(id, stream);
+ }
+ rc.showConsole();
+ }
+ } catch (DockerException
+ | InterruptedException e) {
+ Display.getDefault().syncExec(
+ new Runnable() {
+
+ @Override
+ public void run() {
+ MessageDialog
+ .openError(
+ Display.getCurrent()
+ .getActiveShell(),
+ DVMessages
+ .getFormattedString(
+ ERROR_LOGGING_CONTAINER,
+ id),
+ e.getMessage());
+ }
+ });
+ }
+ return null;
+ }
+
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/KillContainersCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/KillContainersCommandHandler.java
new file mode 100644
index 0000000000..c9e8277598
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/KillContainersCommandHandler.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import java.util.List;
+
+import org.eclipse.linuxtools.docker.core.DockerException;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerContainer;
+import org.eclipse.linuxtools.internal.docker.ui.views.DVMessages;
+
+/**
+ * Command handler to kill all the selected {@link IDockerContainer}
+ *
+ * @author xcoulon
+ *
+ */
+public class KillContainersCommandHandler extends BaseContainersCommandHandler {
+
+ private static final String CONTAINERS_KILL_MSG = "ContainersKill.msg"; //$NON-NLS-1$
+ private static final String CONTAINER_KILL_MSG = "ContainerKill.msg"; //$NON-NLS-1$
+ private static final String CONTAINER_KILL_ERROR_MSG = "ContainerKillError.msg"; //$NON-NLS-1$
+
+ @Override
+ void executeInJob(final IDockerContainer container, final IDockerConnection connection) {
+ try {
+ connection.killContainer(container.id());
+ connection.getContainers(true);
+ } catch (DockerException | InterruptedException e) {
+ final String errorMessage = DVMessages.getFormattedString(CONTAINER_KILL_ERROR_MSG, container.id());
+ openError(errorMessage, e);
+ }
+ }
+
+ @Override
+ String getJobName(final List<IDockerContainer> selectedContainers) {
+ return DVMessages.getString(CONTAINERS_KILL_MSG);
+ }
+
+ @Override
+ String getTaskName(final IDockerContainer container) {
+ return DVMessages.getFormattedString(CONTAINER_KILL_MSG, container.name());
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/PauseContainersCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/PauseContainersCommandHandler.java
new file mode 100644
index 0000000000..a1ab9bb10f
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/PauseContainersCommandHandler.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import java.util.List;
+
+import org.eclipse.linuxtools.docker.core.DockerException;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerContainer;
+import org.eclipse.linuxtools.internal.docker.ui.views.DVMessages;
+
+/**
+ * Command handler to pause all the selected {@link IDockerContainer}
+ * @author xcoulon
+ *
+ */
+public class PauseContainersCommandHandler extends BaseContainersCommandHandler {
+
+ private static final String CONTAINERS_PAUSE_MSG = "ContainersPause.msg"; //$NON-NLS-1$
+ private static final String CONTAINER_PAUSE_MSG = "ContainerPause.msg"; //$NON-NLS-1$
+ private static final String CONTAINER_PAUSE_ERROR_MSG = "ContainerPauseError.msg"; //$NON-NLS-1$
+
+ @Override
+ void executeInJob(final IDockerContainer container, final IDockerConnection connection) {
+ try {
+ connection.pauseContainer(container.id());
+ connection.getContainers(true);
+ } catch (DockerException | InterruptedException e) {
+ final String errorMessage = DVMessages.getFormattedString(CONTAINER_PAUSE_ERROR_MSG, container.id());
+ openError(errorMessage, e);
+ }
+ }
+
+ @Override
+ String getJobName(final List<IDockerContainer> selectedContainers) {
+ return DVMessages.getString(CONTAINERS_PAUSE_MSG);
+ }
+
+ @Override
+ String getTaskName(final IDockerContainer container) {
+ return DVMessages.getFormattedString(CONTAINER_PAUSE_MSG, container.name());
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/PullImageCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/PullImageCommandHandler.java
new file mode 100644
index 0000000000..8b4c8f9169
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/PullImageCommandHandler.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.linuxtools.docker.core.DockerException;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.internal.docker.core.DockerConnection;
+import org.eclipse.linuxtools.internal.docker.ui.views.DVMessages;
+import org.eclipse.linuxtools.internal.docker.ui.views.DockerImagesView;
+import org.eclipse.linuxtools.internal.docker.ui.views.ImagePullProgressHandler;
+import org.eclipse.linuxtools.internal.docker.ui.wizards.ImagePull;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class PullImageCommandHandler extends AbstractHandler implements
+ IHandler {
+
+ private final static String PULL_IMAGE_JOB_TITLE = "ImagePull.msg"; //$NON-NLS-1$
+ private static final String ERROR_PULLING_IMAGE = "ImagePullError.msg"; //$NON-NLS-1$
+
+ private IDockerConnection connection;
+
+ @Override
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+ final ImagePull wizard = new ImagePull();
+ final boolean pullImage = CommandUtils.openWizard(wizard,
+ HandlerUtil.getActiveShell(event));
+ if (pullImage) {
+ if (activePart instanceof DockerImagesView) {
+ connection = ((DockerImagesView) activePart)
+ .getConnection();
+ }
+ performPullImage(wizard);
+ }
+ return null;
+ }
+
+ private void performPullImage(final ImagePull wizard) {
+ final Job pullImageJob = new Job(
+ DVMessages.getString(PULL_IMAGE_JOB_TITLE)) {
+
+ @Override
+ protected IStatus run(final IProgressMonitor monitor) {
+ final String id = wizard.getImageId();
+ monitor.beginTask(DVMessages.getString(PULL_IMAGE_JOB_TITLE), 1);
+ // pull the image and let the progress
+ // handler refresh the images when done
+ try {
+ ((DockerConnection) connection).pullImage(id,
+ new ImagePullProgressHandler(connection, id));
+ monitor.worked(1);
+ } catch (final DockerException e) {
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ MessageDialog.openError(Display.getCurrent()
+ .getActiveShell(),
+ DVMessages.getFormattedString(
+ ERROR_PULLING_IMAGE, id), e
+ .getMessage());
+
+ }
+
+ });
+ // for now
+ } catch (InterruptedException e) {
+ // do nothing
+ } finally {
+ monitor.done();
+ }
+ return Status.OK_STATUS;
+ }
+
+ };
+
+ pullImageJob.schedule();
+
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/PushImageCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/PushImageCommandHandler.java
new file mode 100644
index 0000000000..66e6d09571
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/PushImageCommandHandler.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.linuxtools.docker.core.DockerException;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.internal.docker.core.DockerConnection;
+import org.eclipse.linuxtools.internal.docker.ui.views.DVMessages;
+import org.eclipse.linuxtools.internal.docker.ui.views.DockerImagesView;
+import org.eclipse.linuxtools.internal.docker.ui.views.ImagePushProgressHandler;
+import org.eclipse.linuxtools.internal.docker.ui.wizards.ImagePush;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class PushImageCommandHandler extends AbstractHandler implements
+ IHandler {
+
+ private final static String PUSH_IMAGE_JOB_TITLE = "ImagePush.msg"; //$NON-NLS-1$
+ private static final String ERROR_PUSHING_IMAGE = "ImagePushError.msg"; //$NON-NLS-1$
+
+ private IDockerConnection connection;
+
+ @Override
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+ final ImagePush wizard = new ImagePush();
+ final boolean pushImage = CommandUtils.openWizard(wizard,
+ HandlerUtil.getActiveShell(event));
+ if (pushImage) {
+ if (activePart instanceof DockerImagesView) {
+ connection = ((DockerImagesView) activePart)
+ .getConnection();
+ }
+ performPushImage(wizard);
+ }
+ return null;
+ }
+
+ private void performPushImage(final ImagePush wizard) {
+ final Job pushImageJob = new Job(
+ DVMessages.getString(PUSH_IMAGE_JOB_TITLE)) {
+
+ @Override
+ protected IStatus run(final IProgressMonitor monitor) {
+ final String tag = wizard.getImageTag();
+ monitor.beginTask(DVMessages.getString(PUSH_IMAGE_JOB_TITLE), 1);
+ // pull the image and let the progress
+ // handler refresh the images when done
+ try {
+ ((DockerConnection) connection).pushImage(tag,
+ new ImagePushProgressHandler(connection, tag));
+ monitor.worked(1);
+ } catch (final DockerException e) {
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ MessageDialog.openError(Display.getCurrent()
+ .getActiveShell(), DVMessages
+ .getFormattedString(ERROR_PUSHING_IMAGE,
+ tag), e.getMessage());
+
+ }
+
+ });
+ // for now
+ } catch (InterruptedException e) {
+ // do nothing
+ } finally {
+ monitor.done();
+ }
+ return Status.OK_STATUS;
+ }
+
+ };
+
+ pushImageJob.schedule();
+
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RefreshConnectionsCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RefreshConnectionsCommandHandler.java
new file mode 100644
index 0000000000..31086a5c2f
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RefreshConnectionsCommandHandler.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.navigator.CommonNavigator;
+
+
+/**
+ * @author xcoulon
+ *
+ */
+public class RefreshConnectionsCommandHandler extends AbstractHandler {
+
+
+ @Override
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+ if(activePart instanceof CommonNavigator) {
+ ((CommonNavigator)activePart).getCommonViewer().refresh();
+ }
+ // return must be null, javadoc says.
+ return null;
+ }
+
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RefreshContainersCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RefreshContainersCommandHandler.java
new file mode 100644
index 0000000000..4ab2b2dc5d
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RefreshContainersCommandHandler.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import static org.eclipse.linuxtools.internal.docker.ui.commands.CommandUtils.getCurrentConnection;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.internal.docker.ui.views.DVMessages;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class RefreshContainersCommandHandler extends AbstractHandler implements
+ IHandler {
+
+ public final static String CONTAINERS_REFRESH_MSG = "ContainersRefresh.msg"; //$NON-NLS-1$
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+ final IDockerConnection connection = getCurrentConnection(activePart);
+ if (connection == null) {
+ return null;
+ }
+ final Job job = new Job(DVMessages.getString(CONTAINERS_REFRESH_MSG)) {
+ @Override
+ protected IStatus run(final IProgressMonitor monitor) {
+ monitor.beginTask(DVMessages.getString(CONTAINERS_REFRESH_MSG),
+ 1);
+ connection.getContainers(true);
+ monitor.worked(1);
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ };
+ job.setPriority(Job.LONG);
+ job.setUser(true);
+ job.schedule();
+ return null;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RefreshImagesCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RefreshImagesCommandHandler.java
new file mode 100644
index 0000000000..60cf455a9c
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RefreshImagesCommandHandler.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import static org.eclipse.linuxtools.internal.docker.ui.commands.CommandUtils.getCurrentConnection;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.internal.docker.ui.views.DVMessages;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class RefreshImagesCommandHandler extends AbstractHandler implements
+ IHandler {
+
+ public final static String IMAGES_REFRESH_MSG = "ImagesRefresh.msg"; //$NON-NLS-1$
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+ final IDockerConnection connection = getCurrentConnection(activePart);
+ if (connection == null) {
+ return null;
+ }
+ final Job job = new Job(DVMessages.getString(IMAGES_REFRESH_MSG)) {
+ @Override
+ protected IStatus run(final IProgressMonitor monitor) {
+ monitor.beginTask(DVMessages.getString(IMAGES_REFRESH_MSG), 1);
+ connection.getImages(true);
+ monitor.worked(1);
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ };
+ job.setPriority(Job.LONG);
+ job.setUser(true);
+ job.schedule();
+ return null;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveConnectionCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveConnectionCommandHandler.java
new file mode 100644
index 0000000000..db8e4832fc
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveConnectionCommandHandler.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.linuxtools.docker.core.DockerConnectionManager;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.navigator.CommonNavigator;
+import org.eclipse.ui.navigator.CommonViewer;
+
+/**
+ * @author xcoulon
+ *
+ */
+public class RemoveConnectionCommandHandler extends AbstractHandler implements IHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+ if(activePart instanceof CommonNavigator) {
+ final CommonViewer viewer = ((CommonNavigator)activePart).getCommonViewer();
+ final ITreeSelection selection = (ITreeSelection) viewer.getSelection();
+ for (TreePath treePath : selection.getPaths()) {
+ DockerConnectionManager.getInstance().removeConnection((IDockerConnection) treePath.getLastSegment());
+ }
+ viewer.refresh();
+ }
+ // return must be null, javadoc says.
+ return null;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveContainerLogCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveContainerLogCommandHandler.java
new file mode 100644
index 0000000000..e629a75350
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveContainerLogCommandHandler.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerContainer;
+import org.eclipse.linuxtools.internal.docker.ui.RunConsole;
+import org.eclipse.linuxtools.internal.docker.ui.views.DockerContainersView;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class RemoveContainerLogCommandHandler extends AbstractHandler implements
+ IHandler {
+
+ private IDockerConnection connection;
+ private IDockerContainer container;
+
+ @Override
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+ List<IDockerContainer> selectedContainers = CommandUtils
+ .getSelectedContainers(activePart);
+ if (activePart instanceof DockerContainersView) {
+ connection = ((DockerContainersView) activePart).getConnection();
+ }
+ if (selectedContainers.size() != 1 || connection == null)
+ return null;
+ container = selectedContainers.get(0);
+ final String id = container.id();
+ final RunConsole rc = RunConsole.findConsole(id);
+ if (rc != null)
+ RunConsole.removeConsole(rc);
+ return null;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveContainersCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveContainersCommandHandler.java
new file mode 100644
index 0000000000..e6b7a81ca4
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveContainersCommandHandler.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.linuxtools.docker.core.DockerException;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerContainer;
+import org.eclipse.linuxtools.internal.docker.ui.views.DVMessages;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * Command handler to kill all the selected {@link IDockerContainer}
+ *
+ * @author xcoulon
+ *
+ */
+public class RemoveContainersCommandHandler extends BaseContainersCommandHandler {
+
+ private static final String CONTAINERS_REMOVE_MSG = "ContainersRemove.msg"; //$NON-NLS-1$
+ private static final String CONTAINER_REMOVE_MSG = "ContainerRemove.msg"; //$NON-NLS-1$
+ private static final String CONTAINER_REMOVE_ERROR_MSG = "ContainerRemoveError.msg"; //$NON-NLS-1$
+ private static final String CONTAINER_REMOVE_CONFIRM = "ContainerRemoveConfirm.msg"; //$NON-NLS-1$
+ private static final String CONTAINER_REMOVE_LIST = "ContainerRemoveList.msg"; //$NON-NLS-1$
+
+ @Override
+ void executeInJob(final IDockerContainer container,
+ final IDockerConnection connection) {
+ try {
+ connection.removeContainer(container.id());
+ } catch (DockerException | InterruptedException e) {
+ final String errorMessage = DVMessages.getFormattedString(
+ CONTAINER_REMOVE_ERROR_MSG, container.id().substring(0, 8));
+ openError(errorMessage, e);
+ } finally {
+ // always get images as we sometimes get errors on intermediate
+ // images
+ // being removed but we will remove some top ones successfully
+ connection.getContainers(true);
+ }
+ }
+
+ @Override
+ String getJobName(final List<IDockerContainer> selectedContainers) {
+ return DVMessages.getString(CONTAINERS_REMOVE_MSG);
+ }
+
+ @Override
+ String getTaskName(final IDockerContainer image) {
+ return DVMessages.getFormattedString(CONTAINER_REMOVE_MSG, image.name());
+ }
+
+ private class DialogResponse {
+ private boolean response;
+
+ public boolean getResponse() {
+ return response;
+ }
+
+ public void setResponse(boolean value) {
+ response = value;
+ }
+ }
+
+ @Override
+ boolean confirmed(List<IDockerContainer> selectedContainers) {
+ // ask for confirmation before deleting images
+ List<String> containersToRemove = new ArrayList<String>();
+ for (IDockerContainer container : selectedContainers) {
+ containersToRemove.add(container.name());
+ }
+ final List<String> names = containersToRemove;
+ final DialogResponse response = new DialogResponse();
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ boolean result = MessageDialog.openConfirm(
+ new Shell(),
+ DVMessages.getString(CONTAINER_REMOVE_CONFIRM),
+ DVMessages.getFormattedString(CONTAINER_REMOVE_LIST,
+ names.toString()));
+ response.setResponse(result);
+ }
+ });
+ return response.getResponse();
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveImagesCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveImagesCommandHandler.java
new file mode 100644
index 0000000000..9cba9d1273
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveImagesCommandHandler.java
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.linuxtools.docker.core.DockerException;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerContainer;
+import org.eclipse.linuxtools.docker.core.IDockerImage;
+import org.eclipse.linuxtools.internal.docker.ui.views.DVMessages;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * Command handler to kill all the selected {@link IDockerContainer}
+ *
+ * @author jjohnstn
+ *
+ */
+public class RemoveImagesCommandHandler extends BaseImagesCommandHandler {
+
+ private static final String IMAGES_DELETE_MSG = "ImagesRemove.msg"; //$NON-NLS-1$
+ private static final String IMAGE_DELETE_MSG = "ImageRemove.msg"; //$NON-NLS-1$
+ private static final String IMAGE_DELETE_ERROR_MSG = "ImageRemoveError.msg"; //$NON-NLS-1$
+ private static final String IMAGE_DELETE_CONFIRM = "ImageDeleteConfirm.msg"; //$NON-NLS-1$
+ private static final String IMAGE_DELETE_LIST = "ImageDeleteList.msg"; //$NON-NLS-1$
+
+ @Override
+ void executeInJob(final IDockerImage image,
+ final IDockerConnection connection) {
+ try {
+ connection.removeImage(image.id());
+ } catch (DockerException | InterruptedException e) {
+ if (!image.isDangling() && !image.isIntermediateImage()) {
+ final String errorMessage = DVMessages.getFormattedString(
+ IMAGE_DELETE_ERROR_MSG, image.repoTags().get(0));
+ openError(errorMessage, e);
+
+ } else {
+ final String errorMessage = DVMessages.getFormattedString(
+ IMAGE_DELETE_ERROR_MSG, image.id().substring(0, 8));
+ openError(errorMessage, e);
+ }
+ } finally {
+ // always get images as we sometimes get errors on intermediate
+ // images
+ // being removed but we will remove some top ones successfully
+ connection.getImages(true);
+ }
+ }
+
+ @Override
+ String getJobName(final List<IDockerImage> selectedImages) {
+ return DVMessages.getString(IMAGES_DELETE_MSG);
+ }
+
+ @Override
+ String getTaskName(final IDockerImage image) {
+ if (!image.isDangling() && !image.isIntermediateImage())
+ return DVMessages.getFormattedString(IMAGE_DELETE_MSG, image
+ .repoTags().get(0));
+
+ return DVMessages.getFormattedString(IMAGE_DELETE_MSG, image.id()
+ .substring(0, 8));
+ }
+
+ private class DialogResponse {
+ private boolean response;
+
+ public boolean getResponse() {
+ return response;
+ }
+
+ public void setResponse(boolean value) {
+ response = value;
+ }
+ }
+
+ @Override
+ boolean confirmed(List<IDockerImage> selectedImages) {
+ // ask for confirmation before deleting images
+ List<String> imagesToRemove = new ArrayList<String>();
+ for (IDockerImage image : selectedImages) {
+ // use repo tags if present, otherwise truncate ids
+ // to 8 characters so they show up
+ // reasonably in confirmation dialog...don't
+ // think this will ever cause an issue
+ if (!image.isDangling() && !image.isIntermediateImage())
+ imagesToRemove.add(image.repoTags().get(0));
+ else
+ imagesToRemove.add(image.id().substring(0, 8));
+ }
+ final List<String> names = imagesToRemove;
+ final DialogResponse response = new DialogResponse();
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ boolean result = MessageDialog.openConfirm(
+ new Shell(),
+ DVMessages.getString(IMAGE_DELETE_CONFIRM),
+ DVMessages.getFormattedString(IMAGE_DELETE_LIST,
+ names.toString()));
+ response.setResponse(result);
+ }
+ });
+ return response.getResponse();
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveTagCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveTagCommandHandler.java
new file mode 100644
index 0000000000..45d7030c9c
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/RemoveTagCommandHandler.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.linuxtools.docker.core.DockerException;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerImage;
+import org.eclipse.linuxtools.internal.docker.core.DockerConnection;
+import org.eclipse.linuxtools.internal.docker.ui.views.DVMessages;
+import org.eclipse.linuxtools.internal.docker.ui.views.DockerImagesView;
+import org.eclipse.linuxtools.internal.docker.ui.wizards.ImageRemoveTag;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class RemoveTagCommandHandler extends AbstractHandler implements
+ IHandler {
+
+ private final static String REMOVE_TAG_JOB_TITLE = "ImageRemoveTagTitle.msg"; //$NON-NLS-1$
+ private final static String REMOVE_TAG_MSG = "ImageRemoveTag.msg"; //$NON-NLS-1$
+ private static final String ERROR_REMOVING_TAG_IMAGE = "ImageRemoveTagError.msg"; //$NON-NLS-1$
+
+ private IDockerConnection connection;
+ private IDockerImage image;
+
+ @Override
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+ List<IDockerImage> selectedImages = CommandUtils
+ .getSelectedImages(activePart);
+ if (activePart instanceof DockerImagesView) {
+ connection = ((DockerImagesView) activePart).getConnection();
+ }
+ if (selectedImages.size() != 1 || connection == null)
+ return null;
+ image = selectedImages.get(0);
+ final ImageRemoveTag wizard = new ImageRemoveTag(image);
+ final boolean removeTag = CommandUtils.openWizard(wizard,
+ HandlerUtil.getActiveShell(event));
+ if (removeTag) {
+ if (activePart instanceof DockerImagesView) {
+ connection = ((DockerImagesView) activePart)
+ .getConnection();
+ }
+ performRemoveTagImage(wizard);
+ }
+ return null;
+ }
+
+ private void performRemoveTagImage(final ImageRemoveTag wizard) {
+ final Job removeTagImageJob = new Job(
+ DVMessages.getString(REMOVE_TAG_JOB_TITLE)) {
+
+ @Override
+ protected IStatus run(final IProgressMonitor monitor) {
+ final String tag = wizard.getTag();
+ monitor.beginTask(DVMessages.getString(REMOVE_TAG_MSG), 2);
+ // tag the image and let the progress
+ // handler refresh the images when done
+ try {
+ ((DockerConnection) connection).removeTag(tag);
+ monitor.worked(1);
+ ((DockerConnection) connection).getImages(true);
+ monitor.worked(1);
+ } catch (final DockerException e) {
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ MessageDialog.openError(Display.getCurrent()
+ .getActiveShell(), DVMessages
+ .getFormattedString(
+ ERROR_REMOVING_TAG_IMAGE,
+ tag), e.getMessage());
+
+ }
+
+ });
+ // for now
+ } catch (InterruptedException e) {
+ // do nothing
+ } finally {
+ monitor.done();
+ }
+ return Status.OK_STATUS;
+ }
+
+ };
+
+ removeTagImageJob.schedule();
+
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/ShowAllContainersCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/ShowAllContainersCommandHandler.java
new file mode 100644
index 0000000000..4317e6d57e
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/ShowAllContainersCommandHandler.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.linuxtools.internal.docker.ui.views.DockerContainersView;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * @author xcoulon
+ *
+ */
+public class ShowAllContainersCommandHandler extends AbstractHandler {
+
+ @Override
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+ final boolean checked = !HandlerUtil.toggleCommandState(event.getCommand());
+ if(activePart instanceof DockerContainersView) {
+ final DockerContainersView containersView = (DockerContainersView) activePart;
+ containersView.showAllContainers(checked);
+ }
+ return null;
+ }
+
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/ShowAllImagesCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/ShowAllImagesCommandHandler.java
new file mode 100644
index 0000000000..dcacae52f5
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/ShowAllImagesCommandHandler.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.linuxtools.internal.docker.ui.views.DockerImagesView;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * @author jjohnstn
+ *
+ */
+public class ShowAllImagesCommandHandler extends AbstractHandler {
+
+ @Override
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+ final boolean checked = !HandlerUtil.toggleCommandState(event.getCommand());
+ if (activePart instanceof DockerImagesView) {
+ final DockerImagesView imagesView = (DockerImagesView) activePart;
+ imagesView.showAllImages(checked);
+ }
+ return null;
+ }
+
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/StartContainersCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/StartContainersCommandHandler.java
new file mode 100644
index 0000000000..9f7647136d
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/StartContainersCommandHandler.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import static org.eclipse.linuxtools.internal.docker.ui.commands.CommandUtils.getRunConsole;
+
+import java.util.List;
+
+import org.eclipse.linuxtools.docker.core.DockerException;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerContainer;
+import org.eclipse.linuxtools.internal.docker.core.DockerConnection;
+import org.eclipse.linuxtools.internal.docker.ui.RunConsole;
+import org.eclipse.linuxtools.internal.docker.ui.views.DVMessages;
+
+/**
+ * Command handler to start all the selected {@link IDockerContainer}
+ * @author xcoulon
+ *
+ */
+public class StartContainersCommandHandler extends BaseContainersCommandHandler {
+
+ private static final String CONTAINERS_START_MSG = "ContainersStart.msg"; //$NON-NLS-1$
+ private static final String CONTAINER_START_MSG = "ContainerStart.msg"; //$NON-NLS-1$
+ private static final String CONTAINER_START_ERROR_MSG = "ContainerStartError.msg"; //$NON-NLS-1$
+
+ @Override
+ void executeInJob(final IDockerContainer container, final IDockerConnection connection) {
+ try {
+ final RunConsole console = getRunConsole(connection, container);
+ if (console != null) {
+ // if we are auto-logging, show the console
+ console.showConsole();
+ // Start the container
+ ((DockerConnection) connection).startContainer(container.id(), console.getOutputStream());
+ } else {
+ ((DockerConnection) connection).startContainer(container.id(), null);
+ }
+ ((DockerConnection) connection).getContainers(true);
+ } catch (DockerException | InterruptedException e) {
+ final String errorMessage = DVMessages.getFormattedString(CONTAINER_START_ERROR_MSG, container.id());
+ openError(errorMessage, e);
+ }
+ }
+
+ @Override
+ String getJobName(final List<IDockerContainer> selectedContainers) {
+ return DVMessages.getString(CONTAINERS_START_MSG);
+ }
+
+ @Override
+ String getTaskName(final IDockerContainer container) {
+ return DVMessages.getFormattedString(CONTAINER_START_MSG, container.name());
+ }
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/StopContainersCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/StopContainersCommandHandler.java
new file mode 100644
index 0000000000..017b9ea3d7
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/StopContainersCommandHandler.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import java.util.List;
+
+import org.eclipse.linuxtools.docker.core.DockerException;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerContainer;
+import org.eclipse.linuxtools.internal.docker.ui.views.DVMessages;
+
+/**
+ * Command handler to stop all the selected {@link IDockerContainer}
+ *
+ * @author xcoulon
+ *
+ */
+public class StopContainersCommandHandler extends BaseContainersCommandHandler {
+
+ private static final String CONTAINERS_STOP_MSG = "ContainersStop.msg"; //$NON-NLS-1$
+ private static final String CONTAINER_STOP_MSG = "ContainerStop.msg"; //$NON-NLS-1$
+ private static final String CONTAINER_STOP_ERROR_MSG = "ContainerStopError.msg"; //$NON-NLS-1$
+
+ @Override
+ void executeInJob(final IDockerContainer container, final IDockerConnection connection) {
+ try {
+ connection.stopContainer(container.id());
+ connection.getContainers(true);
+ } catch (DockerException | InterruptedException e) {
+ final String errorMessage = DVMessages.getFormattedString(CONTAINER_STOP_ERROR_MSG, container.id());
+ openError(errorMessage, e);
+ }
+ }
+
+ @Override
+ String getJobName(final List<IDockerContainer> selectedContainers) {
+ return DVMessages.getString(CONTAINERS_STOP_MSG);
+ }
+
+ @Override
+ String getTaskName(final IDockerContainer container) {
+ return DVMessages.getFormattedString(CONTAINER_STOP_MSG, container.name());
+ }
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/TagImageCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/TagImageCommandHandler.java
new file mode 100644
index 0000000000..b503a12c7b
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/TagImageCommandHandler.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.linuxtools.docker.core.DockerException;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerImage;
+import org.eclipse.linuxtools.internal.docker.core.DockerConnection;
+import org.eclipse.linuxtools.internal.docker.ui.views.DVMessages;
+import org.eclipse.linuxtools.internal.docker.ui.views.DockerImagesView;
+import org.eclipse.linuxtools.internal.docker.ui.wizards.ImageTag;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class TagImageCommandHandler extends AbstractHandler implements
+ IHandler {
+
+ private final static String TAG_IMAGE_JOB_TITLE = "ImageTagTitle.msg"; //$NON-NLS-1$
+ private final static String TAG_IMAGE_MSG = "ImageTag.msg"; //$NON-NLS-1$
+ private static final String ERROR_TAGGING_IMAGE = "ImageTagError.msg"; //$NON-NLS-1$
+
+ private IDockerConnection connection;
+ private IDockerImage image;
+
+ @Override
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ final IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+ List<IDockerImage> selectedImages = CommandUtils
+ .getSelectedImages(activePart);
+ if (activePart instanceof DockerImagesView) {
+ connection = ((DockerImagesView) activePart).getConnection();
+ }
+ if (selectedImages.size() != 1 || connection == null)
+ return null;
+ image = selectedImages.get(0);
+ final ImageTag wizard = new ImageTag(image.id());
+ final boolean tagImage = CommandUtils.openWizard(wizard,
+ HandlerUtil.getActiveShell(event));
+ if (tagImage) {
+ if (activePart instanceof DockerImagesView) {
+ connection = ((DockerImagesView) activePart)
+ .getConnection();
+ }
+ performTagImage(wizard);
+ }
+ return null;
+ }
+
+ private void performTagImage(final ImageTag wizard) {
+ final Job tagImageJob = new Job(
+ DVMessages.getString(TAG_IMAGE_JOB_TITLE)) {
+
+ @Override
+ protected IStatus run(final IProgressMonitor monitor) {
+ final String tag = wizard.getTag();
+ monitor.beginTask(DVMessages.getString(TAG_IMAGE_MSG), 2);
+ // tag the image and let the progress
+ // handler refresh the images when done
+ try {
+ ((DockerConnection) connection).tagImage(image.id(), tag);
+ monitor.worked(1);
+ ((DockerConnection) connection).getImages(true);
+ monitor.worked(1);
+ } catch (final DockerException e) {
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ MessageDialog.openError(Display.getCurrent()
+ .getActiveShell(), DVMessages
+ .getFormattedString(ERROR_TAGGING_IMAGE,
+ tag), e.getMessage());
+
+ }
+
+ });
+ // for now
+ } catch (InterruptedException e) {
+ // do nothing
+ } finally {
+ monitor.done();
+ }
+ return Status.OK_STATUS;
+ }
+
+ };
+
+ tagImageJob.schedule();
+
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/UnpauseContainersCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/UnpauseContainersCommandHandler.java
new file mode 100644
index 0000000000..5f03fc57c6
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/UnpauseContainersCommandHandler.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.commands;
+
+import static org.eclipse.linuxtools.internal.docker.ui.commands.CommandUtils.getRunConsole;
+
+import java.util.List;
+
+import org.eclipse.linuxtools.docker.core.DockerException;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerContainer;
+import org.eclipse.linuxtools.internal.docker.ui.RunConsole;
+import org.eclipse.linuxtools.internal.docker.ui.views.DVMessages;
+
+/**
+ * Command handler to unpause all the selected {@link IDockerContainer}
+ * @author xcoulon
+ *
+ */
+public class UnpauseContainersCommandHandler extends BaseContainersCommandHandler {
+
+ private static final String CONTAINERS_UNPAUSE_MSG = "ContainersPause.msg"; //$NON-NLS-1$
+ private static final String CONTAINER_UNPAUSE_MSG = "ContainerPause.msg"; //$NON-NLS-1$
+ private static final String CONTAINER_UNPAUSE_ERROR_MSG = "ContainerPauseError.msg"; //$NON-NLS-1$
+
+ @Override
+ void executeInJob(final IDockerContainer container, final IDockerConnection connection) {
+ try {
+ final RunConsole console = getRunConsole(connection, container);
+ if (console != null) {
+ // if we are auto-logging, show the console
+ console.showConsole();
+ // Start the container
+ connection.unpauseContainer(container.id(), console.getOutputStream());
+ } else {
+ connection.unpauseContainer(container.id(), null);
+ }
+ connection.getContainers(true);
+ } catch (DockerException | InterruptedException e) {
+ final String errorMessage = DVMessages.getFormattedString(CONTAINER_UNPAUSE_ERROR_MSG, container.id());
+ openError(errorMessage, e);
+ }
+ }
+
+ @Override
+ String getJobName(final List<IDockerContainer> selectedContainers) {
+ return DVMessages.getString(CONTAINERS_UNPAUSE_MSG);
+ }
+
+ @Override
+ String getTaskName(final IDockerContainer container) {
+ return DVMessages.getFormattedString(CONTAINER_UNPAUSE_MSG, container.name());
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/DockerPreferencePage.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/DockerPreferencePage.java
new file mode 100644
index 0000000000..d3e40e2ce2
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/DockerPreferencePage.java
@@ -0,0 +1,295 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui.preferences;
+
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.BINDING_MODE;
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.TCP_CERT_PATH;
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.TCP_CONNECTION;
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.TCP_HOST;
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.TCP_TLS_VERIFY;
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.UNIX_SOCKET;
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.UNIX_SOCKET_PATH;
+
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.preference.PreferenceStore;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings;
+import org.eclipse.linuxtools.docker.ui.Activator;
+import org.eclipse.linuxtools.internal.docker.core.DockerContainerRefreshManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+public class DockerPreferencePage extends PreferencePage implements
+ IWorkbenchPreferencePage {
+
+ private static final String REFRESH_TIME_MSG = "RefreshTime.label"; //$NON-NLS-1$
+
+ private Button unixSocketBtn;
+ private Text unixSocketPathText;
+
+ private EnumDockerConnectionSettings bindingMode;
+ private String unixSocketPath = null;
+ private String tcpHost = null;
+ private boolean tcpTLSVerify = false;
+ private String tcpCertPath = null;
+
+ public DockerPreferencePage() {
+ super();
+ setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ }
+
+
+ /**:
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ *
+ * Preferences are initialized by the {@link PreferenceInitializer} which attempts to find
+ * DOCKER environment variables at the system level.
+ *
+ * @see PreferenceInitializer
+ */
+ public void init(final IWorkbench workbench) {
+ final IPreferenceStore preferenceStore = getPreferenceStore();
+ this.bindingMode = EnumDockerConnectionSettings.valueOf(preferenceStore.getString(BINDING_MODE.toString()));
+ this.unixSocketPath = preferenceStore.getString(UNIX_SOCKET_PATH.toString());
+ this.tcpHost = preferenceStore.getString(TCP_HOST.toString());
+ this.tcpTLSVerify = preferenceStore.getBoolean(TCP_TLS_VERIFY.toString());
+ this.tcpCertPath = preferenceStore.getString(TCP_CERT_PATH.toString());
+ }
+
+ /**
+ * Saves the current values in the {@link PreferenceStore}.
+ */
+ private void savePreferences() {
+ final IPreferenceStore preferenceStore = getPreferenceStore();
+ preferenceStore.setValue(BINDING_MODE.toString(), this.bindingMode.toString());
+ preferenceStore.setValue(UNIX_SOCKET_PATH.toString(), this.unixSocketPath);
+ preferenceStore.setValue(TCP_HOST.toString(), this.tcpHost);
+ preferenceStore.setValue(TCP_TLS_VERIFY.toString(), this.tcpTLSVerify);
+ preferenceStore.setValue(TCP_CERT_PATH.toString(), this.tcpCertPath);
+ }
+
+ @Override
+ public boolean performOk() {
+ savePreferences();
+ return true;
+ }
+
+
+ @Override
+ protected void performApply() {
+ // TODO Auto-generated method stub
+ super.performApply();
+ }
+
+ @Override
+ protected void performDefaults() {
+ // TODO Auto-generated method stub
+ super.performDefaults();
+ }
+
+ @Override
+ protected Control createContents(final Composite parent) {
+ final Composite container = new Composite(parent, SWT.NONE);
+ GridLayoutFactory.fillDefaults().numColumns(1).applyTo(container);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).applyTo(container);
+ createConnectionSettingsContainer(container);
+ createContainerRefreshContainer(container);
+ return container;
+ }
+
+ /**
+ * Creates the connection settings container, where the user can choose how to
+ * connect to the docker daemon (using sockets or TCP with SSL - or not)
+ *
+ * @param parent the parent container (ie, the main container in the preference page)
+ */
+ private void createConnectionSettingsContainer(final Composite parent) {
+ final int COLUMNS = 3;
+ final int INDENT = 20;
+ final Group container = new Group(parent, SWT.BORDER);
+ container.setText("Docker deamon binding settings");
+ container.setToolTipText("Select the binding mode to use to connect to the Docker daemon");
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).span(1, 1).grab(true, false).applyTo(container);
+ GridLayoutFactory.fillDefaults().numColumns(COLUMNS).margins(0, 0).spacing(10, 2).applyTo(container);
+
+ unixSocketBtn = new Button(container, SWT.RADIO);
+ unixSocketBtn.setText("Unix socket");
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(COLUMNS, 1).applyTo(unixSocketBtn);
+ final Label socketPathLabel = new Label(container, SWT.NONE);
+ socketPathLabel.setText("Location:");
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).indent(INDENT, 0).applyTo(socketPathLabel);
+ unixSocketPathText = new Text(container, SWT.BORDER);
+ unixSocketPathText.setToolTipText("Path to the socket file");
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(unixSocketPathText);
+ final Button socketPathBrowseButton = new Button(container, SWT.BUTTON1);
+ socketPathBrowseButton.setText("Browse...");
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(socketPathBrowseButton);
+ unixSocketBtn.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ final Button targetButton = ((Button)e.widget);
+ if(targetButton.getSelection()) {
+ bindingMode = UNIX_SOCKET;
+ unixSocketPathText.setEnabled(true);
+ socketPathBrowseButton.setEnabled(true);
+ } else {
+ unixSocketPathText.setEnabled(false);
+ socketPathBrowseButton.setEnabled(false);
+ }
+ }
+ });
+ unixSocketPathText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent evt) {
+ unixSocketPath = ((Text)evt.widget).getText();
+ }
+ });
+
+ // TCP Connection with optional TLS
+ final Button tcpConnectionBtn = new Button(container, SWT.RADIO);
+ tcpConnectionBtn.setText("TCP Connection");
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(COLUMNS, 1).applyTo(tcpConnectionBtn);
+ final Label tcpHostLabel = new Label(container, SWT.NONE);
+ tcpHostLabel.setText("Host:");
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).indent(INDENT, 0).applyTo(tcpHostLabel);
+ final Text tcpHostText = new Text(container, SWT.BORDER);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(2, 1).grab(true, false).applyTo(tcpHostText);
+ final Button tcpAuthButton = new Button(container, SWT.CHECK);
+ tcpAuthButton.setText("Enable authentication");
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).indent(INDENT, 0).span(3, 1).applyTo(tcpAuthButton);
+ final Label tcpCertPathLabel = new Label(container, SWT.NONE);
+ tcpCertPathLabel.setText("Path:");
+ tcpCertPathLabel.setToolTipText("Path to the certificates folder");
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).indent(INDENT * 2, 0).applyTo(tcpCertPathLabel);
+ final Text tcpCertPathText = new Text(container, SWT.BORDER);
+ tcpCertPathText.setEnabled(false);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(tcpCertPathText);
+ final Button tcpCertPathBrowseButton = new Button(container, SWT.BUTTON1);
+ tcpCertPathBrowseButton.setText("Browse...");
+ tcpCertPathText.setEnabled(false);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(tcpCertPathBrowseButton);
+
+ tcpConnectionBtn.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ final Button targetButton = ((Button)e.widget);
+ if(targetButton.getSelection()) {
+ bindingMode = TCP_CONNECTION;
+ tcpHostText.setEnabled(true);
+ tcpAuthButton.setEnabled(true);
+ } else {
+ tcpHostText.setEnabled(false);
+ tcpAuthButton.setEnabled(false);
+ tcpCertPathText.setEnabled(false);
+ tcpCertPathBrowseButton.setEnabled(false);
+ }
+ }
+ });
+ tcpAuthButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ final Button targetButton = ((Button)e.widget);
+ if(targetButton.getSelection()) {
+ tcpTLSVerify = true;
+ tcpCertPathText.setEnabled(true);
+ tcpCertPathBrowseButton.setEnabled(true);
+ } else {
+ tcpTLSVerify = false;
+ tcpCertPathText.setEnabled(false);
+ tcpCertPathBrowseButton.setEnabled(false);
+ }
+ }
+ });
+ tcpHostText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent evt) {
+ tcpHost = ((Text)evt.widget).getText();
+ }
+ });
+ tcpCertPathText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent evt) {
+ tcpCertPath = ((Text)evt.widget).getText();
+ }
+ });
+
+ // now that all widgets and their selectionAdapters are instanciated, let's set the values
+ if(this.bindingMode == UNIX_SOCKET) {
+ unixSocketBtn.setSelection(true);
+ if(this.unixSocketPath != null) {
+ unixSocketPathText.setText(this.unixSocketPath);
+ }
+ // disable other widgets
+ tcpHostText.setEnabled(false);
+ tcpAuthButton.setEnabled(false);
+ tcpCertPathText.setEnabled(false);
+ tcpCertPathBrowseButton.setEnabled(false);
+ } else {
+ tcpConnectionBtn.setSelection(true);
+ if(this.tcpHost != null) {
+ tcpHostText.setText(this.tcpHost);
+ }
+ if(this.tcpTLSVerify) {
+ tcpAuthButton.setSelection(true);
+ tcpCertPathText.setEnabled(true);
+ if(this.tcpCertPath != null) {
+ tcpCertPathText.setText(this.tcpCertPath);
+ }
+ tcpCertPathBrowseButton.setEnabled(true);
+ }
+ // disable other widgets
+ unixSocketBtn.setSelection(false);
+ unixSocketPathText.setEnabled(false);
+ }
+ }
+
+ /**
+ * Create a container for the refresh rate property
+ * @param parent the parent container
+ */
+ private void createContainerRefreshContainer(Composite parent) {
+ final Composite container = new Composite(parent, SWT.NONE);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).span(1, 1).grab(true, false).applyTo(container);
+ GridLayoutFactory.fillDefaults().margins(0, 0).spacing(10, 2).applyTo(container);
+ final IntegerFieldEditor refreshTime = new IntegerFieldEditor(PreferenceConstants.REFRESH_TIME,
+ Messages.getString(REFRESH_TIME_MSG), container);
+
+ refreshTime.setValidRange(5, 200);
+ // If the preference changes, alert the Refresh Manager
+ Activator.getDefault().getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() {
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
+ if (event.getProperty().equals(PreferenceConstants.REFRESH_TIME))
+ DockerContainerRefreshManager.getInstance().setRefreshTime(refreshTime.getIntValue());
+ }
+ });
+ }
+
+
+
+
+} \ No newline at end of file
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/LoggingPreferencePage.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/LoggingPreferencePage.java
new file mode 100644
index 0000000000..ac294f4950
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/LoggingPreferencePage.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui.preferences;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.linuxtools.docker.ui.Activator;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+public class LoggingPreferencePage extends FieldEditorPreferencePage implements
+ IWorkbenchPreferencePage {
+
+ private static final String AUTO_START_MSG = "AutoLogOnStart.label"; //$NON-NLS-1$
+ private static final String TIME_STAMP_MSG = "LogTimeStamp.label"; //$NON-NLS-1$
+
+ private BooleanFieldEditor autoLogOnStart;
+ private BooleanFieldEditor addTimeStamp;
+
+ public LoggingPreferencePage() {
+ super(GRID);
+ setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ @Override
+ public void init(IWorkbench workbench) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ protected void createFieldEditors() {
+ autoLogOnStart = new BooleanFieldEditor(
+ PreferenceConstants.AUTOLOG_ON_START,
+ Messages.getString(AUTO_START_MSG), getFieldEditorParent());
+ addField(autoLogOnStart);
+
+ addTimeStamp = new BooleanFieldEditor(
+ PreferenceConstants.LOG_TIMESTAMP,
+ Messages.getString(TIME_STAMP_MSG), getFieldEditorParent());
+ addField(addTimeStamp);
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/Messages.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/Messages.java
new file mode 100644
index 0000000000..0df875cfe0
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/Messages.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui.preferences;
+
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages {
+
+ private static final String BUNDLE_NAME = Messages.class.getName();
+
+ public static String getString(String key) {
+ try {
+ return ResourceBundle.getBundle(BUNDLE_NAME).getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ } catch (NullPointerException e) {
+ return '#' + key + '#';
+ }
+ }
+
+ public static String getFormattedString(String key, String arg) {
+ return MessageFormat.format(getString(key), new Object[] { arg });
+ }
+
+ public static String getFormattedString(String key, String[] args) {
+ return MessageFormat.format(getString(key), (Object[]) args);
+ }
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/Messages.properties b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/Messages.properties
new file mode 100644
index 0000000000..a22499eaab
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/Messages.properties
@@ -0,0 +1,15 @@
+################################################################################
+# Copyright (c) 2014 Red Hat.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat - Initial Contribution
+###############################################################################
+RefreshTime.label=Container Refresh Rate (seconds)
+DefaultHost.label=Default Docker Host
+AutoLogOnStart.label=Automatically log when Container starts
+LogTimeStamp.label=Request time stamp for logs
+PreferencesDesc.txt=Preferences for Docker Manager Plug-ins \ No newline at end of file
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/PreferenceConstants.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/PreferenceConstants.java
new file mode 100644
index 0000000000..9e93035760
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/PreferenceConstants.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui.preferences;
+
+/**
+ * Constant definitions for plug-in preferences
+ */
+public class PreferenceConstants {
+
+ // Time in seconds to wait before automatically refreshing the Containers
+ // view (min 5)
+ public static final String REFRESH_TIME = "containerRefreshTime"; //$NON-NLS-1$
+
+ public static final String AUTOLOG_ON_START = "autoLogOnStart"; //$NON-NLS-1$
+ public static final String LOG_TIMESTAMP = "logTimestamp"; //$NON-NLS-1$
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/PreferenceInitializer.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/PreferenceInitializer.java
new file mode 100644
index 0000000000..aa7c26b1e0
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/preferences/PreferenceInitializer.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui.preferences;
+
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.BINDING_MODE;
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.TCP_CERT_PATH;
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.TCP_CONNECTION;
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.TCP_HOST;
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.TCP_TLS_VERIFY;
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.UNIX_SOCKET;
+import static org.eclipse.linuxtools.docker.core.EnumDockerConnectionSettings.UNIX_SOCKET_PATH;
+import static org.eclipse.linuxtools.internal.docker.ui.preferences.PreferenceConstants.AUTOLOG_ON_START;
+import static org.eclipse.linuxtools.internal.docker.ui.preferences.PreferenceConstants.LOG_TIMESTAMP;
+import static org.eclipse.linuxtools.internal.docker.ui.preferences.PreferenceConstants.REFRESH_TIME;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.linuxtools.docker.ui.Activator;
+import org.eclipse.linuxtools.internal.docker.core.DockerConnection;
+
+/**
+ * Class used to initialize default preference values.
+ */
+public class PreferenceInitializer extends AbstractPreferenceInitializer {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#
+ * initializeDefaultPreferences()
+ */
+ public void initializeDefaultPreferences() {
+ final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+ store.setDefault(REFRESH_TIME, 15);
+ // sadly, this will only work if the DOCKER environment variables were set
+ // as the system level, not in a .bash_rc or similar terminal session script
+ // which Eclipse cannot access when it is launched from the Dock (or menu).
+ final String defaultDockerHost = System.getenv("DOCKER_HOST"); //$NON-NLS-1$
+ final String defaultDockerTLSVerify = System.getenv("DOCKER_TLS_VERIFY"); //$NON-NLS-1$
+ final String defaultDockerCertPath = System.getenv("DOCKER_CERT_PATH"); //$NON-NLS-1$
+ //FIXME: can we use the OS name to provide smarter default values ?
+ if (defaultDockerHost == null || defaultDockerHost.equals("")) {
+ store.setDefault(BINDING_MODE.toString(), UNIX_SOCKET.toString());
+ store.setDefault(UNIX_SOCKET_PATH.toString(), DockerConnection.Defaults.DEFAULT_UNIX_SOCKET_PATH);
+ } else if(defaultDockerHost.startsWith("unix://")) {
+ store.setDefault(BINDING_MODE.toString(), UNIX_SOCKET.toString());
+ store.setDefault(UNIX_SOCKET_PATH.toString(), defaultDockerHost);
+ } else {
+ store.setDefault(BINDING_MODE.toString(), TCP_CONNECTION.toString());
+ store.setDefault(TCP_HOST.toString(), defaultDockerHost);
+ if("1".equals(defaultDockerTLSVerify)) {
+ store.setDefault(TCP_TLS_VERIFY.toString(), Boolean.TRUE);
+ }
+ if(defaultDockerCertPath != null && !defaultDockerCertPath.isEmpty()) {
+ store.setDefault(TCP_CERT_PATH.toString(), defaultDockerCertPath);
+ }
+ }
+
+ store.setDefault(AUTOLOG_ON_START, true);
+ store.setDefault(LOG_TIMESTAMP, true);
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/propertytesters/ContainerPropertyTester.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/propertytesters/ContainerPropertyTester.java
new file mode 100644
index 0000000000..4d5e9b30f5
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/propertytesters/ContainerPropertyTester.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.propertytesters;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.linuxtools.docker.core.EnumDockerStatus;
+import org.eclipse.linuxtools.docker.core.IDockerContainer;
+
+/**
+ * @author xcoulon
+ *
+ */
+public class ContainerPropertyTester extends PropertyTester {
+
+ /** Property name to check if a given {@link IDockerContainer} is running. */
+ public static final String IS_RUNNING = "isRunning";
+
+ /** Property name to check if a given {@link IDockerContainer} is stopped (exited). */
+ public static final String IS_STOPPED = "isStopped";
+
+ /** Property name to check if a given {@link IDockerContainer} is paused. */
+ public static final String IS_PAUSED = "isPaused";
+
+ @Override
+ public boolean test(final Object receiver, final String property, final Object[] args, final Object expectedValue) {
+ if (receiver instanceof IDockerContainer) {
+ final IDockerContainer container = (IDockerContainer) receiver;
+ switch (property) {
+ case IS_RUNNING:
+ return checkIfStateMatchesExpectation(container, EnumDockerStatus.RUNNING, expectedValue);
+ case IS_STOPPED:
+ return checkIfStateMatchesExpectation(container, EnumDockerStatus.STOPPED, expectedValue);
+ case IS_PAUSED:
+ return checkIfStateMatchesExpectation(container, EnumDockerStatus.PAUSED, expectedValue);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Checks if the status of the given {@link IDockerContainer}
+ *
+ * @param container the given {@link IDockerContainer}
+ * @param expectedStatus the {@link IDockerContainer} status to check
+ * @param expectedMatch the container status result to check
+ * @return {@code true} if the current status matches the expectation, {@code false} otherwise.
+ */
+ private boolean checkIfStateMatchesExpectation(final IDockerContainer container, final EnumDockerStatus expectedStatus, final Object expectedMatch) {
+ if(expectedMatch == null) {
+ return false;
+ }
+ final EnumDockerStatus containerStatus = EnumDockerStatus.fromStatusMessage(container.status());
+ return expectedMatch.equals((containerStatus == expectedStatus));
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/propertytesters/ImagePropertyTester.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/propertytesters/ImagePropertyTester.java
new file mode 100644
index 0000000000..9bff2c3fd5
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/propertytesters/ImagePropertyTester.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.propertytesters;
+
+import java.util.List;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.linuxtools.docker.core.IDockerImage;
+
+/**
+ * @author jjohnstn
+ *
+ */
+public class ImagePropertyTester extends PropertyTester {
+
+ /** Property name to check if a given {@link IDockerImage} can be tagged. */
+ public static final String CAN_BE_TAGGED = "canBeTagged"; //$NON-NLS-1$
+ public static final String HAS_MULTIPLE_TAGS = "hasMultipleTags"; //$NON-NLS-1$
+
+ @Override
+ public boolean test(final Object receiver, final String property, final Object[] args, final Object expectedValue) {
+ if (receiver instanceof IDockerImage) {
+ final IDockerImage image = (IDockerImage) receiver;
+ switch (property) {
+ case CAN_BE_TAGGED:
+ return !image.isDangling() && !image.isIntermediateImage();
+ case HAS_MULTIPLE_TAGS:
+ List<String> repoTags = image.repoTags();
+ return repoTags != null && repoTags.size() > 1;
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/propertytesters/package-info.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/propertytesters/package-info.java
new file mode 100644
index 0000000000..63cf8ef915
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/propertytesters/package-info.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+/**
+ * @author xcoulon
+ *
+ */
+package org.eclipse.linuxtools.internal.docker.ui.propertytesters; \ No newline at end of file
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/utils/UIUtils.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/utils/UIUtils.java
new file mode 100644
index 0000000000..f1b7a94ced
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/utils/UIUtils.java
@@ -0,0 +1,257 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui.utils;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.action.ContributionManager;
+import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.IContributionManager;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPartSite;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.menus.IMenuService;
+import org.eclipse.ui.part.EditorPart;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class UIUtils {
+
+ private UIUtils() {
+ }
+
+ /**
+ * Returns the selection of the active workbench window.
+ *
+ * @return the selection
+ *
+ * @see IWorkbenchWindow#getSelectionService()
+ */
+ public static ISelection getWorkbenchWindowSelection() {
+ return getActiveWorkbenchWindow().getSelectionService().getSelection();
+ }
+
+ /**
+ * Gets the structured selection.
+ *
+ * @return the structured selection
+ */
+ public static IStructuredSelection getStructuredSelection() {
+ ISelection selection = getWorkbenchWindowSelection();
+ if (selection instanceof IStructuredSelection) {
+ return (IStructuredSelection) selection;
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Gets the first element.
+ *
+ * @param selection
+ * the selection
+ * @param expectedClass
+ * the expected class
+ *
+ * @return the first element
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> T getFirstElement(final ISelection selection,
+ final Class<T> expectedClass) {
+ if (selection == null) {
+ return null;
+ } else {
+ Assert.isTrue(selection instanceof IStructuredSelection);
+ Object firstElement = ((IStructuredSelection) selection)
+ .getFirstElement();
+ if (firstElement != null
+ && expectedClass.isAssignableFrom(firstElement.getClass())) {
+ return (T) firstElement;
+ } else {
+ return null;
+ }
+ }
+ }
+
+ /**
+ * Gets the active page.
+ *
+ * @return the active page
+ */
+ public static IWorkbenchPage getActivePage() {
+ IWorkbenchPage workbenchPage = getActiveWorkbenchWindow()
+ .getActivePage();
+ Assert.isNotNull(workbenchPage);
+ return workbenchPage;
+ }
+
+ /**
+ * Returns the editor that's currently active (focused).
+ *
+ * @return the active editor
+ */
+ public static IEditorPart getActiveEditor() {
+ IEditorPart editor = getActivePage().getActiveEditor();
+ Assert.isNotNull(editor);
+ return editor;
+ }
+
+ /**
+ * Gets the active workbench window.
+ *
+ * @return the active workbench window
+ */
+ public static IWorkbenchWindow getActiveWorkbenchWindow() {
+ IWorkbenchWindow workbenchWindow = getWorkbench()
+ .getActiveWorkbenchWindow();
+ Assert.isNotNull(workbenchWindow);
+ return workbenchWindow;
+ }
+
+ /**
+ * Gets the workbench.
+ *
+ * @return the workbench
+ */
+ public static IWorkbench getWorkbench() {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ Assert.isNotNull(workbench);
+ return workbench;
+ }
+
+ /**
+ * Replaces an image with the given key by the given image descriptor.
+ *
+ * @param imageKey
+ * the image key
+ * @param imageDescriptor
+ * the image descriptor
+ */
+ public static void replaceInJfaceImageRegistry(final String imageKey,
+ final ImageDescriptor imageDescriptor) {
+ Assert.isNotNull(imageKey);
+ Assert.isNotNull(imageDescriptor);
+
+ JFaceResources.getImageRegistry().remove(imageKey);
+ JFaceResources.getImageRegistry().put(imageKey, imageDescriptor);
+ }
+
+ /**
+ * Register the given ContributionManager with the given id. The
+ * contribution manager gets unregistered on control disposal.
+ *
+ * @param id
+ * the id
+ * @param contributionManager
+ * the contribution manager
+ * @param control
+ * the control
+ *
+ * @see ContributionManager
+ * @see IMenuService
+ * @see DisposeListener
+ */
+ public static void registerContributionManager(final String id,
+ final IContributionManager contributionManager,
+ final Control control) {
+ Assert.isNotNull(id);
+ Assert.isNotNull(contributionManager);
+ Assert.isTrue(control != null && !control.isDisposed());
+
+ final IMenuService menuService = (IMenuService) PlatformUI
+ .getWorkbench().getService(IMenuService.class);
+ menuService.populateContributionManager(
+ (ContributionManager) contributionManager, id);
+ contributionManager.update(true);
+ control.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ menuService
+ .releaseContributions((ContributionManager) contributionManager);
+ }
+ });
+ }
+
+ /**
+ * Creates context menu to a given control.
+ *
+ * @param control
+ * the control
+ *
+ * @return the i menu manager
+ */
+ public static IMenuManager createContextMenu(final Control control) {
+ Assert.isTrue(control != null && !control.isDisposed());
+
+ MenuManager menuManager = new MenuManager();
+ menuManager
+ .add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
+
+ Menu menu = menuManager.createContextMenu(control);
+ control.setMenu(menu);
+ return menuManager;
+ }
+
+ /**
+ * Gets the dialog settings for the given identifer and plugin.
+ *
+ * @param identifier
+ * the identifier
+ * @param plugin
+ * the plugin
+ *
+ * @return the dialog settings
+ */
+ public static IDialogSettings getDialogSettings(final String identifier,
+ final AbstractUIPlugin plugin) {
+ Assert.isNotNull(plugin);
+ IDialogSettings dialogSettings = plugin.getDialogSettings();
+ IDialogSettings section = dialogSettings.getSection(identifier);
+ if (section == null) {
+ section = dialogSettings.addNewSection(identifier);
+ }
+ return section;
+ }
+
+ /**
+ * Returns the page for a given editor.
+ *
+ * @param editor
+ * the editor
+ * @return
+ *
+ * @return the page
+ *
+ * @see IWorkbenchPage
+ */
+ public static IWorkbenchPage getPage(EditorPart editor) {
+ Assert.isNotNull(editor);
+ IWorkbenchPartSite site = editor.getSite();
+ Assert.isNotNull(site);
+ return site.getPage();
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/BasePropertySection.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/BasePropertySection.java
new file mode 100644
index 0000000000..3b85adf3a1
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/BasePropertySection.java
@@ -0,0 +1,77 @@
+package org.eclipse.linuxtools.internal.docker.ui.views;
+
+import java.util.Collection;
+
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.TreeViewerColumn;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+
+public abstract class BasePropertySection extends AbstractPropertySection {
+
+ private TreeViewer treeViewer;
+
+ @Override
+ public void createControls(final Composite parent, final TabbedPropertySheetPage propertySheetPage) {
+ GridLayoutFactory.fillDefaults().numColumns(1).applyTo(parent);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(parent);
+ final Composite container = new Composite(parent, SWT.NONE);
+ container.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
+ GridLayoutFactory.fillDefaults().numColumns(1).margins(5, 5).applyTo(container);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).hint(400, 180).applyTo(container);
+ this.treeViewer = createTableTreeViewer(container);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(treeViewer.getControl());
+ }
+
+ private TreeViewer createTableTreeViewer(final Composite container) {
+ final TreeViewer treeViewer = new TreeViewer(container, SWT.V_SCROLL | SWT.H_SCROLL);
+ final Tree tree = treeViewer.getTree();
+ tree.setLinesVisible(true);
+ tree.setHeaderVisible(true);
+ final TreeViewerColumn propertyColumn = new TreeViewerColumn(treeViewer, SWT.BORDER);
+ propertyColumn.getColumn().setWidth(150);
+ propertyColumn.getColumn().setText("Property");
+ propertyColumn.setLabelProvider(new ColumnLabelProvider() {
+ @Override
+ public String getText(final Object element) {
+ if(element instanceof Object[]) {
+ final Object property = ((Object[])element)[0];
+ return property.toString();
+ }
+ return super.getText(element);
+ }
+ });
+ final TreeViewerColumn valueColumn = new TreeViewerColumn(treeViewer, SWT.BORDER);
+ valueColumn.getColumn().setWidth(500);
+ valueColumn.getColumn().setText("Value");
+ valueColumn.setLabelProvider(new ColumnLabelProvider() {
+ @Override
+ public String getText(final Object element) {
+ if(element instanceof Object[]) {
+ final Object value = ((Object[])element)[1];
+ // do not show values of a collection. There will be nested elements in the treeview for them.
+ if(value instanceof Collection) {
+ return "";
+ } else if(value instanceof String || value instanceof Boolean || value instanceof Integer) {
+ return value.toString();
+ }
+ return "";
+ }
+ return super.getText(element);
+ }
+ });
+ return treeViewer;
+ }
+
+ TreeViewer getTreeViewer() {
+ return treeViewer;
+ }
+
+} \ No newline at end of file
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ConnectionInfoContentProvider.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ConnectionInfoContentProvider.java
new file mode 100644
index 0000000000..eb5e0943b3
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ConnectionInfoContentProvider.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.views;
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.linuxtools.docker.core.IDockerConnectionInfo;
+
+/**
+ * @author xcoulon
+ *
+ */
+public class ConnectionInfoContentProvider implements ITreeContentProvider {
+
+ private static final Object[] EMPTY = new Object[0];
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput) {
+ }
+
+ @Override
+ public Object[] getElements(final Object inputElement) {
+ if(inputElement instanceof IDockerConnectionInfo) {
+ final IDockerConnectionInfo connectionInfo = (IDockerConnectionInfo) inputElement;
+ return new Object[] {
+ new Object[]{"Containers", connectionInfo.getContainers()}, //$NON-NLS-1$
+ new Object[]{"Images", connectionInfo.getImages()}, //$NON-NLS-1$
+ new Object[]{"Storage driver", connectionInfo.getStorageDriver()}, //$NON-NLS-1$
+ new Object[]{"Execution driver", connectionInfo.getExecutionDriver()}, //$NON-NLS-1$
+ new Object[]{"Kernel version", connectionInfo.getKernelVersion()}, //$NON-NLS-1$
+ new Object[]{"Operating system", connectionInfo.getOs()}, //$NON-NLS-1$
+ new Object[]{"File descriptors", connectionInfo.getFileDescriptors()}, //$NON-NLS-1$
+ new Object[]{"Go routines", connectionInfo.getGoroutines()}, //$NON-NLS-1$
+ new Object[]{"Init path", connectionInfo.getInitPath()}, //$NON-NLS-1$
+ new Object[]{"API version", connectionInfo.getApiVersion()}, //$NON-NLS-1$
+ new Object[]{"Version", connectionInfo.getVersion()}, //$NON-NLS-1$
+ new Object[]{"Git commit", connectionInfo.getGitCommit()}, //$NON-NLS-1$
+ };
+ }
+ return EMPTY;
+ }
+
+ @Override
+ public Object[] getChildren(final Object parentElement) {
+ return EMPTY;
+ }
+
+ @Override
+ public Object getParent(final Object element) {
+ return null;
+ }
+
+ @Override
+ public boolean hasChildren(final Object element) {
+ return false;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ConnectionInfoPropertySection.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ConnectionInfoPropertySection.java
new file mode 100644
index 0000000000..bd154b7397
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ConnectionInfoPropertySection.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.views;
+
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.TimeUnit;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.linuxtools.docker.core.DockerException;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerConnectionInfo;
+import org.eclipse.linuxtools.docker.ui.Activator;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+
+/**
+ * @author xcoulon
+ *
+ */
+public class ConnectionInfoPropertySection extends BasePropertySection {
+
+ private IDockerConnection selectedConnection = null;
+ private IDockerConnectionInfo connectionInfo;
+
+ @Override
+ public void createControls(Composite parent, TabbedPropertySheetPage propertySheetPage) {
+ super.createControls(parent, propertySheetPage);
+ getTreeViewer().setContentProvider(new ConnectionInfoContentProvider());
+ }
+
+ @Override
+ public void setInput(final IWorkbenchPart part, final ISelection selection) {
+ super.setInput(part, selection);
+ Assert.isTrue(selection instanceof ITreeSelection);
+ Object input = ((ITreeSelection) selection).getFirstElement();
+ Assert.isTrue(input instanceof IDockerConnection);
+ this.selectedConnection = (IDockerConnection) input;
+ this.connectionInfo = getConnectionInfo(selectedConnection);
+ if (getTreeViewer() != null) {
+ getTreeViewer().setInput(connectionInfo);
+ getTreeViewer().expandAll();
+ }
+ }
+
+ private IDockerConnectionInfo getConnectionInfo(final IDockerConnection connection) {
+ final BlockingQueue<IDockerConnectionInfo> result = new ArrayBlockingQueue<>(1);
+ final Job loadConnectionInfoJob = new Job("Loading connection info...") {
+ @Override
+ protected IStatus run(final IProgressMonitor monitor) {
+ monitor.beginTask("Loading connection info...", 1);
+ try {
+ result.add(connection.getInfo());
+ } catch (DockerException e) {
+ Activator.log(e);
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ };
+ loadConnectionInfoJob.schedule();
+ try {
+ return result.poll(2, TimeUnit.SECONDS);
+ } catch (InterruptedException e) {
+ Activator.log(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
+ "Failed to retrieve general info on connection '" + connection.getName() + "'", e));
+ return null;
+ }
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInfoContentProvider.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInfoContentProvider.java
new file mode 100644
index 0000000000..4a0fbf1e8e
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInfoContentProvider.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.views;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.linuxtools.docker.core.IDockerContainer;
+import org.eclipse.linuxtools.docker.core.IDockerPortMapping;
+import org.eclipse.linuxtools.internal.docker.core.DockerPortMapping;
+
+/**
+ * @author xcoulon
+ *
+ */
+public class ContainerInfoContentProvider implements ITreeContentProvider {
+
+ private static final Object[] EMPTY = new Object[0];
+
+ @Override
+ public void dispose() {
+
+ }
+
+ @Override
+ public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput) {
+ }
+
+ @Override
+ public Object[] getElements(final Object inputElement) {
+ if(inputElement instanceof IDockerContainer) {
+ final IDockerContainer container = (IDockerContainer) inputElement;
+ return new Object[] {
+ new Object[]{"Id", container.id().substring(0, 12)}, //$NON-NLS-1$
+ new Object[]{"Image", container.image()}, //$NON-NLS-1$
+ new Object[]{"Command", container.command()}, //$NON-NLS-1$
+ new Object[]{"Created", LabelUtils.toCreatedDate(container.created())}, //$NON-NLS-1$
+ new Object[]{"Status", container.status()}, //$NON-NLS-1$
+ new Object[]{"Ports", getPorts(container)}, //$NON-NLS-1$
+ new Object[]{"Names", getNames(container)}, //$NON-NLS-1$
+ };
+ }
+ return EMPTY;
+ }
+
+ /**
+ * @return the first {@link DockerPortMapping} if the given {@link IDockerContainer} has only one {@link DockerPortMapping}, an empty {@link String} if the given list is empty, otherwise the given list itself.
+ * @param container the {@link IDockerContainer} of elements to analyze
+ */
+ private Object getPorts(final IDockerContainer container) {
+ if(container.ports().isEmpty()) {
+ return "";
+ } else if(container.ports().size() == 1) {
+ return LabelUtils.containerPortMappingToString(container.ports().get(0));
+ } else {
+ final List<String> ports = new ArrayList<>();
+ for (IDockerPortMapping portMapping : container.ports()) {
+ ports.add(LabelUtils.containerPortMappingToString(portMapping));
+ }
+ return ports;
+ }
+ }
+
+ /**
+ * @return the first name if the given {@link IDockerContainer} has only one, an empty {@link String} if the given list is empty, otherwise the given list itself.
+ * @param container the {@link IDockerContainer} of elements to analyze
+ */
+ private Object getNames(final IDockerContainer container) {
+ if(container.names().isEmpty()) {
+ return "";
+ } else if(container.names().size() == 1) {
+ return container.name();
+ } else {
+ return container.names();
+ }
+ }
+
+ @Override
+ public Object[] getChildren(final Object parentElement) {
+ final Object propertyValue = ((Object[])parentElement)[1];
+ final Object value = ((Object[])parentElement)[1];
+ if(value instanceof List) {
+ @SuppressWarnings("unchecked")
+ final List<Object> propertyValues = (List<Object>)propertyValue;
+ final Object[] result = new Object[propertyValues.size()];
+ for (int i = 0; i < propertyValues.size(); i++) {
+ result[i] = new Object[]{"", LabelUtils.toString(propertyValues.get(i))};
+ }
+ return result;
+ } else if(value instanceof Object[]) {
+ return (Object[])value;
+ }
+ return new Object[]{value};
+ }
+
+ @Override
+ public Object getParent(final Object element) {
+ return null;
+ }
+
+ @Override
+ public boolean hasChildren(final Object element) {
+ if(element instanceof Object[]) {
+ return !(((Object[])element)[1] instanceof String);
+ }
+ return false;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInfoPropertySection.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInfoPropertySection.java
new file mode 100644
index 0000000000..15b8b5096e
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInfoPropertySection.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.views;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.linuxtools.docker.core.IDockerContainer;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+
+/**
+ * @author xcoulon
+ *
+ */
+public class ContainerInfoPropertySection extends BasePropertySection {
+
+ private IDockerContainer selectedContainer;
+
+ @Override
+ public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
+ super.createControls(parent, aTabbedPropertySheetPage);
+ getTreeViewer().setContentProvider(new ContainerInfoContentProvider());
+ }
+
+ @Override
+ public void setInput(final IWorkbenchPart part, final ISelection selection) {
+ super.setInput(part, selection);
+ Object input = null;
+ if (selection instanceof ITreeSelection)
+ input = ((ITreeSelection) selection).getFirstElement();
+ else if (selection instanceof IStructuredSelection)
+ input = ((IStructuredSelection) selection).getFirstElement();
+ Assert.isTrue(input instanceof IDockerContainer);
+ this.selectedContainer = (IDockerContainer) input;
+ if (getTreeViewer() != null) {
+ getTreeViewer().setInput(this.selectedContainer);
+ }
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInspectContentProvider.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInspectContentProvider.java
new file mode 100644
index 0000000000..3030c29d10
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInspectContentProvider.java
@@ -0,0 +1,161 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.docker.ui.views;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.linuxtools.docker.core.IDockerContainerInfo;
+import org.eclipse.linuxtools.docker.core.IDockerContainerState;
+import org.eclipse.linuxtools.docker.core.IDockerHostConfig;
+import org.eclipse.linuxtools.docker.core.IDockerNetworkSettings;
+import org.eclipse.linuxtools.docker.core.IDockerPortBinding;
+
+/**
+ * @author xcoulon
+ *
+ */
+public class ContainerInspectContentProvider implements ITreeContentProvider {
+
+ private static final Object[] EMPTY = new Object[0];
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ @Override
+ public Object[] getElements(Object inputElement) {
+ if(inputElement instanceof IDockerContainerInfo) {
+ final IDockerContainerInfo info = (IDockerContainerInfo) inputElement;
+ return new Object[] {
+ new Object[]{"Id", info.id().substring(0, 12)}, //$NON-NLS-1$
+ new Object[]{"Name", info.name()}, //$NON-NLS-1$
+ new Object[]{"Created", LabelUtils.toCreatedDate(info.created())}, //$NON-NLS-1$
+ new Object[]{"State", info.state()}, //$NON-NLS-1$
+ new Object[]{"Args", LabelUtils.reduce(info.args())}, //$NON-NLS-1$
+ new Object[]{"Driver", info.driver()}, //$NON-NLS-1$
+ new Object[]{"ExecDriver", info.execDriver()}, //$NON-NLS-1$
+ new Object[]{"HostConfig", info.hostConfig()}, //$NON-NLS-1$
+ new Object[]{"HostnamePath", info.hostnamePath()}, //$NON-NLS-1$
+ new Object[]{"HostsPath", info.hostsPath()}, //$NON-NLS-1$
+ new Object[]{"Image", info.image()}, //$NON-NLS-1$
+ new Object[]{"MountLabel", info.mountLabel()}, //$NON-NLS-1$
+ new Object[]{"NetworkSettings", info.networkSettings()}, //$NON-NLS-1$
+ new Object[]{"Path", info.path()}, //$NON-NLS-1$
+ new Object[]{"ProcessLabel", info.processLabel()}, //$NON-NLS-1$
+ new Object[]{"ResolvConfPath", info.resolvConfPath()}, //$NON-NLS-1$
+ new Object[]{"Volumes", info.volumes()}, //$NON-NLS-1$
+ new Object[]{"VolumesRW", info.volumesRW()}, //$NON-NLS-1$
+ };
+ }return EMPTY;
+ }
+
+ @Override
+ public Object[] getChildren(Object parentElement) {
+ final Object propertyValue = ((Object[])parentElement)[1];
+ if(propertyValue instanceof IDockerContainerState) {
+ final IDockerContainerState containerState = (IDockerContainerState) propertyValue;
+ return new Object[] {
+ new Object[]{"ExitCode", containerState.exitCode()}, //$NON-NLS-1$
+ new Object[]{"Finished at", LabelUtils.toFinishedDate(containerState.finishDate())}, //$NON-NLS-1$
+ new Object[]{"Running", containerState.running()}, //$NON-NLS-1$
+ new Object[]{"Paused", containerState.paused()}, //$NON-NLS-1$
+ new Object[]{"Pid", containerState.pid()}, //$NON-NLS-1$
+ };
+ } else if(propertyValue instanceof IDockerHostConfig) {
+ final IDockerHostConfig hostConfig = (IDockerHostConfig) propertyValue;
+ return new Object[] {
+ new Object[]{"Binds", LabelUtils.reduce(hostConfig.binds())}, //$NON-NLS-1$
+ new Object[]{"ContainerIDFile", hostConfig.containerIDFile()}, //$NON-NLS-1$
+ new Object[]{"Dns", LabelUtils.reduce(hostConfig.dns())}, //$NON-NLS-1$
+ new Object[]{"DnsSearch", LabelUtils.reduce(hostConfig.dnsSearch())}, //$NON-NLS-1$
+ new Object[]{"Links", splitLinks(hostConfig.links())}, //$NON-NLS-1$
+ new Object[]{"LxcConf", hostConfig.lxcConf()}, //$NON-NLS-1$
+ new Object[]{"NetworkMode", hostConfig.networkMode()}, //$NON-NLS-1$
+ new Object[]{"PortBindings", LabelUtils.reduce(hostConfig.portBindings())}, //$NON-NLS-1$
+ new Object[]{"Privileged", hostConfig.privileged()}, //$NON-NLS-1$
+ new Object[]{"PublishAllPorts", hostConfig.publishAllPorts()}, //$NON-NLS-1$
+ new Object[]{"VolumesFrom", LabelUtils.reduce(hostConfig.volumesFrom())}, //$NON-NLS-1$
+ };
+ } else if(propertyValue instanceof IDockerPortBinding) {
+ final IDockerPortBinding portBinding = (IDockerPortBinding) propertyValue;
+ return new Object[] {
+ new Object[]{"Host IP/Port", LabelUtils.toString(portBinding)} //$NON-NLS-1$
+ };
+ } else if(propertyValue instanceof IDockerNetworkSettings) {
+ final IDockerNetworkSettings networkSettings = (IDockerNetworkSettings) propertyValue;
+ return new Object[] {
+ new Object[]{"Bridge", networkSettings.bridge()}, //$NON-NLS-1$
+ new Object[]{"Gateway", networkSettings.gateway()}, //$NON-NLS-1$
+ new Object[]{"IPAddress", networkSettings.ipAddress()}, //$NON-NLS-1$
+ new Object[]{"IPPrefixLen", networkSettings.ipPrefixLen()}, //$NON-NLS-1$
+ new Object[]{"PortMapping", networkSettings.portMapping()}, //$NON-NLS-1$
+ new Object[]{"Ports", LabelUtils.reduce(networkSettings.ports())}, //$NON-NLS-1$
+ };
+ } else if(propertyValue instanceof List<?>) {
+ @SuppressWarnings("unchecked")
+ final List<Object> propertyValues = (List<Object>)propertyValue;
+ final Object[] result = new Object[propertyValues.size()];
+ for (int i = 0; i < propertyValues.size(); i++) {
+ result[i] = new Object[]{"", LabelUtils.toString(propertyValues.get(i))}; //$NON-NLS-1$
+ }
+ return result;
+ } else if(propertyValue instanceof Map<?,?>) {
+ final Map<?,?> propertyValues = (Map<?,?>)propertyValue;
+ final Object[] result = new Object[propertyValues.size()];
+ int i = 0;
+ for (Entry<?, ?> entry : propertyValues.entrySet()) {
+ result[i] = new Object[]{entry.getKey(), entry.getValue()};
+ i++;
+ }
+ return result;
+ }
+ return EMPTY;
+ }
+
+ private Object splitLinks(final List<String> links) {
+ if(links == null || links.isEmpty()) {
+ return ""; //$NON-NLS-1$
+ } else if(links.size() == 1) {
+ return links.get(0).split(";");
+ } else {
+ final Object[] result = new Object[links.size()];
+ for(int i = 0; i < links.size(); i++) {
+ final String[] split = links.get(i).split(":");
+ result[i] = new Object[]{split[0], split[1]};
+ }
+ return result;
+ }
+ }
+
+ @Override
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ @Override
+ public boolean hasChildren(Object element) {
+ if(element instanceof Object[]) {
+ final Object value = ((Object[])element)[1];
+ return (value instanceof List || value instanceof Map || value instanceof IDockerContainerState || value instanceof IDockerNetworkSettings || value instanceof IDockerHostConfig || value instanceof IDockerPortBinding);
+ }
+ return false;
+ }
+
+}
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInspectPropertySection.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInspectPropertySection.java
new file mode 100644
index 0000000000..5e1a6765c0
--- /dev/null
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/views/ContainerInspectPropertySection.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2014, 2015 Red Hat.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - Initial Contribution
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.docker.ui.views;
+
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.TimeUnit;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.linuxtools.docker.core.IDockerConnection;
+import org.eclipse.linuxtools.docker.core.IDockerContainer;
+import org.eclipse.linuxtools.docker.core.IDockerContainerInfo;
+import org.eclipse.linuxtools.docker.ui.Activator;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkben