Search in sources :

Example 1 with ContextMenu

use of org.eclipse.reddeer.swt.impl.menu.ContextMenu in project linuxtools by eclipse.

the class ContainerLogTest method getContainerLog.

private String getContainerLog() {
    new ContextMenu().getItem("Display Log").select();
    String consoleText;
    if (mockitoIsUsed()) {
        ConsoleView consoleView = new ConsoleView();
        consoleView.open();
        consoleView = MockUtils.getConsoleViewText(CONSOLE_TEXT);
        consoleText = consoleView.getConsoleText();
    } else {
        DockerTerminal dockerTerminal = new DockerTerminal();
        dockerTerminal.activate();
        consoleText = dockerTerminal.getTextFromPage(CONTAINER_NAME);
    }
    return consoleText;
}
Also used : ConsoleView(org.eclipse.reddeer.eclipse.ui.console.ConsoleView) DockerTerminal(org.eclipse.linuxtools.docker.reddeer.ui.DockerTerminal) ContextMenu(org.eclipse.reddeer.swt.impl.menu.ContextMenu)

Example 2 with ContextMenu

use of org.eclipse.reddeer.swt.impl.menu.ContextMenu in project linuxtools by eclipse.

the class DockerImagesTab method addTagToImage.

public void addTagToImage(String imageName, String newTag) {
    selectImage(imageName);
    new ContextMenu().getItem("Add Tag").select();
    new DefaultShell("Tag Image");
    new LabeledText("New Tag:").setText(newTag);
    new FinishButton().click();
}
Also used : FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ContextMenu(org.eclipse.reddeer.swt.impl.menu.ContextMenu)

Example 3 with ContextMenu

use of org.eclipse.reddeer.swt.impl.menu.ContextMenu in project linuxtools by eclipse.

the class DockerImagesTab method pushImage.

public void pushImage(String imageName, String registryAccount, boolean forceTagging, boolean keepTaggedImage) {
    selectImage(imageName);
    new ContextMenu().getItem("Push...").select();
    Combo combo = new DefaultCombo();
    combo.setSelection(registryAccount);
    new CheckBox("Force tagging image with selected registry").toggle(forceTagging);
    new CheckBox("Keep tagged image upon completion").toggle(keepTaggedImage);
    new FinishButton().click();
}
Also used : DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) CheckBox(org.eclipse.reddeer.swt.impl.button.CheckBox) ContextMenu(org.eclipse.reddeer.swt.impl.menu.ContextMenu) Combo(org.eclipse.reddeer.swt.api.Combo) DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo)

Example 4 with ContextMenu

use of org.eclipse.reddeer.swt.impl.menu.ContextMenu in project linuxtools by eclipse.

the class DockerImagesTab method removeTagFromImage.

public void removeTagFromImage(String imageName, String tagToBeRemoved) {
    selectImage(imageName);
    new ContextMenu().getItem("Remove Tag").select();
    String fullTag = "";
    Combo combo = new DefaultCombo();
    List<String> comboItems = combo.getItems();
    for (String item : comboItems) {
        if (item.contains(tagToBeRemoved)) {
            fullTag = item;
            break;
        }
    }
    combo.setSelection(fullTag);
    new FinishButton().click();
}
Also used : DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) ContextMenu(org.eclipse.reddeer.swt.impl.menu.ContextMenu) Combo(org.eclipse.reddeer.swt.api.Combo) DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo)

Example 5 with ContextMenu

use of org.eclipse.reddeer.swt.impl.menu.ContextMenu in project linuxtools by eclipse.

the class DockerConnection method refreshContainers.

/**
 * Refresh containers.
 */
public void refreshContainers() {
    treeViewerHandler.getTreeItem(item, "Containers").select();
    new ContextMenu().getItem("Refresh").select();
    new WaitWhile(new JobIsRunning());
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenu(org.eclipse.reddeer.swt.impl.menu.ContextMenu) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Aggregations

ContextMenu (org.eclipse.reddeer.swt.impl.menu.ContextMenu)12 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)6 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)5 Combo (org.eclipse.reddeer.swt.api.Combo)5 DefaultCombo (org.eclipse.reddeer.swt.impl.combo.DefaultCombo)5 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)5 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)5 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)4 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)4 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)3 Shell (org.eclipse.reddeer.swt.api.Shell)2 CheckBox (org.eclipse.reddeer.swt.impl.button.CheckBox)2 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)2 DockerTerminal (org.eclipse.linuxtools.docker.reddeer.ui.DockerTerminal)1 ConsoleView (org.eclipse.reddeer.eclipse.ui.console.ConsoleView)1 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)1 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)1