DialogPane
SceneBuilder
में इस कार्यान्वयन है।सीन्यूबिल्डर में कस्टम नियंत्रण में जोड़ने के लिए पूर्व निर्धारित वस्तुओं की ड्रॉपडाउन सूची को कैसे सक्षम करें?</p> <p>आप फलक के लिए बटन की एक सूची में जोड़ सकते हैं:
मैं scenebuilder में अपने कस्टम नियंत्रण के लिए यह करने के लिए देख रहा हूँ। मुझे DialogPane
के लिए कन्स्ट्रक्टर के अंदर कुछ भी स्पष्ट नहीं मिला जो यह काम करेगा।
क्या यह संभावना है?
private final ObservableList<ButtonType> buttons = FXCollections.observableArrayList();
public DialogPane() {
getStyleClass().add("dialog-pane");
headerTextPanel = new GridPane();
getChildren().add(headerTextPanel);
graphicContainer = new StackPane();
contentLabel = createContentLabel("");
getChildren().add(contentLabel);
buttonBar = createButtonBar();
if (buttonBar != null) {
getChildren().add(buttonBar);
}
buttons.addListener((ListChangeListener<ButtonType>) c -> {
while (c.next()) {
if (c.wasRemoved()) {
for (ButtonType cmd : c.getRemoved()) {
buttonNodes.remove(cmd);
}
}
if (c.wasAdded()) {
for (ButtonType cmd : c.getAddedSubList()) {
if (! buttonNodes.containsKey(cmd)) {
buttonNodes.put(cmd, createButton(cmd));
}
}
}
}
});
}
दिलचस्प ... यह काम करने के लिए यह जगह देखने के लिए संभवतः [दृश्य बिल्डर] (https://bitbucket.org/gluon-oss/scenebuilder/src) के लिए स्रोत कोड है। आपको यह पता लगाने की ज़रूरत है कि क्या यह इस संपत्ति को 'डायलॉगपेन' में एक विशेष मामले के रूप में मानता है (जिसमें आप शायद भाग्य से बाहर हैं), या यदि यह कुछ विशिष्ट दिखता है (केवल पढ़ने वाली संपत्ति जिसमें एक प्रकार है जिसमें कुछ स्थिरांक हैं एक ही प्रकार, या कुछ परिभाषित ...)। –