org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox Java Examples

The following examples show how to use org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox. 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: CloudSdkPreferenceAreaTest.java    From google-cloud-eclipse with Apache License 2.0 6 votes vote down vote up
@Test
public void testValidationStatus_switchManagementOption() {
  when(preferences.getString(CloudSdkPreferences.CLOUD_SDK_MANAGEMENT)).thenReturn("MANUAL");
  when(preferences.getString(CloudSdkPreferences.CLOUD_SDK_PATH))
      .thenReturn("/non-existing/directory");
  createPreferenceArea();

  assertTrue(chooseSdk.getSelection());
  assertEquals(IStatus.ERROR, area.getStatus().getSeverity());

  new SWTBotCheckBox(chooseSdk).click();
  assertTrue(area.getStatus().isOK());

  new SWTBotCheckBox(chooseSdk).click();
  assertEquals(IStatus.ERROR, area.getStatus().getSeverity());
}
 
Example #2
Source File: SarosPreferences.java    From saros with GNU General Public License v2.0 6 votes vote down vote up
private void setIBBOnlyTransfer(boolean check) throws RemoteException {

    clickMenuSarosPreferences();

    SWTBot bot = new SWTBot();

    SWTBotShell shell = bot.shell(SHELL_PREFERNCES);

    shell.activate();
    shell.bot().tree().expandNode(NODE_SAROS, NODE_SAROS_NETWORK).select();

    SWTBotCheckBox checkBox =
        shell
            .bot()
            .checkBoxInGroup(
                PREF_NODE_SAROS_NETWORK_ADVANCED_GROUP_FILE_TRANSFER_FORCE_IBB,
                PREF_NODE_SAROS_NETWORK_ADVANCED_GROUP_FILE_TRANSFER);

    if (check) checkBox.select();
    else checkBox.deselect();

    shell.bot().button(APPLY).click();
    shell.bot().button(APPLY_AND_CLOSE).click();

    shell.bot().waitUntil(SarosConditions.isShellClosed(shell));
  }
 
Example #3
Source File: MavenCoordinatesWizardUiTest.java    From google-cloud-eclipse with Apache License 2.0 5 votes vote down vote up
@Test
public void testDynamicEnabling() {
  Button asMavenProject = CompositeUtil.findControl(shell, Button.class);

  new SWTBotCheckBox(asMavenProject).click();
  assertTrue(getGroupIdField().getEnabled());
  assertTrue(getArtifactIdField().getEnabled());
  assertTrue(getVersionField().getEnabled());

  new SWTBotCheckBox(asMavenProject).click();
  assertFalse(getGroupIdField().getEnabled());
  assertFalse(getArtifactIdField().getEnabled());
  assertFalse(getVersionField().getEnabled());
}
 
Example #4
Source File: AbstractBotInputOutputStackPanel.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
public AbstractBotInputOutputStackPanel setStoreOutputResult(final boolean storeOutputResult) {
    final SWTBotCheckBox checkBox = bot.checkBox(Messages.storeOutputResult);
    if (storeOutputResult) {
        checkBox.select();
    } else {
        checkBox.deselect();
    }
    return this;
}
 
Example #5
Source File: BotAddDataDialog.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
public BotAddDataDialog setAutoGenerateForm(final boolean pAutoGenerate) {
    final SWTBotCheckBox cb = bot.checkBox("Auto-generate form");
    if (cb.isChecked() && !pAutoGenerate) {
        cb.deselect();
    } else if (!cb.isChecked() && pAutoGenerate) {
        cb.select();
    }
    return this;
}
 
Example #6
Source File: AbstractBotDataWizardPage.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
public AbstractBotDataWizardPage setAutoGenerateForm(final boolean pAutoGenerate) {
    final SWTBotCheckBox cb = bot.checkBox("Auto-generate form");
    if (cb.isChecked() && !pAutoGenerate) {
        cb.deselect();
    } else if (!cb.isChecked() && pAutoGenerate) {
        cb.select();
    }
    return this;
}
 
Example #7
Source File: BotDiagramPropertySection.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
public BotDiagramPropertySection setActivateValidation(final boolean activate) {
    final SWTBotCheckBox checkBox = bot.checkBox(Messages.GeneralSection_ActivateValidation);
    if (activate) {
        checkBox.select();
    } else {
        checkBox.deselect();
    }
    return this;
}
 
Example #8
Source File: BotGeneralPropertySection.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Check/Uncheck "Default flow".
 *
 * @param pIsDefaultFlow
 */
public void setIsDefaultFlow(final boolean pIsDefaultFlow) {
    final SWTBotCheckBox cb = bot.checkBox(Messages.defaultFlowLabel);
    if (cb.isChecked() && !pIsDefaultFlow) {
        cb.deselect();
    } else if (!cb.isChecked() && pIsDefaultFlow) {
        cb.select();
    }
}
 
