@Override protected void resetEditorFrom(GoRunFileConfiguration configuration) { myFileField.setText(configuration.getFilePath()); myCommonSettingsPanel.resetEditorFrom(configuration); }
@Override public void updateDataModel() { String projectRoot = myProjectRootComponent.getText(); if (!projectRoot.isEmpty()) { suggestProjectNameAndPath(null, projectRoot); } }
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; }
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 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) ); }
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 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 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); }
private void createUIComponents() { mySchemaLocation = new TextFieldWithBrowseButton(); final String title = "Choose XSD or DTD schema"; mySchemaLocation.addBrowseFolderListener( title, "Make sure there are only necessary schemes in directory where your XSD or DTD schema is located", new FileTypeDescriptor(title, "xsd", "dtd") ); mySchemaLocation.getTextField().setEditable(false); mySchemaLocation.addActionListener(new ActionListener() { myOutputDir = new TextFieldWithBrowseButton(); FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor(); myOutputDir.addBrowseFolderListener("Select Output Directory For Generated Files", "", myProject, descriptor);
@Override public void mousePressed(MouseEvent mouseEvent) { VirtualFile projectDirectory = project.getBaseDir(); String text = textLocalProfilerCsvPath.getText(); VirtualFile toSelect = VfsUtil.findRelativeFile(text, projectDirectory); if(toSelect == null) { toSelect = projectDirectory; } VirtualFile selectedFile = FileChooser.chooseFile( FileChooserDescriptorFactory.createSingleFileDescriptor("csv"), project, toSelect ); if (null == selectedFile) { return; } String path = VfsUtil.getRelativePath(selectedFile, projectDirectory, '/'); if (null == path) { path = selectedFile.getPath(); } textLocalProfilerCsvPath.setText(path); }
privateKeyPathField.setVisible(shouldUsePrivateKey); if (!shouldUsePrivateKey) { passLabel.setLabelFor(sshProxyPasswordField); passLabel.setText("Password:"); privateKeyPathField.setText(null); } else { passLabel.setText("Passphrase:"); privateKeyPathField.setName("sshPrivateKeyPathComponent"); privateKeyPathField.getTextField().setName("sshPrivateKeyPathField"); shellWorkingDirField.setText(null);
@Override @NotNull public JComponent getPreferredFocusedComponent() { return myProjectRootComponent.getTextField(); }
@Nullable @Override protected JComponent getGeneralComponent() { myScriptField = new TextFieldWithBrowseButton(); myScriptField.addBrowseFolderListener( PerlBundle.message("perl.run.config.select.script.header"), PerlBundle.message("perl.run.config.select.script.prompt"), myScriptField.getTextField().getDocument().addDocumentListener(new DocumentAdapter() { @Override protected void textChanged(@NotNull DocumentEvent documentEvent) {
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 setupUI() { rootPanel = new JPanel(new BorderLayout()); fileLocation = new TextFieldWithBrowseButton(); // TODO make these keys conform to the standards. fileLocation.setText(P4Bundle.getString("config.file.location.tooltip")); fileLocation.setToolTipText(P4Bundle.getString("configuration.p4config.chooser")); fileLocation.setEditable(true); JLabel label = SwingUtil.createLabelFor(P4Bundle.getString("configuration.p4config"), fileLocation); label.setHorizontalAlignment(SwingConstants.TRAILING); rootPanel.add(label, BorderLayout.WEST); rootPanel.add(fileLocation, BorderLayout.CENTER); } }
public DubBinaryForModuleStep(final WizardContext wizardContext) { this.myWizardContext = wizardContext; this.myPanel = new JPanel(new GridBagLayout()); this.myPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); // Title label final JLabel titletextLabel = new JLabel(DlangBundle.INSTANCE.message("d.ui.dub.config.label.choosedublocation")); this.myPanel.add(titletextLabel, new GridBagConstraints(0, -1, 1, 1, 1.0D, 0.0D, 18, 2, new Insets(8, 10, 8, 10), 0, 0)); this.dubBinary = new TextFieldWithBrowseButton(); if(StringUtil.isNotEmpty(ToolKey.DUB_KEY.getPath())) { this.dubBinary.setText(ToolKey.DUB_KEY.getPath()); } final JButton autoFindButton = new JButton(DlangBundle.INSTANCE.message("d.ui.dub.config.label.autofind"), DlangIcons.SDK); final JLabel dubFormatLabel = new JLabel(DlangBundle.INSTANCE.message("d.ui.dub.config.label.dubbinarylocation")); dubFormatLabel.setLabelFor(dubBinary); GuiUtil.addFolderListener(dubBinary, "dub"); GuiUtil.addApplyPathAction(autoFindButton, dubBinary, "dub"); this.myPanel.add(dubFormatLabel, new GridBagConstraints(0, -1, 1, 1, 0.0D, 0.0D, 17, 0, new Insets(0, 0, 5, 4), 0, 0)); this.myPanel.add(dubBinary, new GridBagConstraints(0, -1, 1, 1, 1.0D, 0.0D, 18, 2, new Insets(10, 0, 20, 0), 0, 0)); this.myPanel.add(autoFindButton, new GridBagConstraints(0, -1, 1, 1, 1.0D, 0.0D, 18, 2, new Insets(10, 0, 20, 0), 0, 0)); }
CloudReposMessageBundle.message("clonefromgcp.destination.directory.description")); fcd.setHideIgnored(false); parentDirectory.addActionListener( new ComponentWithBrowseButton.BrowseFolderActionListener<JTextField>( fcd.getTitle(), parentDirectory.getChildComponent().getDocument().addDocumentListener(updateOkButtonListener); parentDirectory.setText(ProjectUtil.getBaseDir()); directoryName.getDocument().addDocumentListener(updateOkButtonListener);
this.storeModuleFilesInChooser.addBrowseFolderListener( HybrisI18NBundleUtils.message( "hybris.project.import.select.directory.where.new.idea.module.files.will.be.stored"), this.sourceCodeFilesInChooser.setVisible(false); sourceCodeFilesInChooser.addActionListener(new MySourceCodeChooserActionListener( FileChooserDescriptorFactory.createSingleLocalFileDescriptor())); this.hybrisDistributionDirectoryFilesInChooser.addBrowseFolderListener( HybrisI18NBundleUtils.message("hybris.import.label.select.hybris.distribution.directory"), "", ); this.externalExtensionsDirectoryFilesInChooser.addBrowseFolderListener( HybrisI18NBundleUtils.message("hybris.import.label.select.custom.extensions.directory"), "", ); this.configOverrideFilesInChooser.addBrowseFolderListener( HybrisI18NBundleUtils.message("hybris.import.label.select.config.extensions.directory"), "", this.dbDriversDirOverrideFileChooser.addBrowseFolderListener( HybrisI18NBundleUtils.message("hybris.import.label.select.dbdriver.extensions.directory"), "",
this.directoryField = new TextFieldWithBrowseButton(); dirPanel.add(directoryField, BorderLayout.CENTER); directoryField.setButtonEnabled(true); directoryField.addBrowseFolderListener( P4Bundle.getString("checkout.config.directory.chooser.title"), P4Bundle.getString("checkout.config.directory.chooser.desc"),
public JComponent createComponent() { pathToTranslationRootTextField.getButton().addMouseListener(createPathButtonMouseListener(pathToTranslationRootTextField.getTextField(), FileChooserDescriptorFactory.createSingleFolderDescriptor())); pathToTranslationRootTextFieldReset.addMouseListener(createResetPathButtonMouseListener(pathToTranslationRootTextField.getTextField(), Settings.DEFAULT_TRANSLATION_PATH)); directoryToApp.getButton().addMouseListener(createPathButtonMouseListener(directoryToApp.getTextField(), FileChooserDescriptorFactory.createSingleFolderDescriptor())); directoryToAppReset.addMouseListener(createResetPathButtonMouseListener(directoryToApp.getTextField(), Settings.DEFAULT_APP_DIRECTORY)); directoryToWeb.getButton().addMouseListener(createPathButtonMouseListener(directoryToWeb.getTextField(), FileChooserDescriptorFactory.createSingleFolderDescriptor())); directoryToWebReset.addMouseListener(createResetPathButtonMouseListener(directoryToWeb.getTextField(), Settings.DEFAULT_WEB_DIRECTORY)); enableSchedulerCheckBox.setEnabled(WebDeploymentUtil.isEnabled(project)); buttonReindex.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { IndexUtil.forceReindex(); super.mouseClicked(e); } }); return panel1; }