本文整理汇总了Java中javafx.scene.control.CheckBox.isSelected方法的典型用法代码示例。如果您正苦于以下问题:Java CheckBox.isSelected方法的具体用法?Java CheckBox.isSelected怎么用?Java CheckBox.isSelected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.CheckBox
的用法示例。
在下文中一共展示了CheckBox.isSelected方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onActionSelectAll
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
public void onActionSelectAll(ActionEvent ae) {
if (!triggerOnActionSelectAll) {
return;
}
LoggerFacade.getDefault().info(this.getClass(), "On action select all"); // NOI18N
if (!(ae.getSource() instanceof CheckBox)) {
return;
}
final CheckBox checkBox = (CheckBox) ae.getSource();
final Boolean isSelected = checkBox.isSelected();
lvEntities.getItems().stream()
.filter((item) -> (item instanceof CheckBoxListCellModel))
.forEach((item) -> {
final CheckBoxListCellModel model = (CheckBoxListCellModel) item;
model.setSelected(isSelected);
});
}
示例2: getSelection
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
public int getSelection(CheckBox cb) {
int selection;
if (cb.isAllowIndeterminate() && cb.isIndeterminate()) {
selection = 1;
} else {
selection = cb.isSelected() ? 2 : 0;
}
return selection;
}
示例3: selectCheckboxNotSelectedSelected
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
@Test public void selectCheckboxNotSelectedSelected() throws Throwable {
CheckBox checkBoxNode = (CheckBox) getPrimaryStage().getScene().getRoot().lookup(".check-box");
AssertJUnit.assertEquals(false, checkBoxNode.isSelected());
checkBox.marathon_select("checked");
new Wait("Waiting for the check box selection.") {
@Override public boolean until() {
return checkBoxNode.isSelected();
}
};
}
示例4: selectCheckboxSelectedSelected
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
@Test public void selectCheckboxSelectedSelected() throws Throwable {
CheckBox checkBoxNode = (CheckBox) getPrimaryStage().getScene().getRoot().lookup(".check-box");
checkBoxNode.setSelected(true);
AssertJUnit.assertEquals(true, checkBoxNode.isSelected());
checkBox.marathon_select("checked");
new Wait("Waiting for the check box selection.") {
@Override public boolean until() {
return checkBoxNode.isSelected();
}
};
}
示例5: selectCheckboxSelectedNotSelected
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
@Test public void selectCheckboxSelectedNotSelected() throws Throwable {
CheckBox checkBoxNode = (CheckBox) getPrimaryStage().getScene().getRoot().lookup(".check-box");
checkBoxNode.setSelected(true);
AssertJUnit.assertEquals(true, checkBoxNode.isSelected());
checkBox.marathon_select("unchecked");
new Wait("Waiting for the check box deselect.") {
@Override public boolean until() {
return !checkBoxNode.isSelected();
}
};
}
示例6: selectCheckboxNotSelectedNotSelected
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
@Test public void selectCheckboxNotSelectedNotSelected() throws Throwable {
CheckBox checkBoxNode = (CheckBox) getPrimaryStage().getScene().getRoot().lookup(".check-box");
AssertJUnit.assertEquals(false, checkBoxNode.isSelected());
checkBox.marathon_select("unchecked");
new Wait("Waiting for the check box deselect.") {
@Override public boolean until() {
return !checkBoxNode.isSelected();
}
};
}
示例7: checkedCheckboxNotSelectedNotSelected
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
@Test public void checkedCheckboxNotSelectedNotSelected() throws Throwable {
CheckBox checkBoxNode = findCheckbox("Three state checkbox");
AssertJUnit.assertEquals(false, checkBoxNode.isSelected());
triStateCheckBox.marathon_select("checked");
new Wait("Waiting for the check box deselect.") {
@Override public boolean until() {
return !checkBoxNode.isIndeterminate() && checkBoxNode.isSelected();
}
};
}
示例8: select
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
private void select(Feature feature) {
CheckBox checkBox = checkboxFor(feature);
boolean oldValue = checkBox.isSelected();
clickOn(checkBox).interrupt();
//workaround when sometimes it wont click the checkbox
if(checkBox.isSelected() == oldValue) {
checkBox.setSelected(!oldValue);
}
}
示例9: clickCheckBox
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
private void clickCheckBox(CheckBox checkBox) {
boolean oldValue = checkBox.isSelected();
clickOn(checkBox).interrupt();
//workaround when sometimes it wont click the checkbox
if(checkBox.isSelected() == oldValue) {
checkBox.setSelected(!oldValue);
}
}
示例10: showFileMovableDialog
import javafx.scene.control.CheckBox; //导入方法依赖的package包/类
public Pair<FileAction, String[]> showFileMovableDialog(String bucket, String key, boolean setKey) {
MainWindowController main = MainWindowController.getInstance();
ButtonType ok = new ButtonType(Values.OK, ButtonData.OK_DONE);
Dialog<String[]> dialog = getDialog(ok);
TextField keyTextField = new TextField();
keyTextField.setPrefWidth(300);
keyTextField.setPromptText(Values.FILE_NAME);
keyTextField.setText(key);
ComboBox<String> bucketCombo = new ComboBox<String>();
bucketCombo.getItems().addAll(main.bucketChoiceCombo.getItems());
bucketCombo.setValue(bucket);
CheckBox copyasCheckBox = new CheckBox(Values.COPY_AS);
copyasCheckBox.setSelected(true);
GridPane grid = getGridPane();
grid.add(copyasCheckBox, 0, 0, 2, 1);
grid.add(new Label(Values.BUCKET_NAME), 0, 1);
grid.add(bucketCombo, 1, 1);
if (setKey) {
grid.add(new Label(Values.FILE_NAME), 0, 2);
grid.add(keyTextField, 1, 2);
Platform.runLater(() -> keyTextField.requestFocus());
}
dialog.getDialogPane().setContent(grid);
dialog.setResultConverter(dialogButton -> {
if (dialogButton == ok) {
return new String[] { bucketCombo.getValue(), keyTextField.getText() };
}
return null;
});
Optional<String[]> result = dialog.showAndWait();
if (result.isPresent()) {
bucket = bucketCombo.getValue();
key = keyTextField.getText();
FileAction action = copyasCheckBox.isSelected() ? FileAction.COPY : FileAction.MOVE;
return new Pair<FileAction, String[]>(action, new String[] { bucket, key });
} else {
return null;
}
}