|
39 | 39 | import com.google.cloud.tools.appengine.api.deploy.DefaultDeployConfiguration; |
40 | 40 | import com.google.cloud.tools.eclipse.appengine.deploy.AppEngineProjectDeployer; |
41 | 41 | import com.google.cloud.tools.eclipse.appengine.deploy.CleanupOldDeploysJob; |
42 | | -import com.google.cloud.tools.eclipse.appengine.deploy.Messages; |
43 | 42 | import com.google.cloud.tools.eclipse.appengine.deploy.standard.ExplodedWarPublisher; |
44 | 43 | import com.google.cloud.tools.eclipse.appengine.deploy.standard.StandardDeployJob; |
45 | 44 | import com.google.cloud.tools.eclipse.appengine.deploy.standard.StandardDeployJobConfig; |
46 | 45 | import com.google.cloud.tools.eclipse.appengine.deploy.standard.StandardDeployPreferences; |
47 | 46 | import com.google.cloud.tools.eclipse.appengine.deploy.standard.StandardDeployPreferencesConverter; |
48 | 47 | import com.google.cloud.tools.eclipse.appengine.deploy.standard.StandardProjectStaging; |
| 48 | +import com.google.cloud.tools.eclipse.appengine.deploy.ui.Messages; |
49 | 49 | import com.google.cloud.tools.eclipse.appengine.login.IGoogleLoginService; |
50 | 50 | import com.google.cloud.tools.eclipse.sdk.ui.MessageConsoleWriterOutputLineListener; |
51 | 51 | import com.google.cloud.tools.eclipse.ui.util.MessageConsoleUtilities; |
@@ -156,7 +156,24 @@ private String promptForProjectId(Shell shell, String initialValue) throws Deplo |
156 | 156 | Messages.getString("dialog.prompt.projectId.title"), |
157 | 157 | Messages.getString("dialog.prompt.projectId.message"), |
158 | 158 | initialValue, |
159 | | - new ProjectIdValidator()); |
| 159 | + new ProjectIdValidator() { |
| 160 | + @Override |
| 161 | + // The input dialog does not provide decoration for the error message, |
| 162 | + // make errors more recognizable with modified validation messages |
| 163 | + // FIXME https://github.com/GoogleCloudPlatform/cloud-tools-for-eclipse/issues/635 |
| 164 | + public String isValid(String newText) { |
| 165 | + String error = super.isValid(newText); |
| 166 | + if (error != null) { |
| 167 | + if (error.isEmpty()) { |
| 168 | + return Messages.getString("error.projectId.invalid"); |
| 169 | + } else { |
| 170 | + return Messages.getString("error.projectId.prefix", error); |
| 171 | + } |
| 172 | + } else { |
| 173 | + return null; |
| 174 | + } |
| 175 | + } |
| 176 | + }); |
160 | 177 | int result = dialog.open(); |
161 | 178 | if (result == Window.OK) { |
162 | 179 | return dialog.getValue(); |
|
0 commit comments