Search in sources :

Example 1 with SWTBotToolbarButton

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton in project translationstudio8 by heartsome.

the class XlfEditor method changeEditorLayout.

/**
	 * 修改编辑器布局 将编辑器布局由水平改为垂直,或反之
	 */
public void changeEditorLayout() {
    XlfEditor xe = new XlfEditor(bot.activeEditor());
    SWTBotToolbarButton changeEditorLayout = TS.getInstance().tlbBtnWTltChangeEditorLayout();
    if (xe.isHorizontalLayout()) {
        changeEditorLayout.click();
        // 修改布局会导致 NatTable 重绘,重新赋值以更新其他地方的引用
        getNatTable();
        bot.waitUntil(new IsEditorLayoutVertical(xe));
    } else {
        changeEditorLayout.click();
        getNatTable();
        bot.waitUntil(new IsEditorLayoutHorizontal(xe));
    }
}
Also used : IsEditorLayoutVertical(net.heartsome.cat.ts.test.ui.waits.IsEditorLayoutVertical) IsEditorLayoutHorizontal(net.heartsome.cat.ts.test.ui.waits.IsEditorLayoutHorizontal) SWTBotToolbarButton(org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton)

Example 2 with SWTBotToolbarButton

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton in project linuxtools by eclipse.

the class AbstractSWTBotTest method exitProjectFolder.

/**
 * Exit from the project tree.
 */
private static void exitProjectFolder(SWTWorkbenchBot bot) {
    try {
        SWTBotToolbarButton forwardButton = projectExplorer.toolbarPushButton("Forward");
        projectExplorer.toolbarPushButton("Back to Workspace").click();
        bot.waitUntil(widgetIsEnabled(forwardButton));
    } catch (WidgetNotFoundException e) {
    // Already exited from project folder
    }
}
Also used : WidgetNotFoundException(org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException) SWTBotToolbarButton(org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton)

Example 3 with SWTBotToolbarButton

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton in project linuxtools by eclipse.

the class TestUtils method exitProjectFolder.

/**
 * Exit from the project tree.
 */
public static void exitProjectFolder(SWTWorkbenchBot bot, SWTBotView navigator) {
    SWTBotToolbarButton forwardButton = navigator.toolbarPushButton(ICreaterepoTestConstants.GO_FORWARD);
    navigator.toolbarPushButton(ICreaterepoTestConstants.GO_BACK).click();
    bot.waitUntil(widgetIsEnabled(forwardButton));
}
Also used : SWTBotToolbarButton(org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton)

Example 4 with SWTBotToolbarButton

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton in project linuxtools by eclipse.

the class TestCreateSystemtapScript method finalCleanUp.

@AfterClass
public static void finalCleanUp() {
    projectExplorer.setFocus();
    SWTBotToolbarButton forwardButton = projectExplorer.toolbarPushButton("Forward");
    projectExplorer.toolbarPushButton("Back to Workspace").click();
    bot.waitUntil(Conditions.widgetIsEnabled(forwardButton));
    projectExplorer.bot().tree().select(SYSTEMTAP_PROJECT_NAME).contextMenu("Delete").click();
    SWTBotShell deleteShell = bot.shell("Delete Resources");
    deleteShell.bot().button("OK").click();
    bot.waitUntil(Conditions.shellCloses(deleteShell));
}
Also used : SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell) SWTBotToolbarButton(org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton) AfterClass(org.junit.AfterClass)

Example 5 with SWTBotToolbarButton

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton in project linuxtools by eclipse.

the class DockerImagesViewSWTBotTest method verifyBuildAndPullActionEnablement.

@Test
public void verifyBuildAndPullActionEnablement() {
    // given
    final DockerClient client = MockDockerClientFactory.image(MockImageFactory.name("angry_bar").build()).build();
    final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
    DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
    SWTUtils.syncExec(() -> SWTUtils.getView(bot, "org.eclipse.ui.views.PropertySheet", true));
    this.dockerImagesView.setFocus();
    // select the container in the table
    selectImageInTable("angry_bar");
    List<SWTBotToolbarButton> buttons = this.dockerImagesBotView.getToolbarButtons();
    for (SWTBotToolbarButton button : buttons) {
        if (button.getText().equals("Build Image")) {
            assertThat(button.isEnabled());
        } else if (button.getText().equals("Pull...")) {
            assertThat(button.isEnabled());
        }
    }
    unselectImages();
    buttons = this.dockerImagesBotView.getToolbarButtons();
    for (SWTBotToolbarButton button : buttons) {
        if (button.getText().equals("Build Image")) {
            assertThat(button.isEnabled());
        } else if (button.getText().equals("Pull...")) {
            assertThat(button.isEnabled());
        }
    }
    unselectConnections();
    buttons = this.dockerImagesBotView.getToolbarButtons();
    for (SWTBotToolbarButton button : buttons) {
        if (button.getText().equals("Build Image")) {
            assertThat(!button.isEnabled());
        } else if (button.getText().equals("Pull...")) {
            assertThat(!button.isEnabled());
        }
    }
}
Also used : DockerConnection(org.eclipse.linuxtools.internal.docker.core.DockerConnection) DockerClient(com.spotify.docker.client.DockerClient) SWTBotToolbarButton(org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton) Test(org.junit.Test)

Aggregations

SWTBotToolbarButton (org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton)14 Test (org.junit.Test)9 DockerClient (com.spotify.docker.client.DockerClient)4 DockerConnection (org.eclipse.linuxtools.internal.docker.core.DockerConnection)4 RunWithProject (org.eclipse.linuxtools.internal.docker.ui.testutils.RunWithProject)4 MarkdownViewBot (code.satyagraha.gfm.viewer.bots.MarkdownViewBot)3 ProjectBot (code.satyagraha.gfm.viewer.bots.ProjectBot)3 EditorBot (code.satyagraha.gfm.viewer.bots.EditorBot)2 SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)2 ProjectFileBot (code.satyagraha.gfm.viewer.bots.ProjectBot.ProjectFileBot)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 IsEditorLayoutHorizontal (net.heartsome.cat.ts.test.ui.waits.IsEditorLayoutHorizontal)1 IsEditorLayoutVertical (net.heartsome.cat.ts.test.ui.waits.IsEditorLayoutVertical)1 IFile (org.eclipse.core.resources.IFile)1 ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)1 JobJoiner (org.eclipse.egit.ui.test.JobJoiner)1 ObjectId (org.eclipse.jgit.lib.ObjectId)1 Repository (org.eclipse.jgit.lib.Repository)1 SWTBotView (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)1