Example #9
Source File: SwtBotUtils.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
public static void setCheckBox(SWTBotCheckBox checkBox, boolean checked) {
  if (checked) {
    checkBox.select();
  } else {
    checkBox.deselect();
  }
}
 
Example #10
Source File: ControlViewTest.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
private static String prepareAndVerifyExperimentHandling(SWTBot bot, boolean createExperiment, boolean defaultExperiment, IPath path) {
    String experimentName = path.lastSegment();
    if (createExperiment) {
        SWTBotCheckBox checkBox = bot.checkBox();
        checkBox.click();
        if (!defaultExperiment) {
            experimentName = verifyExperimentNameHandling(bot, experimentName);
        }
    }
    return experimentName;
}
 
Example #11
Source File: FindDialogTestBase.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
private static void setCheckButton(String mnemonic, boolean option, SWTBot bot) {
    final SWTBotCheckBox checkBox = bot.checkBox(mnemonic);
    if (checkBox.isEnabled()) {
        if (option) {
            checkBox.select();
        } else {
            checkBox.deselect();
        }
    }
}
 
Example #12
Source File: AppEngineDeployPreferencesPanelTest.java    From google-cloud-eclipse with Apache License 2.0 5 votes vote down vote up
@Test
public void testUncheckStopPreviousVersionButtonWhenDisabled() {
  deployPanel = createPanel(true /* requireValues */);

  Button promoteButton = CompositeUtil.findButton(deployPanel,
      "Promote the deployed version to receive all traffic");
  Button stopButton = CompositeUtil.findButton(deployPanel, "Stop previous version");
  SWTBotCheckBox promote = new SWTBotCheckBox(promoteButton);
  SWTBotCheckBox stop = new SWTBotCheckBox(stopButton);

  // Initially, everything is checked and enabled.
  assertTrue(promoteButton.getSelection());
  assertTrue(stopButton.getSelection());
  assertTrue(stopButton.getEnabled());

  promote.click();
  assertFalse(promoteButton.getSelection());
  assertFalse(stopButton.getSelection());
  assertFalse(stopButton.getEnabled());

  promote.click();
  assertTrue(promoteButton.getSelection());
  assertTrue(stopButton.getSelection());
  assertTrue(stopButton.getEnabled());

  stop.click();
  assertTrue(promoteButton.getSelection());
  assertFalse(stopButton.getSelection());
  assertTrue(stopButton.getEnabled());

  promote.click();
  assertFalse(promoteButton.getSelection());
  assertFalse(stopButton.getSelection());
  assertFalse(stopButton.getEnabled());

  promote.click();
  assertTrue(promoteButton.getSelection());
  assertFalse(stopButton.getSelection());
  assertTrue(stopButton.getEnabled());
}
 
Example #13
Source File: CloudSdkPreferenceAreaTest.java    From google-cloud-eclipse with Apache License 2.0 5 votes vote down vote up
@Test
public void testApply_automatic() {
  when(preferences.getString(CloudSdkPreferences.CLOUD_SDK_MANAGEMENT)).thenReturn("MANUAL");
  when(preferences.getString(CloudSdkPreferences.CLOUD_SDK_PATH))
      .thenReturn("/non-existing/directory");

  createPreferenceArea();
  new SWTBotCheckBox(chooseSdk).click();
  assertTrue(area.getStatus().isOK());

  area.performApply();
  verify(cloudSdkManager).installManagedSdkAsync();
  verifyNoMoreInteractions(cloudSdkManager);
}
 
Example #14
Source File: ClientApisLibrariesSelectorGroupTest.java    From google-cloud-eclipse with Apache License 2.0 5 votes vote down vote up
private SWTBotCheckBox getButton(String libraryId) {
  for (Button button : librariesSelector.getLibraryButtons()) {
    if (libraryId.equals(((Library) button.getData()).getId())) {
      return new SWTBotCheckBox(button);
    }
  }
  fail("Could not find button for " + libraryId);
  return null; // won't be reached
}
 
Example #15
Source File: AppEngineLibrariesSelectorGroupTest.java    From google-cloud-eclipse with Apache License 2.0 5 votes vote down vote up
private SWTBotCheckBox getButton(String libraryId) {
  for (Button button : librariesSelector.getLibraryButtons()) {
    if (libraryId.equals(((Library) button.getData()).getId())) {
      return new SWTBotCheckBox(button);
    }
  }
  fail("Could not find button for " + libraryId);
  return null; // won't be reached
}
 
Example #16
Source File: FlexibleLibrariesSelectorGroupTest.java    From google-cloud-eclipse with Apache License 2.0 5 votes vote down vote up
private SWTBotCheckBox getButton(String libraryId) {
  for (Button button : librariesSelector.getLibraryButtons()) {
    if (libraryId.equals(((Library) button.getData()).getId())) {
      return new SWTBotCheckBox(button);
    }
  }
  fail("Could not find button for " + libraryId);
  return null; // won't be reached
}
 
