Java Code Examples for org.eclipse.swtbot.swt.finder.widgets.SWTBotTable#pressShortcut()

The following examples show how to use org.eclipse.swtbot.swt.finder.widgets.SWTBotTable#pressShortcut() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CopyToClipboardTest.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Test copy to clipboard with multiple selection
 */
@Test
public void testCopyMultipleSelection() {
    final SWTBotTable tableBot = fEditorBot.bot().table();
    tableBot.getTableItem(1).click();
    tableBot.pressShortcut(Keystrokes.SHIFT, Keystrokes.DOWN);
    tableBot.pressShortcut(Keystrokes.SHIFT, Keystrokes.DOWN);

    tableBot.contextMenu(COPY_TO_CLIPBOARD).click();
    assertClipboardContentsEquals(HEADER_TEXT + EVENT1_TEXT + EVENT2_TEXT + EVENT3_TEXT);
}
 
Example 2
Source File: CopyToClipboardTest.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Test copy to clipboard not enabled when selection includes search row
 */
@Test
public void testNoCopySearchRow() {
    final SWTBotTable tableBot = fEditorBot.bot().table();
    tableBot.getTableItem(1).click();
    tableBot.pressShortcut(Keystrokes.SHIFT, Keystrokes.UP);

    assertContextMenuAbsent(tableBot, COPY_TO_CLIPBOARD);
}
 
Example 3
Source File: SWTBotTestUtil.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
public static void selectExpressionProposal(final SWTBot bot, final String storageExpressionName,
        final String returnType, final int index) {
    bot.toolbarButtonWithId(SWTBOT_ID_EXPRESSIONVIEWER_DROPDOWN, index).click();
    final SWTBotShell proposalShell = bot.shellWithId(SWTBOT_ID_EXPRESSIONVIEWER_PROPOSAL_SHELL);
    final SWTBot proposalBot = proposalShell.bot();
    final SWTBotTable proposalTAble = proposalBot.tableWithId(SWTBOT_ID_EXPRESSIONVIEWER_PROPOSAL_TABLE);
    final int row = proposalTAble.indexOf(storageExpressionName + " -- " + returnType, 0);
    if (row == -1) {
        throw new WidgetNotFoundException(storageExpressionName + " not found in proposals");
    }
    proposalTAble.select(row);
    proposalTAble.pressShortcut(Keystrokes.CR);
    bot.waitUntil(Conditions.shellCloses(proposalShell));
}