protected void clickSaveAllAndGenerateDocu() { SWTBotToolbarButton toolbarButtonWithTooltip = null; try { toolbarButtonWithTooltip = bot.toolbarButtonWithTooltip("Save All (Shift+Ctrl+S)"); } catch (Exception ex) { LOGGER.info("error when retrieving \"Save All (Shift+Ctrl+S)\" toolbar." + "Try \"Save All\":"); try { toolbarButtonWithTooltip = bot.toolbarButtonWithTooltip("Save All"); } catch (Exception ex2) { LOGGER.error("error when retrieving \"Save All\" toolbar:", ex2); } } toolbarButtonWithTooltip.click(); // bot.toolbarButtonWithTooltip("Save All").click(); generateDocu("save_all_clicked", PageName.ALL_PAGES); }
@Override public void delete(ICondition condition) { List<SWTBotToolbarButton> swtBotToolbarButtons = view.getToolbarButtons(); for (SWTBotToolbarButton swtBotToolbarButton : swtBotToolbarButtons) { if ("Delete".equals(swtBotToolbarButton.getToolTipText())) { swtBotToolbarButton.click(); } } if (condition!=null) view.bot().waitUntil(condition); }
@Override public void undoDelete(ICondition condition) { List<SWTBotToolbarButton> swtBotToolbarButtons = view.getToolbarButtons(); for (SWTBotToolbarButton swtBotToolbarButton : swtBotToolbarButtons) { if ("Undo Delete".equals(swtBotToolbarButton.getToolTipText())) { swtBotToolbarButton.click(); } } if (condition!=null) view.bot().waitUntil(condition); }
@Override public void redoDelete(ICondition condition) { List<SWTBotToolbarButton> swtBotToolbarButtons = view.getToolbarButtons(); for (SWTBotToolbarButton swtBotToolbarButton : swtBotToolbarButtons) { if ("Redo Delete".equals(swtBotToolbarButton.getToolTipText())) { swtBotToolbarButton.click(); } } if (condition!=null) view.bot().waitUntil(condition); }
@Override public void resetEdgeRoute() { List<SWTBotToolbarButton> swtBotToolbarButtons = view.getToolbarButtons(); for (SWTBotToolbarButton swtBotToolbarButton : swtBotToolbarButtons) { if ("Reset Edge Route".equals(swtBotToolbarButton.getToolTipText())) { swtBotToolbarButton.click(); } } }
private SWTBotToolbarButton findToolBarButton (String text) { List<SWTBotToolbarButton> items = this.botView.getToolbarButtons(); for (SWTBotToolbarButton button : items) { if (text.equals(button.getToolTipText())) { return button; } } throw new WidgetNotFoundException (text); }
/** * Returns whether the toolbar button is selected. * * @param toolbarButton * the {@link SWTBotToolbarButton}, must not be {@code null} * @return {@code true} if the toolbar button is selected, {@code false} otherwise */ public static boolean isSelected(final SWTBotToolbarButton toolbarButton) { Assert.isNotNull(toolbarButton, "toolbarButton"); return UIThreadRunnable.syncExec(toolbarButton.display, new BoolResult() { @Override public Boolean run() { return toolbarButton.widget.getSelection(); } }); }
@Test public void testPlotEditor() { IVizServiceFactory fakeFactory = new BasicVizServiceFactory(); fakeFactory.register(new CSVVizService()); factoryHolder.setVizServiceFactory(fakeFactory); // Close the initial eclipse welcome view, if one exists try { bot.viewByTitle("Welcome").close(); } catch (WidgetNotFoundException e) { // We expect that the SWTBot will throw an exception if Eclipse // doesn't start with a welcome view, so there is nothing to do here } // Open the fib8.csv file in the plot editor. SWTBotTreeItem node = bot.tree().getAllItems()[0]; node.expand(); node.getNode("fib8.csv").select(); node.getNode("fib8.csv").doubleClick(); // Test the plot series selection dialog. SWTBotToolbarButton button; button = bot.activeEditor().bot().toolbarButton(0); button.click(); bot.shell("Select a series").activate(); bot.tree().select("f(x)"); bot.button("OK").click(); // Check that the data tab is present bot.cTabItem("Data").activate(); bot.cTabItem("Plot").activate(); // Test the editor closing menu option. button = bot.activeEditor().bot().toolbarButton(1).click(); return; }
public void delete(ICondition condition) { SWTBotToolbarButton swtBotToolbarButton = bot.toolbarButtonWithTooltip("Delete"); swtBotToolbarButton.click(); if (condition!=null) bot.waitUntil(condition,1000*60); }
public void undoDelete(ICondition condition) { SWTBotToolbarButton swtBotToolbarButton = bot.toolbarButtonWithTooltip("Undo Delete"); swtBotToolbarButton.click(); if (condition!=null) bot.waitUntil(condition); }
public void redoDelete(ICondition condition) { SWTBotToolbarButton swtBotToolbarButton = bot.toolbarButtonWithTooltip("Redo Delete"); swtBotToolbarButton.click(); if (condition!=null) bot.waitUntil(condition); }
public void resetEdgeRoute() { SWTBotToolbarButton resetButton = bot.toolbarButtonWithTooltip("Reset Edge Route"); resetButton.click(); }
public void clickClearButton () { String text = PerformanceView.getClearToolBarButtonText(); SWTBotToolbarButton button = findToolBarButton (text); button.click(); }
public void clickLoadButton () { String text = PerformanceView.getLoadToolBarButtonText(); SWTBotToolbarButton button = findToolBarButton (text); button.click(); }
public SWTBotToolbarButton toolbarButtonWithTooltip(String tooltip, int index) { Matcher<ToolItem> matcher = allOf(widgetOfType(ToolItem.class), withTooltip(tooltip), withStyle(SWT.PUSH, "SWT.PUSH")); return new SWTBotToolbarPushButton((ToolItem) bot().widget(matcher, index), matcher); }
/** * @return 工具栏按钮:接受匹配; */ public SWTBotToolbarButton tlbBtnAcceptMatch() { return toolbarButton(TsUIConstants.getString("tlbBtnAcceptMatch")); }
/** * @return 工具栏按钮:仅接受文本; */ public SWTBotToolbarButton tlbBtnAcceptTextOnly() { return toolbarButton(TsUIConstants.getString("tlbBtnAcceptTextOnly")); }
/** * @return 工具栏按钮:在记忆库中标记匹配; */ public SWTBotToolbarButton tlbBtnFlagMatchInTm() { return toolbarButton(TsUIConstants.getString("tlbBtnFlagMatchInTm")); }
/** * @return 工具栏按钮:显示/隐藏匹配属性; */ public SWTBotToolbarButton tlbBtnToggleMatchDetail() { return toolbarButton(TsUIConstants.getString("tlbBtnToggleMatchDetail")); }
/** * @return 工具栏按钮:插入术语; */ public SWTBotToolbarButton tlbBtnInsertTerm() { return toolbarButton(TsUIConstants.getString("tlbBtnInsertTerm")); }
/** * @return 工具栏按钮:添加批注; */ public SWTBotToolbarButton tlbBtnAddNote() { return toolbarButton(TsUIConstants.getString("tlbBtnAddNote")); }
/** * @return 工具栏按钮:编辑批注; */ public SWTBotToolbarButton tlbBtnEditNote() { return toolbarButton(TsUIConstants.getString("tlbBtnEditNote")); }
/** * @return 工具栏按钮:删除批注; */ public SWTBotToolbarButton tlbBtnDeleteNote() { return toolbarButton(TsUIConstants.getString("tlbBtnDeleteNote")); }
/** * @return 工具栏按钮:取消操作; */ public SWTBotToolbarButton tlbBtnWTltCancelOperation() { return dialogBot.toolbarButtonWithTooltip(TsUIConstants.getString("tlbBtnWTltCancelOperation")); }
/** * @return 工具栏按钮:改变编辑器布局; */ public SWTBotToolbarButton tlbBtnWTltChangeEditorLayout() { return bot.toolbarButton(TsUIConstants .getString("tlbBtnWTltChangeEditorLayout")); }