本文整理汇总了Java中com.sun.javafx.scene.control.skin.resources.ControlResources类的典型用法代码示例。如果您正苦于以下问题:Java ControlResources类的具体用法?Java ControlResources怎么用?Java ControlResources使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ControlResources类属于com.sun.javafx.scene.control.skin.resources包,在下文中一共展示了ControlResources类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FileSelection
import com.sun.javafx.scene.control.skin.resources.ControlResources; //导入依赖的package包/类
public FileSelection(File parent) {
DialogPane dialogPane = this.getDialogPane();
dialogPane.setMaxWidth(1.7976931348623157E308D);
this.directoryView = new CheckTreeView<>();
this.directoryView.setMaxWidth(1.7976931348623157E308D);
CheckBoxTreeItem<File> root = createTree(new CheckBoxTreeItem<>(parent));
root.setExpanded(true);
directoryView.setRoot(root);
GridPane.setHgrow(this.directoryView, Priority.ALWAYS);
GridPane.setFillWidth(this.directoryView, true);
this.grid = new GridPane();
this.grid.setHgap(10.0D);
this.grid.setMaxWidth(1.7976931348623157E308D);
this.grid.setAlignment(Pos.CENTER_LEFT);
dialogPane.contentTextProperty().addListener((o) -> this.updateGrid());
this.setTitle(ControlResources.getString("Dialog.confirm.title"));
dialogPane.setHeaderText(ControlResources.getString("Dialog.confirm.header"));
dialogPane.getStyleClass().add("text-input-dialog");
dialogPane.getButtonTypes().addAll(new ButtonType[] { ButtonType.APPLY, ButtonType.CANCEL });
this.updateGrid();
this.setResultConverter((dialogButton) -> {
ButtonBar.ButtonData data = dialogButton == null ? null : dialogButton.getButtonData();
return data == ButtonData.APPLY ? this.getValues() : null;
});
}
示例2: TextAreaInputDialog
import com.sun.javafx.scene.control.skin.resources.ControlResources; //导入依赖的package包/类
/**
* Creates a new TextInputDialog with the default value entered into the
* dialog {@link TextField}.
*/
public TextAreaInputDialog(@NamedArg("defaultValue") String defaultValue) {
final DialogPane dialogPane = getDialogPane();
// -- textfield
this.textField = new TextArea(defaultValue);
this.textField.setMaxWidth(Double.MAX_VALUE);
GridPane.setHgrow(textField, Priority.ALWAYS);
GridPane.setFillWidth(textField, true);
// -- label
label = new Label(dialogPane.getContentText());
label.setPrefWidth(Region.USE_COMPUTED_SIZE);
label.textProperty().bind(dialogPane.contentTextProperty());
this.defaultValue = defaultValue;
this.grid = new GridPane();
this.grid.setHgap(10);
this.grid.setVgap(3);
this.grid.setMaxWidth(Double.MAX_VALUE);
this.grid.setAlignment(Pos.CENTER_LEFT);
dialogPane.contentTextProperty().addListener(o -> updateGrid());
setTitle(ControlResources.getString("Dialog.confirm.title"));
dialogPane.setHeaderText(ControlResources.getString("Dialog.confirm.header"));
dialogPane.getStyleClass().add("text-input-dialog");
dialogPane.getButtonTypes().addAll(ButtonType.OK, ButtonType.CANCEL);
updateGrid();
setResultConverter((dialogButton) -> {
ButtonBar.ButtonData data = dialogButton == null ? null : dialogButton.getButtonData();
return data == ButtonBar.ButtonData.OK_DONE ? textField.getText() : null;
});
}
示例3: CommitDialog
import com.sun.javafx.scene.control.skin.resources.ControlResources; //导入依赖的package包/类
/**
* Creates a new TextInputDialog with the default value entered into the
* dialog {@link TextField}.
*/
public CommitDialog(@NamedArg("defaultValue") String defaultValue,
@NamedArg("userNameValue") String userNameValue,
@NamedArg("userEmailValue") String userEmailValue,
boolean hideUser,
Collection<String> history) {
final DialogPane dialogPane = getDialogPane();
this.hideUser = hideUser;
// -- textfield
this.textField = new AutoCompleteTextArea(defaultValue);//new TextArea(defaultValue);
textField.getEntries().addAll(history);
this.textField.setMaxWidth(Double.MAX_VALUE);
GridPane.setHgrow(textField, Priority.ALWAYS);
GridPane.setFillWidth(textField, true);
// -- label
label = new Label(dialogPane.getContentText());
label.setPrefWidth(Region.USE_COMPUTED_SIZE);
label.textProperty().bind(dialogPane.contentTextProperty());
this.defaultValue = defaultValue;
this.userEmailLbl = new Label("Email");
this.userEmailTxt = new TextField(userEmailValue);
this.userEmailValue = userEmailValue;
this.userNameLbl = new Label("Name");
this.userNameTxt = new TextField(userNameValue);
this.userNameValue = userNameValue;
this.grid = new GridPane();
this.grid.setHgap(10);
this.grid.setVgap(3);
this.grid.setMaxWidth(Double.MAX_VALUE);
this.grid.setAlignment(Pos.CENTER_LEFT);
dialogPane.contentTextProperty().addListener(o -> updateGrid());
setTitle(ControlResources.getString("Dialog.confirm.title"));
dialogPane.setHeaderText(ControlResources.getString("Dialog.confirm.header"));
dialogPane.getStyleClass().add("text-input-dialog");
dialogPane.getButtonTypes().addAll(ButtonType.OK, ButtonType.CANCEL);
updateGrid();
setResultConverter((dialogButton) -> {
ButtonBar.ButtonData data = dialogButton == null ? null : dialogButton.getButtonData();
return data == ButtonBar.ButtonData.OK_DONE ? textField.getText() : null;
});
}