@Override protected void applyEditorTo(@NotNull GoAppEngineRunConfiguration configuration) throws ConfigurationException { configuration.setHost(StringUtil.nullize(myHostField.getText().trim())); configuration.setPort(StringUtil.nullize(myPortField.getText().trim())); configuration.setAdminPort(StringUtil.nullize(myAdminPortField.getText().trim())); configuration.setConfigFile(StringUtil.nullize(myConfigFileField.getText().trim())); myCommonSettingsPanel.applyEditorTo(configuration); }
@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); }
/** * Factory method. It creates panel with dialog options. Options panel is located at the * center of the dialog's content pane. The implementation can return <code>null</code> * value. In this case there will be no options panel. * * @return center panel */ @Nullable @Override protected JComponent createCenterPanel() { final JPanel centerPanel = new JPanel(new BorderLayout()); centerPanel.setPreferredSize(new Dimension(600, 300)); previewDocument = EditorFactory.getInstance().createDocument(content); preview = Utils.createPreviewEditor(previewDocument, project, false); name = new JBTextField(IgnoreBundle.message("dialog.userTemplate.name.value")); JLabel nameLabel = new JLabel(IgnoreBundle.message("dialog.userTemplate.name")); nameLabel.setBorder(JBUI.Borders.emptyRight(10)); JPanel namePanel = new JPanel(new BorderLayout()); namePanel.add(nameLabel, BorderLayout.WEST); namePanel.add(name, BorderLayout.CENTER); JComponent previewComponent = preview.getComponent(); previewComponent.setBorder(JBUI.Borders.emptyTop(10)); centerPanel.add(namePanel, BorderLayout.NORTH); centerPanel.add(previewComponent, BorderLayout.CENTER); return centerPanel; }
@Override public void actionPerformed(ActionEvent e) { Map<String, RemoteProject> map = downloadProjectList(); if (map != null) { SearchProjectKeyDialog dialog = new SearchProjectKeyDialog(rootPanel, projectKeyTextField.getText(), map); if (dialog.showAndGet()) { projectKeyTextField.setText(dialog.getSelectedProjectKey() != null ? dialog.getSelectedProjectKey() : ""); } } } });
private void updateStagedArtifactNameEmptyText() { File artifact = deploymentSource.getFile(); if (artifact == null) { stagedArtifactNameTextField.getEmptyText().clear(); return; } AppEngineFlexibleDeploymentArtifactType artifactType = AppEngineFlexibleDeploymentArtifactType.typeForPath(artifact.toPath()); if (artifactType.equals(UNKNOWN)) { stagedArtifactNameTextField.getEmptyText().clear(); } else { stagedArtifactNameTextField.getEmptyText().setText(artifact.getName()); } }
private void createUIComponents() { sonarcloudIcon = new JLabel(SonarLintIcons.icon("SonarCloud")); sonarqubeIcon = new JLabel(SonarLintIcons.icon("SonarQube")); sonarcloudText = SwingHelper.createHtmlViewer(false, null, null, null); sonarqubeText = SwingHelper.createHtmlViewer(false, null, null, null); JBTextField text = new JBTextField(); text.getEmptyText().setText("Example: http://localhost:9000"); urlText = text; nameField = new JBTextField(); nameField.setDocument(new LengthRestrictedDocument(NAME_MAX_LENGTH)); } }
@Override protected JComponent createCenterPanel() { nameField = new JBTextField("newRule"); double h = nameField.getSize().getHeight(); nameField.setPreferredSize(new Dimension(250,(int)h)); setTitle("Name the extracted rule"); nameField.selectAll(); return nameField; }
public LoginPanel(final LoginDialog dialog) { hostTextField.getEmptyText().setText("https://review.example.org"); hostTextField.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent e) { SettingsPanel.fixUrl(hostTextField); } }); DocumentListener listener = new DocumentAdapter() { @Override protected void textChanged(DocumentEvent e) { dialog.clearErrors(); } }; loginTextField.getDocument().addDocumentListener(listener); passwordField.getDocument().addDocumentListener(listener); gerritLoginInfoTestField.setText(LOGIN_CREDENTIALS_INFO); gerritLoginInfoTestField.setMargin(new Insets(5, 0, 0, 0)); gerritLoginInfoTestField.setBackground(UIUtil.TRANSPARENT_COLOR); }
public UserSelector() { getTextField().setCursor(Cursor.getDefaultCursor()); getTextField() .getEmptyText() .setText(GoogleCloudCoreMessageBundle.message("select.user.emptytext")); }
textField.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); textField.addMouseListener(listener); textField.addFocusListener( new FocusListener() { @Override
public Document getDocument() { return getTextField().getDocument(); }
@Override public void addNotify() { super.addNotify(); textField.addFocusListener( new FocusAdapter() { @Override public void focusGained(FocusEvent event) { CustomizableComboBox.this.repaint(); } @Override public void focusLost(FocusEvent event) { CustomizableComboBox.this.repaint(); } }); }
public RepositorySelector(@Nullable CloudProject cloudProject, boolean canCreateRepository) { this.cloudProject = cloudProject; this.canCreateRepository = canCreateRepository; getTextField() .getEmptyText() .setText(CloudReposMessageBundle.message("cloud.repository.selector.placeholder.text")); }
projectKeyTextField = new JBTextField(); projectKeyTextField.getEmptyText().setText("Input project key or search one");
public SettingsPanel() { hostTextField.getEmptyText().setText("https://review.example.org"); hostTextField.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent e) {
public AddEditExclusionDialog(Project project) { super(project, false); this.project = project; setTitle("Add SonarLint File Exclusion"); init(); FileChooserDescriptor fileChooser = new FileChooserDescriptor(true, false, false, true, false, false); fileChooser.setRoots(project.getBaseDir()); fileTextField.addBrowseFolderListener("Select File to Exclude", "Select the file which will be excluded from SonarLint analysis", project, fileChooser); FileChooserDescriptor directoryChooser = FileChooserDescriptorFactory.createSingleFolderDescriptor(); directoryChooser.setRoots(project.getBaseDir()); directoryTextField.addBrowseFolderListener("Select Directory to Exclude", "Select the directory which will be excluded from SonarLint analysis", project, directoryChooser); DocumentListener docListener = new DocumentAdapter() { protected void textChanged(final DocumentEvent e) { updateOk(); } }; fileTextField.getTextField().getDocument().addDocumentListener(docListener); directoryTextField.getTextField().getDocument().addDocumentListener(docListener); globTextField.getDocument().addDocumentListener(docListener); ActionListener listener = e -> updateControls(); directoryRadioButton.addActionListener(listener); globRadioButton.addActionListener(listener); fileRadioButton.addActionListener(listener); updateControls(); }
/** * Creates new user template. */ private void performCreateAction() { IgnoreSettings.UserTemplate template = new IgnoreSettings.UserTemplate(name.getText(), previewDocument.getText()); settings.getUserTemplates().add(template); Notifications.Bus.notify(new Notification( IgnoreBundle.PLUGIN_ID, IgnoreBundle.message("dialog.userTemplate.added"), IgnoreBundle.message("dialog.userTemplate.added.description", template.getName()), NotificationType.INFORMATION ), project); super.doOKAction(); } }
public void setHost(final String host) { hostTextField.setText(host); }
@Test public void fireStateChange_doesSetStagedArtifactNameEmptyText() { when(deploymentSource.getFile()).thenReturn(warArtifact); String beforeText = editor.getStagedArtifactNameTextField().getEmptyText().getText(); editor.fireStateChange(); String afterText = editor.getStagedArtifactNameTextField().getEmptyText().getText(); assertThat(beforeText).isEmpty(); assertThat(afterText).isEqualTo(warArtifact.getName()); }
public JBTextField createComponent() { String valueAsString = Objects.toString(setting.getValueAsFloat(), null); JBTextField jbTextField = new JBTextField(valueAsString); applyGenericProperties(jbTextField); return jbTextField; }