我有一个表,它有一个带复选框的列.

在按钮上单击,我想找出哪些复选框被选中,哪些不是.到目前为止,我设法在表格中创建复选框.代码如下.
public class TTEs implements Initializable {
@FXML
private TableView<TestObject> tableReport;
@FXML
private TableColumn<TestObject, String> name;
@FXML
private TableColumn<TestObject, Boolean> checkbox;
@FXML
public void getValues() {
//the method will get what check boxes are checked (this part is the problem)
}
@Override
public void initialize(URL arg0, ResourceBundle arg1) {
ObservableList<TestObject> data = FXCollections.observableArrayList();
data.add(new TestObject("Test 1", true));
data.add(new TestObject("Test 2", false));
tableReport.setItems(data);
name.setCellValueFactory(new PropertyValueFactory<TestObject, String>("name"));
checkbox.setCellValueFactory(new PropertyValueFactory<TestObject, Boolean>("checked"));
checkbox.setCellFactory(new Callback<TableColumn<TestObject, Boolean>,
TableCell<TestObject, Boolean>>() {
public TableCell<TestObject, Boolean> call(TableColumn<TestObject, Boolean> …Run Code Online (Sandbox Code Playgroud) 这是什么意思?
Illegal static declaration in inner class Mobile.mymobile
modifier 'static' is only allowed in constant variable declarations
Line 75, public static void main(String[] args) {
Run Code Online (Sandbox Code Playgroud)
我的代码:
/**
* to write a simple java class Mobile that models a mobile phone.
*
* @author (jamal)
* @version (14/10/13)
*/
public class Mobile
{
// type of phone
private String phonetype;
// size of screen in inches
private int screensize;
// menory card capacity
private int memorycardcapacity;
// name of present service …Run Code Online (Sandbox Code Playgroud) 有没有办法递归调用存储过程(甚至UDF,如果这将工作)对DocumentDB文档?
我们有一个看起来像这样的文档:
{
"docID" : "my_id",
"owner" : "fred",
"items" : [
{
"itemID" : "1",
"type" : "item",
"value" : 3
},
{
"itemID" : "2",
"type" : "group",
"items" : [
{
"itemID" : "2.1",
"type" : "group",
"items" : [
{
"itemID" : "2.1.1",
"type" : "item",
"value" : 2
},
{
"itemID" : "2.1.2",
"type" : "item",
"value" : 4
}
]
},
{
"itemID" : "2.2",
"type" : "item",
"value" : 1
}
]
} …Run Code Online (Sandbox Code Playgroud) 该git add -p命令允许对文件或部分文件进行交互式分段(https://git-scm.com/book/en/v2/Git-Tools-Interactive-Staging).
有没有办法以非交互方式登台?说,我有这些帅哥:
$ git diff
diff --git a/test.txt b/test.txt
index 77e67ac..34eabb1 100644
--- a/test.txt
+++ b/test.txt
@@ -1,4 +1,4 @@
-this is the first change
+this is the first change, don't stage it!
@@ -6,5 +6,5 @@ this is the first change
-this is the first change
+this is the second change, stage it!
Run Code Online (Sandbox Code Playgroud)
如果git add -p 2不通过交互式菜单运行第二个hunk ,那么运行一个命令会很不错.
注意:这里提到了一个解决方案(如何在git中以非交互方式调度块?),但它涉及多个命令以及编辑补丁文件的附加步骤.
这什么时候有用?假设我正在编辑一个冗长且重复的JSON文件,并且在运行之后git diff,我知道我想要将所有其他大块文件放在一起.我不想单独检查每个大块头; 我只想告诉git"阶段第2,第4,第6,第8等等."
当尝试使用自定义脚本与Sourcetree(可以使用帅哥)进行交互时,这也很有用.
我们有一个存储过程,它是在DocumentDB示例代码中的bulkImport sproc之后建模的.这个sproc需要一系列文档,做一些事情,并最终调用createDocument,文档说这是异步的.
现在我们已经为Create编写了一个预触发器来检查某些字段,并可选择在请求的某些文档中添加一些其他字段.
{
"id":"triggerNameRedacted",
"triggerType": "Pre",
"triggerOperation": "Create",
"body": "function()
{
var context = getContext();
var request = context.getRequest();
var documentToCreate = request.getBody();
documentToCreate.msg = 'got to here';
request.setBody(documentToCreate);
}"
}
Run Code Online (Sandbox Code Playgroud)
我们将它附加到options我们传递给createDocument我们的sproc中的对象上.
var options = {
disableAutomaticIdGeneration: false,
preTriggerInclude: 'triggerNameRedacted'
};
Run Code Online (Sandbox Code Playgroud)
我们希望看到触发器被调用.但是,触发器未被触发.我们已经尝试了各种修改来尝试查看触发器被触发,但它仍然没有:将大量的sproc和触发器削减到绝对最小值,将triggerOperation更改为"All".
在服务器端包装器的源代码中,以及上面链接的Collection文档中,似乎服务器端代码不会查看*Trigger*选项对象的任何字段,例如preTriggerInclude在我们的例子中.
是否可以createDocument在存储过程中调用执行预创建触发器,或者从另一个存储过程调用存储过程的限制是否适用于任何服务器端代码?
TL; DR: DocumentDB自动生成的ID应该是GUID还是UUID,实际上有区别吗?如果它们是UUID,那么UUID的哪个变体/版本?
背景:如果您没有提供ID,某些DocumentDB客户端库将自动为您生成ID.我已经看到它在Azure博客中提到并且在几个 相关 问题中生成的ID是GUID.我知道有一些关于GUID是否是UUID的讨论,有很多人说它们是.
问题:但是,我注意到DocumentDB自动生成的一些ID不遵循UUID RFC,它只允许"version"半字节(Vin xxxxxxxx-xxxx-Vxxx-xxxx-xxxxxxxxxxxx)中的数字1-5 .DocumentDB与该半字节的任何十六进制数字,例如生成的ID d981befd-d19b-ee48-35bd-c1b507d3ec4f,其版本半字节是第一e的ee48.
这可能取决于使用哪个客户端来创建文档.在我们的数据库DocumentDB,我们与第三组文件dde5,627a,fe95,等等.通过Collection.createDocument()使用选项调用,这些文档存储在存储过程中{'disableAutomaticIdGeneration': false}.我通过第三方DocumentDB Studio应用程序创建的其他文档始终具有4xxx第三个分组,这是一个有效的UUID版本.但是,我通过Azure门户创建的文档具有非标准的第三组b359.
问题:自动生成的DocumentDB ID应该是GUID还是UUID,实际上是否存在差异?如果是UUID,那么哪个变种?