@Override protected boolean canHandleShellCloseEvent() { if (FileActionDialog.getDisablePopup()) { return true; } if (MessageDialog.openQuestion( getShell(), Messages.handleShellCloseEventTitle, Messages.handleShellCloseEventMessage)) { return super.canHandleShellCloseEvent(); } return false; }
@Override @Before public void setUp() { BonitaStudioPreferencesPlugin.getDefault() .getPreferenceStore() .setValue( BonitaPreferenceConstants.CONSOLE_BROWSER_CHOICE, BonitaPreferenceConstants.INTERNAL_BROWSER); BonitaStudioPreferencesPlugin.getDefault() .getPreferenceStore() .setValue(BonitaPreferenceConstants.ASK_RENAME_ON_FIRST_SAVE, false); FileActionDialog.setDisablePopup(true); }
public void removeConnectorDefinition(final String name, final String version) { SWTBotConnectorTestUtil.activateConnectorDefEditionShell(bot); bot.tree().setFocus(); bot.waitUntil( new ICondition() { public boolean test() throws Exception { bot.tree() .select("Uncategorized") .expandNode("Uncategorized") .select(name + " (" + version + ")"); return bot.tree().selectionCount() > 0; } public void init(SWTBot bot) {} public String getFailureMessage() { return "Cannot select tree item"; } }, 10000, 1000); assertNotNull( "could not find" + name + " (" + version + ")", bot.tree() .select("Uncategorized") .expandNode("Uncategorized") .getNode(name + " (" + version + ")")); bot.tree() .select("Uncategorized") .expandNode("Uncategorized") .select(name + " (" + version + ")"); bot.button("Delete").click(); if (!FileActionDialog.getDisablePopup()) { bot.waitUntil(Conditions.shellIsActive("Delete?")); bot.button(IDialogConstants.YES_LABEL).click(); } bot.button(IDialogConstants.CANCEL_LABEL).click(); }
@AfterClass public static void tearDownAfterClass() { FileActionDialog.setDisablePopup(disablePopup); }
@BeforeClass public static void setUpBeforeClass() { disablePopup = FileActionDialog.getDisablePopup(); FileActionDialog.setDisablePopup(true); }
@AfterClass public static void resetdisablePopup() { FileActionDialog.setDisablePopup(disablepopup); }