Source:
private void setupPanel(BibEntry entry, boolean compressed) { if (preferences == null) { return; } editors.clear(); gridPane.getChildren().clear(); gridPane.getColumnConstraints().clear(); gridPane.getRowConstraints().clear(); fields = determineFieldsToShow(entry); List<Label> labels = new ArrayList<>(); for (Field field : fields) { FieldEditorFX fieldEditor = FieldEditors.getForField(field, taskExecutor, dialogService, journalAbbreviationLoader.getRepository(preferences.getJournalAbbreviationPreferences()), preferences, databaseContext, entry.getType(), suggestionProviders, undoManager); fieldEditor.bindToEntry(entry); editors.put(field, fieldEditor); labels.add(new FieldNameLabel(field, field.getName())); } ColumnConstraints columnExpand = new ColumnConstraints(); columnExpand.setHgrow(Priority.ALWAYS); ColumnConstraints columnDoNotContract = new ColumnConstraints(); columnDoNotContract.setMinWidth(Region.USE_PREF_SIZE); int rows; if (compressed) { rows = (int) Math.ceil((double) fields.size() / 2); addColumn(gridPane, 0, labels.subList(0, rows)); addColumn(gridPane, 3, labels.subList(rows, labels.size())); addColumn(gridPane, 1, editors.values().stream().map(FieldEditorFX::getNode).limit(rows)); addColumn(gridPane, 4, editors.values().stream().map(FieldEditorFX::getNode).skip(rows)); gridPane.getColumnConstraints().addAll(columnDoNotContract, columnExpand, new ColumnConstraints(10), columnDoNotContract, columnExpand); setCompressedRowLayout(gridPane, rows); } else { addColumn(gridPane, 0, labels); addColumn(gridPane, 1, editors.values().stream().map(FieldEditorFX::getNode)); gridPane.getColumnConstraints().addAll(columnDoNotContract, columnExpand); setRegularRowLayout(gridPane); } }

Target:
private void setupPanel(BibEntry entry, boolean compressed) { if (preferences == null) { return; } editors.clear(); gridPane.getChildren().clear(); gridPane.getColumnConstraints().clear(); gridPane.getRowConstraints().clear(); fields = determineFieldsToShow(entry); List<Label> labels = new ArrayList<>(); for (Field field : fields) { FieldEditorFX fieldEditor = FieldEditors.getForField(field, taskExecutor, dialogService, journalAbbreviationLoader.getRepository(preferences.getJournalAbbreviationPreferences()), preferences, databaseContext, entry.getType(), suggestionProviders, undoManager); fieldEditor.bindToEntry(entry); editors.put(field, fieldEditor); labels.add(new FieldNameLabel(field)); } ColumnConstraints columnExpand = new ColumnConstraints(); columnExpand.setHgrow(Priority.ALWAYS); ColumnConstraints columnDoNotContract = new ColumnConstraints(); columnDoNotContract.setMinWidth(Region.USE_PREF_SIZE); int rows; if (compressed) { rows = (int) Math.ceil((double) fields.size() / 2); addColumn(gridPane, 0, labels.subList(0, rows)); addColumn(gridPane, 3, labels.subList(rows, labels.size())); addColumn(gridPane, 1, editors.values().stream().map(FieldEditorFX::getNode).limit(rows)); addColumn(gridPane, 4, editors.values().stream().map(FieldEditorFX::getNode).skip(rows)); gridPane.getColumnConstraints().addAll(columnDoNotContract, columnExpand, new ColumnConstraints(10), columnDoNotContract, columnExpand); setCompressedRowLayout(gridPane, rows); } else { addColumn(gridPane, 0, labels); addColumn(gridPane, 1, editors.values().stream().map(FieldEditorFX::getNode)); gridPane.getColumnConstraints().addAll(columnDoNotContract, columnExpand); setRegularRowLayout(gridPane); } }