|
Lines 327-332
Link Here
|
| 327 |
return result; |
327 |
return result; |
| 328 |
} |
328 |
} |
| 329 |
|
329 |
|
|
|
330 |
private CVSRepositoryLocation createLocation() throws CVSException { |
| 331 |
String host = hostCombo.getText(); |
| 332 |
if (host.charAt(0) == ':') { |
| 333 |
return CVSRepositoryLocation.fromString(host); |
| 334 |
} |
| 335 |
|
| 336 |
return CVSRepositoryLocation.fromProperties(createProperties()); |
| 337 |
} |
| 338 |
|
| 330 |
/** |
339 |
/** |
| 331 |
* Crate a new location with the information entered on the page. |
340 |
* Crate a new location with the information entered on the page. |
| 332 |
* The location will exists and can be sed for connecting but is not |
341 |
* The location will exists and can be sed for connecting but is not |
|
Lines 338-344
Link Here
|
| 338 |
public ICVSRepositoryLocation getLocation() throws CVSException { |
347 |
public ICVSRepositoryLocation getLocation() throws CVSException { |
| 339 |
if (location == null) { |
348 |
if (location == null) { |
| 340 |
if (!isPageComplete()) return null; |
349 |
if (!isPageComplete()) return null; |
| 341 |
location = CVSRepositoryLocation.fromProperties(createProperties()); |
350 |
location = createLocation(); |
| 342 |
if (location.equals(oldLocation)) { |
351 |
if (location.equals(oldLocation)) { |
| 343 |
location = oldLocation; |
352 |
location = oldLocation; |
| 344 |
} |
353 |
} |
|
Lines 482-515
Link Here
|
| 482 |
* and error messages appropriately. |
491 |
* and error messages appropriately. |
| 483 |
*/ |
492 |
*/ |
| 484 |
private void validateFields() { |
493 |
private void validateFields() { |
| 485 |
String user = userCombo.getText(); |
|
|
| 486 |
IStatus status = validateUserName(user); |
| 487 |
if (!isStatusOK(status)) { |
| 488 |
return; |
| 489 |
} |
| 490 |
|
| 491 |
String host = hostCombo.getText(); |
494 |
String host = hostCombo.getText(); |
| 492 |
status = validateHost(host); |
495 |
IStatus status = validateHost(host); |
| 493 |
if (!isStatusOK(status)) { |
496 |
if (!isStatusOK(status)) { |
| 494 |
return; |
497 |
return; |
| 495 |
} |
498 |
} |
| 496 |
|
499 |
|
| 497 |
if (portText.isEnabled()) { |
500 |
if (host.charAt(0) != ':') { |
| 498 |
String port = portText.getText(); |
501 |
String user = userCombo.getText(); |
| 499 |
status = validatePort(port); |
502 |
status = validateUserName(user); |
| 500 |
if (!isStatusOK(status)) { |
503 |
if (!isStatusOK(status)) { |
| 501 |
return; |
504 |
return; |
| 502 |
} |
505 |
} |
| 503 |
} |
506 |
|
|
|
507 |
if (portText.isEnabled()) { |
| 508 |
String port = portText.getText(); |
| 509 |
status = validatePort(port); |
| 510 |
if (!isStatusOK(status)) { |
| 511 |
return; |
| 512 |
} |
| 513 |
} |
| 504 |
|
514 |
|
| 505 |
String pathString = repositoryPathCombo.getText(); |
515 |
String pathString = repositoryPathCombo.getText(); |
| 506 |
status = validatePath(pathString); |
516 |
status = validatePath(pathString); |
| 507 |
if (!isStatusOK(status)) { |
517 |
if (!isStatusOK(status)) { |
| 508 |
return; |
518 |
return; |
|
|
519 |
} |
| 509 |
} |
520 |
} |
| 510 |
|
|
|
| 511 |
try { |
521 |
try { |
| 512 |
CVSRepositoryLocation l = CVSRepositoryLocation.fromProperties(createProperties()); |
522 |
CVSRepositoryLocation l = createLocation(); |
| 513 |
if (!l.equals(oldLocation) && KnownRepositories.getInstance().isKnownRepository(l.getLocation())) { |
523 |
if (!l.equals(oldLocation) && KnownRepositories.getInstance().isKnownRepository(l.getLocation())) { |
| 514 |
setErrorMessage(Policy.bind("ConfigurationWizardMainPage.0")); //$NON-NLS-1$ |
524 |
setErrorMessage(Policy.bind("ConfigurationWizardMainPage.0")); //$NON-NLS-1$ |
| 515 |
setPageComplete(false); |
525 |
setPageComplete(false); |
|
Lines 565-574
Link Here
|
| 565 |
if (host.length() == 0) { |
575 |
if (host.length() == 0) { |
| 566 |
return new Status(IStatus.ERROR, CVSUIPlugin.ID, REQUIRED_FIELD, Policy.bind("ConfigurationWizardMainPage.2"), null); //$NON-NLS-1$ |
576 |
return new Status(IStatus.ERROR, CVSUIPlugin.ID, REQUIRED_FIELD, Policy.bind("ConfigurationWizardMainPage.2"), null); //$NON-NLS-1$ |
| 567 |
} |
577 |
} |
| 568 |
if (host.indexOf(':') != -1) { |
578 |
// if (host.indexOf(':') != -1) { |
| 569 |
return new Status(IStatus.ERROR, CVSUIPlugin.ID, INVALID_FIELD_CONTENTS, |
579 |
// return new Status(IStatus.ERROR, CVSUIPlugin.ID, INVALID_FIELD_CONTENTS, |
| 570 |
Policy.bind("ConfigurationWizardMainPage.invalidHostName"), null); //$NON-NLS-1$ |
580 |
// Policy.bind("ConfigurationWizardMainPage.invalidHostName"), null); //$NON-NLS-1$ |
| 571 |
} |
581 |
// } |
| 572 |
if (host.startsWith(" ") || host.endsWith(" ")) { //$NON-NLS-1$ //$NON-NLS-2$ |
582 |
if (host.startsWith(" ") || host.endsWith(" ")) { //$NON-NLS-1$ //$NON-NLS-2$ |
| 573 |
return new Status(IStatus.ERROR, CVSUIPlugin.ID, INVALID_FIELD_CONTENTS, |
583 |
return new Status(IStatus.ERROR, CVSUIPlugin.ID, INVALID_FIELD_CONTENTS, |
| 574 |
Policy.bind("ConfigurationWizardMainPage.5"), null); //$NON-NLS-1$ |
584 |
Policy.bind("ConfigurationWizardMainPage.5"), null); //$NON-NLS-1$ |