Example #17
Source File: PreferencesDialog.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @return 复选框:使用自动快速翻译;
 */
public SWTBotCheckBox tmChkbxAutoQT() {
	return dlgBot.checkBox(TsUIConstants.getString("prefTMChkbxAutoQT"));
}
 
Example #18
Source File: PreferencesDialog.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @return 复选框:启用共享库提示;
 */
public SWTBotCheckBox tmChkbxShareDBTips() {
	return dlgBot.checkBox(TsUIConstants.getString("prefTMChkbxShareDBTips"));
}
 
Example #19
Source File: PreferencesDialog.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @return 复选框:匹配存在时不应用记忆库;
 */
public SWTBotCheckBox tmChkbxMatchExistNotApplyTM() {
	return dlgBot.checkBox(TsUIConstants.getString("prefTMChkbxMatchExistNotApplyTM"));
}
 
Example #20
Source File: PreferencesDialog.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @return 复选框:搜索记忆库时区分大小写;
 */
public SWTBotCheckBox tmChkbxMatchCase() {
	return dlgBot.checkBox(TsUIConstants.getString("prefTMChkbxMatchCase"));
}
 
Example #21
Source File: PreferencesDialog.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @return 复选框:匹配时使用标记自动补全;
 */
public SWTBotCheckBox tmChkbxAutoCompleteTag() {
	return dlgBot.checkBox(TsUIConstants.getString("prefTMChkbxAutoCompleteTag"));
}
 
Example #22
Source File: PreferencesDialog.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @return 复选框:匹配时是否忽略标记;
 */
public SWTBotCheckBox tmChkbxIgnoreTag() {
	return dlgBot.checkBox(TsUIConstants.getString("prefTMChkbxIgnoreTag"));
}
 
Example #23
Source File: PreferencesDialog.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @return 复选框:预翻译区分大小写;
 */
public SWTBotCheckBox transPreChkbxCaseSensitive() {
	return dlgBot.checkBox(TsUIConstants.getString("prefTransPreChkbxCaseSensitive"));
}
 
Example #24
Source File: PreTranslateDialog.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @return 复选框:是否锁定完全匹配
 */
public SWTBotCheckBox chkbxLock100Matches() {
	return dlgBot.checkBox(TsUIConstants.getString("chkbxLock100Matches"));
}
 
Example #25
Source File: PreTranslateDialog.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @return 复选框:是否锁定上下文匹配
 */
public SWTBotCheckBox chkbxLockContextMatches() {
	return dlgBot.checkBox(TsUIConstants.getString("chkbxLockContextMatches"));
}
 
Example #26
Source File: DatabaseManagementDialog.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @return 复选框:记住信息;
 */
public SWTBotCheckBox chkbxRemeber() {
	return dialogBot.checkBox(TsUIConstants.getString("chkbxRemeber"));
}
 
Example #27
Source File: RemoteBotCheckBox.java    From saros with GNU General Public License v2.0 4 votes vote down vote up
public IRemoteBotCheckBox setWidget(SWTBotCheckBox checkBox) {
  this.widget = checkBox;
  return this;
}
 
Example #28
Source File: SarosPreferences.java    From saros with GNU General Public License v2.0 4 votes vote down vote up
private void preferInstantSessionStart(boolean check) throws RemoteException {

    clickMenuSarosPreferences();

    SWTBot bot = new SWTBot();

    SWTBotShell shell = bot.shell(SHELL_PREFERNCES);

    shell.activate();
    shell.bot().tree().expandNode(NODE_SAROS, NODE_SAROS_ADVANCED).select();

    SWTBotCheckBox checkBox =
        shell.bot().checkBox(PREF_NODE_SAROS_ADVANCED_INSTANT_SESSION_START_PREFERRED);

    if (check) checkBox.select();
    else checkBox.deselect();

    shell.bot().button(APPLY).click();
    shell.bot().button(APPLY_AND_CLOSE).click();

    shell.bot().waitUntil(SarosConditions.isShellClosed(shell));
  }
 
Example #29
Source File: MavenCoordinatesWizardUiTest.java    From google-cloud-eclipse with Apache License 2.0 4 votes vote down vote up
private void enableUi() {
  Button asMavenProject = CompositeUtil.findControl(shell, Button.class);
  new SWTBotCheckBox(asMavenProject).click();
}
 
Example #30
Source File: PreferencesDialog.java    From translationstudio8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @return 复选框:匹配存在时不应用记忆库;
 */
public SWTBotCheckBox tmChkbxMatchExistNotApplyTM() {
	return dlgBot.checkBox(TsUIConstants.getString("prefTMChkbxMatchExistNotApplyTM"));
}