Search in sources :

Example 6 with ContextMenu

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

the class DockerConnection method refreshImages.

/**
 * Refresh images.
 */
public void refreshImages() {
    treeViewerHandler.getTreeItem(item, "Images").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)

Example 7 with ContextMenu

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

the class DockerContainer method remove.

public void remove() {
    select();
    boolean removeEnabled = new ContextMenu().getItem("Remove").isEnabled();
    if (!removeEnabled) {
        new ContextMenu().getItem("Stop").select();
        new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
        item.select();
    }
    new ContextMenu().getItem("Remove").select();
    new WaitUntil(new ShellIsAvailable("Confirm Remove Container"), TimePeriod.DEFAULT);
    new PushButton("OK").click();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenu(org.eclipse.reddeer.swt.impl.menu.ContextMenu) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 8 with ContextMenu

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

the class DockerConnection method pullImage.

public void pullImage(String imageName, String imageTag, String dockerRegister) {
    if (getImage(imageName, imageTag) == null) {
        refreshImages();
        treeViewerHandler.getTreeItem(item, "Images").select();
        new ContextMenu().getItem("Pull...").select();
        new WaitUntil(new ShellIsAvailable("Pull Image"), TimePeriod.DEFAULT);
        Shell pullShell = new DefaultShell("Pull Image");
        // select register
        if (dockerRegister != null) {
            Combo combo = new DefaultCombo();
            combo.setSelection(dockerRegister);
        }
        new LabeledText(IMAGE_NAME_LABEL_DIALOG).setFocus();
        new LabeledText(IMAGE_NAME_LABEL_DIALOG).setText(imageTag == null ? imageName : imageName + ":" + imageTag);
        new WaitUntil(new ControlIsEnabled(new FinishButton()));
        new FinishButton(pullShell).click();
        new WaitWhile(new ShellIsAvailable(pullShell));
        new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) Shell(org.eclipse.reddeer.swt.api.Shell) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) ContextMenu(org.eclipse.reddeer.swt.impl.menu.ContextMenu) Combo(org.eclipse.reddeer.swt.api.Combo) DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 9 with ContextMenu

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

the class DockerConnection method openImageSearchDialog.

public void openImageSearchDialog(String imageName, String imageTag, String dockerRegister) {
    refreshImages();
    treeViewerHandler.getTreeItem(item, "Images").select();
    new ContextMenu().getItem("Pull...").select();
    new WaitUntil(new ShellIsAvailable("Pull Image"), TimePeriod.DEFAULT);
    // select register
    if (dockerRegister != null) {
        Combo combo = new DefaultCombo();
        combo.setSelection(dockerRegister);
    }
    new LabeledText(IMAGE_NAME_LABEL_DIALOG).setFocus();
    new LabeledText(IMAGE_NAME_LABEL_DIALOG).setText(imageTag == null ? imageName : imageName + ":" + imageTag);
    new PushButton("Search...").click();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ContextMenu(org.eclipse.reddeer.swt.impl.menu.ContextMenu) Combo(org.eclipse.reddeer.swt.api.Combo) DefaultCombo(org.eclipse.reddeer.swt.impl.combo.DefaultCombo) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 10 with ContextMenu

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

the class DockerImage method pushImage.

public void pushImage(String registryAccount, boolean forceTagging, boolean keepTaggedImage) {
    select();
    new ContextMenu().getItem("Push...").select();
    new DefaultShell("Push Image");
    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) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) 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)

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