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()); } }
public RepositorySelector(@Nullable CloudProject cloudProject, boolean canCreateRepository) { this.cloudProject = cloudProject; this.canCreateRepository = canCreateRepository; getTextField() .getEmptyText() .setText(CloudReposMessageBundle.message("cloud.repository.selector.placeholder.text")); }
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); }
projectKeyTextField.getEmptyText().setText("Input project key or search one");
public SettingsPanel() { hostTextField.getEmptyText().setText("https://review.example.org");
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)); } }
@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 UserSelector() { getTextField().setCursor(Cursor.getDefaultCursor()); getTextField() .getEmptyText() .setText(GoogleCloudCoreMessageBundle.message("select.user.emptytext")); }
@Test public void updateArtifactField_toUnknown_doesClearStagedArtifactNameEmptyText() { // Starts the field with non-empty text so we can verify it was cleared. editor.getStagedArtifactNameTextField().getEmptyText().setText("some text"); editor.setDeploymentSource(userSpecifiedPathDeploymentSource); editor.getArchiveSelector().setText(unknownArtifact.toString()); editor.fireStateChange(); assertThat(editor.getStagedArtifactNameTextField().getEmptyText().getText()).isEmpty(); }
@Test public void updateArtifactField_toWar_doesSetStagedArtifactNameEmptyText() { editor.setDeploymentSource(userSpecifiedPathDeploymentSource); editor.getArchiveSelector().setText(warArtifact.toString()); editor.fireStateChange(); assertThat(editor.getStagedArtifactNameTextField().getEmptyText().getText()) .isEqualTo(warArtifact.getName()); }
.getEmptyText() .setText(AppEngineMessageBundle.message("appengine.flex.version.placeholder.text"));
@Test public void updateArtifactField_toJar_doesSetStagedArtifactNameEmptyText() { editor.setDeploymentSource(userSpecifiedPathDeploymentSource); editor.getArchiveSelector().setText(jarArtifact.toString()); editor.fireStateChange(); assertThat(editor.getStagedArtifactNameTextField().getEmptyText().getText()) .isEqualTo(jarArtifact.getName()); }
@Test public void updateArtifactField_withEmptyArtifact_doesClearStagedArtifactNameEmptyText() { // Sets up the artifact field with some text so a change is triggered when clearing it below. editor.getArchiveSelector().setText("some/artifact.war"); editor.setDeploymentSource(userSpecifiedPathDeploymentSource); editor.getArchiveSelector().setText(null); editor.fireStateChange(); assertThat(editor.getStagedArtifactNameTextField().getEmptyText().getText()).isEmpty(); } }