use of org.eclipse.linuxtools.internal.docker.ui.views.DockerImagesView in project linuxtools by eclipse.
the class EditDockerConnectionSWTBotTest method shouldRefreshDockerImagesViewWhenConnectionNameChanges.
@Test
public void shouldRefreshDockerImagesViewWhenConnectionNameChanges() {
// given
configureTCPConnection("Test");
final SWTBotTreeItem connectionTreeItem = SWTUtils.getTreeItem(dockerExplorer.bot(), "Test");
assertThat(connectionTreeItem).isNotNull();
// when
openConnectionEditionWizard("Test");
bot.text(0).setText("foo");
getFinishButton().click();
SWTUtils.wait(2, TimeUnit.SECONDS);
// then
final DockerImagesView dockerImagesView = dockerImages.view();
final String formTitle = SWTUtils.syncExec(() -> dockerImagesView.getFormTitle());
assertThat(formTitle).contains("foo");
}
use of org.eclipse.linuxtools.internal.docker.ui.views.DockerImagesView in project linuxtools by eclipse.
the class RefreshCommandHandler method getRefreshJobs.
private List<Job> getRefreshJobs(final IWorkbenchPart activePart) {
final IDockerConnection connection = getCurrentConnection(activePart);
final ArrayList<Job> jobs = new ArrayList<>();
if (activePart instanceof DockerImagesView) {
jobs.add(getRefreshImagesJob(connection));
} else if (activePart instanceof DockerContainersView) {
jobs.add(getRefreshContainersJob(connection));
} else if (activePart instanceof DockerExplorerView) {
DockerExplorerView dockerExplorerView = (DockerExplorerView) activePart;
final ITreeSelection selection = dockerExplorerView.getCommonViewer().getStructuredSelection();
if (selection.getFirstElement() instanceof DockerContainersCategory) {
jobs.add(getRefreshContainersJob(connection));
} else if (selection.getFirstElement() instanceof DockerImagesCategory) {
jobs.add(getRefreshImagesJob(connection));
} else {
final IDockerConnection[] connections = DockerConnectionManager.getInstance().getConnections();
for (IDockerConnection selectedConnection : connections) {
if (!selectedConnection.isOpen()) {
try {
selectedConnection.open(true);
} catch (DockerException e) {
// do nothing
}
}
if (selectedConnection.isOpen()) {
jobs.add(getRefreshContainersJob(selectedConnection));
jobs.add(getRefreshImagesJob(selectedConnection));
}
}
}
}
return jobs;
}
use of org.eclipse.linuxtools.internal.docker.ui.views.DockerImagesView in project linuxtools by eclipse.
the class ShowAllImagesCommandHandler method execute.
@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;
}
Aggregations