当前位置: 首页>>代码示例>>Java>>正文


Java CheckBox.isSelected方法代码示例

本文整理汇总了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);
            });
}
 
开发者ID:Naoghuman,项目名称:ABC-List,代码行数:21,代码来源:TestdataPresenter.java

示例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;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:10,代码来源:JavaFXElementPropertyAccessor.java

示例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();
        }
    };
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:11,代码来源:JavaFXCheckBoxElementTest.java

示例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();
        }
    };
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:12,代码来源:JavaFXCheckBoxElementTest.java

示例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();
        }
    };
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:12,代码来源:JavaFXCheckBoxElementTest.java

示例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();
        }
    };
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:11,代码来源:JavaFXCheckBoxElementTest.java

示例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();
        }
    };
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:11,代码来源:JavaFXCheckBoxElementTest.java

示例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);
    }
}
 
开发者ID:AntonioGabrielAndrade,项目名称:LIRE-Lab,代码行数:12,代码来源:CreateCollectionViewObject.java

示例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);
    }
}
 
开发者ID:AntonioGabrielAndrade,项目名称:LIRE-Lab,代码行数:11,代码来源:FeatureTableViewObject.java

示例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;
	}
}
 
开发者ID:zhazhapan,项目名称:qiniu,代码行数:44,代码来源:Dialogs.java


注:本文中的javafx.scene.control.CheckBox.isSelected方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。