public GoSdkConfigurable(@NotNull Project project, boolean dialogMode) { myProject = project; if (dialogMode) { myComponent.setPreferredSize(new Dimension(400, -1)); } FileChooserDescriptor chooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle("Select GOROOT"); mySdkPathField.addBrowseFolderListener(myProject, new MyBrowseFolderListener(chooserDescriptor)); listenForPathUpdate(); Disposer.register(myDisposable, mySdkPathField); }
public BallerinaSdkConfigurable(@NotNull Project project, boolean dialogMode) { myProject = project; if (dialogMode) { myComponent.setPreferredSize(new Dimension(400, -1)); } FileChooserDescriptor chooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor() .withTitle("Select GOROOT"); mySdkPathField.addBrowseFolderListener(myProject, new MyBrowseFolderListener(chooserDescriptor)); listenForPathUpdate(); Disposer.register(myDisposable, mySdkPathField); }
public static void installFileChooser(@NotNull Project project, @NotNull ComponentWithBrowseButton field, boolean directory, boolean showFileSystemRoots, @Nullable Condition<VirtualFile> fileFilter) { FileChooserDescriptor chooseDirectoryDescriptor = directory ? FileChooserDescriptorFactory.createSingleFolderDescriptor() : FileChooserDescriptorFactory.createSingleLocalFileDescriptor(); chooseDirectoryDescriptor.setRoots(project.getBaseDir()); chooseDirectoryDescriptor.setShowFileSystemRoots(showFileSystemRoots); chooseDirectoryDescriptor.withFileFilter(fileFilter); if (field instanceof TextFieldWithBrowseButton) { ((TextFieldWithBrowseButton)field).addBrowseFolderListener(new TextBrowseFolderListener(chooseDirectoryDescriptor, project)); } else { //noinspection unchecked field.addBrowseFolderListener(project, new ComponentWithBrowseButton.BrowseFolderActionListener(null, null, field, project, chooseDirectoryDescriptor, TextComponentAccessor.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT)); } }
private static void installWorkingDirectoryChooser(@NotNull Project project, @NotNull ComponentWithBrowseButton field) { FileChooserDescriptor chooseDirectoryDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor(); chooseDirectoryDescriptor.setShowFileSystemRoots(true); chooseDirectoryDescriptor.withShowHiddenFiles(false); if (field instanceof TextFieldWithBrowseButton) { ((TextFieldWithBrowseButton) field).addBrowseFolderListener( new TextBrowseFolderListener(chooseDirectoryDescriptor, project)); } else { //noinspection unchecked field.addBrowseFolderListener(project, new ComponentWithBrowseButton.BrowseFolderActionListener(null, null, field, project, chooseDirectoryDescriptor, TextComponentAccessor.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT)); } }
private JPanel createExeRow(final String ext, final String path, final String args) { final JLabel extLabel = new JLabel(EXT_LABEL); final JTextField extField = new JTextField(); extField.setToolTipText(EXT_TOOLTIP); extField.setText(ext); final JLabel pathLabel = new JLabel(FILE_PATH_LABEL); final TextFieldWithBrowseButton pathField = new TextFieldWithBrowseButton(); pathField.setToolTipText("e.g. C:\\rustLS\\rls.exe"); pathField.setText(path); pathField.addBrowseFolderListener(new TextBrowseFolderListener(new FileChooserDescriptor(true, false, true, true, true, false).withShowHiddenFiles(true))); final JLabel argsLabel = new JLabel("Args"); final JTextField argsField = new JTextField(); argsField.setToolTipText("e.g. -stdio"); argsField.setText(args); final List<JComponent> components = Arrays.asList(extLabel, extField, pathLabel, pathField, argsLabel, argsField); final JPanel panel = createRow(components, ExeLanguageServerDefinition$.MODULE$.getPresentableTyp()); final scala.collection.mutable.LinkedHashMap<String, JComponent> map = new scala.collection.mutable.LinkedHashMap<>(); map.put(EXT, extField); map.put(PATH, pathField); map.put(ARGS, argsField); rows.add(new ServersGUIRow(panel, ExeLanguageServerDefinition$.MODULE$.typ(), map)); return panel; }
public Root(WizardContext context) { super(context); String projectFileDirectory = context.getProjectFileDirectory(); //noinspection DialogTitleCapitalization myProjectRootComponent.addBrowseFolderListener( "Select mix.exs of a mix project to import", "", null, FileChooserDescriptorFactory.createSingleFolderDescriptor() ); myProjectRootComponent.setText(projectFileDirectory); // provide project path myGetDepsCheckbox.setVisible(ourEnabled); }
private JPanel createCommandRow(final String ext, final String command) { final JLabel extLabel = new JLabel(EXT_LABEL); final JTextField extField = new JTextField(); extField.setToolTipText(EXT_TOOLTIP); extField.setText(ext); final JLabel commandLabel = new JLabel("Command"); final TextFieldWithBrowseButton commandField = new TextFieldWithBrowseButton(); commandField.setText(command); commandField.setToolTipText("e.g. python.exe -m C:\\python-ls\\pyls"); commandField.addBrowseFolderListener(new TextBrowseFolderListener(new FileChooserDescriptor(true, false, true, true, true, false).withShowHiddenFiles(true))); final List<JComponent> components = Arrays.asList(extLabel, extField, commandLabel, commandField); final JPanel panel = createRow(components, RawCommandServerDefinition$.MODULE$.getPresentableTyp()); final scala.collection.mutable.LinkedHashMap<String, JComponent> map = new scala.collection.mutable.LinkedHashMap<>(); map.put(EXT, extField); map.put(COMMAND, commandField); rows.add(new ServersGUIRow(panel, RawCommandServerDefinition$.MODULE$.typ(), map)); return panel; }
private static void installFileChooser(@NotNull Project project, @NotNull ComponentWithBrowseButton field, @Nullable Condition<VirtualFile> fileFilter) { FileChooserDescriptor chooseDirectoryDescriptor = FileChooserDescriptorFactory.createSingleFileDescriptor(BallerinaFileType.INSTANCE); chooseDirectoryDescriptor.setRoots(project.getBaseDir()); chooseDirectoryDescriptor.setShowFileSystemRoots(false); chooseDirectoryDescriptor.withShowHiddenFiles(false); chooseDirectoryDescriptor.withFileFilter(fileFilter); if (field instanceof TextFieldWithBrowseButton) { ((TextFieldWithBrowseButton) field).addBrowseFolderListener( new TextBrowseFolderListener(chooseDirectoryDescriptor, project)); } else { //noinspection unchecked field.addBrowseFolderListener(project, new ComponentWithBrowseButton.BrowseFolderActionListener(null, null, field, project, chooseDirectoryDescriptor, TextComponentAccessor.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT)); } }
private void createUIComponents() { shellWorkingDirField = new TextFieldWithBrowseButton(); shellWorkingDirField.addBrowseFolderListener("Mongo Shell Working Directory", "", null, new FileChooserDescriptor(false, true, false, false, false, false)); shellWorkingDirField.setName("shellWorkingDirField"); } }
private void createUIComponents() { documentToImportTextField = new TextFieldWithBrowseButton(); FileChooserDescriptor fileChooserDescriptor = new FileChooserDescriptor(true, false, false, false, false, false); ComponentWithBrowseButton.BrowseFolderActionListener<JTextField> privateKeyBrowseFolderActionListener = new ComponentWithBrowseButton.BrowseFolderActionListener<>("Mongo Shell Working Directory", null, documentToImportTextField, null, fileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT); documentToImportTextField.addBrowseFolderListener(null, privateKeyBrowseFolderActionListener, false); } }
private TextFieldWithBrowseButton createShellWorkingDirField() { TextFieldWithBrowseButton shellWorkingDirField = new TextFieldWithBrowseButton(); FileChooserDescriptor dirChooserDescriptor = new FileChooserDescriptor(false, true, false, false, false, false); ComponentWithBrowseButton.BrowseFolderActionListener<JTextField> browseFolderActionListener = new ComponentWithBrowseButton.BrowseFolderActionListener<>("Mongo Shell Working Directory", null, shellWorkingDirField, project, dirChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT); shellWorkingDirField.addBrowseFolderListener(null, browseFolderActionListener, false); shellWorkingDirField.setName("shellWorkingDirField"); return shellWorkingDirField; }
private TextFieldWithBrowseButton createPrivateKeyField() { TextFieldWithBrowseButton privateKeyPathField = new TextFieldWithBrowseButton(); FileChooserDescriptor fileChooserDescriptor = new FileChooserDescriptor(true, false, false, false, false, false) .withShowHiddenFiles(true); ComponentWithBrowseButton.BrowseFolderActionListener<JTextField> privateKeyBrowseFolderActionListener = new ComponentWithBrowseButton.BrowseFolderActionListener<>("Private Key Path", null, privateKeyPathField, project, fileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT); privateKeyPathField.addBrowseFolderListener(null, privateKeyBrowseFolderActionListener, false); return privateKeyPathField; }
private LabeledComponent<TextFieldWithBrowseButton> createShellPathField() { LabeledComponent<TextFieldWithBrowseButton> shellPathField = new LabeledComponent<>(); TextFieldWithBrowseButton component = new TextFieldWithBrowseButton(); component.getChildComponent().setName("shellPathField"); shellPathField.setComponent(component); shellPathField.getComponent().addBrowseFolderListener("Mongo Shell Configuration", "", null, new FileChooserDescriptor(true, false, false, false, false, false)); shellPathField.getComponent().setText(configuration.getShellPath()); return shellPathField; }
public static void addFolderListener(final TextFieldWithBrowseButton textField, @NotNull final String executable, @Nullable final String description, @NotNull final FileChooserDescriptor descriptor) { textField.addBrowseFolderListener(String.format("Select %s executable", executable), description, null, descriptor); }
public static void addFolderListener(final TextFieldWithBrowseButton textField, @NotNull final String executable) { textField.addBrowseFolderListener(String.format("Select %s executable", executable), "", null, FileChooserDescriptorFactory.createSingleLocalFileDescriptor()); }
private void createUIComponents() { FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleLocalFileDescriptor(); descriptor.setTitle("Chooser Bash Interpreter..."); this.interpreterPath = new TextFieldWithBrowseButton(null, this); this.interpreterPath.addBrowseFolderListener("Choose Bash Interpreter...", null, project, descriptor); }
public DUnitTestRunConfigurationEditor(final Project project) { initDFileTextWithBrowse(project, myFileField); myWorkingDirectory.addBrowseFolderListener(ExecutionBundle.message("select.working.directory.message"), null, project, FileChooserDescriptorFactory.createSingleFolderDescriptor()); }
@NotNull private TextFieldWithBrowseButton getPath(String configurationPath) { FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFileDescriptor(EXTENSION); FileTextField field = FileChooserFactory.getInstance().createFileTextField(descriptor, null); field.getField().setEnabled(false); field.getField().setText(configurationPath); TextFieldWithBrowseButton path = new TextFieldWithBrowseButton(field.getField()); path.addBrowseFolderListener(null, null, null, descriptor, TEXT_FIELD_WHOLE_TEXT); return path; }
private FilePartUI(FileConfigPart part) { super(part); setupUI(); VirtualFile path = part.getConfigFile(); fileLocation.getTextField().setText(path == null ? null : path.getPath()); fileLocation.addBrowseFolderListener( P4Bundle.message("configuration.connection-choice.picker.p4config"), P4Bundle.message("configuration.p4config.chooser"), null, new FileChooserDescriptor(true, false, false, false, false, false) ); }
public void initComponents(Module module) { ModulesComboBox modulesComboBox = moduleComponent.getComponent(); modulesComboBox.fillModules(project, MonkeyModuleType.getInstance()); fillTargetDevices(module); fillDeploymentTargets(); FileChooserDescriptor fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor(); fileChooserDescriptor.setTitle("Select Device Path"); getDeviceDirectoryField().addBrowseFolderListener(new TextBrowseFolderListener(fileChooserDescriptor, this.project)); }