|
Lines 78-84
Link Here
|
| 78 |
ProvUIProvisioningListener comboRepoListener; |
78 |
ProvUIProvisioningListener comboRepoListener; |
| 79 |
|
79 |
|
| 80 |
Image info, warning, error; |
80 |
Image info, warning, error; |
| 81 |
URI[] comboRepos; |
81 |
URI[] comboRepos; // the URIs shown in the combo, kept in sync with combo items |
|
|
82 |
HashMap disabledRepoProposals = new HashMap(); // proposal string -> disabled URI |
| 82 |
|
83 |
|
| 83 |
public RepositorySelectionGroup(IWizardContainer container, Composite parent, Policy policy, IUViewQueryContext queryContext) { |
84 |
public RepositorySelectionGroup(IWizardContainer container, Composite parent, Policy policy, IUViewQueryContext queryContext) { |
| 84 |
this.container = container; |
85 |
this.container = container; |
|
Lines 425-434
Link Here
|
| 425 |
try { |
426 |
try { |
| 426 |
int flags = queryContext.getMetadataRepositoryFlags() | IRepositoryManager.REPOSITORIES_DISABLED; |
427 |
int flags = queryContext.getMetadataRepositoryFlags() | IRepositoryManager.REPOSITORIES_DISABLED; |
| 427 |
String[] items = repoCombo.getItems(); |
428 |
String[] items = repoCombo.getItems(); |
|
|
429 |
// Clear any previously remembered disabled repos |
| 430 |
disabledRepoProposals = new HashMap(); |
| 428 |
URI[] disabled = ProvisioningUtil.getMetadataRepositories(flags); |
431 |
URI[] disabled = ProvisioningUtil.getMetadataRepositories(flags); |
| 429 |
String[] disabledItems = new String[disabled.length]; |
432 |
String[] disabledItems = new String[disabled.length]; |
| 430 |
for (int i = 0; i < disabledItems.length; i++) { |
433 |
for (int i = 0; i < disabledItems.length; i++) { |
| 431 |
disabledItems[i] = getSiteString(disabled[i]); |
434 |
disabledItems[i] = getSiteString(disabled[i]); |
|
|
435 |
disabledRepoProposals.put(disabledItems[i], disabled[i]); |
| 432 |
} |
436 |
} |
| 433 |
String[] both = new String[items.length + disabledItems.length]; |
437 |
String[] both = new String[items.length + disabledItems.length]; |
| 434 |
System.arraycopy(items, 0, both, 0, items.length); |
438 |
System.arraycopy(items, 0, both, 0, items.length); |
|
Lines 534-547
Link Here
|
| 534 |
try { |
538 |
try { |
| 535 |
container.run(false, false, new IRunnableWithProgress() { |
539 |
container.run(false, false, new IRunnableWithProgress() { |
| 536 |
public void run(IProgressMonitor monitor) { |
540 |
public void run(IProgressMonitor monitor) { |
| 537 |
URI location = null; |
541 |
URI location; |
| 538 |
IStatus status; |
542 |
IStatus status; |
| 539 |
location = RepositoryLocationValidator.locationFromString(selectedRepo); |
543 |
// This might be a disabled repo. If so, no need to validate further. |
| 540 |
if (location == null) |
544 |
if (disabledRepoProposals.containsKey(selectedRepo)) { |
| 541 |
status = RepositoryLocationValidator.getInvalidLocationStatus(selectedRepo); |
545 |
location = (URI) disabledRepoProposals.get(selectedRepo); |
| 542 |
else { |
546 |
status = Status.OK_STATUS; |
| 543 |
RepositoryLocationValidator validator = manipulator.getRepositoryLocationValidator(repoCombo.getShell()); |
547 |
} else { |
| 544 |
status = validator.validateRepositoryLocation(location, false, monitor); |
548 |
location = RepositoryLocationValidator.locationFromString(selectedRepo); |
|
|
549 |
if (location == null) |
| 550 |
status = RepositoryLocationValidator.getInvalidLocationStatus(selectedRepo); |
| 551 |
else { |
| 552 |
RepositoryLocationValidator validator = manipulator.getRepositoryLocationValidator(repoCombo.getShell()); |
| 553 |
status = validator.validateRepositoryLocation(location, false, monitor); |
| 554 |
} |
| 545 |
} |
555 |
} |
| 546 |
if (status.isOK() && location != null) { |
556 |
if (status.isOK() && location != null) { |
| 547 |
try { |
557 |
try { |