private void buildSection()

in kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/inspector/InspectorPanelController.java [632:718]


    private void buildSection(SectionId sectionId) {
        if (sectionId == SectionId.NONE) {
            return;
        }
//        System.out.println("\nBuilding section " + sectionId + " - Selection : " + selection.getEntries());
        GridPane gridPane = getSectionContent(sectionId);
        gridPane.getChildren().clear();
        if (handleSelectionMessage(gridPane)) {
            return;
        }

        // Get Metadata
        Set<ValuePropertyMetadata> propMetaAll = getValuePropertyMetadata();

        SortedMap<InspectorPath, ValuePropertyMetadata> propMetaSection = new TreeMap<>(Metadata.getMetadata().INSPECTOR_PATH_COMPARATOR);
        assert propMetaAll != null;
        int i = 0;
        for (ValuePropertyMetadata valuePropMeta : propMetaAll) {
            InspectorPath inspectorPath = valuePropMeta.getInspectorPath();
            // Check section
            if (!isSameSection(inspectorPath.getSectionTag(), sectionId)) {
                continue;
            }
            if (valuePropMeta.isStaticProperty() && !isStaticPropertyRelevant(valuePropMeta.getName())) {
                i++;
                continue;
            }
            if (isEditedMode()) {
                if (!isPropertyEdited(valuePropMeta, propMetaAll)) {
                    continue;
                }
            }
            propMetaSection.put(valuePropMeta.getInspectorPath(), valuePropMeta);
        }


        String currentSubSection = ""; //NOI18N
        int lineIndex = 0;
        if (sectionId == SectionId.CODE) {
            // add fx:id here, since it is not a property.
            // It has its own sub section title
            addSubSectionSeparator(gridPane, lineIndex, FXID_SUBSECTION_NAME);
            lineIndex++;
            currentSubSection = FXID_SUBSECTION_NAME;
            lineIndex = addFxIdEditor(gridPane, lineIndex);
        }

        if (propMetaSection.isEmpty()) {
            displayEmptyMessage(gridPane);
            return;
        }

        if (lineIndex == 0 && propMetaSection.isEmpty()) {
            displayEmptyMessage(gridPane);
            return;
        }

        Iterator<Entry<InspectorPath, ValuePropertyMetadata>> iter = propMetaSection.entrySet().iterator();
        Set<PropertyName> groupProperties = new HashSet<>();
        while (iter.hasNext()) {
            // Loop on properties
            Entry<InspectorPath, ValuePropertyMetadata> entry = iter.next();
            InspectorPath inspectorPath = entry.getKey();
            ValuePropertyMetadata propMeta = entry.getValue();
            String newSubSection = inspectorPath.getSubSectionTag();
//            System.out.println(inspectorPath.getSectionTag() + " - " + newSubSection + " - " + propMeta.getName());
            if (!currentSubSection.equalsIgnoreCase(newSubSection)) {
                addSubSectionSeparator(gridPane, lineIndex, newSubSection);
                lineIndex++;
                currentSubSection = newSubSection;
            }
            if (isGroupedProperty(propMeta.getName())) {
                // Several properties are grouped in a single editor (e.g. AnchorPane constraints)
                if (groupProperties.contains(propMeta.getName())) {
                    continue;
                }
                PropertiesEditor propertiesEditor
                        = getInitializedPropertiesEditor(propMeta.getName(), propMetaSection.values(), groupProperties);
                if (propertiesEditor == null) {
                    continue;
                }
                lineIndex = addInGridPane(gridPane, propertiesEditor, lineIndex);
            } else {
                lineIndex = addInGridPane(gridPane, getInitializedPropertyEditor(propMeta), lineIndex);
            }
        }
    }