private void initConfigFileField(@NotNull Project project) { GoRunUtil.installFileChooser(project, myConfigFileField, false, false, file -> "yaml".equals(file.getExtension())); myConfigFileField.getChildComponent().setHistory(ContainerUtil.map2List( YamlFilesModificationTracker.getYamlFiles(project, null), VirtualFile::getPath)); } }
@Override protected void resetEditorFrom(@NotNull GoAppEngineRunConfiguration configuration) { myHostField.setText(StringUtil.notNullize(configuration.getHost())); myPortField.setText(StringUtil.notNullize(configuration.getPort())); myAdminPortField.setText(StringUtil.notNullize(configuration.getAdminPort())); myConfigFileField.getChildComponent().setText(StringUtil.notNullize(configuration.getConfigFile())); myCommonSettingsPanel.resetEditorFrom(configuration); }
/** * Creates a label and text field input and adds them to the configuration * window. * * @param settings Panel to add components to. * @param labelText Which text to show to the left of the field. * @return The TextFieldWithBrowseButton created. */ public static TextFieldWithHistory createTextfield(final JPanel settings, final String labelText, final Object constraints) { // Create UI elements. final TextFieldWithHistory tf = new TextFieldWithHistory(); // Add elements to Panel. final JPanel subPanel = new JPanel(new GridBagLayout()); subPanel.add(new JLabel(labelText + ':')); subPanel.add(tf, getFillLineConstraints()); settings.add(subPanel, constraints); return tf; }