private Document(boolean selected, String docName) {
            this.selected = new SimpleBooleanProperty(selected);
            this.docName = new SimpleStringProperty(docName);
            this.selected = new SimpleBooleanProperty(selected);

            this.selected.addListener(new ChangeListener<Boolean>() {
                public void changed(ObservableValue<? extends Boolean> ov, Boolean t, Boolean t1) {
                    if (t1) {
                        choosedDocName = docNameProperty().get();
                        listOfchoosedDocuments.add(choosedDocName);
                    }

                    if (t1 == false) {
                        unChoosedDocName = docNameProperty().get();
                        for (int i = 0; i < listOfchoosedDocuments.size(); i++) {

                            if (unChoosedDocName.equals(listOfchoosedDocuments.get(i))) {
                                listOfchoosedDocuments.remove(i);
                            }
                        }
                    }
                }
            });
        }