blob: 33b406b7669880e3104282e731f71a533bcec5b2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
/*******************************************************************************
* Copyright (c) 2017, 2018 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
*
* Contributor:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
package org.eclipse.linuxtools.docker.reddeer.ui;
import java.util.List;
import org.eclipse.reddeer.eclipse.exception.EclipseLayerException;
import org.eclipse.reddeer.swt.api.TableItem;
import org.eclipse.reddeer.swt.impl.table.DefaultTable;
import org.eclipse.reddeer.swt.impl.text.DefaultText;
import org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem;
import org.eclipse.reddeer.workbench.impl.view.WorkbenchView;
/**
*
* @author jkopriva@redhat.com
*
*/
public class DockerContainersTab extends WorkbenchView {
public DockerContainersTab() {
super("Docker Containers");
}
public TableItem getDockerContainer(String dockerContainerName) {
this.activate();
for (TableItem item : getTableItems()) {
if (item.getText().equals(dockerContainerName)) {
return item;
}
}
throw new EclipseLayerException("There is no container with name " + dockerContainerName);
}
public void refresh() {
this.activate();
new DefaultToolItem("Refresh (F5)").click();
}
public List<TableItem> getTableItems() {
return new DefaultTable().getItems();
}
public void select(String containerName) {
getDockerContainer(containerName).select();
}
public void searchContainer(String containerName) {
this.activate();
new DefaultText().setText(containerName);
}
}
|