當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。