fix: [NO BACKPORT] replace deprecations
This commit is contained in:
parent
a76138ddea
commit
f0b7eb14a4
2 changed files with 4 additions and 7 deletions
|
@ -35,27 +35,24 @@ public class TextFieldUtil {
|
||||||
public static TextFieldWithBrowseButton pathToDirectoryTextField(Disposable disposable,
|
public static TextFieldWithBrowseButton pathToDirectoryTextField(Disposable disposable,
|
||||||
@NlsContexts.DialogTitle String dialogTitle,
|
@NlsContexts.DialogTitle String dialogTitle,
|
||||||
Runnable onTextChanged) {
|
Runnable onTextChanged) {
|
||||||
return pathTextField(FileChooserDescriptorFactory.createSingleFolderDescriptor(),
|
return pathTextField(FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle(dialogTitle),
|
||||||
disposable,
|
disposable,
|
||||||
dialogTitle,
|
|
||||||
onTextChanged);
|
onTextChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TextFieldWithBrowseButton pathToFileTextField(Disposable disposable,
|
public static TextFieldWithBrowseButton pathToFileTextField(Disposable disposable,
|
||||||
@NlsContexts.DialogTitle String dialogTitle,
|
@NlsContexts.DialogTitle String dialogTitle,
|
||||||
Runnable onTextChanged) {
|
Runnable onTextChanged) {
|
||||||
return pathTextField(FileChooserDescriptorFactory.createSingleFileDescriptor(),
|
return pathTextField(FileChooserDescriptorFactory.createSingleFileDescriptor().withTitle(dialogTitle),
|
||||||
disposable,
|
disposable,
|
||||||
dialogTitle,
|
|
||||||
onTextChanged);
|
onTextChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TextFieldWithBrowseButton pathTextField(FileChooserDescriptor fileChooserDescriptor,
|
public static TextFieldWithBrowseButton pathTextField(FileChooserDescriptor fileChooserDescriptor,
|
||||||
Disposable disposable,
|
Disposable disposable,
|
||||||
@NlsContexts.DialogTitle String dialogTitle,
|
|
||||||
Runnable onTextChanged) {
|
Runnable onTextChanged) {
|
||||||
val component = new TextFieldWithBrowseButton(new ExtendableTextField(), null, disposable);
|
val component = new TextFieldWithBrowseButton(new ExtendableTextField(), null, disposable);
|
||||||
component.addBrowseFolderListener(dialogTitle, null, null, fileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
component.addBrowseFolderListener(null, fileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||||
addTextChangeListener(component.getChildComponent(), ignored -> onTextChanged.run());
|
addTextChangeListener(component.getChildComponent(), ignored -> onTextChanged.run());
|
||||||
|
|
||||||
return component;
|
return component;
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class WorkingDirectoryComponent extends LabeledComponent<TextFieldWithBro
|
||||||
field = new TextFieldWithBrowseButton(null, parent);
|
field = new TextFieldWithBrowseButton(null, parent);
|
||||||
var fileChooser = FileChooserDescriptorFactory.createSingleFolderDescriptor();
|
var fileChooser = FileChooserDescriptorFactory.createSingleFolderDescriptor();
|
||||||
fileChooser.setTitle(ExecutionBundle.message("select.working.directory.message"));
|
fileChooser.setTitle(ExecutionBundle.message("select.working.directory.message"));
|
||||||
field.addBrowseFolderListener(null, null, null, fileChooser);
|
field.addBrowseFolderListener(null, fileChooser);
|
||||||
setComponent(field);
|
setComponent(field);
|
||||||
setText(ExecutionBundle.message("run.configuration.working.directory.label"));
|
setText(ExecutionBundle.message("run.configuration.working.directory.label"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue