Example usage for javafx.scene.layout AnchorPane setManaged

List of usage examples for javafx.scene.layout AnchorPane setManaged

Introduction

In this page you can find the example usage for javafx.scene.layout AnchorPane setManaged.

Prototype

public final void setManaged(boolean value) 

Source Link

Usage

From source file:spdxedit.PackageEditor.java

@FXML
private void initialize() {
    assert tabFiles != null : "fx:id=\"tabFiles\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert tabPackageProperties != null : "fx:id=\"tabPackageProperties\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert tabExternalRefs != null : "fx:id=\"tabExternalRefs\" was not injected: check your FXML file 'PackageEditor.fxml'.";

    assert filesTable != null : "fx:id=\"filesTable\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert tblColumnFile != null : "fx:id=\"tblColumnFile\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert chkListFileTypes != null : "fx:id=\"chkListFileTypes\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert tabRelationships != null : "fx:id=\"tabRelationships\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert btnOk != null : "fx:id=\"btnOk\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert btnDeleteFileFromPackage != null : "fx:id=\"btnDeleteFileFromPackage\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert btnAddFile != null : "fx:id=\"btnAddFile\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert btnCopyright != null : "fx:id=\"btnCopyright\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert btnFileLicense != null : "fx:id=\"btnFileLicense\" was not injected: check your FXML file 'PackageEditor.fxml'.";

    //File relationship checkboxes
    assert chkDataFile != null : "fx:id=\"chkDataFile\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert chkTestCase != null : "fx:id=\"chkTestCase\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert chkDocumentation != null : "fx:id=\"chkDocumentation\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert chkOptionalComponent != null : "fx:id=\"chkOptionalComponent\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert chkMetafile != null : "fx:id=\"chkMetafile\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert chkBuildTool != null : "fx:id=\"chkBuildTool\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert chkExcludeFile != null : "fx:id=\"chkExcludeFile\" was not injected: check your FXML file 'PackageEditor.fxml'.";

    //Initialise file relationship checkbox handling
    //TODO: Could make this easier by extending the CheckBox control?
    chkDataFile.selectedProperty().addListener((observable, oldValue,
            newValue) -> addOrRemoveFileRelationshipToPackage(RelationshipType.DATA_FILE_OF, newValue));
    chkTestCase.selectedProperty().addListener((observable, oldValue,
            newValue) -> addOrRemoveFileRelationshipToPackage(RelationshipType.TEST_CASE_OF, newValue));
    chkDocumentation.selectedProperty().addListener((observable, oldValue,
            newValue) -> addOrRemoveFileRelationshipToPackage(RelationshipType.DOCUMENTATION_OF, newValue));
    chkOptionalComponent.selectedProperty()
            .addListener((observable, oldValue, newValue) -> addOrRemoveFileRelationshipToPackage(
                    RelationshipType.OPTIONAL_COMPONENT_OF, newValue));
    chkMetafile.selectedProperty().addListener((observable, oldValue,
            newValue) -> addOrRemoveFileRelationshipToPackage(RelationshipType.METAFILE_OF, newValue));
    chkBuildTool.selectedProperty().addListener((observable, oldValue,
            newValue) -> addOrRemoveFileRelationshipToPackage(RelationshipType.BUILD_TOOL_OF, newValue));
    chkExcludeFile.selectedProperty()//from w  w w.  j  a  v  a  2  s .  co m
            .addListener((observable, oldValue, newValue) -> handleChkExcludeFileChange(newValue));

    //Package relationship controls
    assert lstTargetPackages != null : "fx:id=\"lstTargetPackages\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert chcNewRelationshipType != null : "fx:id=\"chcNewRelationshipType\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert btnAddRelationship != null : "fx:id=\"btnAddRelationship\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert btnRemoveRelationship != null : "fx:id=\"btnRemoveRelationship\" was not injected: check your FXML file 'PackageEditor.fxml'.";

    //Initialize package relationship controls
    lstTargetPackages.getSelectionModel().selectedItemProperty()
            .addListener((observable1, oldValue1, newValue1) -> handleTargetPackageSelected(newValue1));
    lstTargetPackages.setCellFactory(listView -> new MainSceneController.SpdxPackageListCell());
    lstPackageRelationships.getSelectionModel().selectedItemProperty().addListener(
            (observable1, oldValue1, newValue1) -> btnRemoveRelationship.setDisable(newValue1 == null));
    //Package relationship types
    chcNewRelationshipType.setConverter(RELATIONSHIP_TYPE_STRING_CONVERTER);
    chcNewRelationshipType.getItems()
            .setAll(Stream.of(RelationshipType.AMENDS, RelationshipType.DESCENDANT_OF,
                    RelationshipType.DYNAMIC_LINK, RelationshipType.GENERATED_FROM, RelationshipType.GENERATES,
                    RelationshipType.HAS_PREREQUISITE, RelationshipType.PREREQUISITE_FOR,
                    RelationshipType.STATIC_LINK, RelationshipType.OTHER).collect(Collectors.toList()));
    chcNewRelationshipType.getSelectionModel().selectFirst();
    assert (otherPackages != null); //Constructor finished executing
    lstTargetPackages.getItems().setAll(otherPackages);

    //Package license editor
    assert tabPkgLicenses != null : "fx:id=\"tabPkgLicenses\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert tabPkgDeclaredLicense != null : "fx:id=\"tabPkgDeclaredLicense\" was not injected: check your FXML file 'PackageEditor.fxml'.";
    assert tabPkgConcludedLicense != null : "fx:id=\"tabPkgConcludedLicense\" was not injected: check your FXML file 'PackageEditor.fxml'.";

    pkgConcludedLicenseEdit = new LicenseEditControl(documentContainer);
    pkgConcludedLicenseEdit.setInitialValue(pkg.getLicenseConcluded());
    pkgConcludedLicenseEdit
            .setOnLicenseChange(license -> SpdxWithoutExeption.setLicenseConcluded(pkg, license));
    tabPkgConcludedLicense.setContent(pkgConcludedLicenseEdit.getUi());
    pkgDeclaredLicenseEdit = new LicenseEditControl(documentContainer);
    pkgDeclaredLicenseEdit.setInitialValue(SpdxWithoutExeption.getLicenseDeclared(pkg));
    pkgDeclaredLicenseEdit.setOnLicenseChange(license -> SpdxWithoutExeption.setLicenseDeclared(pkg, license));
    tabPkgDeclaredLicense.setContent(pkgDeclaredLicenseEdit.getUi());

    //Initialize other elements
    tblColumnFile.setCellValueFactory(
            (TreeTableColumn.CellDataFeatures<SpdxFile, String> param) -> new ReadOnlyStringWrapper(
                    param.getValue().getValue().getName()));
    //Load all file types into the file type list in order.
    chkListFileTypes.getItems().setAll(Stream.of(FileType.values()).sorted(Ordering.usingToString()) //Sort
            .map(fileType -> StringableWrapper.wrap(fileType, SpdxLogic::toString)) //Wrap so that the nice toString function gets used by the checkbox
            .collect(Collectors.toList()));
    chkListFileTypes.getCheckModel().getCheckedItems().addListener(this::handleFileTypeCheckedOrUnchecked);
    filesTable.getSelectionModel().selectedItemProperty()
            .addListener((observable, oldValue, newValue) -> handleFileSelected(newValue));
    filesTable.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    filesTable.setShowRoot(false);

    AnchorPane externalRefControl = new ExternalRefListControl(pkg).getUi();
    externalRefControl.setPadding(new Insets(12, 10, 5, 10));
    tabExternalRefs.setContent(externalRefControl);
    externalRefControl.setManaged(true);

    new PackagePropertyEditor(pkg).initialize(tabPackageProperties);

}