use of com.intellij.openapi.fileChooser.FileTextField in project intellij-community by JetBrains.
the class ExportToHTMLDialog method createNorthPanel.
@Override
protected JComponent createNorthPanel() {
OptionGroup optionGroup = new OptionGroup();
myRbCurrentFile = new JRadioButton(CodeEditorBundle.message("export.to.html.file.name.radio", (myFileName != null ? myFileName : "")));
optionGroup.add(myRbCurrentFile);
myRbSelectedText = new JRadioButton(CodeEditorBundle.message("export.to.html.selected.text.radio"));
optionGroup.add(myRbSelectedText);
myRbCurrentPackage = new JRadioButton(CodeEditorBundle.message("export.to.html.all.files.in.directory.radio", (myDirectoryName != null ? myDirectoryName : "")));
optionGroup.add(myRbCurrentPackage);
myCbIncludeSubpackages = new JCheckBox(CodeEditorBundle.message("export.to.html.include.subdirectories.checkbox"));
optionGroup.add(myCbIncludeSubpackages, true);
FileTextField field = FileChooserFactory.getInstance().createFileTextField(FileChooserDescriptorFactory.createSingleFolderDescriptor(), myDisposable);
myTargetDirectoryField = new TextFieldWithBrowseButton(field.getField());
LabeledComponent<TextFieldWithBrowseButton> labeledComponent = assignLabel(myTargetDirectoryField, myProject);
optionGroup.add(labeledComponent);
ButtonGroup buttonGroup = new ButtonGroup();
buttonGroup.add(myRbCurrentFile);
buttonGroup.add(myRbSelectedText);
buttonGroup.add(myRbCurrentPackage);
ActionListener actionListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
myCbIncludeSubpackages.setEnabled(myRbCurrentPackage.isSelected());
}
};
myRbCurrentFile.addActionListener(actionListener);
myRbSelectedText.addActionListener(actionListener);
myRbCurrentPackage.addActionListener(actionListener);
return optionGroup.createPanel();
}
use of com.intellij.openapi.fileChooser.FileTextField in project intellij-community by JetBrains.
the class ShowUpdateInfoDialogAction method getUserText.
@NotNull
private static Pair<String, VirtualFile> getUserText(@NotNull Project project, @NotNull String title) {
JTextArea textArea = new JTextArea(10, 50);
UIUtil.addUndoRedoActions(textArea);
textArea.setWrapStyleWord(true);
textArea.setLineWrap(true);
JPanel panel = new JPanel(new BorderLayout(0, 10));
panel.add(ScrollPaneFactory.createScrollPane(textArea), BorderLayout.CENTER);
Disposable disposable = Disposer.newDisposable();
FileTextField fileField = FileChooserFactory.getInstance().createFileTextField(BrowseFilesListener.SINGLE_FILE_DESCRIPTOR, disposable);
TextFieldWithBrowseButton fileCompo = new TextFieldWithBrowseButton(fileField.getField());
FileChooserDescriptor fileDescriptor = FileChooserDescriptorFactory.createSingleLocalFileDescriptor();
fileCompo.addBrowseFolderListener("Patch File", "Patch file", project, fileDescriptor);
panel.add(LabeledComponent.create(fileCompo, "Patch file:"), BorderLayout.SOUTH);
DialogBuilder builder = new DialogBuilder(project);
builder.addDisposable(disposable);
builder.setCenterPanel(panel);
builder.setPreferredFocusComponent(textArea);
builder.setTitle(title);
builder.addOkAction();
builder.addCancelAction();
return builder.showAndGet() ? Pair.create(textArea.getText(), fileField.getSelectedFile()) : Pair.empty();
}
use of com.intellij.openapi.fileChooser.FileTextField in project kotlin by JetBrains.
the class ChoosePathDialog method createCenterPanel.
@Override
protected JComponent createCenterPanel() {
VerticalLayout verticalLayout = new VerticalLayout();
verticalLayout.setGap(3);
JPanel panel = new JPanel(verticalLayout);
if (description != null) {
panel.add(new JLabel(description));
}
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
FileTextField field = FileChooserFactory.getInstance().createFileTextField(descriptor, myDisposable);
field.getField().setColumns(25);
myPathField = new TextFieldWithBrowseButton(field.getField());
myPathField.addBrowseFolderListener("Choose Destination Folder", "Choose folder", myProject, descriptor);
myPathField.setText(defaultPath);
panel.add(myPathField);
return panel;
}
use of com.intellij.openapi.fileChooser.FileTextField in project intellij-community by JetBrains.
the class MapExternalResourceDialog method createUIComponents.
private void createUIComponents() {
FileTextField field = FileChooserFactory.getInstance().createFileTextField(FILE_CHOOSER_DESCRIPTOR, getDisposable());
myFileTextField = new TextFieldWithBrowseButton(field.getField());
}
Aggregations