@Override
 protected boolean canHandleShellCloseEvent() {
   if (FileActionDialog.getDisablePopup()) {
     return true;
   }
   if (MessageDialog.openQuestion(
       getShell(), Messages.handleShellCloseEventTitle, Messages.handleShellCloseEventMessage)) {
     return super.canHandleShellCloseEvent();
   }
   return false;
 }
  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();
  }
 @BeforeClass
 public static void setUpBeforeClass() {
   disablePopup = FileActionDialog.getDisablePopup();
   FileActionDialog.setDisablePopup(true);
 }